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 / docs / runtime / COMMIT_A_REACTION_DESIGN.md

183 lines · 15016 bytes Raw Blame History Source

Commit a reaction: design note

Status: DESIGN NOTE, docs only. No runtime code changes. Nothing here is implemented, qualified or measured. Update 2026-10-02: the FORGE question in section 5 is decided (Option B). See "Decision 2026-10-02" at the end. Evidence base: omega origin/main at 2dc9dd8. Every line number below was checked against that commit. Vocabulary (module, interface, seam, adapter, depth) follows the codebase-design skill. Owner of src/runtime: the M20 program. This note touches no file there.

1. The chain today, with evidence

There is no single "commit a reaction" function. The chain is spread over rx_compose.c (the only module that wires it, 1258 lines), rx_world.c, rx_jspace.c and rx_cortex_record.c. AEGIS in this chain is a reaction named compose.verify, not a call into rx_aegis.c.

StepWhat happensEvidence
RoutingAlternatives are discovered; routing mints nothingrx_compose.c:1130-1131 (sr_route_alternatives)
World: goal publishedGoal fields are written as an external publish, then the run waits for quietrx_compose.c:1150 calls rx_world_publish_external (rx_world.c:2053); wait at rx_compose.c:1155 via rx_world_wait_quiescent (rx_world.c:2405) or wait_own (rx_compose.c:908)
J-Space: two candidatescompose.candidate.0/1 fork a staged branch from the current state branch, run the Skill (a CPU procedure, rx_compose.c:162), derive the result into the branchcandidate_fn rx_compose.c:126-188; fork :157 (js_branch_fork_staged, rx_jspace.c:1241); derive :169 (js_branch_derive)
AEGIS: verifycompose.verify (faculty RX_FACULTY_AEGIS) waits for both candidates, applies the contract, picks the lowest-numbered passer, writes the verdictreaction desc rx_compose.c:771-787; verify_fn rx_compose.c:191-220; the only subject allowed to write the verdict holds the write cap (:747)
Commit: name the winnercommit_fn proposes state.REF = winner branch; proposes nothing if there is no winnerrx_compose.c:223-232 (no-winner refusal :226)
Commit: World binderBefore the World accepts the new REF, bind_check validates, then bind_fn seals the branch (point of no return)bind_check rx_compose.c:236-249; bind_fn :251-268 (js_branch_seal, rx_jspace.c:1255); bind_abort :270; installed by rx_world_set_binder (rx_world.c:982, call rx_compose.c:706) and rx_world_bind_field (rx_world.c:1010, call :803)
SettleReclaim losers, make J-Space durable, write Cortex records, release the old branch, make durable againrx_compose.c:1175 (js_space_reclaim_staged, rx_jspace.c:1273), :1181 (js_space_commit, rx_jspace.c:1516), :1189 (compose_records), :1194 release, :1195 commit
CortexCandidate claims, evidence ref, promotion of the winner, loser admissions; resumablecompose_records rx_compose.c:340-500; Cortex attached to the World at open by rx_cortex_attach or rx_cortex_attach_scoped (rx_cortex_record.c:209, :223; calls rx_compose.c:805-809)

Ordering rules (all in rx_compose.c unless noted)

  1. Binder is installed before objects, caps and reactions (:705-706).
  2. Objects are created in fixed slot order GOAL, CAND0, CAND1, VERDICT, STATE; own-World mode requires ids 0..4 (:718-725, refusal RX_ERR_BAD_DESC at :724).
  3. Caps are minted before reactions (:735-750); Cortex is attached after the field bind (:803-811).
  4. Open order: machine.id check, cx_open, cx_verify_chain, J-Space open, recover(), then the World is built (:844-871, :961-964).
  5. Verify waits for BOTH candidates to be done for this goal (:198-199).
  6. A pending, incomplete composition record is completed BEFORE a new goal starts (:1116-1128).
  7. Settle order is reclaim, durable commit, Cortex records, release old, durable commit (:1175-1199).
  8. The binder seals, then clears branch ownership so a loser or outsider cannot reuse it (:265-266).

Refusal rules

Error codes are defined at rx_world.h:112-127.

What the four named mutants guard

tools/c4_requal_mutants.sh rows M05, M06, M12, M16 (script lines 24, 25, 31, 35). Each sed pattern was checked to match exactly one line. All four guard the recovery path on open, not the live commit above.

