Repository navigation
docs(adr): define multi-target execution, recovery and Pi tools #9252
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Closed
eshulman2
wants to merge
1
commit into
fullsend-ai:main
from
eshulman2:docs/cve-intake-durable-workers
Closed
Changes from all commits
Commits
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
100 changes: 100 additions & 0 deletions
100
docs/ADRs/0165-recover-work-through-repository-owned-operation-journals.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,100 @@ | ||
| --- | ||
| title: "165. Recover work through repository-owned operation journals" | ||
| status: Accepted | ||
| relates_to: | ||
| - durable-work-recovery | ||
| - agent-architecture | ||
| - agent-infrastructure | ||
| topics: | ||
| - coordination | ||
| - recovery | ||
| --- | ||
|
|
||
| # 165. Recover work through repository-owned operation journals | ||
|
|
||
| Date: 2026-11-10 | ||
|
|
||
| ## Status | ||
|
|
||
| Accepted | ||
|
|
||
| ## Context | ||
|
|
||
| Per-subject serialization ([ADR 0106](0106-serialize-agent-runs-and-coalesce-subsequent-events.md)) | ||
| and occurrence-aware poll state | ||
| ([ADR 0132](0132-occurrence-aware-shared-poller-state.md)) reduce duplicate | ||
| dispatch. They do not reserve an operation across scheduling, worker failure | ||
| and external publication. Runtime workflow packaging in | ||
| [#8225](https://github.com/fullsend-ai/fullsend/pull/8225) addresses another | ||
| boundary: delivering a sequence to an agent runtime. | ||
|
|
||
| [Durable work recovery](../problems/durable-work-recovery.md) describes the | ||
| failure cases. This ADR aims to keep admitted work recoverable across hosts | ||
| without making a model or a central daemon the coordination authority. | ||
|
|
||
| ## Options | ||
|
|
||
| Integration-owned databases offer flexibility but repeat the same recovery | ||
| controls. A mandatory workflow service adds an operated dependency. A | ||
| repository-owned journal reuses forge state and existing schedulers, at the | ||
| cost of conditional writes and explicit reconciliation. | ||
|
|
||
| ## Decision | ||
|
|
||
| Fullsend adopts repository-owned operation journals to recover work across | ||
| dispatch, execution and publication. | ||
|
|
||
| The trusted host records work before dispatch in repository-scoped forge | ||
| storage with integrity checks and compare-and-swap updates. An admitted plan | ||
| defines stable operation identities, required children and persistent work | ||
| bounds. Attempts retain their own identity, source/input revisions and | ||
| scheduler/run identifiers. Scheduling acceptance, worker completion and each | ||
| publication effect have separate receipts. Loss of an acknowledgement leaves | ||
| recoverable pending work rather than advancing a completion checkpoint. | ||
|
|
||
| Short-lived reconcilers use leases and monotonically increasing ownership | ||
| generations. Every result acceptance, state transition and publication | ||
| admission checks the current generation and plan. A timed-out or superseded | ||
| worker cannot authorize a new effect. A publication admitted before ownership | ||
| loss remains an in-flight effect to reconcile; expiry cannot revoke a request | ||
| already accepted by an external service. Remote writes remain in trusted host | ||
| adapters, outside worker sandboxes. | ||
|
|
||
| Publication adapters persist intent before writing, use a stable external | ||
| operation marker, and reconcile ambiguous outcomes before retrying. An | ||
| eventually consistent search returning no match is not proof a create failed. | ||
| If the adapter cannot establish the outcome, it holds publication for operator | ||
| resolution. It can retry publication from retained validated evidence without | ||
| rerunning inference, subject to current authorization, source and policy. | ||
| Missing, exhausted or unresolved required children remain visible and cannot | ||
| imply completion. A configured domain adapter may request investigation after | ||
| failure, but cannot turn that request into a successful worker assessment. | ||
|
|
||
| This is a deterministic host capability. It adds neither a coordinator agent | ||
| nor authority from journal contents. Existing actor, entity, disclosure and | ||
| repository gates still apply. Domain mapping, assessment semantics and ticket | ||
| rendering remain adapters. Journal records contain bounded identities, digests | ||
| and receipts, not raw private prompts or credentials. Artifact publication | ||
| policy still applies. Journal integrity failure stops scheduling and | ||
| publication; it does not silently reset state and repeat work. | ||
|
|
||
| ## Forge scope | ||
|
|
||
| The contract applies to GitHub, GitLab and Forgejo target repositories. | ||
| Each backend must demonstrate conditional updates and the same recovery | ||
| tests before enablement. Initial implementation may enable GitHub alone; | ||
| GitLab and Forgejo remain disabled until their adapters conform. Jira may be | ||
| a source or publication destination; its unconditional issue-property writes | ||
| do not satisfy the journal's compare-and-swap requirement. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - Recovery can resume scheduling or publication without keeping a host or | ||
| model session alive. | ||
| - Existing forge storage and CI schedules remain the coordination substrate. | ||
| - Backend integrity, ownership and ambiguous-write tests become enablement | ||
| gates; delivery is not claimed to be exactly once. | ||
| - Adopters must define target identity and completion rules while Fullsend | ||
| enforces the shared recovery boundary. | ||
| - Journal layout, credentials, retention and adapter implementation require | ||
| follow-up work before this capability is available. |
74 changes: 74 additions & 0 deletions
74
docs/ADRs/0166-select-pi-extension-tools-without-widening-access.md
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,74 @@ | ||
| --- | ||
| title: "166. Select Pi extension tools without widening access" | ||
| status: Accepted | ||
| relates_to: | ||
| - security-threat-model | ||
| - agent-architecture | ||
| topics: | ||
| - runtime | ||
| - tools | ||
| - security | ||
| --- | ||
|
|
||
| # 166. Select Pi extension tools without widening access | ||
|
|
||
| Date: 2026-11-10 | ||
|
|
||
| ## Status | ||
|
|
||
| Accepted | ||
|
|
||
| ## Context | ||
|
|
||
| [ADR 0094](0094-pi-extensions-are-harness-resources.md) admits extension code | ||
| through trusted harness resources. The Pi runner translates built-in agent | ||
| tool names, but drops other declared names. An extension can therefore load | ||
| while its tool cannot be selected by a strict agent allowlist. | ||
| [#9179](https://github.com/fullsend-ai/fullsend/pull/9179) addresses MCP tool | ||
| patterns and child permissions; ordinary extension tools need the same | ||
| least-privilege property without acquiring an MCP identity. | ||
|
|
||
| The [threat model](../problems/security-threat-model.md) requires tool access | ||
| to remain bounded. This ADR aims to let an agent select an exact tool supplied | ||
| by a vetted Pi extension without enabling unrelated tools. | ||
|
|
||
| ## Options | ||
|
|
||
| Removing the strict tool list exposes default tools and unrelated extension | ||
| tools. Hardcoding every plugin's name into the built-in translation table | ||
| couples independently versioned resources to runner releases. Resolving exact | ||
| declared names against the loaded extension registry preserves that boundary. | ||
|
|
||
| ## Decision | ||
|
|
||
| Fullsend resolves exact declared Pi extension tool names against vetted | ||
| extensions to preserve strict tool selection. | ||
|
|
||
| Keep existing built-in translations. Treat an otherwise unmapped exact name | ||
| as a requested native extension tool, and resolve it only after loading the | ||
| runner-vetted extension set. A missing or ambiguous requested tool fails the | ||
| run before inference. It never falls back to all extension tools, Pi defaults | ||
| or a broader built-in tool. This decision does not add wildcard matching for | ||
| native extension tools or change MCP pattern semantics. | ||
|
|
||
| The effective tool set is explicit, including when empty. Hook authorization | ||
| uses the same canonical native name. Child runs, if supported, load the vetted | ||
| code that supplies a requested tool and receive only the intersection of | ||
| parent and child permissions. A runtime path that cannot enforce this refuses | ||
| the selection. Repository discovery cannot supply tools or alter identity; | ||
| extension integrity checks continue before launch and retry. Selecting a tool | ||
| does not grant shell, filesystem, network or publication authority. | ||
|
|
||
| ## Forge scope | ||
|
|
||
| This runtime contract applies equally to GitHub, GitLab and Forgejo runs. | ||
| It introduces no forge-specific provider or authorization exception. | ||
|
|
||
| ## Consequences | ||
|
|
||
| - A read-only agent can expose one extension tool while excluding builtin | ||
| shell, editing and compatibility tools. | ||
| - Tool typos and missing extensions become explicit setup failures. | ||
| - Hook checks and child permission tests must use the same resolved names. | ||
| - Runner implementation and real-Pi denial tests are required before native | ||
| extension selections are supported. | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -86,6 +86,11 @@ These splits suggest that "memory" may not be one feature. It may be several fee | |
|
|
||
| Cross-run memory is one piece of a broader question: what happens when an agent fails? The memory problem asks how agents learn from prior failures. The recovery problem asks what the system does immediately after a failure, before any learning occurs. | ||
|
|
||
| Recovering scheduling ownership and ambiguous external writes is a separate | ||
| mechanical problem; see [durable work recovery](durable-work-recovery.md). | ||
| Its operation journal retains attempts and work bounds without deciding | ||
| whether another model approach is likely to succeed. | ||
|
Comment on lines
+89
to
+92
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 1. Living-doc edits reach documents outside the adr's problem areas The PR adds durable-work-recovery backlink paragraphs to docs/problems/cross-run-memory.md and docs/problems/operational-observability.md, but neither file is in ADR 0165's relates_to list (durable-work-recovery, agent-architecture, agent-infrastructure). The rule asks that living-document changes stay within the ADR's problem areas, and these two additions are cross-links to the new durable-work-recovery doc rather than edits to a relates_to area. A reviewer reading ADR 0165 alone would not expect these two files to change, so the decision's scope becomes harder to audit. Agent Prompt
|
||
|
|
||
| ### Retry vs. escalate | ||
|
|
||
| When a run fails (CI failure, merge conflict, model refusal, timeout), the system must decide: retry the same approach, try a different approach, or escalate to a human. Execution limits bound how much work can occur, but reaching a limit does not establish whether another attempt is likely to produce a different outcome. | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,88 @@ | ||
| --- | ||
| title: Durable work recovery | ||
| --- | ||
|
|
||
| # Durable work recovery | ||
|
|
||
| A job can disappear after discovery, finish after its caller stops, or publish | ||
| an external change before its acknowledgement is saved. A successful model | ||
| invocation does not answer whether the requested work was scheduled, which | ||
| attempt owns it, or whether publication must be retried. | ||
|
|
||
| The [repository coordination model](agent-architecture.md#interaction-model-the-repo-as-coordinator) | ||
| keeps authority in repository-visible controls. Recovery must preserve that | ||
| boundary. It needs deterministic bookkeeping, rather than an agent deciding | ||
| which other agents should run. The | ||
| [infrastructure discussion](agent-infrastructure.md) also separates execution | ||
| capacity from waiting for people or external systems. | ||
|
|
||
| ## Failure boundaries | ||
|
|
||
| - A dispatcher stops after a remote scheduler accepts a request but before it | ||
| records the scheduler's run identifier. | ||
| - Two hosts discover the same operation while neither has reserved it. | ||
| - A worker's lease expires; its replacement starts while the old worker is | ||
| still running. | ||
| - A worker saves valid evidence, but its publication request times out after | ||
| the external system creates the issue or comment. | ||
| - One required child never returns while other children succeed. | ||
| - Source, authorization or a target plan changes while work is queued. | ||
|
|
||
| Serialization for a harness and subject reduces overlap. It does not make | ||
| dispatch, execution and external writes one transaction. A source checkpoint | ||
| or the absence of a running CI job cannot prove completion. Operators need to | ||
| distinguish these conditions from ordinary agent failures; see | ||
| [operational observability](operational-observability.md#what-just-happened). | ||
|
|
||
| Persistent attempt bounds supply recovery mechanics, while | ||
| [cross-run escalation](cross-run-memory.md#error-recovery-and-retry-mechanics) | ||
| also needs failure interpretation and policy. A journal does not decide whether | ||
| a different model strategy is likely to succeed. | ||
|
|
||
| ## Options and trade-offs | ||
|
|
||
| ### Let each integration own its recovery | ||
|
|
||
| An adapter can maintain a database and reconcile its own jobs and external | ||
| effects. This is flexible and avoids a new platform contract. Each adapter | ||
| must also implement authorization rechecks, duplicate prevention, restart | ||
| handling and publication recovery. Guarantees can differ across workflows. | ||
|
|
||
| ### Extend repository-owned state | ||
|
|
||
| A repository-scoped journal can use conditional forge writes and short-lived | ||
| reconcilers. Existing schedulers still run individual workers. This fits the | ||
| repository coordination model and avoids a required central service. It needs | ||
| explicit trust, retention, conflict, lease and external-effect protocols; | ||
| eventual-consistency searches cannot establish that an ambiguous write failed. | ||
|
|
||
| ### Delegate to a durable workflow service | ||
|
|
||
| A service can supply timers, retries and ownership. It introduces another | ||
| operated component and trust boundary. Its scheduler guarantees still do not | ||
| make a remote issue creation atomic or authorize a retry after scope changes. | ||
|
|
||
| ## Decision and acceptance | ||
|
|
||
| [ADR 0165](../ADRs/0165-recover-work-through-repository-owned-operation-journals.md) | ||
| chooses a repository-owned journal. Its implementation remains separate from | ||
| the decision. A local database test is not distributed acceptance. | ||
|
|
||
| Fault tests must stop both sides of each handoff, overlap reconcilers, expire | ||
| ownership while a worker is still alive, and supersede a plan before | ||
| publication. A remote write that succeeded before its acknowledgement was | ||
| lost must be reconciled without rerunning inference or blindly repeating the | ||
| write. Every required target remains accounted for, including exhausted or | ||
| missing attempts. A domain adapter may publish an investigation request when | ||
| analysis fails; that request is not an assessment or permission to remediate. | ||
|
|
||
| ## Open questions | ||
|
|
||
| - Which journal layout, signing rules, retention and compaction bounds meet | ||
| the conditional-write and integrity requirements on each forge? | ||
| - Which existing scheduler APIs can reconcile accepted-but-unacknowledged | ||
| requests by stable operation identity? | ||
| - Which publication adapters can safely prove a write absent, and which must | ||
| retain an ambiguous operation for human reconciliation? | ||
| - How should an operator repair corrupted or inaccessible state without | ||
| discarding accepted work or permitting stale workers to publish? |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
2. Adr does not link the pi tool-dropping behavior it describes
📜 Skill insight⚙ MaintainabilityAgent Prompt
ⓘ Copy this prompt and use it to remediate the issue with your preferred AI generation toolsDismiss ↗ | View ↗