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-operator-emergency-stop.md

189 lines · 12332 bytes Raw Blame History Source

R16 G6: operator emergency stop (contract)

Status: runtime control IMPLEMENTED and host-tested; WIRED into the production R13 program with an outside operator entry point (docs/r16-operator-control.md, CAND-3 lane ESTOP). G6 item operator_emergency_controls_passing is operated only by execution: the host integration test make test-r16-operator-host and its mutants make test-r16-operator-mutants, plus the silicon run make test-r16-operator-silicon. It is not PASS until a silicon receipt from the candidate exists. See "Not done" at the end.

Source: src/runtime/rx_world.c (rx_world_emergency_stop, rx_world_emergency_resume, rx_world_set_halt_dir, rx_world_halt_status), src/runtime/rx_generation.c (rx_gen_promote mark check), src/runtime/rx_world.h (contract comment). Tests: make test-rx-emergency (tests/runtime/rx_emergency.c plus tests/runtime/rx_emergency_mutants.sh) and make test-r12 (t_emergency_stop in tests/runtime/rx_r12_resident.c).

1. What it is

One deterministic operator control over a running reaction world: stop (nothing new commits, nothing from outside publishes, no generation is proposed or promoted) and resume (the world continues from exactly the state it held, and the work the stop refused runs again). ADR 0016 §57: "Do not remove deterministic operator control." This is that control for the R16 world. It is not a kill switch for the process and not a rollback: the world's state is kept, not changed.

2. Authority

A stop or resume is accepted only when all three hold, checked under the world lock in this order:

  1. Caller credential. subject is enrolled (rx_world_enroll_caller) and cred passes the constant-time caller check (absent, unknown, revoked, stale and forged credentials are refused: RX_ERR_IDENTITY). This holds whether or not the world has bound its callers.
  2. Not a reaction. subject is not the subject of any reaction ever added to the world: no reaction can stop or resume the world it runs in (RX_ERR_AUTHORITY). ADR 0016 I9: intelligence cannot promote itself past authority policy; the same applies to pausing or un-pausing.
  3. Capability. cap is a live capability for subject on RX_WORLD_RES_CONTROL (0x906) with right RX_WORLD_RIGHT_HALT, validated by the world's authority (rx_caproot or the native Aienux authority). The right is RX_RIGHT_EPOCH: privileged, never delegable. The right that may void every capability may also pause the world. Wrong right, wrong resource, another subject's capability or a revoked capability: RX_ERR_AUTHORITY.

Authority is never a boolean anyone can set (ADR 0016 §57, "Do not encode authority as editable booleans"). w->halted is the world's state, written only by the two authorized calls and by restart restoration (§4). Every refused attempt leaves the world digest, the crumb log and the stop state unchanged (E1). A forged resume is refused before the world says whether it is stopped (E1).

3. What a stop does

Taken under mu then callers_mu (the C7 order), so work already committing finishes first, and nothing lands between the check and the state change.

PathUnder a stopEvidence
Workerstake no work (worker_main waits); resume broadcastsE3, mutant M2
An activation computing when the stop landsits result is refused at commit: CANCELLED, RX_ERR_HALTED, crumb; it is re-armed and runs again on resume, committing exactly onceE3, mutant M1
Outside publication (rx_world_publish_external)refused, RX_ERR_HALTED, world unchangedE2, E4, mutant M3
Resident seat result (rx_resident_accept)not published: the output window is re-projected from the world, the activation ends CANCELLED and runs again on resume; the claim closesR12 t_emergency_stop (manual mutant: removing the guard fails 5 checks)
Object create and retire (rx_world_create, rx_world_retire)refused, RX_ERR_HALTED, world unchanged (digest, crumbs)E7, mutants M11, M12
Sequential activation (rx_world_seq_activate_timed_locked)refused, RX_ERR_HALTEDcode review only
Caller check (rx_world_caller_check_fn)refuses with RX_CALLER_ERR_HALTED (CHECK and HOLD; RELEASE unaffected)E5, mutant M4
Generation store bound to the worldrx_gen_propose / rx_gen_promote refuse with RX_GEN_ERR_HALTED; a promotion is re-checked after its HOLD, right before the flip, so a stop during its live barrier or its disk writes refuses it; active generation unchanged in memory and on diskE5

