interplane-mv
INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority.
Brought by drakestapleton
interplane-mv / docs / plans / 0.4-EXECUTION-PLAN.md
| 1 | # INTERPLANE 0.4 "Execution": plan |
| 2 | |
| 3 | Status: **plan, 2026-11-09, docs only**. Nothing below is implemented by the commit that adds this |
| 4 | file, and nothing in it is implemented anywhere yet. Every 0.4 behaviour named here is PROPOSED. |
| 5 | The gates are pre-registered separately in `bench/PROTOCOL-0.4.md` and are not restated here. |
| 6 | `STATUS.md` remains the only place that says what is implemented (`AGENTS.md:16`). The plan waits |
| 7 | for Drake's acceptance; on 2026-11-09 he decided that the Forge lane is built first, so no 0.4 cut |
| 8 | starts before that acceptance and before the decisions in section 3 are made. |
| 9 | |
| 10 | Governing rule (README.md:5): **models express intent, runtimes retain authority.** 0.4 keeps that |
| 11 | line intact while an exchange runs over more than one round: events arrive in a checkable order, a |
| 12 | cancelled request runs nothing more, a continuation still needs the authority the runtime minted, a |
| 13 | retry never runs an effect twice, and the record of what ran survives the process that ran it. |
| 14 | |
| 15 | Scope of the claim, fixed now: 0.4 claims transport and streaming semantics, cancellation and |
| 16 | continuation correctness, retry idempotence and receipt durability, on the runtime layer only. It |
| 17 | does not claim model behaviour, model quality or performance (latency, throughput, memory). Nothing |
| 18 | in 0.4 lets INTERPLANE mint, cache, upgrade or extend authority (`CURRENT_STATE.md:110-111`, |
| 19 | `spec/CROSSVEIL.md:17-18`): a receipt records what a runtime decided and did, and is never read as |
| 20 | a grant. |
| 21 | |
| 22 | Inputs to this plan: `ROADMAP.md` (0.4 row), `STATUS.md`, `CURRENT_STATE.md` section 5, |
| 23 | `spec/VECTORVEIL.md`, `spec/RELAYLINE.md`, `spec/CORE.md`, `spec/CROSSVEIL.md`, |
| 24 | `spec/VERSIONING.md`, `spec/schemas/envelope.schema.json`, `spec/schemas/event.schema.json`, |
| 25 | `docs/REPORT-0.3.md` (Limits, Unproven, Next step), `docs/plans/0.3-TRUST-PLAN.md` section 6 (the |
| 26 | named follow-up IP-D), `docs/adr/0001` to `0004`, the Rust crates under `rust/crates/`, the AIEN |
| 27 | adapter under `adapters/aien/`, and `provenance/BINDING.md`. |
| 28 | |
| 29 | ## 1. What exists today (main 6aa1eec9) |
| 30 | |
| 31 | Line numbers are at `6aa1eec9e91b23483d06c9da3677e88a462f54ed` unless another commit is named. |
| 32 | Statuses are those of `STATUS.md`; where this section says "code exists" it means IMPLEMENTED, not |
| 33 | EXERCISED by a 0.4 gate. |
| 34 | |
| 35 | ### Languages and the verdict rule |
| 36 | |
| 37 | - The Python SDK, its runners and the two Python adapters were removed on 2026-10-15 |
| 38 | (`CHANGELOG.md:9-11`, `STATUS.md:7-8`). No Python may be tracked (`AGENTS.md:75`). The Rust |
| 39 | workspace is the only implementation. |
| 40 | - The byte-identical verdict rule now compares the Rust output with the recorded reference, not two |
| 41 | languages: "The Rust conformance verdicts and the negative-control matrix must equal |
| 42 | `conformance/expected/` byte for byte" (`AGENTS.md:73`); the recorded 106 rows were the last |
| 43 | output of both runners when they agreed (`CHANGELOG.md:9`, `STATUS.md:38`). The repository's own |
| 44 | rule therefore does not require a second language. What a second implementation would add is |
| 45 | open (decision 5, section 3). |
| 46 | - `forge/` is seeded Omega built with a pinned `omc` (`AGENTS.md:14`); it is the only non-Rust |
| 47 | first-party code in the tree. |
| 48 | |
| 49 | ### Envelope and transport (Vectorveil) |
| 50 | |
| 51 | - Vectorveil 0.1 is the envelope only; transport is in-process or ordinary request/response, with |
| 52 | no broker and no RPC framework (`spec/VECTORVEIL.md:3-5`). `signature` and remote transport |
| 53 | bindings are reserved, and adding either must not change the envelope's required fields |
| 54 | (`spec/VECTORVEIL.md:7-8`). |
| 55 | - Envelope fields: required set at `spec/schemas/envelope.schema.json:7-15`; "A repeated |
| 56 | message_id is a replay" (`:20-23`); `trace_id` and `parent_id` (`:24-38`); eight payload kinds |
| 57 | (`:54-65`); optional `digest`, SHA-256 of the RFC 8785 payload bytes (`:95-105`); `signature` |
| 58 | reserved, "proves origin, never authorization" (`:106-113`); `extensions` (`:114-117`). |
| 59 | - Canonical JSON is JCS (`spec/CORE.md:355-359`). Unknown `payload.kind` is rejected |
| 60 | (`spec/VERSIONING.md:18`); unknown top-level fields are preserved or ignored, never acted on |
| 61 | (`spec/VERSIONING.md:17`). |
| 62 | |
| 63 | ### Events (RelayLine) |
| 64 | |
| 65 | - RelayLine 0.1 is the event contract only and "does not implement streaming" |
| 66 | (`spec/RELAYLINE.md:3-4`). The legal order is informal: "Per trace, `seq` is monotonic" and one |
| 67 | arrow chain per request (`spec/RELAYLINE.md:6-8`). Streaming, partial calls and cancellation are |
| 68 | "documented inputs ... but not transported"; formalization waits for measured behaviour of the |
| 69 | Odysseus SSE loop and the aegis-runtime gateway (`spec/RELAYLINE.md:12-14`). |
| 70 | - Event schema: required `kind`, `event`, `seq` (`spec/schemas/event.schema.json:7-11`); eleven |
| 71 | event values including `cancelled` (`:18-30`); `seq` integer from 0, "Monotonic per trace." |
| 72 | (`:32-36`); optional `request_id`, `turn`, `payload` (`:37-57`); open to extra properties (`:63`). |
| 73 | Rust type `Event` at `rust/crates/interplane-core/src/types.rs:552-564`; `cancelled` is a |
| 74 | variant (`types.rs:99`). |
| 75 | - The pipeline appends events to an in-memory `Vec<Event>` (`pipeline.rs:139`) with a per-trace |
| 76 | counter (`pipeline.rs:143`). `emit` assigns contiguous `seq` per trace (`pipeline.rs:604-606`), |
| 77 | never carries a payload (`pipeline.rs:613`) and drops events past `max_events_per_trace` |
| 78 | (`pipeline.rs:596-602`). Paths here and below are under `rust/crates/interplane-crossveil/src/`. |
| 79 | - Emit sites: `tool_request` `:758`, `tool_mapped` `:852`, `tool_decision` `:882`, |
| 80 | `tool_execution_started` `:1006`, `continue` `:1303`, `reasoning_delta` `:1323`, |
| 81 | `model_delta` `:1326`, `complete` `:1402`, and `tool_result` / `tool_error` through |
| 82 | `emit_outcome` (`:618-627`). No code path emits `cancelled`. |
| 83 | - The conformance runner compares observed records, not events: `rust/crates/interplane-conformance/src/lib.rs` |
| 84 | never reads the event list, as `spec/RELAYLINE.md:10-12` states. |
| 85 | |
| 86 | ### Lifecycle, cancellation and continuation |
| 87 | |
| 88 | - States and transitions: `rust/crates/interplane-core/src/lifecycle.rs:7-18`; terminal set |
| 89 | `:22-27` (REQUIRES_APPROVAL is not terminal for the host); the lifecycle keeps the minted |
| 90 | `approval_id` (`:69`, stored at `:117-119`) and accepts a continuation only with that id |
| 91 | (`:126-135`). |
| 92 | - `Lifecycle::cancel` moves only REQUIRES_APPROVAL to DENIED (`lifecycle.rs:142-147`); there is no |
| 93 | cancel for AUTHORIZED or EXECUTING. The spec says the same: cancellation applies to a pending |
| 94 | approval only (`spec/CORE.md:213-214`; `spec/CROSSVEIL.md:47`). |
| 95 | - Host-only continuation API: `continue_approval` (`pipeline.rs:1091-1187`), `cancel_approval` |
| 96 | (`:1191-1221`), `pending_approval` (`:1071`), with the normative check order in |
| 97 | `spec/CORE.md:172-193`. A continuation "never calls decide and never touches the request ledger" |
| 98 | (`pipeline.rs:1088-1090`). |
| 99 | - Pending entries live in a `HashMap` in the pipeline instance; "a new pipeline starts empty" |
| 100 | (`pipeline.rs:147-149`). After a restart every continuation is refused |
| 101 | (`spec/CORE.md:222-223`, `spec/CROSSVEIL.md:52-53`). Conformance reaches that only through the |
| 102 | fixture step `{"restart": true}`, which builds a fresh pipeline (`spec/CORE.md:522-523`). |
| 103 | |
| 104 | ### Execution |
| 105 | |
| 106 | - `RuntimeAuthority` is synchronous: `decide` and `execute` return values directly |
| 107 | (`rust/crates/interplane-crossveil/src/lib.rs:29-42`). The pipeline calls `execute` inline under |
| 108 | `catch_unwind` (`pipeline.rs:1007-1009`); a result naming another request is dropped |
| 109 | (`:1012-1029`); `timed_out` is a status the runtime returns (`:1050-1055`), not a deadline the |
| 110 | pipeline enforces. Nothing can interrupt work in flight. |
| 111 | - The pipeline timestamp is a constant, `"2026-01-01T00:00:00Z"` (`pipeline.rs:336`); approval |
| 112 | expiry uses a host-supplied `now` (`spec/CORE.md:182-185`). |
| 113 | - Normative mock runtime: `spec/CORE.md:361-430`; `rust/crates/interplane-crossveil/src/mock.rs` |
| 114 | counts `decide_calls` and `execute_calls` (`mock.rs:148-150`) and returns a canned `timed_out` |
| 115 | for `slow_tool` (`mock.rs:376-381`). |
| 116 | |
| 117 | ### Replay, limits and close_trace |
| 118 | |
| 119 | - `RequestLedger` is an in-memory map (`rust/crates/interplane-core/src/ledger.rs:64-67`); a |
| 120 | repeated `message_id` is `replayed_message` (`ledger.rs:74-81`) and a repeated `request_id` is |
| 121 | `duplicate_request_id` (`ledger.rs:83-90`). Fixtures 16 and 17 pin both refusals. |
| 122 | - Session limits (`ledger.rs:7-31`, defaults `:47-61`; table `spec/CORE.md:47-53`) and host-only |
| 123 | `close_trace` (`pipeline.rs:470-498`, `spec/CORE.md:68-76`) bound a long-lived host. The closed-id |
| 124 | window "lives in the pipeline's memory only; it is not persisted" (`spec/CORE.md:100`). |
| 125 | `STATUS.md:56` records the 16 scenarios as unit tests with "fixtures follow the next corpus |
| 126 | revision". |
| 127 | - Replay of a continuation is refused; "Host effect idempotency (a runtime's own receipt ledger) is |
| 128 | separate" (`spec/CORE.md:216-220`, `spec/CROSSVEIL.md:48-51`). |
| 129 | |
| 130 | ### Receipts and provenance |
| 131 | |
| 132 | - Core has no receipt type. `ObservedRecord` is deterministic and carries no timestamps |
| 133 | (`spec/CORE.md:539-548`); it is a conformance record, not a durable receipt. |
| 134 | - The provenance companion (outside Core, ADR 0004) defines two effect bindings: the strong |
| 135 | `aien-ledger-slice/1` built from records the AIEN daemon wrote, and the weaker |
| 136 | `record_effect_receipt/1` that names no request or trace (`provenance/BINDING.md:17-18`). |
| 137 | |
| 138 | ### AIEN adapter (the real EffectLane path) |
| 139 | |
| 140 | - Pinned to sovereign-core `9b5e6e82` (`adapters/aien/PINS:8`); status at `STATUS.md:40`. |
| 141 | - Effects run only behind `EffectLane::execute_effect` with an `AuthorizedEffect` that AIEN |
| 142 | minted (`adapters/aien/src/lib.rs:3-7`, `:687-688`, `:954-958`). The idempotency key is the |
| 143 | request id, "so one logical request is one effect identity (and one ledger entry)" (`lib.rs:303-304`, |
| 144 | `:338`). |
| 145 | - Two-phase grant spend: `authorize_approved` reserves, `execute_effect` commits; a refused |
| 146 | continuation releases the grant; an unknown provider outcome leaves AIEN's ledger `Uncertain` |
| 147 | (`lib.rs:371-379`). |
| 148 | - A spent grant presented again for the same effect returns AIEN's existing receipt and runs |
| 149 | nothing (`lib.rs:415-437`); the adapter holds that receipt in an in-memory map (`lib.rs:152-153`) |
| 150 | and `execute` hands it back instead of running (`lib.rs:949-959`). Correlation state is bounded at |
| 151 | 4096 requests for the adapter's lifetime (`lib.rs:53-54`). |
| 152 | - The ledger route sends approved writes through the AIEN daemon, which claims the request id, |
| 153 | approval id and approval key "durably (replay refused across restarts)" |
| 154 | (`adapters/aien/src/compose_ledger.rs:8-13`); the write is temp file plus `sync_all` plus rename |
| 155 | (`compose_ledger.rs:923-928`). That durability is AIEN's, not INTERPLANE's. |
| 156 | |
| 157 | ### Streams already parsed |
| 158 | |
| 159 | - Lenshift `openai_stream` assembles an SSE body into one message and rejects incomplete streams |
| 160 | (`rust/crates/interplane-lenshift/src/openai_stream.rs:56`; `STATUS.md:23`, 23 fixtures, 6 real |
| 161 | streams). `LenshiftTurn.partial` exists (`rust/crates/interplane-lenshift/src/lib.rs:49`); the |
| 162 | pipeline copies it to the turn outcome (`pipeline.rs:1313`) and acts on nothing else. |
| 163 | - So two items of the 0.3 follow-up IP-D (`docs/plans/0.3-TRUST-PLAN.md:306-309`) are already |
| 164 | covered for one dialect (assembly by call index, incomplete-call rejection) and one is covered by |
| 165 | unit tests (session bounds, `STATUS.md:56`). Frame bounds on a transport and an unresolved result |
| 166 | on unknown completion are open. |
| 167 | |
| 168 | ### What the design must respect (`CURRENT_STATE.md` section 5) |
| 169 | |
| 170 | - Neither runtime has a trace id; Vectorveil needs `trace_id`, `message_id` and `request_id` and |
| 171 | must accept runtime-local ids as extensions (`CURRENT_STATE.md:105-106`). |
| 172 | - Results re-enter the model differently per runtime; RelayLine defines the result event and |
| 173 | Lenshift renders it per dialect (`CURRENT_STATE.md:107-109`). |
| 174 | - Nothing in INTERPLANE may mint authority (`CURRENT_STATE.md:110-111`). |
| 175 | - The Odysseus SSE loop named in `spec/RELAYLINE.md:13-14` can no longer be measured here: the |
| 176 | Odysseus adapter was removed (`CHANGELOG.md:11`). [INFERENCE] 0.4 has to formalize streaming from |
| 177 | the recorded `openai_stream` captures and the AIEN path instead, or re-acquire an Odysseus capture |
| 178 | outside this repository (decision 2). |
| 179 | |
| 180 | ## 2. Gaps (each one is closed by a named cut in section 4) |
| 181 | |
| 182 | | # | Gap | Evidence | Cut | |
| 183 | |---|---|---|---| |
| 184 | | G1 | Event order is prose, not a checkable grammar; no checker exists | `spec/RELAYLINE.md:6-8` | O1 | |
| 185 | | G2 | Conformance never compares events; an order regression is invisible | `spec/RELAYLINE.md:10-12`; `interplane-conformance/src/lib.rs` | O2 | |
| 186 | | G3 | `cancelled` exists in the schema and type but is never emitted | `event.schema.json:29`; `types.rs:99`; emit sites in section 1 | C1 | |
| 187 | | G4 | Cancel reaches only REQUIRES_APPROVAL; AUTHORIZED and EXECUTING cannot be cancelled | `lifecycle.rs:142-147`; `CORE.md:213-214` | C1, C2 | |
| 188 | | G5 | `execute` is synchronous and inline, so in-flight work cannot be cancelled and a late result has no defined handling | `rust/crates/interplane-crossveil/src/lib.rs:33-40`; `pipeline.rs:1007-1009` | C2 | |
| 189 | | G6 | No receipt type in Core; `ObservedRecord` is a test record without identity of the decision, approval or event range | `CORE.md:539-548` | D1 | |
| 190 | | G7 | Nothing INTERPLANE records survives a restart: events, ledger, pending table, closed ids | `pipeline.rs:139`, `:147-149`; `ledger.rs:64-67`; `CORE.md:100` | D2, K1 | |
| 191 | | G8 | A retry with the same `request_id` is refused (`duplicate_request_id`) and its outcome is lost to the host; there is no lookup of what already ran | `ledger.rs:83-90`; fixture 16 | Y1 | |
| 192 | | G9 | An execution that started and never finished (crash, unknown provider outcome) has no INTERPLANE state; "unresolved result on unknown completion" is open from IP-D | `0.3-TRUST-PLAN.md:308-309`; `REPORT-0.3.md:137-138` | Y2 | |
| 193 | | G10 | Continuation across processes is impossible by design (fail closed); 0.4 names it as a goal | `CORE.md:222-223`; `0.3-TRUST-PLAN.md:306-307` | K1 | |
| 194 | | G11 | No transport binding: envelopes and events cross only in process; no frame bounds | `VECTORVEIL.md:3-8` | T1, T2 | |
| 195 | | G12 | Event stream is not transported; model deltas and partial calls stop at Lenshift | `RELAYLINE.md:12-14`; `pipeline.rs:1313` | S1 | |
| 196 | | G13 | Session-limit scenarios have no fixtures | `STATUS.md:56` | O2 | |
| 197 | | G14 | AIEN `Uncertain` / `ReconciliationRequired` is untested and its receipt is held in memory only by the adapter | `REPORT-0.3.md:137-138`; `adapters/aien/src/lib.rs:152-153` | A1 | |
| 198 | | G15 | The 0.3 freeze digests every file under `conformance/fixtures`, so new fixtures there would move the frozen 0.3 digest | `interplane-conformance/src/trust_digest.rs:4-6`; `conformance/TRUST-DIGEST.txt:1-3` | N1 | |
| 199 | |
| 200 | ## 3. Design decisions that need Drake |
| 201 | |
| 202 | Each decision is open. The recommendation is the plan's default if Drake accepts it unchanged; the |
| 203 | cuts in section 4 name the decision they depend on. None of these widens authority: every option |
| 204 | below keeps decide and execute in the runtime. |
| 205 | |
| 206 | **Decision 1. Vectorveil: a wire transport, or bindings only.** |
| 207 | - (a) Bindings only: Vectorveil defines how the existing JCS envelope bytes are framed over a |
| 208 | carrier the host already has (in-process call, one byte-stream binding), plus frame bounds. No |
| 209 | broker, no RPC, no connection management, as in `spec/VECTORVEIL.md:4-5`. |
| 210 | - (b) A wire transport: INTERPLANE owns sessions, connection setup, flow control and reconnection. |
| 211 | - Recommendation: (a). It keeps `VECTORVEIL.md:7-8` true (no new required field) and the |
| 212 | transport gate (protocol gate T) can test byte identity directly. (b) puts a network stack in the |
| 213 | claim without a runtime that asks for it [INFERENCE: neither runtime in `CURRENT_STATE.md` |
| 214 | section 5 needs INTERPLANE to own connections]. |
| 215 | |
| 216 | **Decision 2. RelayLine in 0.4: SSE, WebSocket, or in-process only.** |
| 217 | - (a) In-process only, with a serialized event log (JCS, one event per line) as the conformance |
| 218 | artefact. |
| 219 | - (b) In-process plus one SSE binding (`text/event-stream`, one event per `data:` frame). |
| 220 | - (c) WebSocket. |
| 221 | - Recommendation: (b). Both real backends already stream SSE and the repository already parses it |
| 222 | with recorded captures (`STATUS.md:23`); WebSocket adds framing and a bidirectional channel that no |
| 223 | current runtime uses. If Drake wants Odysseus captures as the formalization source named in |
| 224 | `spec/RELAYLINE.md:13-14`, that capture has to come from outside this repository (section 1). |
| 225 | |
| 226 | **Decision 3. Receipt integrity: signing, or a hash chain.** |
| 227 | - (a) Hash chain: each receipt carries `prev_receipt_digest`, the receipt digest is SHA-256 of its |
| 228 | JCS form without that field, and a journal is valid only as an unbroken chain from its genesis |
| 229 | record. Tamper-evident against edits, reordering and truncation in the middle; not origin proof. |
| 230 | - (b) Signature (Ed25519 over the JCS form): origin proof, needs key custody, rotation and a |
| 231 | verifier key path in every consumer. |
| 232 | - (c) Both. |
| 233 | - Recommendation: (a) for 0.4, with the envelope `signature` still reserved |
| 234 | (`envelope.schema.json:106-113`). A signature "proves origin, never authority" (`AGENTS.md:82`); |
| 235 | 0.4's claim is durability and idempotence, which the chain covers. Signing becomes its own |
| 236 | release with a key-custody decision. |
| 237 | |
| 238 | **Decision 4. Where a retry may re-execute and where it must replay a receipt.** |
| 239 | - (a) Never re-execute: any retry of a `(trace_id, request_id)` that has a receipt returns that |
| 240 | receipt; one without a receipt is a new request and is decided afresh; one whose receipt is |
| 241 | `started` without an outcome is `unresolved` and is never run again by INTERPLANE. |
| 242 | - (b) As (a), except a capability the runtime's catalog marks retry-safe (a read) may be re-run |
| 243 | under a new `request_id` by the host. |
| 244 | - Recommendation: (a) inside INTERPLANE, with (b) left to the host and runtime: re-running a read |
| 245 | is a new request the runtime decides again, so it needs no INTERPLANE exception. INTERPLANE |
| 246 | cannot know which effects are safe to repeat, and guessing would be authority. |
| 247 | |
| 248 | **Decision 5. Whether a second SDK language returns.** |
| 249 | - The repository's rule does not require one: verdicts are compared with the recorded reference |
| 250 | (`AGENTS.md:73`, `CHANGELOG.md:9` at `6aa1eec9`), and Python is barred (`AGENTS.md:75`). |
| 251 | - The cost of no second language: every 0.4 fixture's expected verdict is produced by the Rust |
| 252 | runner alone, so the reference is self-recorded and the cross-implementation check that caught |
| 253 | two differences after 0.3 (`REPORT-0.3.md:145-148`) is gone for new behaviour. |
| 254 | - Options: (a) Rust only, expected verdicts reviewed by hand from the spec and pinned by |
| 255 | negative controls; (b) an independent verifier in seeded Omega for the two checkable artefacts |
| 256 | (event grammar, receipt journal), in the manner of `forge/` (`AGENTS.md:14`); (c) a full second |
| 257 | SDK. |
| 258 | - Recommendation: (b). It restores an independent second reading where the 0.4 claim is new, |
| 259 | without a second pipeline, and keeps first-party logic in seeded Omega. It sits behind the Forge |
| 260 | lane Drake chose to build first. |
| 261 | |
| 262 | **Decision 6. Do pending approvals survive a restart in 0.4.** |
| 263 | - Today a restart refuses every continuation (`spec/CORE.md:222-223`, fixture A12 in |
| 264 | `bench/PROTOCOL-0.3.md`). Changing that expected outcome is a protocol change |
| 265 | (`AGENTS.md:72`, `spec/VERSIONING.md:19-20`). |
| 266 | - (a) Keep it: only receipts are durable; a pending approval dies with the process. |
| 267 | - (b) Opt-in durable pending entries: a host that opens the pipeline over a journal can continue a |
| 268 | pending request after restart with the same seven checks; the in-memory default and A12 stay as |
| 269 | they are. |
| 270 | - Recommendation: (b). It answers "continuation across processes" (`0.3-TRUST-PLAN.md:306-307`) |
| 271 | without moving any 0.3 verdict. |
| 272 | |
| 273 | **Decision 7. How the runtime trait learns about cancellation and late results.** |
| 274 | - (a) Split execution: `execute` may return a pending handle; the host later delivers the result |
| 275 | through a host-only call; `cancel` is a new optional trait method with a fail-closed default. |
| 276 | - (b) Keep `execute` synchronous; cancellation covers only the window before `execute` is called. |
| 277 | - Recommendation: (a), because the 0.4 row names "cancellation" of running work and (b) cannot |
| 278 | express a late result at all. It is an adapter-facing API change; the AIEN adapter (cut A1) and |
| 279 | the mock change in the same PR series. |
| 280 | |
| 281 | **Decision 8. Implementation language of new 0.4 code (note added 2026-11-16).** |
| 282 | - This plan was drafted on 2026-11-09. On 2026-11-13 Drake set the rule that new code is written |
| 283 | in Omega (`.om`) and built with the newest Omega compiler build. The file layout in section 4 |
| 284 | (the new module `relay.rs`, the new crates `interplane-journal` and `interplane-vectorveil`) is |
| 285 | the 2026-11-09 draft and predates that rule. |
| 286 | - Which parts stay edits to the existing Rust workspace and which become new components in seeded |
| 287 | Omega is for Drake to settle when he accepts this plan; no cut starts before that. The cuts in |
| 288 | section 4 are not rewritten by this note. |
| 289 | |
| 290 | ## 4. Lanes and cuts |
| 291 | |
| 292 | Each cut is one PR. Owner types: **spec** (normative text and schemas), **SDK** (Rust crates and |
| 293 | conformance runner), **adapter** (the AIEN adapter at its pins), **host** (a change in a host |
| 294 | repository), **taskmaster** (runs, report, status). Red before green: a cut that adds behaviour |
| 295 | first lands a failing fixture or test. Every cut keeps the 106 recorded verdicts byte-identical |
| 296 | (`AGENTS.md:73`); new 0.4 fixtures live under a new root (cut N1). A change to `tests/gates/` or |
| 297 | `.github/workflows/` is `BLOCKED_OPERATOR` (`AGENTS.md:85`) and is listed per cut, not made by it. |
| 298 | |
| 299 | Acceptance commands below assume the repository root; `cargo` commands run from `rust/`. |
| 300 | |
| 301 | ### Lane O: ordering |
| 302 | |
| 303 | **O1. RelayLine grammar and checker.** (spec + SDK; first cut, no decision blocks it) |
| 304 | - Files: `spec/RELAYLINE.md` (the informal chain at `:6-8` replaced by a transition table per |
| 305 | request and the per-trace `seq` rule), `spec/schemas/event.schema.json` (descriptions only), |
| 306 | new module `rust/crates/interplane-core/src/relay.rs` (`check(&[Event]) -> Result<(), Violation>`), |
| 307 | `STATUS.md`. |
| 308 | - Invariant: one normative grammar; every event sequence the pipeline emits is accepted by it, and |
| 309 | every sequence outside it is refused with a named violation (seq gap, seq repeat, seq decrease, |
| 310 | event after a terminal, terminal twice, result without start, unknown request, cross-trace seq). |
| 311 | - Fixtures: the grammar table itself; the corpus is O2's. |
| 312 | - Red first: run the checker over the event lists of all 106 existing cases; every sequence it |
| 313 | refuses is recorded and resolved in the spec text, never by widening the checker silently |
| 314 | [INFERENCE: refusals are likely, for example `reject` emits `tool_error` with no preceding |
| 315 | `tool_request` (`pipeline.rs:630-640`)]. |
| 316 | - Acceptance: `cargo test -p interplane-core relay`. |
| 317 | - Negative control: variant W1 (checker accepts every sequence) must fail gate O. |
| 318 | |
| 319 | **O2. Event conformance and session-limit fixtures.** (SDK; depends on O1) |
| 320 | - Files: `rust/crates/interplane-conformance/src/lib.rs` (new optional `expected.events` block; |
| 321 | a case without it is unchanged), `spec/CORE.md` fixture format section, new fixtures under |
| 322 | `conformance/execution/relay/` and `conformance/execution/limits/`. |
| 323 | - Invariant: for 0.4 cases the emitted event list (`event`, `seq`, `request_id`, `turn`) is part |
| 324 | of the verdict and must equal the recorded one byte for byte; the 106 existing rows stay |
| 325 | identical. |
| 326 | - Fixtures: the ordering corpus of protocol section 3 (legal and illegal sequences, checker-only |
| 327 | cases) and one fixture per session-limit scenario in `STATUS.md:56`. |
| 328 | - Acceptance: the verdict `cmp` of `AGENTS.md:44-45` over both roots. |
| 329 | - Negative control: W2 (emitter reuses a `seq`). |
| 330 | |
| 331 | ### Lane C: cancellation |
| 332 | |
| 333 | **C1. Host cancel for any non-terminal request, and the `cancelled` event.** (spec + SDK) |
| 334 | - Files: `spec/CORE.md` (Cancellation `:213-214` widened), `spec/CROSSVEIL.md:47`, |
| 335 | `lifecycle.rs` (`cancel` from MAPPED, AUTHORIZED and REQUIRES_APPROVAL), `pipeline.rs` |
| 336 | (`cancel_request(trace_id, request_id)`, emits `cancelled`), result vocabulary (proposed |
| 337 | `result.status = cancelled` and `ErrorCode::Cancelled`, both MINOR per `spec/VERSIONING.md:8`). |
| 338 | - Invariant: after the host's cancel is acknowledged for a request that has not started, `execute` |
| 339 | is never called for it; the request is terminal; `cancelled` is its last event. A cancel of a |
| 340 | terminal, unknown or closed request is refused and changes nothing. Cancel stays host-only; |
| 341 | nothing in model output reaches it. |
| 342 | - Fixtures: `conformance/execution/cancel/` (protocol C01 to C06). |
| 343 | - Acceptance: `cargo test -p interplane-crossveil cancel` and the verdict `cmp`. |
| 344 | - Negative control: W3 (execute still called after acknowledged cancel). |
| 345 | |
| 346 | **C2. Split execution, cancel in flight, late results.** (spec + SDK + mock; depends on C1 and |
| 347 | decision 7) |
| 348 | - Files: `rust/crates/interplane-crossveil/src/lib.rs` (`RuntimeAuthority`), `pipeline.rs` |
| 349 | (`execute_authorized` `:995-1067` split; `deliver_result` host call), `mock.rs` (a held |
| 350 | capability whose result the fixture delivers), `spec/CORE.md` mock table. |
| 351 | - Invariant: once a cancel is acknowledged, no effect starts for that request; a result delivered |
| 352 | after the acknowledgement is recorded as late (receipt outcome `late_result`) and is never |
| 353 | rendered to the model, never changes the terminal state and never triggers another call. |
| 354 | Whether the runtime stopped the effect is the runtime's report, not INTERPLANE's claim. |
| 355 | - Fixtures: protocol C07 to C12. |
| 356 | - Acceptance: as C1. |
| 357 | - Negative control: W4 (late result rendered to the model). |
| 358 | |
| 359 | ### Lane D: durable receipts |
| 360 | |
| 361 | **D1. Execution receipt type.** (spec + SDK; depends on O1 and decision 3) |
| 362 | - Files: new `spec/schemas/receipt.schema.json`, `spec/CORE.md` (new section "Execution receipt"), |
| 363 | `rust/crates/interplane-core/src/types.rs`. |
| 364 | - Content (proposed): `receipt_version`, `trace_id`, `request_id`, `request_digest` (the existing |
| 365 | `capability_request_digest`, `pipeline.rs:76-78`), `decision` value and authority, minted |
| 366 | `approval_id` or null, `phase` (`started` or `outcome`), `result_digest` (as in |
| 367 | `CORE.md:547-548`), `stage`, first and last `seq`, `prev_receipt_digest`, `receipt_digest`. |
| 368 | - Invariant: a receipt is a record, never a grant; no code path reads a receipt into a decision. |
| 369 | The digest is reproducible from the JCS bytes alone. |
| 370 | - Fixtures: `conformance/fixtures`-style digest cases under `conformance/execution/digest/`. |
| 371 | - Acceptance: schema self-check plus `interplane-corpus validate` over the new root. |
| 372 | - Negative control: W8 (verifier skips the digest check) must fail D03. |
| 373 | |
| 374 | **D2. Append-only receipt journal.** (SDK; depends on D1) |
| 375 | - Files: new crate `rust/crates/interplane-journal/` (outside Core: it does file I/O, and Core |
| 376 | holds no host dependency, `AGENTS.md:76`). |
| 377 | - Invariant: write-ahead order. The `started` receipt is durable (written and `fsync`ed) before |
| 378 | `execute` is called; if it cannot be made durable, `execute` is not called. Each record is length |
| 379 | framed and chained; on open, a torn or corrupt record is refused and the journal is reported |
| 380 | unusable from that point, never truncated, rewritten or repaired. |
| 381 | - Fixtures: protocol D01 to D08, including the offset sweep over a torn final record. |
| 382 | - Acceptance: `cargo test -p interplane-journal`. |
| 383 | - Negative controls: W7 (repairs a torn tail), W9 (writes the receipt after execute). |
| 384 | |
| 385 | ### Lane Y: retries |
| 386 | |
| 387 | **Y1. Idempotent replay of a finished request.** (spec + SDK; depends on D2 and decision 4) |
| 388 | - Files: `spec/CORE.md` (Replay `:216-220` extended), `pipeline.rs` (host-only |
| 389 | `receipt_for(trace_id, request_id)`). |
| 390 | - Invariant: a retry of a request that has an outcome receipt returns that receipt byte for byte |
| 391 | and calls neither `decide` nor `execute`. The protocol refusals stay: a replayed envelope is |
| 392 | still `replayed_message` and a reused `request_id` is still `duplicate_request_id` (fixtures 16 |
| 393 | and 17 unchanged); the receipt is what the host reads to learn the outcome. |
| 394 | - Fixtures: protocol R01 to R06. |
| 395 | - Negative control: W6 (retry re-executes). |
| 396 | |
| 397 | **Y2. Unresolved on unknown completion.** (SDK; depends on Y1) |
| 398 | - Invariant: a `started` receipt with no outcome after restart yields `unresolved`; INTERPLANE |
| 399 | never runs it again, never reports it as success or failure, and hands reconciliation to the |
| 400 | runtime (the AIEN analogue is `Uncertain`, `adapters/aien/src/lib.rs:377-378`). |
| 401 | - Fixtures: protocol R07, R08. |
| 402 | - Negative control: W9. |
| 403 | |
| 404 | ### Lane K: continuation across processes |
| 405 | |
| 406 | **K1. Durable pending entries (opt-in).** (spec + SDK; depends on D2 and decision 6) |
| 407 | - Files: `spec/CORE.md` (Restart `:222-223`: in-memory default unchanged, journal mode added), |
| 408 | `pipeline.rs` (pending table optionally journaled). |
| 409 | - Invariant: in journal mode a continuation after restart passes exactly the seven checks of |
| 410 | `spec/CORE.md:172-188` against the journaled entry, with the host clock; without the minted |
| 411 | `approval_id` it is refused; a second continuation after it resolved returns the same receipt and |
| 412 | runs nothing. In-memory mode keeps A12. |
| 413 | - Fixtures: protocol K01 to K09. |
| 414 | - Negative control: W5 (journal mode skips the `approval_id` check). |
| 415 | |
| 416 | ### Lane T: transport |
| 417 | |
| 418 | **T1. Vectorveil binding.** (spec + SDK; depends on decision 1) |
| 419 | - Files: `spec/VECTORVEIL.md` (binding section; `:7` updated), new crate |
| 420 | `rust/crates/interplane-vectorveil/` (in-process binding and one byte-stream binding with a |
| 421 | frame bound). |
| 422 | - Invariant: the bytes of every envelope after the binding equal its JCS bytes before it; |
| 423 | `digest` values are unchanged; unknown fields survive; an oversized, truncated or doubled frame is |
| 424 | refused before parsing. |
| 425 | - Fixtures: every envelope in the 0.3 corpus plus `conformance/execution/transport/`. |
| 426 | - Negative controls: W10 (re-serializes without JCS), W11 (drops unknown fields). |
| 427 | |
| 428 | **T2. Conformance over the binding.** (SDK; depends on T1) |
| 429 | - Invariant: the verdict file produced through the binding equals |
| 430 | `conformance/expected/verdicts.json` byte for byte, and the 0.4 verdicts equal their recorded |
| 431 | file. |
| 432 | - Acceptance: the verdict `cmp`, once in process and once through the binding. |
| 433 | |
| 434 | ### Lane S: streaming |
| 435 | |
| 436 | **S1. RelayLine event stream binding.** (spec + SDK; depends on O2, T1 and decision 2) |
| 437 | - Files: `spec/RELAYLINE.md` (`:12-14` replaced), stream writer and reader in |
| 438 | `interplane-vectorveil`. |
| 439 | - Invariant: the event sequence a reader reassembles equals the in-process list byte for byte and |
| 440 | passes the O1 checker; a stream cut mid-event or mid-call yields an incomplete-stream error, |
| 441 | never a guessed call (as `openai_stream` does today, `STATUS.md:23`). |
| 442 | - Fixtures: protocol O-corpus streamed, plus cut-stream cases. |
| 443 | |
| 444 | ### Lane A: AIEN adapter |
| 445 | |
| 446 | **A1. AIEN receipts, cancellation and unresolved outcomes.** (adapter; depends on C2, Y2; |
| 447 | re-pin) |
| 448 | - Files: `adapters/aien/src/lib.rs`, `adapters/aien/PINS`, `adapters/aien/tests/`. |
| 449 | - Invariant: an INTERPLANE receipt for an AIEN effect cites AIEN's own `EffectReceipt` identity |
| 450 | (effect id, policy digest), never replaces it; AIEN's `Uncertain` maps to `unresolved`; a cancel |
| 451 | before AIEN commits releases the grant (as a refused continuation does, `lib.rs:374-376`). |
| 452 | - Re-pin: the 0.3 report names sovereign-core `0bdc97a` (#208, effect-bound idempotency ledger) as |
| 453 | the next re-pin (`REPORT-0.3.md:183-184`); the current pin is `9b5e6e82`. Which pin 0.4 uses is |
| 454 | recorded in the run manifest, not assumed here. |
| 455 | - Fixtures: T4 subset of C, K, R, D (computed, as in 0.3). |
| 456 | - Acceptance: `tests/gates/run.sh adapter-aien`. |
| 457 | - Negative control: the T4 subset run with W3 and W6. |
| 458 | |
| 459 | ### Lane N: freeze and negative controls |
| 460 | |
| 461 | **N1. Execution corpus root and freeze file.** (SDK; with O2) |
| 462 | - Files: `conformance/execution/` (new root), `conformance/EXECUTION-DIGEST.txt`, new module in |
| 463 | `interplane-conformance` beside `trust_digest.rs`. `conformance/TRUST-DIGEST.txt` and its |
| 464 | corpus stay as frozen for 0.3. |
| 465 | - Gate wiring: a new step in `tests/gates/run.sh` is `BLOCKED_OPERATOR` (`AGENTS.md:85`); the cut |
| 466 | provides the command and asks the operator. |
| 467 | |
| 468 | **N2. Variants W1 to W11.** (SDK; after each lane's cut) |
| 469 | - Built only into the conformance runner behind the existing test-only feature; pipeline |
| 470 | libraries never mention them (`AGENTS.md:76`). |
| 471 | |
| 472 | ### Lane R: report |
| 473 | |
| 474 | **R1. REPORT-0.4.** (taskmaster; depends on every merged cut) |
| 475 | - Run the frozen suite in process and through the binding, the negative-control matrix and the |
| 476 | AIEN subset; run the live leg if a backend is available; write `docs/REPORT-0.4.md` with every |
| 477 | gate as pre-registered; update `STATUS.md`, `ROADMAP.md`, `CHANGELOG.md`. A failed gate is |
| 478 | reported as FAIL with thresholds unchanged. |
| 479 | |
| 480 | **Order:** O1 -> (O2 + N1) -> C1 -> D1 -> D2 -> (C2, Y1, K1 in parallel) -> Y2 -> T1 -> (T2, S1) |
| 481 | -> A1 -> N2 completes -> R1. Decisions gate their cuts: 1 before T1, 2 before S1, 3 before D1, |
| 482 | 4 before Y1, 5 before N2 completes (an Omega verifier would join there), 6 before K1, 7 before C2. |
| 483 | 15 cuts (O1, O2, C1, C2, D1, D2, Y1, Y2, K1, T1, T2, S1, A1, N1, N2) plus R1. |
| 484 | |
| 485 | ## 5. Out of scope for 0.4 |
| 486 | |
| 487 | - Model behaviour, model quality and performance of any kind; the live leg reports, it does not |
| 488 | qualify a model. |
| 489 | - Signatures on envelopes or receipts (unless decision 3 says otherwise), key custody, origin proof. |
| 490 | - A broker, an RPC framework, connection management or reconnection (unless decision 1 says |
| 491 | otherwise); WebSocket (unless decision 2 says otherwise). |
| 492 | - Any change to how a runtime decides, grants or spends authority; INTERPLANE re-executing, |
| 493 | retrying or reconciling an effect on its own. |
| 494 | - Distributed or replicated journals, multi-host failover, delegated authority across sub-agents. |
| 495 | - Durable storage of raw model output (`AGENTS.md:83`): receipts carry digests. |
| 496 | - Upstream changes in sovereign-core or aegis-runtime, beyond a re-pin recorded in the manifest. |
| 497 | - Odysseus: no adapter remains in this repository (`CHANGELOG.md:11` at `6aa1eec9`). |
| 498 | - The Forge lane, which Drake chose to build before any 0.4 cut. |
| 499 | |
| 500 | ## 6. What the 0.4 report will have to say |
| 501 | |
| 502 | `docs/REPORT-0.4.md` follows `docs/REPORT-0.3.md` (Observed, Changed, Proven, Failed, Unproven, |
| 503 | gate table, architectural impact, next step) and must state at least: |
| 504 | |
| 505 | 1. Each gate of `bench/PROTOCOL-0.4.md` with PASS, FAIL or INVALID, and the exact commit, pins and |
| 506 | digests of the qualifying run; a failed gate stays failed. |
| 507 | 2. The decisions of section 3 as Drake made them, with date, and which cuts they shaped. |
| 508 | 3. That INTERPLANE minted, upgraded or re-ran nothing: the count of `execute` calls after an |
| 509 | acknowledged cancel (0 required), of second executions of one `request_id` (0 required), of |
| 510 | torn receipts accepted (0 required) and of continuations accepted without the minted id (0 |
| 511 | required). |
| 512 | 4. What durability means at the tested level: which failures were injected (truncation offsets, |
| 513 | bit flips, process kill points), on which filesystem, and that power loss was not tested if it |
| 514 | was not. |
| 515 | 5. That cancellation of work in flight is cooperative: INTERPLANE guarantees it acts on nothing |
| 516 | after the acknowledgement; whether a runtime stopped an effect is reported per runtime. |
| 517 | 6. Whether the second-reading check of decision 5 ran, and on what; if Rust is the only |
| 518 | implementation, that the 0.4 expected verdicts are self-recorded and what pins them. |
| 519 | 7. The live leg as reported, never as evidence that the boundary holds, with its model, backend, |
| 520 | case count and intervals; if no backend was available, that the claim is limited to the scripted |
| 521 | and mock systems. |
| 522 | 8. Status words kept apart: what is IMPLEMENTED, EXERCISED by a gate, QUALIFIED by the protocol, |
| 523 | MERGED and DEPLOYED, with `STATUS.md` updated in the same PR. |