interplane-mv
INTERPLANE: open interoperability protocol between AI models and agent runtimes. Models express intent. Runtimes retain authority.
Brought by drakestapleton
interplane-mv / bench / PROTOCOL-0.4.md
| 1 | # INTERPLANE 0.4 Execution: pre-registered protocol |
| 2 | |
| 3 | Status: **pre-registered 2026-11-09**, before any 0.4 code exists and before any run. Thresholds in |
| 4 | sections 5 and 6 are fixed by the commit that adds this file. Changing anything below after the |
| 5 | qualifying run has started invalidates that run. Every change is listed in section 10 with its |
| 6 | date and reason. The plan that builds what this protocol tests is `docs/plans/0.4-EXECUTION-PLAN.md`; |
| 7 | names used here (receipt, journal, binding, `cancel_request`, `deliver_result`, `receipt_for`, |
| 8 | `unresolved`, `late_result`) are PROPOSED there in sections 3 and 4. Where a decision in that |
| 9 | plan's section 3 changes a name or a binding, the gate keeps its threshold and the change is |
| 10 | recorded in section 10 before the freeze. |
| 11 | |
| 12 | ## 1. Question and claim |
| 13 | |
| 14 | Claim under test (ROADMAP 0.4): INTERPLANE runs an exchange over more than one round without losing |
| 15 | the boundary. It counts as supported only if every gate in section 5 holds on the systems in |
| 16 | section 2, for the commit and pins named in the run manifest. |
| 17 | |
| 18 | The claim covers transport and streaming semantics, cancellation and continuation correctness, |
| 19 | retry idempotence and receipt durability, on the runtime layer only. It does not cover model |
| 20 | behaviour or performance. A receipt is a record and never authority: no gate passes by reading a |
| 21 | receipt as a grant. |
| 22 | |
| 23 | ## 2. Systems under test |
| 24 | |
| 25 | | Id | System | Pins | |
| 26 | |---|---|---| |
| 27 | | T1 | Rust reference pipeline + normative mock runtime, in process | commit under test | |
| 28 | | TB | T1 with every envelope and event carried through the chosen binding (plan cut T1, S1) | commit under test | |
| 29 | | T4 | AIEN adapter (Rust) | aien-sovereign-core as in `adapters/aien/PINS` at the commit under test, recorded in the manifest | |
| 30 | | TV | independent verifier of the event grammar and the receipt journal (plan decision 5, option b) | only if Drake chose it; otherwise absent and section 5 gate V does not apply | |
| 31 | |
| 32 | T1 and TB run every case. T4 runs every case whose capability class exists in its catalog; its |
| 33 | subset list is computed and frozen with the corpus (section 8). A case in T4's subset that T4 |
| 34 | cannot run is a FAIL for T4, never a skip. There is no second SDK language: Python was removed on |
| 35 | 2026-10-15 (`CHANGELOG.md:9` at `6aa1eec9`, the entry "Removed the Python SDK") and the |
| 36 | repository compares Rust output with the recorded reference (`AGENTS.md:73`). |
| 37 | |
| 38 | ## 3. Corpus |
| 39 | |
| 40 | All 0.4 cases live under `conformance/execution/` (plan cut N1), so the frozen 0.3 corpus and |
| 41 | `conformance/TRUST-DIGEST.txt` do not move. Minimum counts are fixed now. |
| 42 | |
| 43 | ### 3.1 Ordering corpus (gate O) |
| 44 | |
| 45 | - **O-legal: at least 60 sequences**, each a list of events accepted by the grammar. Together they |
| 46 | cover every transition of the grammar table at least once (edge coverage 100 %), including |
| 47 | interleaved requests on one trace, approval continuation, cancellation at each cancellable stage, |
| 48 | late results, `continue` turns and `complete`. |
| 49 | - **O-illegal: at least 140 sequences**, each with exactly one defect. Together they cover every |
| 50 | (state, event) pair that the grammar table does not allow at least once, and each of these |
| 51 | defect classes at least 5 times: `seq` gap, `seq` repeat, `seq` decrease, event after a terminal, |
| 52 | second terminal, `tool_result` or `tool_error` without `tool_execution_started` where the grammar |
| 53 | requires it, event for an unknown `request_id`, `seq` continued across traces. |
| 54 | - **O-emitted:** every event list the pipeline emits on T1 and TB over the whole 0.3 corpus (106 |
| 55 | cases) and the whole 0.4 corpus. |
| 56 | - N for this gate is therefore at least 200 hand-written sequences plus the emitted set. If the |
| 57 | grammar table has more disallowed pairs than 140, the O-illegal minimum rises to that number. |
| 58 | |
| 59 | ### 3.2 Behaviour cases |
| 60 | |
| 61 | | Group | Cases | Minimum | |
| 62 | |---|---|---| |
| 63 | | C cancellation | C01 cancel while REQUIRES_APPROVAL (0.3 A09 behaviour kept); C02 cancel after MAPPED, before decide returns; C03 cancel after AUTHORIZED, before execute; C04 cancel of a terminal request (refused, no change); C05 double cancel; C06 cancel on a closed trace and on an unknown request; C07 cancel while EXECUTING on a held mock capability; C08 result delivered after acknowledged cancel (late); C09 late result naming another request; C10 cancel then continuation of the same request; C11 model content that asks for cancel or claims a cancel happened (text, `arguments`, `extensions`); C12 cancel between `started` receipt and `execute` | 12 | |
| 64 | | K continuation | K01 continuation without the minted `approval_id`, in process; K02 same through the binding; K03 `approval_id` taken from model content; K04 journal mode: continuation after restart with the minted id runs once; K05 journal mode: second continuation after restart returns the same receipt, runs nothing; K06 in-memory mode: continuation after restart refused (0.3 A12 unchanged); K07 journal removed between runs: refused; K08 approval expired across restart (host clock); K09 catalog changed across restart | 9 | |
| 65 | | R retry | R01 retry after success returns the existing receipt; R02 retry after failure returns the failure receipt; R03 retry while the first attempt is executing; R04 retry with changed arguments under the same `request_id`; R05 replayed envelope still `replayed_message` (fixture 17 unchanged); R06 reused `request_id` still `duplicate_request_id` (fixture 16 unchanged); R07 crash after `started`, before outcome: `unresolved`, never re-run; R08 runtime reports unknown outcome: `unresolved` | 8 | |
| 66 | | D durability | D01 receipt read back byte-identical after a clean restart; D02 final record truncated at every byte offset (offset sweep over the full record length); D03 one bit flipped in each field of a record; D04 a middle record removed; D05 two records swapped; D06 journal of another trace namespace substituted; D07 durable write of `started` fails (injected): `execute` not called; D08 process killed by `SIGKILL` at journal append points, at least 50 seeded kill points | 8 groups | |
| 67 | | T transport | T01 every envelope of the 0.3 corpus and of the 0.4 corpus through the binding; T02 unknown top-level fields and `extensions` keys preserved; T03 frame larger than the bound; T04 truncated frame; T05 two envelopes in one frame; T06 empty frame; T07 non-JCS bytes on input (re-serialized form must not be accepted as the original digest); T08 event stream cut mid-event and mid-call | 8 | |
| 68 | |
| 69 | T4's subset is computed from these groups by the existing subset rule; at minimum it holds C01, |
| 70 | C03, C07, C08, K01, K06, R01, R03, R07, R08, D01, D07. |
| 71 | |
| 72 | ## 4. Definitions |
| 73 | |
| 74 | - **Acknowledged cancel:** `cancel_request` returned `resolved` for that request. |
| 75 | - **Effect after cancel:** a call of `execute` (mock `execute_calls`, AIEN `execute_effect`) for a |
| 76 | request after its acknowledged cancel. |
| 77 | - **Acted on:** a late result is acted on if it is rendered to the model, changes the request's |
| 78 | terminal state, changes any other request, or causes any further `decide` or `execute` call. |
| 79 | - **Double execution:** more than one `execute` call for one `(trace_id, request_id)`, counted by |
| 80 | the mock and, on T4, by AIEN's ledger. |
| 81 | - **Torn receipt:** a journal record whose frame length, chain link or digest does not verify. |
| 82 | - **Refused, not repaired:** on a torn receipt the journal reports unusable from that record, the |
| 83 | bytes on disk are identical before and after open (sha256 compared), and no receipt from or after |
| 84 | that record is returned. |
| 85 | - **Byte identity:** equality of the full byte strings, compared with `cmp`. |
| 86 | |
| 87 | ## 5. Gates (decided now) |
| 88 | |
| 89 | 0.4 passes only if every gate holds. |
| 90 | |
| 91 | **O: ordering and `seq`.** |
| 92 | - O1: 100 % of O-legal accepted (0 refused). |
| 93 | - O2: 100 % of O-illegal refused (0 accepted), each with the violation class recorded in its case. |
| 94 | - O3: 100 % of O-emitted accepted on T1 and TB. |
| 95 | - O4: transition coverage 100 % and disallowed-pair coverage 100 %, computed by CI from the |
| 96 | grammar table and the case metadata. |
| 97 | |
| 98 | **C: cancellation (hard invariant, 0 tolerated).** |
| 99 | - C1: effects after cancel = **0** on T1, TB and T4. |
| 100 | - C2: late results acted on = **0**; every late result is recorded (receipt outcome `late_result`). |
| 101 | - C3: C04, C05, C06 change no state and emit no event; C11 changes nothing. |
| 102 | |
| 103 | **K: continuation.** |
| 104 | - K1: continuations accepted without the runtime-minted `approval_id` (K01, K02, K03, K07) = **0**. |
| 105 | - K2: K05 receipt byte-identical to the receipt K04 produced, and `execute_calls` stays 1. |
| 106 | - K3: K06 refused exactly as 0.3 A12; the 106 recorded 0.3 verdicts unchanged byte for byte. |
| 107 | - K4: K08, K09 refused with the 0.3 reasons. |
| 108 | |
| 109 | **R: retry idempotence (hard invariant, 0 tolerated).** |
| 110 | - R1: double executions = **0** over the whole corpus on T1, TB and T4. |
| 111 | - R2: R01, R02 return the existing receipt byte for byte; `decide_calls` and `execute_calls` do not |
| 112 | change. |
| 113 | - R3: R07, R08 yield `unresolved`; re-runs by INTERPLANE = **0**. |
| 114 | - R4: R05, R06 refusals identical to 0.3 fixtures 17 and 16. |
| 115 | |
| 116 | **D: receipt durability.** |
| 117 | - D1: D01 byte-identical read-back for 100 % of receipts. |
| 118 | - D2: torn receipts accepted = **0** and torn receipts repaired = **0** over D02 to D06 and D08. |
| 119 | - D3: every receipt before a torn record is still returned intact (0 lost). |
| 120 | - D4: D07: `execute` calls after a failed durable `started` write = **0**. |
| 121 | |
| 122 | **T: transport identity.** |
| 123 | - T1: for 100 % of envelopes, bytes after the binding equal the JCS bytes before it, and every |
| 124 | `digest` value is unchanged. |
| 125 | - T2: the verdict file over the 0.3 corpus on TB equals `conformance/expected/verdicts.json` byte |
| 126 | for byte; the 0.4 verdict file on TB equals the one on T1 byte for byte. |
| 127 | - T3: T03 to T08 refused before payload parsing; 0 guessed calls from a cut stream. |
| 128 | |
| 129 | **V: independent reading (only if TV exists).** TV's verdict on every O case and every D journal |
| 130 | equals T1's. |
| 131 | |
| 132 | **N: negative controls (the suite must be able to fail).** See section 6. If N does not hold the |
| 133 | run is **INVALID**, not a pass. |
| 134 | |
| 135 | **L: live leg (reported, not gated).** See section 7. |
| 136 | |
| 137 | ### Acceptance mapping |
| 138 | |
| 139 | Multi-round execution without losing the boundary: O, C, K, R, D, T together. Cancellation never |
| 140 | leads to an effect: C1, C2. Continuation still needs runtime authority: K1. Retries never run an |
| 141 | effect twice: R1, R3. Receipts survive and are never repaired: D1 to D4. Transport changes no byte: |
| 142 | T1, T2. |
| 143 | |
| 144 | ## 6. Negative controls |
| 145 | |
| 146 | Deliberately broken variants, built only into the conformance runner behind the existing test-only |
| 147 | feature, never into the pipeline libraries. Names W1 to W11 avoid the 0.3 V1 to V8. |
| 148 | |
| 149 | | Variant | Defect | Must fail at least | |
| 150 | |---|---|---| |
| 151 | | W1 | grammar checker accepts every sequence | O2 | |
| 152 | | W2 | emitter reuses a `seq` after a refusal | O3 | |
| 153 | | W3 | `execute` still called after an acknowledged cancel | C1 (C03, C07, C12) | |
| 154 | | W4 | late result rendered to the model | C2 (C08) | |
| 155 | | W5 | journal-mode continuation skips the `approval_id` check | K1 (K01, K03) | |
| 156 | | W6 | retry of a finished request re-executes | R1, R2 (R01, R03) | |
| 157 | | W7 | journal open truncates a torn tail and continues | D2 (D02, D08) | |
| 158 | | W8 | journal verifier skips digest and chain checks | D2 (D03, D04, D05) | |
| 159 | | W9 | receipt written after `execute` instead of before | R3 (R07), D4 (D07) | |
| 160 | | W10 | binding re-serializes envelopes without JCS | T1, T2 | |
| 161 | | W11 | binding drops unknown fields | T1 (T02) | |
| 162 | |
| 163 | N holds iff (a) each variant fails every gate check listed for it, (b) the union of variant |
| 164 | failures touches all six gates O, C, K, R, D, T, and (c) the unmodified build passes every case |
| 165 | the variants fail. Otherwise the run is INVALID. |
| 166 | |
| 167 | ## 7. Live leg (reported, not gated) |
| 168 | |
| 169 | - Leg: one OpenAI-compatible backend from those already qualified for Qwen3.5-9B |
| 170 | (`STATUS.md:45-46` and the 0.3 backend), streamed through `openai_stream` and, if decision 2 |
| 171 | chose a binding, through it. Multi-round tasks on the mock runtime and on T4, with host cancels |
| 172 | issued at fixed points (before decide, after authorize, mid-execution) and one forced process |
| 173 | restart per task. One run per task, temperature 0, seed 42; repeats are not used to raise n. |
| 174 | - Reported: stream completion rate, incomplete-stream refusals, cancels issued and acknowledged, |
| 175 | late results recorded, receipts written and read back, with a Wilson 95 % interval for each rate |
| 176 | (intervals computed by a tool and quoted with the query). Latency is recorded and not evaluated. |
| 177 | - Gated: nothing on this leg except the hard invariants that hold everywhere, as 0.3 gated only E |
| 178 | on its live leg: C1 and R1 (0 tolerated). A violation there fails 0.4. |
| 179 | - If no backend is available, REPORT-0.4 says so and the claim is limited to T1, TB and T4. |
| 180 | |
| 181 | ## 8. Freezing |
| 182 | |
| 183 | 1. The corpus is frozen by `conformance/EXECUTION-DIGEST.txt`: `corpus_digest` (sha256 over the |
| 184 | `sha256sum` lines of every file under `conformance/execution/` in `LC_ALL=C` path order), |
| 185 | `grammar_sha256` (the grammar table), `negative_controls_sha256`, `protocol_sha256` (this file) |
| 186 | and the T4 subset list. `conformance/TRUST-DIGEST.txt` stays the 0.3 freeze and is not |
| 187 | recomputed over the new root. |
| 188 | 2. Before the first qualifying run the digests and the run manifest (commit, pins, toolchain, |
| 189 | filesystem and kernel for D08, backend for L) are committed to `main`. A run whose recorded |
| 190 | digests differ does not count. |
| 191 | 3. Development runs may happen before or after the freeze. After the freeze no case is dropped, |
| 192 | edited or re-judged because of a result. |
| 193 | |
| 194 | ## 9. Reproduction and raw evidence |
| 195 | |
| 196 | - Must reproduce byte for byte: every verdict file of T1, TB and T4, the event lists of 0.4 cases, |
| 197 | every receipt and journal of the D cases except D08, the negative-control matrix, |
| 198 | `EXECUTION-DIGEST.txt`. A difference is a harness bug. |
| 199 | - Varies: D08 kill offsets beyond the seeded list, live model text, latencies, timestamps. |
| 200 | - Kept under `bench/runs/<run-id>/`: verdict files, event lists, journals before and after each |
| 201 | D case with their sha256, negative-control matrix, adapter logs, live-leg request digests, |
| 202 | decisions and receipts. Arguments are stored as digests and key names, as in 0.3. |
| 203 | |
| 204 | ## 10. Change log |
| 205 | |
| 206 | - 2026-11-09: initial pre-registration (gates O, C, K, R, D, T, V, N, L; ordering corpus at least |
| 207 | 60 legal and 140 illegal sequences; C01 to C12, K01 to K09, R01 to R08, D01 to D08, T01 to T08; |
| 208 | W1 to W11; thresholds above). |
| 209 | - 2026-11-16: section 2 citation of the Python removal pinned to commit `6aa1eec9` and named by |
| 210 | its entry text, because later CHANGELOG entries above it moved its line number. Wording only; |
| 211 | no gate, threshold, system or corpus changed. |