MutantGuarded linePlain meaning
M06rx_compose.c:509Recovery walks state records newest first, so it picks the latest durable state
M05rx_compose.c:535Only records newer than the chosen durable state receive a rollback admission
M16rx_compose.c:540Open refuses if Cortex promoted a state that the J-Space checkpoint lost
M12rx_compose.c:574The recovered state is made durable before the World starts; a failed save refuses the open

This note does not claim which mutants guard the live commit order; that mapping was not done (UNVERIFIED).

2. Where FORGE exists today

Proof it is not on the reaction path (grep over the checkout, .git excluded):

So there are two different things called FORGE here. In J-Space it is a memory-pressure policy. In forge_realization.c it is the realizer for hardware work. Neither runs when a reaction commits.

3. What the architecture records say

Read with gh at aien-spark/aien-architecture main, commit 26daeedb23c5.

ADR 0016, docs/adr/0016-resident-reaction-architecture.md (Accepted by operator, 2026-09-27):

ADR 0024, docs/adr/0024-rust-scaffolding-omega-destination.md (Accepted 2026-10-01):

doctrine/ARCHITECTURE.md (ratified): section 2.6 L191-200 puts FORGE at lowering (step 3) and dispatch (step 6). L229 says rx_world.c is the only code that orders faculty work. L245: other substrates attach as FORGE capability providers.

Reading: the doctrine says FORGE is a reaction that realizes work, which is closer to Option A than to Option B. But it also says FORGE realizes hardware work, and the composed path today runs CPU procedures only, so nothing in it needs realizing. No doctrine sentence says FORGE must sit on the commit path.

4. Proposed "commit a reaction" module (words only)

Today a caller must understand 15 rx_world_* entries, the binder, the J-Space branch calls and the Cortex record calls to get one correct commit, and the correct order lives in comments and in rx_compose.c (deletion test: delete rx_compose.c and the ordering rules reappear in every caller).

One interface: "propose a result for a goal, and either commit it or refuse it". The caller supplies the goal input, the requirement, and the contract that a result must meet. It gets back one of the existing outcomes (committed, no winner, not committed, not durable, record failed), the old and new state references, and the winner. The caller never sees a branch, a binder, a verdict object or a Cortex record.

The order it enforces (unchanged from section 1): route, publish the goal, candidates fork from the current state, verify against the contract, name the winner, seal through the binder, make durable, write Cortex records, release the old state, make durable again. A previous incomplete record is always finished first.

Refusal rules it keeps (unchanged): every code in section 1. After NOT_DURABLE it refuses everything until reopened. It refuses to open over durable history with no state record.

Seams it would keep inside: (a) candidate realizer, where today a CPU Skill runs and where FORGE would plug in if Option A is chosen; (b) the contract check; (c) the durable store (J-Space); (d) the Cortex record writer; (e) the fault points that tests use (RXC_FP_*). The binder, verdict object and slot layout become private. This is largely what rx_compose.h already is, so the first step would be to rename and narrow it, not to rewrite it. The recovery rules (M05, M06, M12, M16) move with it unchanged.

Not decided here: whether open and recovery are part of the same module or a second one.

Note (2026-10-02): the phrase "where FORGE would plug in if Option A is chosen" in seam (a) is closed by the decision below. Option A was not chosen.

5. Decision for Drake (plain English) [CLOSED 2026-10-02: Option B chosen, see "Decision 2026-10-02" below]

Where things stand: the review found that the part of Omega that decides "this result is accepted and remembered" works as one well-guarded sequence, but the piece called FORGE, which the design documents describe as the thing that makes work real, is not part of that sequence. It exists in two places and neither runs when a result is accepted.

The decision: should FORGE be part of how a result is accepted?

Option A: wire FORGE into the path. Candidates would be produced through FORGE instead of through plain CPU procedures.

Option B: amend the doctrine so FORGE is only a memory policy inside J-Space. The documents would be changed to match the code.

Option C: leave as is. Keep the gap, with the known-gap line already in the receipt.

Separately, this note recommends doing the section 4 narrowing under any option, since it changes no behavior and makes the order easier to protect. That is an engineering suggestion, not part of this decision.

One question: do you want FORGE to be part of how Omega accepts a result (A), only a memory policy with the documents corrected (B), or to leave it for now (C)?

The options text above (A, B, C) is kept as the record of what was offered. Option B was chosen. Options A and C are closed.

Decision 2026-10-02

Drake chose Option B on 2026-10-02.