Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,102 @@
---
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
uses the execution boundary in
[ADR 0167](0167-execute-authorized-multi-target-plans.md) for target dispatch
and collection. The journal retains stable operation identities 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.
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.
105 changes: 105 additions & 0 deletions docs/ADRs/0167-execute-authorized-multi-target-plans.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,105 @@
---
title: "167. Execute authorized multi-target plans"
status: Accepted
relates_to:
- durable-work-recovery
- agent-architecture
- agent-infrastructure
topics:
- dispatch
- coordination
- authorization
---

# 167. Execute authorized multi-target plans

Date: 2026-11-10

## Status

Accepted

## Context

[ADR 0061](0061-harness-cel-dispatch.md) dispatches matching harnesses and
supports matrix output. These mechanisms can launch several jobs, but do not
define the complete authorized target set for one request, independent target
contexts or collection of every required result. Per-subject serialization
([ADR 0106](0106-serialize-agent-runs-and-coalesce-subsequent-events.md)) also
needs to distinguish target work that shares one originating event.

[ADR 0165](0165-recover-work-through-repository-owned-operation-journals.md)
defines recovery across attempts and external effects. Target expansion and
collection need their own boundary; see
[durable work recovery](../problems/durable-work-recovery.md). This ADR aims to
execute a bounded, authorized target set without losing isolation or mistaking
partial results for complete coverage.

## Options

A handwritten CI matrix can launch jobs but leaves target identity and
collection rules to each workflow. A model-led coordinator can choose branches
and retries but cannot supply execution authority. A host-admitted execution
plan makes these boundaries explicit while reusing existing schedulers.

## Decision

Fullsend executes host-admitted, immutable multi-target plans to enforce
independent target execution and complete result accounting.

A trusted adapter proposes the target set from reviewed domain data. Before
dispatch, the host freezes a versioned plan containing stable target/action
identities, required targets, repository and branch/component scope, immutable
source revisions, input and policy revisions, pinned worker definitions and
finite concurrency, target-count, attempt and execution-time bounds. Source
selection is separate from the trusted revision supplying harnesses and
plugins. Discovery and model output cannot expand execution permissions.

The host checks the admitted actor's current access and each target action
under existing authorization and disclosure rules. A blocked target stays
visible and undispatched; it is not silently removed from required coverage.
Before launch, the host verifies the checkout against the admitted repository
and source revision. Every child receives a separate checkout, scoped context,
case store and
artifact namespace, bound to its plan, target, action and attempt. Scheduling
and concurrency keys include the target operation identity, so distinct targets
sharing an event or tracker do not cancel or coalesce one another. Retries of
the same operation use the recovery boundary in ADR 0165.

Existing dispatch and CI execution mechanisms launch the children under those
bounds. The host validates each result against its exact attempt and frozen
inputs before collecting it. Missing, invalid, failed, blocked and uncertain
results remain explicit. Collection is accounted for only when every required
target has a retained result or explicit terminal disposition; accounting is
distinct from successful assessment, publication and domain completion. A
failed or uncertain check may request investigation through an authorized
adapter without becoming an affected verdict or remediation permission.

Changed source, mapping, policy or required targets produce a superseding plan
revision. The host stops new work under the old revision and rejects its stale
results and new publication admissions. Adding a required target reopens
collection. Reuse of prior evidence requires explicit revalidation under the
new plan; supersession never silently resets consumed work bounds. Domain
adapters define discovery, result meaning and completion policy. This decision
does not prescribe a new CLI, queue service or agent coordinator.

## Forge scope

The plan contract applies to GitHub, GitLab and Forgejo targets. Each enabled
dispatch backend must preserve target identity, authorization, isolation and
result binding; unsupported combinations are blocked explicitly. Cross-forge
plans require conformance from every participating backend. Jira may identify
the originating request without becoming execution authorization.

## Consequences

