interplane.Get Omega
Read in your language

omega-mv

Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.

Brought by drakestapleton

branch main Branches Tags History

omega-mv / spec / r16-orchestrator-retirement.md

637 lines · 41934 bytes Raw Blame History Rendered
1# R16 orchestrator retirement (pre-registration)
2
3Status: METHODOLOGY. This file is committed before any R16 retirement code,
4inventory tool output, test run or qualification data exists. Branch
5`feat/r16-orchestrator-retirement`, based on omega `origin/main` `ceb68d6`.
6Its acceptance criteria are binding. Changing a criterion, the scope (§3) or
7the classification rules (§4) requires a new commit to this file that says
8what changed and why, made before any data that depends on the change, and
9followed by a rerun of every gate whose evidence the change affects. Only a
10clean, candidate-bound run that meets every gated criterion below may say
11`R16_ORCHESTRATOR_RETIRED = PASS`.
12
13ADR 0016 §49 (aien-architecture `f6baa35`,
14`docs/adr/0016-resident-reaction-architecture.md`), verbatim:
15
16> Only after prior gates pass: remove central sequencing where reactions now
17> provide equivalent or stronger behavior. Do not remove: known-good fallback;
18> recovery path; deterministic maintenance controls; trusted capability root;
19> generation mechanism; evidence.
20>
21> Gate: `R16_ORCHESTRATOR_RETIRED`
22
23Supporting ADR text: §32 migration ladder (… → REACTION AUTHORITATIVE FOR
24CAPABILITY-BOUND EFFECTS → LEGACY FALLBACK → LEGACY RETIRED; "the legacy
25orchestrated runtime becomes the reference oracle"); §54 invariants I1–I16,
26which every R16 change must preserve; §57 "Do not remove rollback", "Do not
27remove deterministic operator control", "Do not make neural inference the
28scheduler".
29
30The operator brief for R16 (Part II of the ADR 0016 completion prompt) is
31copied verbatim into `docs/r16-operator-brief.md`. Where this spec and the
32brief differ, this spec governs and §3.3 lists every difference.
33
34## 1. Purpose
35
36R1–R15 proved that the resident reaction world is correct, recovers, and
37(R15) performs against the central-loop pattern. R16 makes that official:
38central semantic orchestration — code that decides "AIEN now, wait, Omega
39now, wait, AEGIS now, wait, GPU now" — is no longer in charge anywhere in
40production within the scope of §3. After R16 the normal semantic progression
41is the brief's production law:
42
43state publication → dependency readiness → resource admission → authority
44validation → reaction execution → atomic publication → new readiness.
45
46R16 does not delete loops because they are loops. The forbidden thing is
47central semantic orchestration on the authoritative path.
48
49## 2. Preconditions (binding; not gates)
50
51No R16 code, inventory tool or test is written before all of these hold:
52
531. `R15_REACTION_PERFORMANCE = PASS` is merged to omega main, candidate-bound
54 (omega sessions rule 8: "R16 starts only after R15 PASS is merged").
552. omega main contains `03d2820` (GPU seat clean stop; rule 7). At the time
56 of this commit it does not (it is on the R15 branches); this branch is
57 rebased onto main after R15 merges.
583. Fix PRs merged, one at a time, each rebased and given its targeted Spark
59 test: omega #62 capability generation 64 (after aienos #158), #63 R11
60 miscount, #64 evidence digest writer, #65 M19 world faulted. #66 is not
61 required.
624. The make target that proves R4 (causal trace) on the candidate is
63 identified and written into a clarification commit to this file before
64 qualification. omega main has no `evidence/R4/`; without this, an R4 PASS
65 in the receipt is unsupported and G7 cannot pass.
66
67This spec (and the retirement map, §4) may be written and committed before
68the preconditions hold; it contains no data.
69
70## 3. Scope
71
72### 3.1 Decisions (decided by Drake 2026-09-28)
73
74**Q1 = Option A — scoped R16.** R16 retires the central orchestrators that
75reactions have actually replaced:
76
77- omega's hand-sequenced tool path (`tools/omegatool.c`, the
78 `--demonstrate-living-matvec` sequencing and any other production-reachable
79 sequencer of faculties), marked "Oracle until R16" in the ADR migration map
80 `docs/plans/CURRENT_CODE_TO_R0_R16_MIGRATION.md`;
81- the old aegis-runtime loops: `AgentEngine::execute_task` tool-turn loop
82 (`src/agent.rs`), `HeartbeatEngine::start_loop` / `pulse_once` pending-task
83 dispatch (`src/heartbeat.rs`, `src/main.rs` polling), marked "Oracle →
84 retire" in the migration map.
85
86The aien-sovereign-core language-model request loop
87(`AienRuntimeSpine::run_until_complete` / `step`,
88`crates/aien-runtime/src/spine.rs`) is classified **"still in use, not
89replaced by reactions"** and is **not retired by R16**. Reason, recorded: each
90`step` is one batched LLM forward pass (prefill chunks and one decode token
91per sequence over a paged KV cache). It has no goal, plan, candidate
92realization, verification, measurement, selection, authority grant, GPU
93experiment or generation promotion (R15 spec §2 read of sovereign-core
94`63fe7a7`: "NOT DIRECTLY COMPARABLE"). The reaction world has never taken
95over LLM request serving, so there is no equivalent-or-stronger reaction
96behaviour for §49 to retire it in favour of. In the map it is class E
97(physical scheduler: the brief's "PHYSICAL ENGINE STEP … may remain"), with
98the note "LLM request serving, not replaced; retirement deferred to the
99planned C rewrite of sovereign-core". The receipt states plainly that it is
100not retired.
101
102**Q2 = Option A — no edits to the Rust repositories.** R16 makes no change to
103aien-sovereign-core or aegis-runtime. Their loops appear in the retirement map
104labelled LEGACY / NOT-IN-CHARGE (aegis-runtime loops: class A, retired from
105the production path by non-use; sovereign-core spine: class E per Q1).
106aegis-runtime may be archived. R16 proves, by build/link/exec checks and by
107the authoritative-path test (G3), that omega's living system never invokes,
108links or execs either repository.
109
110A different answer to Q1 or Q2 is a scope change under the header clause: a
111new commit to this file before any data.
112
113### 3.2 In scope
114
115omega (all code changes), plus read-only inventory of aien-sovereign-core,
116aegis-runtime, aienos and physics.
117
118### 3.3 Where this scope departs from the operator brief
119
120Recorded so the receipt cannot overclaim:
121
1221. Brief "R16 TARGET 1" names `AienRuntimeSpine::run_until_complete` "the
123 clearest known legacy semantic orchestrator" and says production AIEN must
124 not require a caller to repeatedly call `step()`. Under Q1=A it stays. This
125 is consistent with the brief only under its own exception (a physical
126 engine step may remain); the map must justify class E, and if that
127 justification fails the loop is unclassifiable under this scope and G2
128 fails.
1292. Brief "R16 API / BUILD SURFACE" asks that the distinction be "visible in
130 code" and that `run_until_complete()` not be the obvious production entry
131 point. Under Q2=A this is met in omega only; for the Rust repositories it
132 is met by map labels and documentation, not code.
1333. Brief "DEAD-CODE / DEPENDENCY AUDIT" asks to remove service glue used only
134 by retired sequencing. sovereign-core `aien-cli/src/commands.rs` still
135 shells out to `spark-aegis`; under Q2=A it stays and is listed in the map
136 as legacy glue, not removed.
1374. The brief warns "Do not stop merely because old code was marked
138 deprecated". Q2=A labels the Rust loops rather than removing them. What R16
139 proves instead is non-dependence: the production path does not link, exec
140 or call them (G3), and they cannot reach authoritative state (G4).
1415. R16 PASS therefore means "ADR 0016 migration complete within the scope of
142 §3.1", not that every central loop in the organization is gone.
143
144## 4. Loop inventory method
145
146Output: `spec/r16-orchestrator-retirement-map.md`, committed after this file
147and before any retirement code.
148
149Repositories, each at its `origin/main` SHA recorded in the map header:
150aien-spark/omega, aien-spark/aien-sovereign-core, aien-spark/aegis-runtime,
151aien-dev/aienux, aien-spark/physics.
152
153Search terms (from the brief; each must appear in the map with its hit count):
154`run_until_complete`; `for`/`while` semantic step loops; `max_steps`;
155`max_turns`; manual faculty invocation; polling for semantic readiness;
156central switch statements choosing subsystem order; synchronous AIEN → Omega
157calls; synchronous Omega → AEGIS calls; heartbeat task dispatch; duplicate
158schedulers; duplicate world ownership; duplicate authority ownership; duplicate
159semantic task queues, generation model, resource pool or causal state;
160service/RPC boundaries now replaced by shared reactions.
161
162One row per loop: repo, path, symbol, line (at the recorded SHA), old role,
163new role, class, evidence reason, authoritative (true/false). Every loop gets
164exactly one class:
165
166| Class | Meaning |
167|---|---|
168| A RETIRE | production semantic sequencing now replaced by reactions |
169| B KEEP — MAINTENANCE CONTROL | explicit deterministic operator or maintenance mechanism |
170| C KEEP — RECOVERY | needed for boot, recovery or repair |
171| D KEEP — REFERENCE ORACLE | non-authoritative comparison or test path (e.g. `rx_seq_reference`) |
172| E KEEP — PHYSICAL SCHEDULER | schedules physical resources or work, not faculty semantics |
173| F KEEP — EXTERNAL PROTOCOL LOOP | network/socket/event-loop mechanics that do not decide faculty order |
174| N NOT A CENTRAL LOOP | data/control-flow idiom; no sequencing, wait, or hand-off; authoritative N/A |
175
176A class-A row in omega is retired by code change (moved behind an explicit
177`legacy_oracle`/`reference` name out of the production build, or removed). A
178class-A row in a Rust repository is retired by non-use (§3.1 Q2) and must say
179so. `authoritative` is false for every A, D row after R16.
180
181Known starting verdicts (to be re-checked against current code, not trusted):
182omegatool `--demonstrate-living-matvec` A; `--run-*-gates` B; M19
183`omega_world_*` C (known-good fallback); `rx_seq_reference` D; `rx_plan_arrange`
184`max_steps` (a plan-length field) listed, D or E; aegis-runtime agent loop and
185heartbeat dispatch A (by non-use); sovereign-core spine E (§3.1); aienos boot
186`handoff.rs` C ("must never be removed", §49).
187
188## 5. Acceptance criteria (gated)
189
190| # | Gate | PASS condition |
191|---|---|---|
192| R16-G1 | Retirement map complete | `spec/r16-orchestrator-retirement-map.md` exists, was committed before any retirement code, records the five repository SHAs, reports a hit count for every §4 search term, and gives every loop found exactly one class A–F with a reason; zero rows unclassified |
193| R16-G2 | Code-search gate | `tools/r16_loop_inventory.sh` (shell or C; no Python) scans the five repositories for the §4 patterns, joins each match with the map, prints a machine-readable JSON inventory and exits non-zero if any match is unclassified or any omega match is class A and still reachable from a production build. On the candidate: remaining unclassified semantic-loop count = 0 and exit 0. With a planted `run_until_complete` loop in a scratch copy: exit non-zero |
194| R16-G3 | Authoritative path without legacy orchestrators | A test target (`make test-r16-authpath`) builds the production golden path with every class-A orchestrator absent: no omegatool sequencer linked, no aien-sovereign-core or aegis-runtime symbol linked, no exec of `spark-aegis`, `aegis-runtime` or any sovereign-core binary (checked from the link map and by exec tracing during the run). In that configuration R13 living system (`R13_LIVING_SYSTEM_PASS`) and the R14 recovery subset pass, host and silicon: goal in → AIEN reacts → Omega reacts → authority → GPU → evidence → generation promotes → recovery works |
195| R16-G4 | Legacy paths cannot bypass authority | `tests/runtime/rx_r16_negative.c` (`make test-r16-negative`): from a legacy/reference/oracle context, each of six acts is attempted and refused by the R7 native authority or the publication boundary: (1) write authoritative AIEN belief, (2) select an Omega realization, (3) mint authority, (4) promote a generation, (5) bypass the effect/authority boundary, (6) advance the world generation. 6/6 refused, with no change to authoritative state; removing any one guard turns the test red. Since C6 a subject is bound to a runtime-issued caller credential, and the gate also needs the promoter-subject probes, the C6 identity probes and the promotion control |
196| R16-G5 | API/build surface | In omega, every surviving legacy entry point lives under an explicit name (`legacy_oracle`, `maintenance`, `recovery` or `reference`); the supported production entry point is documented in the repo; no legacy sequencer is the default target or default mode of any production binary. For the Rust repositories (§3.3 item 2), the map row carries the LEGACY / NOT-IN-CHARGE label |
197| R16-G6 | Protected things kept | The receipt shows, each with the file/symbol and the test that exercised it on the candidate: known-good fallback present = true; recovery path present = true; deterministic maintenance controls present = true; trusted capability root present = true; generation mechanism present = true; evidence present = true (the six of §49); and R9 crash recovery, R10 verifier, R12 seat-loss handling, R14 recovery paths, operator emergency controls and needed benchmark reference paths (SEQ) present and passing |
198| R16-G7 | Full ladder on the candidate | On the frozen candidate commit, clean tree: R1, R2, R3, R4, R5, R6, R7, R8, R9, R10, R11, R12 host, R12 silicon, R13 host, R13 silicon, R14 host, R14 silicon all PASS, each named in the receipt with the make target that proved it; and the R15 physical qualification meets every pre-registered R15 gated criterion (R15 spec §11 G1–G16, with its clarifications). R15 numbers need not be byte-identical; if performance changes materially, a new R15-compatible measurement bundle is recorded in the R16 qualification |
199| R16-G8 | Receipt and merge | `evidence/R16/<sha256>.json`, named by the SHA-256 of its own bytes, schema `AIEN_RX_R16_ORCHESTRATOR_RETIRED_V1`, written by the #64 evidence writer, committed unchanged; candidate_commit == run_commit; candidate_bound = true; tree_dirty = false; silicon_observed = true; all fields of §6 present; the PR is merged with a merge commit (not squash) |
200
201If any gate fails: no PASS. Fix the defect at its layer, add coverage, and
202rerun every gate whose evidence the fix touches; G7 is rerun in full on the
203new candidate.
204
205After merge (not a gate, but reported): a fresh clean checkout of merged main
206reruns R1–R16; R15 may reuse the G7 bundle only if the code is unchanged,
207and the report says so.
208
209## 6. Evidence
210
211- Map: `spec/r16-orchestrator-retirement-map.md`.
212- Inventory: `evidence/R16/raw/<run-id>/inventory.json` (G2 tool output) and
213 `SHA256SUMS`.
214- Test logs for G3, G4 and every G7 gate under
215 `evidence/R16/raw/<run-id>/`, one file per gate, plus `machine.json`
216 (hardware identity as R15 spec §13).
217- R15-compatible bundle, if recorded: `evidence/R16/raw/<run-id>/r15/`,
218 reduced by the R15 reducer `tools/r15_reduce.c` unchanged.
219- Receipt `evidence/R16/<sha256>.json`, schema
220 `AIEN_RX_R16_ORCHESTRATOR_RETIRED_V1`, with: candidate_commit, run_commit,
221 candidate_bound, tree_dirty, silicon_observed; commits of omega, aienos,
222 physics, aien-sovereign-core, aegis-runtime; R1–R15 rerun results with the
223 proving target per gate; retirement inventory rows (repo, path, symbol, old
224 role, new role, classification, authoritative); production entry point;
225 legacy-orchestrators-disabled test result (G3); legacy-cannot-bypass-
226 authority test result (G4); remaining central-loop count; remaining
227 unclassified semantic-loop count = 0; the six presence flags of G6; R15
228 acceptance still passing = true; scope (§3.1, including "sovereign-core LLM
229 request loop: not retired, still in use"); `not_claimed` (§7); raw
230 directory digest; gate `R16_ORCHESTRATOR_RETIRED` = PASS or FAIL.
231- No field is edited by hand.
232
233## 7. Not claimed by R16
234
235- Retirement of the aien-sovereign-core LLM request loop (§3.1, Q1).
236- Removal of any Rust code (§3.1, Q2); the Rust loops still run if started
237 by hand outside the AIEN production path.
238- Retirement or code removal of the aien-sovereign-core aien-cli operator tool
239 loops (13 rows) and spark-dream idle-time cycle loop (1 row); classified as
240 class A (retired by non-use), their code is not removed under §3.1 Q2.
241- From the brief's DO NOT OVERCLAIM: R16 PASS means ADR 0016 Resident
242 Reaction Architecture migration complete (within §3.1 scope). It does not
243 mean the AIEN 42-phase master plan is complete, nor full Skill Network,
244 J-Space productization, Fabric deployment, whole-product Effect Broker
245 path, Cortex product integration, RSI product integration, final
246 install/update UX, Phase 41 whole-AIEN golden path or Phase 42 final
247 release qualification.
248
249## 8. Clarifications
250
251Later changes to this file are appended here as numbered clarifications
252(C1, C2, ...), each dated and stating whether any data existed when it was
253made, following the R15 convention.
254
255### C1 (2026-09-29)
256
257Class N (NOT A CENTRAL LOOP) is adopted. Inventory patterns flag data or
258control-flow idioms (CAS retry, seqlock retry, probe, parse, walk, read,
259arithmetic, sift, sample, merge, retry, format, bpe, utf8, token, decode,
260scan) that contain no faculty sequencing, no wait on another component,
261and no hand-off. Class N rows have authoritative = false. The reason
262field for every class N row must name the specific idiom from the fixed
263idiom vocabulary. Any loop containing a wait word or faculty dispatch
264cannot be class N.
265
266### C2 (2026-09-29)
267
268The 13 aien-cli tool-calling loops and the spark-dream idle-time cycle
269loop are classified as class A (retired by non-use) with authoritative = false.
270Under §3.1 Q2, Rust code is not modified; the production path does not invoke
271or link them. They are recorded in §7 as not claimed for code removal.
272
273### C3 (2026-09-29)
274
275Capability root authority clarification: the native C library
276(aienos native/capability/aienos_capability.c) is authoritative. The Rust
277aienos-capability crate is legacy under the no-Rust port (aienos #156).
278Omega's rx_caproot.c is a host reference root, not the trusted capability
279root. This affects G4/G6 wording only; the native C capability root remains
280the sole authoritative capability root.
281
282### C4 (2026-09-30)
283
284Made before any qualification data existed (only host development runs of
285the new G3 to G5 tests on the R16 branch). No gate is loosened.
286
2871. Precondition 4 (R4 target). R4 (causal trace) is proved by
288 `make test-r3`: `tests/runtime/rx_heartbeat_test.c` prints
289 `R4_CAUSAL_TRACE: PASS` and, in the same run, R1, R2, R3, R5 and R6. The
290 committed receipt `evidence/R3/ef3e5565b9deda5226b58caf00c3e05f467cf03f6ae91984c10898d98e28c321.json`
291 records `R4_CAUSAL_TRACE` PASS. In G7, R1 to R6 are each named with the
292 target `test-r3`.
2932. G3 in host mode (`make test-r16-authpath`) prints
294 `R16_G3_AUTHPATH=HOST_PASS_NON_SILICON`. Only `make
295 test-r16-authpath-silicon` on the candidate can print `PASS`.
2963. G4 act mapping (`tests/runtime/rx_r16_negative.c`). The legacy context
297 holds the world handle, a read-only authority view, the R9 store, a
298 forged reference, references it could observe (the external goal grant,
299 the promoter's grants) and grants of its own issued as fixtures.
300 - (1) AIEN belief and experiment belief; (2) Omega selection; (6) the
301 in-force and promotion records production reads: outside publication
302 with each reference, a reaction writing without a declared grant, a
303 reaction holding a forged or unrelated grant, and (belief) a reaction
304 whose real grant the office revokes while it runs.
305 - (3) cognition mint and revoke through the view, with a guessed token
306 and with none.
307 - (4) `rx_gen_promote` with the native authority as callback:
308 self-promotion with a real grant, another subject with the promoter's
309 grant, a forged reference, and a right the subject really holds but
310 that is not PROMOTE.
311 - (5) publication descriptors with a forged reference, an unrelated
312 grant, the promoter's grant, a real grant on the object's resource that
313 is not the writer of record's, and the writer's own grant after
314 revocation; and an overwritten physical record (refused as diverged,
315 canonical object unchanged).
316 - (6) "advance the world generation" means the records above plus the R9
317 active generation and lineage, in memory and recovered from disk,
318 which the test compares after every act.
319 After every act the watched objects, the R9 generation and the Aienux
320 table (observer) must be unchanged, except for the office's own planned
321 revocations, which the test counts separately.
3224. "Removing any one guard turns the test red" is `make
323 test-r16-negative-mutants`: 15 mutants, each removing one guard from a
324 scratch copy (external publication cap check, reaction write coverage,
325 activation cap check, commit cap re-check, both, cognition mint,
326 cognition admin, self-promotion, promotion resource/right, promotion
327 authority callback result, boundary cap identity, boundary cap
328 validation, boundary divergence, SEQ pulse on a production world, SEQ
329 activation on a production world). All must be killed.
3305. G4 limits, stated in the receipt, not tested as refusals: world-owner
331 calls (`rx_world_create`, `rx_world_retire`, `rx_world_add_reaction`)
332 take no capability, and `rx_world_retire` moves an object's generation;
333 `rx_gen_promote` trusts the authority callback its caller passes; code in
334 the same address space can write process memory directly. Cognition mint
335 and admin refuse by construction (the view has no office token).
3366. G5. omegatool's class D milestone demonstrations run only under
337 `--reference-demonstrate-<name>`; the class A living matvec only under
338 `--legacy-oracle-living-matvec`; the old names are rejected. The class B
339 gate runners (`--run-gates`, `--run-m<N>-gates`) keep their names: they
340 run qualification tests and the map does not flag them for G5. With no
341 argument omegatool prints usage and exits 1. The production entry point
342 is `docs/r16-production-entry-point.md`; `make test-r16-surface` checks
343 all of this. The 16 reference modes live in one table (`reference_modes`)
344 that both the dispatcher and the usage text read; the check reads the
345 table, requires usage to list exactly those modes, requires every retired
346 `--demonstrate-<name>` (16 plus living-matvec) to be rejected, requires
347 every new name to be accepted by the real dispatcher through
348 `--reference-dispatch-dry-run <name>` (resolved, not run: several modes
349 need the chip), and runs `--reference-demonstrate-arithmetic` (CPU only).
350
351### C5 (2026-09-30): G4 is open (caller-named subjects); closed by C6
352
353Recorded after a review of the G3 to G5 branch found it; host data existed
354(the G4 host test). This records a discrepancy, it does not loosen G4.
355
3561. `rx_gen_promote` takes the subject from the request, a value the caller
357 supplies, and the authority callback checks the grant against that subject.
358 Nothing binds the subject to the caller. A legacy context that can read the
359 promoter's grant reference (`promotion_authority`, an id and a generation)
360 and names `RX_LIVING_PROMOTE_SUBJ` as the subject is accepted by the
361 unchanged native authority. Observed on host at 6d1ff1d plus this branch:
362 rc 0, R9 active generation 1 -> 3 in memory and on disk.
363 The same flaw is on the reaction path (found by review, confirmed on host):
364 `validate_caps` (rx_world.c) checks each grant against `d->subject`, the
365 subject the descriptor names, and `rx_world_add_reaction` does not check
366 who registers. A legacy reaction naming `RX_LIVING_PROMOTE_SUBJ` and
367 carrying the promoter's in-force grant was registered (rc 0), activated
368 once, committed once and wrote its marker 0xBADBAD into the authoritative
369 in-force record. So act (6), and by the same route acts (1) and (2) for any
370 writer whose grant reference the legacy context can read, are open too.
371 (The probe's wake uses a harness-minted scratch read grant for the promoter
372 subject; in normal operation the promoter's own candidate trigger would
373 wake it.)
3742. `tests/runtime/rx_r16_negative.c` now makes both attempts last (they move
375 authoritative state) and expects refusal. Until a subject is bound to
376 something the legacy path cannot supply (an authenticated caller or
377 registration handle, or the sealed reaction context of the grant's owner),
378 `make test-r16-negative` prints two `R16 G4 OPEN: ...` lines and
379 `R16_G4_LEGACY_REFUSED=FAIL`. The fix is a runtime change (`rx_world.c`,
380 `rx_generation.c`, `rx_living.c`, possibly the native capability library)
381 and a design decision; it is not made on this branch.
3823. The listed attempts of the six acts are still refused, and the test prints
383 `R16 G4 core: six acts refused, state unchanged, for the counted per-act
384 attempts only; this is NOT a claim that legacy cannot promote or write`. The mutant suite judges
385 that core line, so it still answers whether each of the 15 guards is load
386 bearing. No mutant exists for the missing binding, since there is no guard
387 yet to remove; when one is added, a mutant removing it must be added too.
3884. The G4 state comparison also covers the recovered lineage on disk, not
389 only the recovered active generation.
3905. C4 item 5's sentence on `rx_gen_promote` trusting its callback is
391 superseded here: the problem is the caller-supplied subject, which even
392 the real native callback accepts.
393
394### C6 (2026-09-30): C5 closed by runtime-issued caller credentials
395
396Records the runtime change C5 item 2 asked for. It narrows who can act as a
397subject; it does not loosen any gate, and it does not make R16 complete
398(G6 to G8 and the receipt remain blocked).
399
4001. Mechanism (`src/runtime/rx_caller.h`, `rx_world.c`, `rx_generation.c`).
401 - A subject acts only with a credential the runtime issued for it:
402 `rx_world_enroll_caller(w, subject, &cred)` draws a 32-byte secret from
403 `getrandom` and a world-unique generation (never 0; 0 means absent). The
404 world keeps only `SHA-256("AIEN_RX_CALLER_V1", subject, generation,
405 secret)` and compares in constant time; the secret exists only in the
406 enrolling component's keyring (`RxCallerKeyring`).
407 - `rx_world_bind_callers(w)` closes enrollment, one-way. From then on every
408 subject is checked. Worlds that never bind (older tests) behave as before.
409 - Errors (`RX_CALLER_ERR_*`): ABSENT (no credential, or generation 0),
410 UNKNOWN (never enrolled), REVOKED, STALE (another generation), FORGED
411 (secret does not match), CLOSED (enrollment after bind), EXISTS
412 (subject enrolled twice), ENTROPY. At the authority-bearing calls they
413 surface as `RX_ERR_IDENTITY` (world) and `RX_GEN_ERR_IDENTITY` (R9).
414 - Revocation (`rx_world_revoke_caller`) needs the credential itself; it
415 clears the stored digest. A revoked credential is refused everywhere,
416 and enrollment is closed, so the subject cannot be re-issued in that
417 world.
4182. Where it is checked (every authority-bearing call that takes a subject):
419 - `rx_world_add_reaction`: the descriptor's `caller` must be the named
420 subject's credential. The reaction keeps only the generation, never the
421 secret (it is zeroed on registration).
422 - `validate_caps` (activation, commit re-check and the seat completion
423 path): the enrollment the reaction was admitted under must still be live
424 at that generation, so revoking an identity stops a running reaction's
425 write and blocks later activations.
426 - R9, when the store is bound (`rx_gen_bind_authority`): `rx_gen_propose_as`
427 and the durable `rx_gen_post_propose_as` check the proposer's credential;
428 `rx_gen_promote` checks `request->caller` against `request->subject`, then
429 validates the promotion right with the store's own bound authority and
430 ignores the caller's `RxGenAuthFn`. This also closes C4 item 5.
431 - `rx_world_publish_external` is unchanged: its subject is the world's
432 fixed `external_subject`, never a caller-supplied value.
4333. Production wiring: the R15 rig (the production body for R13 to R16)
434 enrolls every production subject (Omega 21, 22; AIEN 31; Aegis 41, 42;
435 Living 61, 62, 63; promoter 64) into per-component keyrings right after the
436 world is created, then binds the world, then binds the R9 store to the world
437 and to the native authority (`rx_living_native_authority`, i.e.
438 `aienos_cap_validate`). Faculties register with
439 `rx_world_add_reaction_keyed`, which takes the credential from their own
440 keyring. The production entry point (R13 living, R14 recovery; see
441 `docs/r16-production-entry-point.md`) is wired the same way through
442 `rx_living_enroll_callers` (enrolls the nine production subjects into an
443 `RxLivingKeyrings`, does not bind). R14 also enrolls its lane, rogue and
444 cycle subjects: the rogue is an enrolled in-process party whose
445 capabilities are forged. Its B6 promotion forgery now meets the identity
446 check first when it names the promoter subject (`RX_GEN_ERR_IDENTITY`),
447 and the native authority when it names itself (`RX_GEN_ERR_AUTHORITY`).
4484. Evidence (`make test-r16-negative`, host):
449 - The pre-fix exploit is kept in the test. At 44d8c06 (before this change)
450 it was ACCEPTED: promotion rc 0, generation 1 -> 3 in memory and on disk;
451 the named-subject reaction committed and wrote 0xBADBAD into the in-force
452 record; gate `R16_G4_LEGACY_REFUSED=FAIL`.
453 - After: 6/6 promotion credential variants and 3/3 reaction variants are
454 refused with the identity error, nothing moved; 40/40 C5 identity probes
455 (spoofed subject, forged, stale, unknown, absent, collision, enrollment
456 after bind, revocation, in-flight revocation, replay after revocation,
457 permissive authority callback); positive control: the promoter with its
458 own credential still promotes. Gate `R16_G4_LEGACY_REFUSED=PASS`.
459 - `make test-r16-negative-mutants` judges the gate line (not only the core
460 line) and adds 12 identity mutants, one per check above: 27 mutants,
461 27 killed, 0 survived, 0 broken; gate `R16_G4_GUARDS_LOAD_BEARING=PASS`.
462 - Host regressions with the bound worlds: R7, R8, R9, R10, R11, R13 host,
463 R14 host (A to F PASS), R15 parity host, R15 G7 host, workflow fusion,
464 G5 surface, visor authority check and the G1/G2 inventory all pass.
465 Nothing was run on the graphics processor.
4665. Limits:
467 - Credentials are secrets in process memory. Code in the same address
468 space that reads another component's keyring can act as that component;
469 G3 (the production binary does not link or exec the legacy code) is what
470 covers that, as it covers any memory write.
471 - `rx_gen_bind_authority` takes no lock; it is called once, at startup,
472 before any other thread uses the store. Since C7 the bound flag is
473 published with release and read with acquire ordering.
474 - Other world users outside the R15 rig and R13 / R14 (`rx_contract.c`,
475 `rx_graph.c`, `rx_fusion.c`, `rx_route.c`) do not bind their worlds or
476 stores yet, so they run unchecked as before. On a bound
477 world their unkeyed registrations would be refused (default deny).
478
479### C7 (2026-09-30): outside review of C6, three gaps closed
480
481An outside review (Codex, Gemini) of the C6 commits found three real gaps.
482Each is reproduced by a probe in `tests/runtime/rx_r16_negative.c` (section
483"R16 C7", on scratch worlds and stores, so the rig is untouched), refused
484after the fix, and has a mutant that removes the fix. This narrows C6; it
485loosens no gate, and R16 is not complete (G6 to G8 and the receipt remain
486blocked).
487
4881. Promotion re-checks identity at the durable commit point.
489 - Gap: `rx_gen_promote` checked the promoter's credential only on entry.
490 A revocation in the live barrier or during the disk writes still moved
491 the active pointer.
492 - Fix: the caller check (`RxGenCallerFn`) now takes an `op`:
493 `RX_CALLER_OP_CHECK`, or `RX_CALLER_OP_HOLD` then `RX_CALLER_OP_RELEASE`
494 (`rx_caller.h`). Right before the pointer is written, the store checks
495 the request subject again with HOLD; on failure it returns
496 `RX_GEN_ERR_IDENTITY` and the pointer does not move. On success the
497 world's enrollment table stays locked, so no revocation lands, until the
498 new generation is active in memory; then RELEASE. The entry check stays,
499 so a forged promoter never reaches the live barrier or the disk.
500 - A refused flip leaves the candidate as the other pre-flip refusals do
501 (written but not active; recovery keeps the old generation).
502 - Probe P1: revoke the promoter from the live callback, then from the disk
503 hook. Before: promote rc 0, generation 1 -> 2 and 2 -> 3, on disk too.
504 After: rc `RX_GEN_ERR_IDENTITY`, generation unchanged in memory and on
505 disk (`rx_gen_recover`). A live promoter still promotes (control), and a
506 forged one is refused before the live barrier runs.
507 - Mutant `c7_flip_recheck`.
5082. Revocation is mutually exclusive with check-then-publish.
509 - Gap: `rx_world_revoke_caller` took only the caller lock. A commit and a
510 seat completion hold the world lock from `validate_caps` (identity
511 check) to `commit_writes` (publish), so a revocation could complete in
512 between and the write still landed.
513 - Fix: revocation takes the world lock first, then the caller lock (the
514 order every path uses). It now precedes the check or follows the
515 publish. It must not be called with the world lock held (reaction
516 bodies run without it).
517 - Probe P2: the world's capability validator, called inside the commit's
518 check after the identity check with the world lock held, starts a
519 revocation on another thread and waits up to 300 ms. Before: the
520 revocation finished inside that window and the write committed. After:
521 the revocation waits until the publish, then succeeds, and the next
522 activation is blocked. The seat completion path takes the same lock but
523 needs the graphics processor, so it is covered by the same lock, not by
524 a host probe.
525 - Mutant `c7_revoke_serialized`.
5263. Reactions registered before binding.
527 - Gap: an unbound world skipped the credential check but kept the
528 generation the caller claimed. Generations are sequential, so a reaction
529 registered before binding with a guessed generation and any secret ran
530 under that subject once the world was bound.
531 - Fix: an unbound world fully checks any credential a reaction names; one
532 that names none is kept as unauthenticated (generation 0).
533 `rx_world_bind_callers` refuses (`RX_ERR_IDENTITY`, world left unbound)
534 while any unauthenticated reaction is registered. Worlds that never bind
535 behave as before.
536 - Probe P3: before binding, a guessed generation with a zero or a random
537 secret: before RX_OK, after `RX_ERR_IDENTITY`; the issued credential is
538 still admitted and the world binds. With an unauthenticated reaction
539 registered: bind before RX_OK, after `RX_ERR_IDENTITY` and unbound.
540 - Mutants `c7_prebind_check`, `c7_bind_refuses_unauthenticated`.
5414. Smaller review items (Gemini), verified one by one:
542 - Fixed: enrollment past `RX_CALLER_MAX` returned `RX_ERR_FULL` (-2), the
543 same number as `RX_CALLER_ERR_UNKNOWN`; it now returns
544 `RX_CALLER_ERR_FULL` (-9).
545 - Fixed: the living promoter's `promotion_caller` silently sent a zeroed
546 credential when its keyring lacked the promoter's; it now fails with
547 `RX_GEN_ERR_IDENTITY` before anything is posted to the executor (the
548 store would refuse it anyway, so this has no mutant).
549 - Fixed: the store's bound flag uses release/acquire atomics.
550 - Fixed: `rx_gen_mutate_object` and `rx_gen_set_evidence` carry no
551 credential; a bound store now refuses them (`RX_GEN_ERR_IDENTITY`).
552 Only the R9 tests, on unbound stores, use them. Probe in P1; mutants
553 `c7_mutate_object_bound`, `c7_set_evidence_bound`.
554 `rx_gen_observe_object` stays open: it can only mark an object seen,
555 which can make a promotion fail (denial of service), never succeed.
556 The work-accounting calls were wrongly listed here too; see item 7.
557 - Changed: the stored secret in a registered reaction is wiped with a
558 volatile loop. The memory stays live, so the plain `memset` could not
559 be removed by the compiler; this is belt and braces.
560 - Not changed, by design: an unbound store accepts the caller's
561 authority callback (the older tests; C6 says so). The credential
562 comparison is constant-time on the secret digest; the generation is
563 compared plainly because it is not secret.
5645. Evidence (`make test-r16-negative`, host): before the fix (the C7 probes
565 compiled against the 8307a14 runtime; P2 then polled every 1 ms instead of
566 the single 300 ms wait it uses now, same pass and fail meaning) the C7 section
567 was 13/24 as expected (P1, P2 and P3 all failing; gate FAIL); after, 25/25
568 (one probe added: forged promoter refused before the barrier), with the
569 C5 section still 40/40, the exploit variants still refused and the control
570 still promoting; gate `R16_G4_LEGACY_REFUSED=PASS`. Mutants: 33 total
571 (27 + 6 C7), 33 killed, 0 survived, 0 broken.
572 Host ladder rerun after the fix: R7, R8 (116/0), R9, R10 (198/0), R11
573 (436/0), R13 host, R14 host (A to F PASS), R15 parity host (5 pairs, 0
574 failures), R15 G7 host (57/0), workflow fusion (17957/0), G5 surface,
575 visor authority check, G1/G2 inventory (280 sites, 0 unclassified) and
576 the G3 authority path (`HOST_PASS_NON_SILICON`) all pass; the silicon
577 binaries were compiled only. Nothing was run on the graphics processor.
5786. Limits:
579 - Between HOLD and RELEASE the promoter holds the world's enrollment lock
580 across the write and sync of the active pointer. Every activation,
581 commit, registration and revocation on that world waits for it, so each
582 promotion adds one sync's worth of stall to the whole world. The
583 alternative (check after the sync) would have to undo a durable flip.
584 The cost is unmeasured: R15 performance was compiled only on this branch.
585 - The durable before-evidence in the committed tree is the six C7 mutant
586 kills; the 13/24 run above used the older runtime.
5877. Second-round review (2026-09-30; Codex found nothing new, GLM one gap):
588 - Gap: on a bound store `rx_gen_finish_work` and `rx_gen_add_work` took
589 no credential, and `rx_gen_add_work` stored the caller's work state
590 as given. Anyone could complete, or insert already done, a required
591 evidence item, so a promotion that classify would refuse succeeded
592 without the drain ever running. Item 4's "never succeed" was wrong for
593 these two calls.
594 - Fix: `rx_gen_add_work_as` and `rx_gen_finish_work_as` take the caller's
595 subject and credential and, on a bound store, check it like
596 `rx_gen_propose_as`. The bare calls pass no credential, so a bound
597 store refuses them (`RX_GEN_ERR_IDENTITY`); unbound stores (R9, visor)
598 behave as before. On every store, work is added pending or issued only
599 (`RX_GEN_ERR_ARG` otherwise); only a finish call marks it done.
600 - Probe P4 (`probe_work`): baseline (unfinished required item, promotion
601 refused), completion with the bare call, an item offered already done
602 or cancelled, the bare add, forged credentials on both `_as` calls, and
603 a control (the proposer adds and completes its item, promotion
604 succeeds). Before the fix (probe built with `-DR16_BEFORE_WORK`, which
605 maps the `_as` calls to the bare ones, against the b199cfe runtime):
606 C7 section 39/49 as expected; the bare completion and the bare and
607 forged calls let promotions through (generation 2 -> 4, then 4 -> 6,
608 drain never called); gate FAIL. After: 49/49, C5 still 40/40, gate
609 `R16_G4_LEGACY_REFUSED=PASS`. Mutants `c7_add_work_credential`,
610 `c7_finish_work_credential`, `c7_add_work_state`: 36 total, 36 killed,
611 0 survived, 0 broken.
612 - Also: the P2 revocation thread's `pthread_join` result is now checked,
613 and the flip recheck carries the contract that `rx_gen_bind_authority`
614 is startup-only and lock-free.
615 - Follow-up authorization closure (2026-11-15): on a bound store only the
616 authenticated candidate proposer may add work. The proposer either owns
617 the item or explicitly names a delegated worker, and supplies that
618 worker's capability for the store/parent-generation/candidate/work/finish
619 resource returned by `rx_gen_work_resource`. The native authority checks
620 the capability when work is added and again when it is finished, so a
621 revoked, expired, cross-worker or cross-work grant cannot produce DONE.
622 Completion writes a root- and receipt-committed `R9WORK1` blob containing
623 the completer and the digest of the evidence observed at completion.
624 A bound-store drain must therefore run as the assigned worker and use
625 `rx_gen_finish_work_as`; unbound R9 and visor accounting remains legacy.
626 The finish resource length-prefixes the store directory before hashing it.
627 Rebase onto main (2026-11-19) ran `tests/runtime/rx_gen_work_auth.c`
628 (PASS, including UBSan) and typechecked `tests/runtime/rx_r16_negative.c`.
629 The R9, R16 and visor binaries were not linked: this tree has no aienos
630 or physics sibling. The ladder list below is the 2026-11-15 run, not
631 that rebase.
632 - Host ladder rerun after this fix: R7, R8 (116/0), R9, R10 (198/0), R11
633 (436/0), R13 host, R14 host (A to F PASS), R15 parity host (5 pairs, 0
634 failures), R15 G7 host (57/0), workflow fusion (17059/0; its check count
635 varies run to run), G5 surface, visor authority check, G1/G2 inventory
636 (280 sites, 0 unclassified) and the G3 authority path
637 (`HOST_PASS_NON_SILICON`) all pass; silicon binaries compiled only.