A refused activation is not spent: it does not count toward the reaction's episode activation budget, so a reaction woken by another reaction's commit is not quarantined by its own refusal and does run on resume (E7, mutant M10; the same correction on the seat-result path is in code, covered by no test that sets a budget).

A second stop answers RX_HALT_ALREADY and changes nothing (E2). A resume of a running world answers RX_HALT_NOT_STOPPED, with no crumb (E1).

The stop is in force in memory before any disk work (mutant M9). Under racing publishers and two operators, the crumb log never shows an EXTERNAL or COMMIT between a STOP and its RESUME, each accepted stop has exactly one STOP crumb, and the chain verifies (E4).

4. Durability and restart

With rx_world_set_halt_dir(w, dir) set (normally the generation store's directory):

The mark is the durable stop state. The canonical evidence is the crumb log (OPERATOR_STOP and OPERATOR_RESUME crumbs, with the resume caused by its stop), per ADR 0016 §57 "Do not use text logs as canonical evidence". These two kinds have no Cortex kind and are not linked into Cortex (rx_cortex_record.c).

5. ADR 0016 invariants

InvariantHow the stop keeps it
I2 stale generations cannot mutate current statea refused activation re-runs on resume against the state then; the seat result path re-projects from the world
I4 revoked authority cannot executea revoked control capability or caller is refused (E1); the stop adds a refusal, never a permission
I6 concurrent publication cannot create torn objectsa stop is taken under the world lock; a commit either finishes before it or is refused whole (E3, E4)
I7 causal history for meaningful committed changesSTOP and RESUME are crumbs; refused activations leave CANCELLED crumbs with RX_ERR_HALTED
I8 generation recovery produces a coherent worldno promotion completes under a stop, including one already past its barrier (E5); restart restores the stop (E6)
I11 GPU failure cannot destroy durable identitya seat result under a stop is dropped and re-projected, never half-published (R12 t_emergency_stop)
I15 irreversible effects remain attributableevery stop, resume and refusal names its subject, capability and reason

6. Tests and what they prove

make test-rx-emergency (host CPU, real rx_caproot authority, worker pool, generation store; built with the normal flags; E1 to E6 in the file header):

make test-r12 t_emergency_stop (native Aienux authority, resident seat stand-in): a seat result that lands after the stop is refused, canonical B and B's window keep the world's value, the dependent does not run, no claim is posted under the stop; after resume the seat runs again and B = X + Y, C = X + Y + 1.

7. Not done

  1. Production wiring: DONE (CAND-3). The production R13 program sets the generation store's directory as the halt directory before any object exists, restores a durable stop before it accepts work, and serves an owner-only operator socket (src/runtime/rx_operator.c, client build/rx_operator). The interface contract is docs/r16-operator-control.md. The old string-presence check (rx_world_set_halt_dir text in the R13 source) is gone: the G6 item now needs the operator integration test, its mutants and the silicon run to pass. Found by the integration test and fixed with it: a durable promotion or proposal that the store refused because of a stop (RX_GEN_ERR_HALTED) was recorded as the final outcome, so the positive episode never promoted after the resume. src/runtime/rx_living.c now treats that refusal as "run again after the resume" (halted_wait).
  2. Silicon. The silicon run of the operator test (`make test-r16-operator-silicon`, resident GB10 seat, no SIGKILL phase) is the only chip evidence; until it has passed on the candidate the item is not PASS.
  3. Mark authenticity. The seal is an unkeyed sha256: it detects a damaged mark, not a forged one. A forged mark can only stop the world (fail closed). Removing the mark while no world runs bypasses the restart restoration; protecting the directory is the operating system's job and is not tested here.
  4. Outside executors. A stop does not reach a durable executor already performing an effect outside the world. Its result is not published until resume, and the effect stays attributable through its crumbs.
  5. Sequential activation under a stop is refused in code but has no test.
  6. Disk work under the locks. The stop writes its mark (fsync included) while holding the world lock and the caller lock. The stop is already in force in memory; a slow disk delays readers and caller checks for that time, never the stop itself.