From ed82a170dfd0c191146e8300559cfb52e78a2330 Mon Sep 17 00:00:00 2001 From: Wayne Sun Date: Mon, 2 Nov 2026 13:55:06 -0500 Subject: [PATCH] docs(adr): 0117 steer a running cycle with admitted entity updates A running cycle may take freshly admitted, filtered entity records as steers. Assisted-by: Claude (fix), Claude (review) Signed-off-by: Wayne Sun --- ...ning-cycle-with-admitted-entity-updates.md | 328 +++++++++++++++ ...inistic-filtered-entity-context-staging.md | 5 + docs/architecture.md | 8 + docs/normative/steer-envelope/v1/README.md | 394 ++++++++++++++++++ 4 files changed, 735 insertions(+) create mode 100644 docs/ADRs/0117-steer-a-running-cycle-with-admitted-entity-updates.md create mode 100644 docs/normative/steer-envelope/v1/README.md diff --git a/docs/ADRs/0117-steer-a-running-cycle-with-admitted-entity-updates.md b/docs/ADRs/0117-steer-a-running-cycle-with-admitted-entity-updates.md new file mode 100644 index 0000000000..d40d62f87b --- /dev/null +++ b/docs/ADRs/0117-steer-a-running-cycle-with-admitted-entity-updates.md @@ -0,0 +1,328 @@ +--- +title: "117. Steer a running cycle with admitted entity updates" +status: Accepted +relates_to: + - agent-architecture + - security-threat-model + - flapping-convergence +topics: + - concurrency + - entities + - authorization + - data-security + - entity-context-snapshot +--- + +# 117. Steer a running cycle with admitted entity updates + +Date: 2026-11-02 + +## Status + +Accepted + +Partially supersedes two sentences of +[ADR 0141](0141-deterministic-filtered-entity-context-staging.md), for the +steer path only. Every other ADR 0141 rule stays current. + +- "An explicitly configured host-side extension may fetch a kind outside the + snapshot": the host-side steer path may also fetch newer revisions of the + snapshot's own kinds for the bound entity during a cycle, through the same + pipeline and fail-closed rules, exposing no raw payload. Sandbox forge reads + stay denied. +- "requires a versioned schema that lists its path in the manifest": "the + manifest" there is the snapshot's `index.json`. Steer output is listed + instead in its own manifest, + [steer envelope v1](../normative/steer-envelope/v1/README.md), under the same + filtering, digest, permissions, exact-path, and cleanup rules. + +Reason: a steer carries newer revisions of what the snapshot holds, and the +snapshot, whose digest is the cycle's admitted input, cannot change mid-cycle. + +This is the first of five steer decisions. The later ones build on it: + +- ADR 0118: runtime delivery. +- ADR 0119: GitHub Actions signal. +- ADR 0120: receipts for absorbed steers. +- ADR 0121: on by default. + +## Context + +[ADR 0106](0106-serialize-agent-runs-and-coalesce-subsequent-events.md) +coalesces later events into one pending follow-up, and +[ADR 0144](0144-reuse-poll-and-entity-bound-run-processes.md) runs it as a new +cycle in the same `fullsend run` process. Neither reaches a running sandbox, +so a turn that started on old state posts output that the entity has already +moved past, such as a review of a replaced head +([#1207](https://github.com/fullsend-ai/fullsend/issues/1207)), and a person +who adds direction mid-run waits for the next cycle. On GitHub Actions, +event-only harnesses get no wake listener from ADR 0144, so their follow-up +starts only after the current job ends. + +Any answer keeps per-record admission with no data-only lane +([ADR 0133](0133-actor-attributed-data-security-boundary.md)) and wakes that +never consume pending work (ADR 0144). + +This ADR aims to let a running sandbox cycle take in admitted entity updates, +including pushes, without weakening those rules. + +## Options + +| Option | Why not chosen | +|---|---| +| Rely on ADR 0144 cycles alone | The stale turn still finishes and may post; nobody can redirect work in flight | +| Ask the agent to re-check the entity at turn end | Advisory, reads the forge from the sandbox (ADR 0141 denies it), and still pays for the stale turn | +| **Steer the running cycle** (chosen) | — see Decision | + +## Decision + +We adopt steering, the delivery of freshly admitted, filtered entity records +and a moved change-proposal head into a running sandbox cycle, to let the +agent's next turn work from the entity's current state. + +Steering is an optional fast path inside one ADR 0144 cycle; the next cycle +stays the correctness backstop. + +### Place in the cycle + +- A steer is one delivery into the current sandbox, not a cycle. +- A steer never takes, fills, consumes, or replaces the newest-pending slot or + the pending platform execution. The prompting notification still schedules + the follow-up cycle, which runs CEL and the pre-script as usual. +- A steer refused before anything is published, in steps 1 to 4a or by a + failing release check, leaves the cycle as if no steer was attempted and + releases its sequence number. +- Once its files or envelope are published, a steer whose acknowledgement + never arrives has an unknown outcome. It keeps its sequence number and its + entry in the manifest chain. It is recorded as possibly delivered, is never + counted as absorbed, and Fullsend never claims the model did not see it. + The cycle takes no further steers, so a later steer never builds on records + the agent may not hold. The next cycle is the backstop. +- A lost runtime session fails the cycle. +- The cycle's platform-verified result revision (ADR 0144) starts at the + revision of the cycle's admitted input. It can move to a steered head only + under the rules in [Result revision](#result-revision). + +### When a steer is attempted + +While a cycle's sandbox runs, a notification for its serialization key (an +ADR 0144 event or wake) prompts a steer attempt, unless the running harness's +own agent identity caused it; updates from other registered agents still +prompt an attempt. That filter is routing, not admission. + +A cycle runs at most one steer attempt at a time, from step 1 to step 6. The +sequence number is assigned and the cap is checked in step 1, inside that +serialization, so every candidate is prepared against the latest published +manifest. A notification that arrives during an attempt starts a new attempt +after the current one ends. Refused attempts count toward a per-cycle attempt +bound, so activity that is never admitted cannot keep the host busy. Each +attempt runs on the host, in order: + +| Step | What happens | If it fails | +|---|---|---| +| 1. Eligibility | Steering is enabled for the harness, the entity is a forge entity, the runtime can take a message into the running session, and the cycle is under its steer cap with time left for a full turn | No steer | +| 2. Still selected | Re-resolve the entity, check [ADR 0149](0149-coalesce-entity-source-discovery-queries.md) source membership for entity-source harnesses, and evaluate harness CEL (see below) | False or unknown: no steer | +| 3. Acquire | Fetch records new, changed, or deleted since the snapshot and earlier steers; for a change proposal whose head moved, fetch the new head into host-private state (see [Head provisioning](#head-provisioning)) | Fetch error, or nothing new or changed: no steer | +| 4. Filter and admit | ADR 0141 pipeline on records, the context-file scan on a moved head, then the admission rule below | Dropped records are counted, never delivered. No steer if: a moved head fails attribution, admission, or the scan; a record the agent already holds was deleted, or its newer revision fails admission or filtering; or no record and no head move is admitted. A deletion is left to the follow-up cycle, so a withdrawn instruction never stays beside its replacement | +| 4a. Pre-script gate | For a harness with a pre-script, run it on the host under the [ADR 0072](0072-pre-script-output-protocol.md) protocol with the steer input below, only if the harness declares that its pre-script supports the steer gate | A pre-script without that declaration: no steer, and it is not run. A skip, an error, a timeout, or no `steer_checked=true` in its output: no steer; the updates wait for the follow-up cycle | +| 5. Release | Under the sandbox write lock: run the release check per record and for a moved head's actor, write the steer files, install a moved head, and append the envelope; then, with the lock released, wait for the acknowledgement | Any record, the head actor, or the head install failing declines the whole steer before the envelope is published, so the delivered set is always the set the pre-script gate saw; the updates wait for the follow-up cycle | +| 6. Record | Add a child event to the cycle's span. Steers count toward the ADR 0106 and ADR 0144 circuit breakers and do not change run status | — | + +**Steer input for the pre-script.** In a steer-gate run the host sets: + +- `FULLSEND_CONTEXT_DIR` to the cycle's snapshot, as usual; +- `FULLSEND_STEER_DIR` to a host-side, read-only, digest-verified copy of + every steer directory of this cycle so far plus the candidate steer, in + steer order. + +Later revisions of a record replace earlier ones by record key, so the +pre-script sees the cumulative state the agent will hold. A pre-script that +reads this input signals it by writing `steer_checked=true`, a new key in the +pre-script output protocol added under its versioning rules. A pre-script that +does not write it never lets a steer through. A pre-script written before +steering is never run as a gate at all: the harness must first declare that +its pre-script supports the steer gate. A steer-gate run is a check only. It +gets no forge write credential and must make no forge or entity writes; +Fullsend relays none of its outputs and posts no status for it. After it +exits, the host re-verifies the candidate's manifest and file digests against +host-private state before release. + +**Still selected.** CEL runs over the current entity with the cycle's retained +prompting event (`null` for an eventless cycle). The event is reused only so +an event-only harness, whose CEL needs one, stays eligible; it never grants +authorization. The event's entity and state fields are refreshed from the +re-resolved entity, so a closed entity or a removed label is seen as it is +now. Independently of CEL, the re-resolved entity must still be open, and for +an event that a label addition triggered, that label must still be present; +otherwise no steer. In the same step the event is revalidated fresh through +its own admission path, and a failure means no steer: + +- an ordinary human actor must meet the harness's effective `human_min_role` + ([ADR 0151](0151-harness-human-role-minimums.md)), or the Authorization v1 + threshold on legacy non-CEL routes; +- a registered bot must pass the + [ADR 0107](0107-bot-identity-resolution-for-dispatch-authorization.md) + `bot_role` gate; +- an exact verified label addition uses Authorization v2's label-transition + grant, and passes only while the label is still present: for a human it + satisfies only a `triage` minimum, and a provider-classified bot uses its + own transition grant without a `bot_role`. + +A bot or a label grant is never declined only because `actor.role` is `none`. +This is not a new ADR 0144 check: it runs inside the cycle that consumed the +event and can only decline, so ADR 0144's rule that later checks "do not +reuse" the event is unchanged. + +### Admission + +A steer release is a "Fullsend-controlled capability invoked after sandbox +initialization", so each release runs the contract's check on each record's +current-revision actor and, when a change proposal's head moved, on the +forge-authenticated actor who moved the head to that revision. That check +"MUST resolve authorization immediately before releasing each result to the +model" +([Authorization v1](../normative/authorization/v1/README.md#model-bound-actor-attributed-data-admission) +and +[v2](../normative/authorization/v2/README.md#model-bound-actor-attributed-data-admission)). + +- Human actors must meet the admission threshold of the cycle's snapshot + records, so one cycle never admits updates at two thresholds. Steer envelope + v1 pairs only with entity-context-snapshot v1, whose threshold is `triage` + (observation) or `write` (mutation). Moving to the harness's + `human_min_role` needs entity-context-snapshot v2 and, with it, steer + envelope v2. +- Bot actors need a registered ADR 0107 `bot_role`. +- Records that fail, or cannot be attributed or verified, are dropped and + counted as omissions. +- A head move is attributed only from forge-authenticated push or head-update + metadata, never from self-asserted Git commit author or committer fields + (ADR 0133). The sandbox already holds the earlier head, so a moved head + whose actor cannot be attributed, or fails admission or the release check, + declines the whole steer, including any accompanying records. The agent + never receives comments about code that was withheld. +- Event-carried evidence, the route job's verdict, earlier CEL results, and the + [ADR 0148](0148-reuse-verified-actor-roles-for-entity-cel.md) role cache + never satisfy the check. + +### Content + +Records take the ADR 0141 host-side path and filter pipeline; the +sandbox-visible format is +[steer envelope v1](../normative/steer-envelope/v1/README.md). A steer is +content, never capability: it cannot change tools, role, model, credentials, +routing, or network policy. + +### Head provisioning + +When a change proposal's head moves from `A` (the head last provisioned into +this sandbox, from the snapshot or the latest published head steer) to `B`, +the host provisions it in three stages. The sandbox never calls the forge and +receives no fetch credential. + +1. **Fetch (step 3).** With its own forge credential, the host fetches `B`, + the commits connecting it to `A`, and the change proposal's current base + into host-private state outside the clone and the run-output tree, and + checks that the fetched commit ID is `B`. Fetching the current base means + the agent never diffs `B` against a stale base when the base moved. +2. **Scan (step 4).** The host runs the pre-agent input scanners (Unicode + normalization and prompt injection) over the repository context files that + changed in `B`'s tree. A critical finding always declines the whole steer, + whatever the scan's fail mode for other inputs. +3. **Install (step 5).** Under the sandbox write lock, after the release + check, the host installs `B`'s objects into the sandbox repository and + sets `refs/fullsend/head` to `B` and `refs/fullsend/base` to the current + base. It writes the objects and refs as files rather than running Git + inside the sandbox, so no agent-writable Git configuration takes part. + The repository is one the agent can modify, so the host never writes into + an existing file there. Each object and ref goes to a freshly created file, + opened relative to a directory handle without following links, and is then + renamed into place, replacing the directory entry rather than the file it + names. A hard link or symlink the agent planted is never written through, + and a symlink or special file on the path declines the steer. + +What the agent sees depends on its working tree: + +| Working tree | What the host does | What the agent does | +|---|---|---| +| Read-only (`readonly_repo`, for example review) | Also updates the read-only tree, `HEAD`, and the index to `B` under the lock, at a tool boundary the runtime reports, with no agent tool running, so no read sees a mix of `A` and `B`. A runtime that cannot report such a boundary declines read-only head steers. The agent has no local edits there to lose | Reads `B`'s files as usual; the envelope's `Head:` line names `B`, which the tree already shows | +| Writable (for example fix or code) | Never modifies the working tree, the index, or `HEAD`, so no in-flight edit or local commit is overwritten | Rebases or checks out `refs/fullsend/head` itself | + +### Result revision + +A cycle's *eligible head set* is its initial snapshot head `H_0` plus every +`head.sha` from a steer in that cycle that the runtime acknowledged before +settle. When the cycle completes validation, the host resolves the cycle's +platform-verified result revision (ADR 0144) from that set. + +ADR 0144 requires the revision to be platform-verified, but does not fix it to +the cycle's starting head. Every head in the set was fetched by the host from +the forge, so this rule defines the revision for steered cycles without +changing ADR 0144. + +| Cycle output | Result revision | What the host has checked | +|---|---|---| +| Result JSON carries `head_sha` (for example review) | `head_sha`, when it is in the eligible head set; otherwise validation fails closed | Only that the agent named a head it was given. This bounds the agent's claim; it does not prove the agent reviewed that head | +| New commits on the PR branch and no `head_sha` (for example fix) | The single eligible head nearest to the extracted `HEAD`: an ancestor of `HEAD` with no other eligible head that descends from it and is also an ancestor of `HEAD`. If no eligible head, or more than one, meets that rule (for example after the agent merged two steered heads), validation fails closed. A result with both new commits and a `head_sha` that disagree also fails closed | That the agent's commits were built on that one head and on no newer eligible one. `H_0` is always eligible, so an agent that ignored every steer resolves to `H_0` | +| Neither | `H_0` | — | + +**No approval on an agent-reported steered head.** When a review's +`head_sha` is a steered head rather than `H_0`, `fullsend run` rewrites an +`approve` action to `comment` in the host copy of the result before the +post-script runs. Every approval outcome is therefore withheld, including the +review event, a ready-for-merge label, and auto-merge, whatever post-script +version the harness uses. The review still posts, pinned to that head, +noting that a full cycle must approve it. Changes-requested and comment +verdicts post as usual. The follow-up cycle reviews the head in full and may +approve it. + +**Post-script baseline.** When the result revision advances to `B`, +`fullsend run` sets `PRE_AGENT_HEAD` to `B` in the post-script's environment, +so its diff, secret, and pre-commit checks cover only commits the agent added +on top of `B`, and existing post-scripts need no change. + +### Dependencies + +Steering stays off, regardless of configuration, until these are in place: + +- per-record admission at the snapshot's threshold, the ADR 0141 filter + pipeline, and its host-side extension path; +- the ADR 0144 cycle lifecycle, and ADR 0106 active-run preservation on the + platform, so a new event does not cancel the running cycle (on GitHub + Actions, `cancel-in-progress: false`); +- an in-sandbox writer the agent cannot impersonate, for the steer files, the + head objects, and the agent's input channel. + +Handled-state receipts are not a dependency: delivery is correct without +them, and each steered cycle is then followed by a full cycle. + +## Forge scope + +Steering applies wherever a running cycle receives a verified signal: + +- **GitHub:** through ADR 0144 events and wakes. ADR 0144 opens no wake + listener on GitHub Actions, and event-only harnesses there have no timer + check either, so this ADR alone does not steer them. Head moves on pull + requests from forks decline, because the push happens in the fork, where + the host cannot attribute it. +- **GitLab and Forgejo:** through ADR 0144 events and wakes, once ADR 0144 is + implemented there; the rules here are forge-neutral. A head move needs the + forge-authenticated actor who moved the head; until a forge adapter exposes + it (Forgejo has none yet), head-move steers there decline and the follow-up + cycle handles the push. +- **Jira and other non-forge entities:** steering is declined, since + entity-context-snapshot v1 does not stage them. + +## Consequences + +- Updates during a cycle, including pushes to a change proposal, reach the + running agent in the same session, so fewer outputs are built from replaced + state or discarded as `stale-head`. +- A steered sandbox stays up longer, each release adds a fresh permission + lookup per actor, and each head move adds a host-side fetch, a context + scan, and an object upload. +- A harness's pre-script gates every steer over the cumulative steer input, + so steering adds no path past it; a harness with a pre-script steers only + after that pre-script opts in, and pays one extra pre-script run per steer. +- A review of a steered head can request changes in the same session, but + only a full cycle can approve that head, and the follow-up cycle always + runs for a pushed head. diff --git a/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md b/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md index d3296b19fb..70e58da673 100644 --- a/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md +++ b/docs/ADRs/0141-deterministic-filtered-entity-context-staging.md @@ -26,6 +26,11 @@ effective `human_min_role` above an immutable `triage` floor. Snapshot v1 retains its historical threshold; deterministic assembly, current-revision checks, and filtering remain required. +Partially superseded by +[ADR 0117](0117-steer-a-running-cycle-with-admitted-entity-updates.md) on the +steer path: host-side re-fetch of newer revisions of snapshot kinds during a +cycle, and steer output listed in its own steer-envelope manifest. + ## Context [Issue #6407](https://github.com/fullsend-ai/fullsend/issues/6407) identifies diff --git a/docs/architecture.md b/docs/architecture.md index 19b5cbc5ab..688e202f60 100644 --- a/docs/architecture.md +++ b/docs/architecture.md @@ -568,6 +568,14 @@ The existing design principle is that [the repo is the coordinator](problems/age Implementation and the normative query protocol are tracked in [#8418](https://github.com/fullsend-ai/fullsend/issues/8418) and [#8421](https://github.com/fullsend-ai/fullsend/issues/8421). +- Steering (target state): a notification during a cycle's sandbox may steer + it with freshly admitted, filtered records, and with a moved change-proposal + head as Git objects the host fetches and installs, as an optional fast path. + A steer never consumes the pending follow-up and admits at the same + threshold as the cycle's snapshot. A review of a steered head cannot + approve it, and the next cycle stays the backstop + ([ADR 0117](ADRs/0117-steer-a-running-cycle-with-admitted-entity-updates.md), + [steer envelope v1](normative/steer-envelope/v1/README.md)). **Open questions:** diff --git a/docs/normative/steer-envelope/v1/README.md b/docs/normative/steer-envelope/v1/README.md new file mode 100644 index 0000000000..afb2f5c774 --- /dev/null +++ b/docs/normative/steer-envelope/v1/README.md @@ -0,0 +1,394 @@ +# Steer envelope v1 + +This specification defines what a steer makes visible inside a running +sandbox: the steer files and the message the agent receives. It is the +contract between `fullsend run`, the agent runtimes, and the agent definitions +in [fullsend-ai/agents](https://github.com/fullsend-ai/agents). + +- [ADR 0117](../../../ADRs/0117-steer-a-running-cycle-with-admitted-entity-updates.md) + decides when a steer happens and which records it may carry. +- ADR 0118 (proposed) decides how a runtime delivers the message. +- [ADR 0141](../../../ADRs/0141-deterministic-filtered-entity-context-staging.md) + requires a versioned schema before extension output becomes + sandbox-visible. This document is that schema for steer output. Its + manifest stands in for the snapshot manifest under the scoped partial + supersession in ADR 0117, with the same filtering, digest, permissions, + exact-path, and cleanup rules. + +This document is normative. The key words MUST, MUST NOT, and MAY are used as +in RFC 2119. + +## Overview + +Each steer produces two things: + +| Part | What it is | Who reads it | +|---|---|---| +| Steer directory | One manifest, one filtered file per admitted record, and any review relation files, in an agent-immutable tree | The agent, through file reads | +| Envelope | A short message that lists the steer's records by key and path, with the new head | The agent, as a new user turn | + +Record bodies appear only in the steer directory. The envelope carries only +manifest fields, including the filtered actor login, so a record body cannot +forge envelope structure. + +## Steer directory + +### Location + +Fullsend reserves one sandbox path per cycle, a sibling of the snapshot path: + +```text +/sandbox/entity-context-steer/ +├── 0001/ +│ ├── manifest.json +│ ├── records/-.md +│ ├── relations/reviews.json (only when a steered record is part of a review) +│ ├── state/threads.json (same) +│ ├── state/actors.json (same) +│ └── threads/.keys (same) +└── 0002/ + └── ... +``` + +- `FULLSEND_STEER_DIR` points to `/sandbox/entity-context-steer` inside the + sandbox. +- Each steer writes a new directory named by its one-based sequence number + within the cycle, zero-padded to four digits so names sort in steer order. + Four digits bound a cycle to 9999 steers, so the configured steer cap MUST + NOT exceed 9999. Earlier steer directories stay until + the cycle ends. +- Fullsend MUST reject a checkout or `host_files` destination that overlaps + this path, and MUST decline steering if the path exists with unexpected + contents at sandbox start. + +### Record files + +Each admitted record is one file. Its name and bytes follow the +[entity-context-snapshot v1](../../entity-context-snapshot/v1/README.md) +record rules exactly: the `records/-.md` name, the +fixed `Fullsend-Record`, `Source-ID`, `Author-ID`, and `Created-At` headers, +and the filtered body. A record key derived for a steer is the same key the +snapshot derives for that forge record. + +- A changed version of a record that is already in the snapshot keeps its + record key. The steer file holds the current filtered revision; the snapshot + copy is not modified. +- A record whose filter status is `rejected`, or whose admission failed, has + no file. It appears only in the manifest's `omitted` list. +- If a newer revision of a record the agent already holds, in the snapshot or + an earlier steer, fails admission or filtering, Fullsend MUST decline the + whole steer. The follow-up cycle handles it. +- Admission uses the same threshold as the cycle snapshot's records (ADR + 0117), so one cycle never admits a record at two thresholds. For steer + envelope v1 that is entity-context-snapshot v1's threshold (see + [Actor](#actor)). + +### Review relation files + +A review record or a review comment means little without its review outcome, +reviewed revision, and thread location, which the snapshot keeps outside the +record files. When a steer carries a record that belongs to a formal review +or a review thread, the steer directory also holds `relations/reviews.json` +and `state/threads.json`. + +- Each file uses the entity-context-snapshot v1 schema of the same name and + holds only the reviews and threads that the steer's admitted records belong + to, in their current state. +- The steer directory also holds a `threads/.keys` file for + each thread, and `state/actors.json` with a row for every actor the + relations name, such as a thread's resolver or a review's dismisser, built + by the snapshot's actor-state rules. +- **Order files name record keys, not paths.** Unlike a snapshot v1 `.order` + file, each line of a steer's `.keys` file is a record key. A key resolves to the newest + revision of that record across the chain: the latest steer that carries it, + else the snapshot. A new reply whose parent exists only in the snapshot + therefore lists the parent's key, which resolves to the snapshot's file. +- Every other relation that names a record resolves it by record key the same + way. +- **Validation.** `relations/reviews.json`, `state/threads.json`, and + `state/actors.json` validate against the entity-context-snapshot v1 JSON + schemas of the same names, with one exception: a thread's `order_path` + names its `threads/.keys` file instead of a `.order` file. + Cross-file checks resolve record keys across the + chain as above, not within the steer directory alone, so a subset of + reviews and threads is valid. +- Each of these files is listed in the manifest's `relations` array. +- A steer with no such record has neither file and an empty `relations` + array. + +### Manifest + +`manifest.json` is UTF-8 JSON serialized with RFC 8785, with no byte-order +mark and no trailing newline. Timestamps and Git object IDs use the +entity-context-snapshot v1 canonical forms. + +| Field | Type | Meaning | +|---|---|---| +| `schema` | string | Always `"steer-envelope"` | +| `schema_version` | integer | Always `1`, the snapshot's integer convention | +| `snapshot_schema_version` | integer | The cycle snapshot's `index.json` `schema_version`; always `1` (see [Versioning](#versioning)) | +| `filter_version` | string | The pipeline version; MUST equal the cycle snapshot's `filter_version` | +| `sequence` | integer | This steer's sequence number, from 1 | +| `snapshot_input_revision` | string | SHA-256 of the cycle snapshot's `index.json` bytes | +| `previous_manifest_sha256` | string or null | SHA-256 of the previous steer's manifest bytes; `null` for the first | +| `entity` | object | The bound entity; see [Entity](#entity) | +| `head` | object or null | For a change proposal whose head moved and was provisioned: `sha`, `previous_sha`, and `base_sha` (the change proposal's current base); otherwise `null` | +| `records` | array | One entry per admitted record, sorted by `created_at` then record key | +| `relations` | array | One entry per review relation file, thread order file, and actor-state file, sorted by `path`; each has `path` and `sha256` (see [Review relation files](#review-relation-files)) | +| `omitted` | array | One entry per scope and code, sorted by scope then code | + +A manifest MUST hold at least one `records` entry or a non-null `head`. +Fullsend MUST NOT publish a steer that carries only `omitted` counts. + +Each `records[]` entry: + +| Field | Type | Meaning | +|---|---|---| +| `record_key` | string | The snapshot record key | +| `kind` | string | `entity`, `comment`, or `review` | +| `path` | string | Path relative to the steer directory, for example `records/-.md` | +| `sha256` | string | SHA-256 of the file bytes | +| `created_at` | string | Source creation time | +| `revision` | string | The source's current-revision time (its edit time, or `created_at` when never edited) | +| `replaces_snapshot` | boolean | `true` when the snapshot holds an earlier revision of the same record | +| `actor` | object | The record's current-revision actor; see [Actor](#actor) | +| `filter` | object | `status` (`unchanged`, `modified`, or `truncated`) and `findings` (codes and counts), as in the snapshot | + +#### Omitted + +Each `omitted[]` entry: + +| Field | Type | Meaning | +|---|---|---| +| `scope` | string | `entity`, `comments`, or `reviews` | +| `code` | string | A snapshot v1 gap code: `authorization_failed`, `unsafe_content`, `fetch_failed`, `source_too_large`, `invalid_metadata`, `profile_bound`, `history_unavailable`, or `unsupported` | +| `count` | integer | At least 1 | + +The snapshot's collection-profile bounds also apply to steers; a record +dropped by a profile bound is counted as `profile_bound`. Omitted entries hold +no record text, keys, or logins. Unlike snapshot gaps they carry no usability +class: a steer is all-or-nothing, so any omission that would make the update +unusable declines the whole steer instead. + +#### Entity + +| Field | Type | Meaning | +|---|---|---| +| `source` | object | Exactly the snapshot `index.json` `source` object: `forge`, `host`, `repository_id`, `repository` | +| `kind` | string | `work_item` or `change_proposal`, the snapshot v1 entity kinds | +| `id` | string | The immutable forge object ID, as in `index.json` `entity.id` | +| `record_key` | string | The snapshot record key of the entity-body record (64 lowercase hex) | + +#### Actor + +The actor object follows a snapshot v1 `state/actors.json` row, plus +`bot_role`: + +| Field | Type | Meaning | +|---|---|---| +| `id` | string | Immutable actor ID. A record whose actor the forge no longer exposes cannot be attributed, so it is omitted, never admitted | +| `kind` | string | `human` or `bot` | +| `login` | string or null | Current login; `null` when unsafe or empty after filtering | +| `role` | string | Human: the verified effective role, one of the Authorization role values `admin`, `maintain`, `write`, `triage`. Bot: `bot` | +| `role_verified` | boolean | `true` for a human, `false` for a bot, as in snapshot actor state | +| `bot_role` | string | Present only for a bot: its registered ADR 0107 canonical role | + +**Minimum role.** Admission and the release check use the same rule: a human +record passes only when its role is verified fresh and meets +entity-context-snapshot v1's threshold for the cycle's agent category +(`triage` or above for observation agents, `write` or above for mutation +agents), and a bot record passes only with a registered `bot_role`. A record +that fails at admission has no actor object and is counted in `omitted`. A +record that fails at release declines the whole steer (see Release check). + +#### Example + +A complete manifest for the second steer of a cycle, shown indented for +reading; the real bytes are RFC 8785 with no whitespace. Digests other than +the two record keys are illustrative. + +```json +{ + "entity": { + "id": "PR_kwDOExample", + "kind": "change_proposal", + "record_key": + "4d2e2874971944bca1f0c97f533bafe5c78a1a09ee69851c94965398b795aa9a", + "source": { + "forge": "github", + "host": "github.com", + "repository": "example-org/example-repo", + "repository_id": "R_kgDOExample" + } + }, + "filter_version": "1", + "head": { + "base_sha": "0a1b2c3d4e5f60718293a4b5c6d7e8f901234567", + "previous_sha": "9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d", + "sha": "4f1c2e9d0b7a65c3e8f1a2b4c6d8e0f1a3b5c7d9" + }, + "omitted": [ + { "code": "authorization_failed", "count": 1, "scope": "comments" } + ], + "previous_manifest_sha256": "891809c735ff5e4e047caeba0599a3213ebf6cdb7f519b68237a5ca09a5b1812", + "records": [ + { + "actor": { + "id": "U_kgDOExample", + "kind": "human", + "login": "example-maintainer", + "role": "write", + "role_verified": true + }, + "created_at": "2026-11-02T10:15:30.000000000Z", + "filter": { "findings": [], "status": "unchanged" }, + "kind": "comment", + "path": "records/20261102T101530000000000Z-c73645a72a9c5de28d71e3e1efe235b9a5d02ee6dfe7dc0ef06cf3d0e5ee3421.md", + "record_key": + "c73645a72a9c5de28d71e3e1efe235b9a5d02ee6dfe7dc0ef06cf3d0e5ee3421", + "replaces_snapshot": false, + "revision": "2026-11-02T10:15:30.000000000Z", + "sha256": "c147efcfc2d7ea666a9e4f5187b115c90903f0fc896a56df9a6ef5d8f3fc9f31" + } + ], + "relations": [], + "schema": "steer-envelope", + "schema_version": 1, + "sequence": 2, + "snapshot_input_revision": "1bc04b5291c26a46d918139138b992d2de976d6851d0893b0476b85bfbdfc6e6", + "snapshot_schema_version": 1 +} +``` + +The manifest's own path set is exact: every file under the steer directory is +`manifest.json` or listed in `records[].path` or `relations[].path`. + +### Write, permissions, and cleanup + +| Rule | Requirement | +|---|---| +| Assembly | The host builds the directory in host-private state, then verifies every `sha256` and the exact path set before upload | +| Release check | The fresh authorization check for every record, and for the actor of a non-null `head`, runs after assembly and immediately before upload, under the sandbox write lock. Any failure MUST decline the whole steer ([ADR 0117](../../../ADRs/0117-steer-a-running-cycle-with-admitted-entity-updates.md)): nothing is uploaded, and the updates wait for the follow-up cycle | +| Upload | Fullsend MUST reject symlinks and special files at every path component, matching the entity-context-snapshot v1 rule | +| Head objects | When `head` is not `null`, Fullsend MUST install the head before delivering the envelope, as ADR 0117's head provisioning describes, and MUST decline the steer if the install fails. The head is never staged as a file under `/sandbox/entity-context-steer` | +| Permissions | Agent-immutable, with the snapshot's modes: a read-only bind mount, or root-owned `0555` directories and `0444` files with the agent unprivileged and without `CAP_FOWNER`. If neither can be enforced, Fullsend MUST NOT steer | +| Host copy | The snapshot's host modes, `0700` directories and `0600` files (owner-only), outside the clone and the retained run-output tree | +| Cleanup | The sandbox copy is removed with the cycle's snapshot copy; the host copy is removed after the post-script, on every controlled exit. Startup scavenges abandoned copies | +| Artifacts | Steer directories are excluded from retained artifacts. Diagnostics MAY keep counts, digests, and filter codes, never bodies | + +## Envelope + +The envelope is the message appended to the running session. It is built only +from manifest fields, never from record bodies. + +```text +Runner update: your task inputs changed after this run started. + +Steer: 0002 +Manifest: /sandbox/entity-context-steer/0002/manifest.json +Head: 4f1c2e9d0b7a65c3e8f1a2b4c6d8e0f1a3b5c7d9 (was 9e8d7c6b5a4f3e2d1c0b9a8f7e6d5c4b3a2f1e0d) +Omitted: 1 + +[steer-record 1/2] +Record: c73645a72a9c5de28d71e3e1efe235b9a5d02ee6dfe7dc0ef06cf3d0e5ee3421 +Kind: comment +Actor: @example-maintainer (write) +Revision: 2026-11-02T10:15:30.000000000Z +Filter: unchanged +Path: /sandbox/entity-context-steer/0002/records/20261102T101530000000000Z-c73645a72a9c5de28d71e3e1efe235b9a5d02ee6dfe7dc0ef06cf3d0e5ee3421.md +[/steer-record] + +[steer-record 2/2] +... +[/steer-record] +``` + +The values above are illustrative; the record key is the worked example from +entity-context-snapshot v1. + +### Envelope rules + +- **Opening line.** Every envelope begins with + `Runner update: your task inputs changed after this run started.`, byte for + byte, followed by one blank line. +- **Header lines.** `Steer:` and `Manifest:` are always present. `Head:` is + present only when the manifest `head` is not `null`, as + `Head: (was )`. `Omitted:` is present + only when the omitted count is above zero, and gives the sum of `omitted[].count`. +- **One block per record.** Each admitted record is one + `[steer-record N/M]` ... `[/steer-record]` block, in manifest order. Lines + inside a block are, in order: `Record`, `Kind`, `Actor`, `Revision`, + `Filter`, `Path`. `Actor` shows `@`, or `(unknown)` when `login` + is `null`, followed by `(role)` for a human or `(bot: )` for a + bot. +- **No other text.** The envelope contains no record body, title, or label + text. A runtime that splits the message into content blocks MUST keep each + record block whole. +- **Field safety.** Every field value comes from the manifest. Fullsend MUST + refuse to steer if any value contains a line break, `[steer-record`, + `[/steer-record]`, or the opening line. + +### The opening line inside record bodies + +Agent definitions treat the opening line in two ways: + +| Where it appears | Meaning | +|---|---| +| First line of a delivered message | A runner update. The agent reads the listed records | +| Inside a record body | An injection attempt. The agent should flag it | + +Fullsend does not rewrite the opening line inside record bodies, because that +would remove the evidence the agent definitions act on. The filter pipeline +still applies to the rest of the body. + +### What the agent may do with a steer + +- Read the listed files. They are filtered, attributed data under + [ADR 0133](../../../ADRs/0133-actor-attributed-data-security-boundary.md): + an admitted record may guide the task within the harness's scope, but cannot + change tools, role, credentials, or routing. +- When `Head:` is present, work from `` without calling the forge. On a + read-only working tree the files already show ``; on a writable one, + build new commits on `refs/fullsend/head`. Diff against + `refs/fullsend/base`, which holds the change proposal's current base. A + harness whose result schema carries `head_sha`, such as review, reports the + head it actually worked on there; other harnesses add no such field. +- Ignore a block whose `Path` does not exist. The agent MAY check a file + against the manifest `sha256` with a tool such as `sha256sum` and ignore a + mismatch. Such a block was not written by Fullsend. + +## Versioning + +This is v1. A breaking change requires `docs/normative/steer-envelope/v2/`. + +- **Snapshot pairing.** Steer envelope v1 pairs only with + entity-context-snapshot v1. Consumers MUST reject a manifest whose + `snapshot_schema_version` is not `1` or differs from the cycle snapshot's + `index.json` `schema_version`. Entity-context-snapshot v2, which the ADR + 0151 `human_min_role` threshold needs, requires steer envelope v2, so one + cycle always admits at the snapshot's single threshold. +- **Schema file.** The prose tables in this document are authoritative for + v1. A `manifest.schema.json` in this directory ships with the first + implementation and MUST match them exactly, with no added or changed fields. + Nothing may claim conformance to this version before it exists. + +These changes are breaking: + +- the opening line, the header line names, the block delimiters, or the block + line order; +- the steer directory path, the record file rules, or a manifest field's name, + type, or meaning; +- any change to the permission, exact-path, or cleanup rules that weakens + them. + +Adding a manifest field is also breaking: consumers validate a closed field +set, as entity-context-snapshot v1 consumers do. + +## Open questions + +- **One block per record.** ADR 0141 asks for one content block per record + "when cache reuse is intended". Appending a steer keeps the earlier prompt + prefix cacheable. Which content-block and cache-boundary layout should a + runtime use for the steer turn so that later turns keep reusing it? +- **In-band version.** The opening line carries no version token. Adding one + later changes the opening line, which is itself a v2 change.