- One request can assess multiple branches independently while retaining the
exact source and scope used for each result.
- Existing matrix execution remains reusable, but rows and concurrency groups
must preserve admitted target identities.
- Partial collection stays visible and cannot imply complete coverage or
successful remediation.
- Domain adapters retain branch-discovery and assessment semantics while
Fullsend enforces execution boundaries.
- Implementation must define the versioned plan/result interface and prove
isolation, bounds and supersession before enabling multi-target execution.
18 changes: 17 additions & 1 deletion docs/architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -342,6 +342,10 @@ flowchart TB
([ADR 0158](ADRs/0158-overlays-may-grant-runtime-fetch-within-the-config-allowlist.md)).
Decided, not yet implemented.
- Plugins are runtime-scoped harness resources: a harness declares `plugins:` as one list of directories in its own repository (same trust and fetch path as skills), and each entry's format decides which runtime loads it — a `plugin.json` bundle is Claude Code's, a directory pi's `-e` loader resolves is uploaded and loaded after a tree-hash preflight computed from the host copy. Each runtime names and skips the entries in the other format, so the list survives a runtime switch. Because `--no-extensions` plus explicit `-e` closes the set of code that can register tools, no per-tool declaration is needed ([ADR 0094](ADRs/0094-pi-extensions-are-harness-resources.md)).
- Decided, not yet implemented: exact Pi extension tool selections resolve
against runner-vetted extensions and keep an explicit effective tool set,
including empty sets; unsupported selections fail before inference
([ADR 0166](ADRs/0166-select-pi-extension-tools-without-widening-access.md)).
- Decided, not yet implemented: extend the runner-owned native Codex child
policy to V2 alongside the 0.166.0 bump. Bootstrap requires the `Agent` tool,
harness security and a direct-route parent selecting V1 or V2 in the bundled
Expand Down Expand Up @@ -618,6 +622,17 @@ The existing design principle is that [the repo is the coordinator](problems/age
[#8418](https://github.com/fullsend-ai/fullsend/issues/8418) and
[#8421](https://github.com/fullsend-ai/fullsend/issues/8421).

- Decided, not yet implemented: host-admitted multi-target plans freeze target
scope, source revisions and finite execution bounds. Child scheduling keys
include the target operation identity, and collection accounts for every
required target independently of domain success
([ADR 0167](ADRs/0167-execute-authorized-multi-target-plans.md)).
- Decided, not yet implemented: repository-owned operation journals retain
separate dispatch, execution and publication receipts. Conditional state
updates and ownership generations support cross-host recovery while domain
adapters retain target and completion semantics
([ADR 0165](ADRs/0165-recover-work-through-repository-owned-operation-journals.md)).

**Open questions:**

- What provider query plans can support entity-first evaluation over the
Expand All @@ -632,7 +647,8 @@ The existing design principle is that [the repo is the coordinator](problems/age
- Is GitHub's event system sufficient for forge-native duplicate protection, or
do we need additional coordination beyond label/state conventions and agent
idempotency? (Jira polling per ADR 0063 uses entity-property locks and runner
lock refresh; ADR 0098 does not resolve this question.)
lock refresh; ADR 0165 chooses an operation journal for recoverable effects,
while adapter implementation and external-system guarantees remain open.)
- How does work assignment interact with the backlog/priority agent described in [agent-architecture.md](problems/agent-architecture.md)?
- How should explicit cancellation, retry, and reassignment interact with the
automatic event-coalescing policy in
Expand Down
12 changes: 12 additions & 0 deletions docs/problems/agent-architecture.md
Original file line number Diff line number Diff line change
Expand Up @@ -178,6 +178,14 @@ This principle aligns with what Yegge's Gas City project calls "Zero Framework C

[OpenAI Symphony](../landscape.md#openai-symphony) is the other useful contrast: a long-running central daemon that owns scheduling state, candidate selection, and retry. Where Gas City puts a controller on the path but forbids it from containing judgment, Symphony's orchestrator visibly contains it (priority sort, blocker rules, reconciliation). Fullsend can borrow Symphony's workspace safety invariants and continuation-turn semantics without adopting the daemon.

Cross-host scheduling and partial external writes need deterministic recovery
without adding a coordinator agent; see
[durable work recovery](durable-work-recovery.md).
[ADR 0165](../ADRs/0165-recover-work-through-repository-owned-operation-journals.md)
chooses repository-owned operation journals.
[ADR 0167](../ADRs/0167-execute-authorized-multi-target-plans.md) supplies the
separate target-plan and collection boundary; implementation remains open.

### How agents communicate

Agents interact through GitHub's existing mechanisms:
Expand Down Expand Up @@ -227,6 +235,10 @@ The multi-agent framework space is expanding rapidly, with new entries appearing

**Observable delegation, still a single coordinator ([Kiro Crew](../landscape.md#kiro-crew)).** Kiro Crew lets a parent conversation delegate to sub-agents that "return their results to the parent conversation," with every step — planning, sub-agent spawning, tool selection, approvals — observable live via the Agent Client Protocol. The observability is worth borrowing: making agent reasoning and tool calls inspectable in real time, rather than only after the fact in a transcript, is a good default regardless of coordination model. But the coordination model itself is the same star topology as MetaGPT and CrewAI — the parent conversation is the coordinator, and it consumes a sub-agent's returned result without the zero-trust composition fullsend's independent review sub-agents apply to each other's findings. It is a session-scoped pattern (one developer's crew, running on their own machine or a remote host they control) rather than a repo-scoped one, so it does not need to answer the question this document is built around: what authorizes a decision when no single human or agent is watching.

Exact Pi extension tool permissions are decided in
[ADR 0166](../ADRs/0166-select-pi-extension-tools-without-widening-access.md);
the runtime must enforce them without widening access to default tools.

## Open questions

- Should agents be stateless (fresh context per task) or stateful (accumulated knowledge of the codebase)? Stateless is safer (no poisoned state persists) but less efficient.
Expand Down
8 changes: 8 additions & 0 deletions docs/problems/agent-infrastructure.md
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,14 @@ Many fullsend scenarios skew toward **ephemeral, task-scoped** execution (triage
- **Governance** — Policy may be applied at runtime by agents reading from a policy repo; infrastructure determines where that runtime runs and how it accesses policy.
- **Repo readiness** — Repos need reliable CI and signals; agent infrastructure may consume or depend on the same CI (e.g. for “run tests” or “run linters”) and should not conflict with it. Headless runtimes amplify **feedback latency** and **workspace handoff** costs when CI is the only execution path.

Restarting workers also needs durable ownership and reconciliation of external
effects; see [durable work recovery](durable-work-recovery.md).
[ADR 0165](../ADRs/0165-recover-work-through-repository-owned-operation-journals.md)
chooses repository-owned journals and short-lived reconcilers.
[ADR 0167](../ADRs/0167-execute-authorized-multi-target-plans.md) bounds and
isolates target execution while reusing existing scheduling mechanisms. Backend
implementation and operational acceptance remain open.

## Open questions

- What is the right level of isolation per agent (process, container, microVM, separate cluster)?
Expand Down
Loading
Loading