Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
merged9bbb6eb838c1b3ca #1068 · opened 2026-11-07 05:59 UTC · closed 2026-11-15 14:36 UTC · merged 2026-11-15 14:36 UTC
Imported from GitHub aien-dev/omega-mv#1068, by drakestapleton
Base 81a70c069c3355d139583e30e076c6b565f5cd58 · Head fff99371908caef3f9e597901cd1cfefffe3684d
Merged on GitHub as fff99371908caef3f9e597901cd1cfefffe3684d; reachable from main c7acd2607139eedfabeac16b6042cefe8ede431f (observed 2026-11-18T16:35:37Z)
drakestapleton wrote on 2026-11-07 05:59 UTC
DRA-292 (Omega Node release lifecycle, durable results, release acceptance). Stacked on #1061 (DRA-291). Draft: not for merge by its author.
What changes
seed/node/release.sh (POSIX sh, no systemd): build OUT composes and compiles the six .om programs with this checkout's seed/out/omc; serve starts the own-model server; start, health, stop (durable pause, drain of running and review jobs, SIGTERM), restore (incarnation + 1, resume), unserve. Cutover and rollback by snapshot of root/ work/ journal/.
journal.om: record type 10 RESULT (objective, result, turns); a second RESULT for an objective, result 0, or index ≥ 64 is refused (25) before any write.
code.om: cw_end journals RESULT before printing; at restart an objective with a RESULT is reported again and never resumed (found by the acceptance run: a restart re-ran an objective that had ended UNKNOWN and issued a new replace). The uncertain-effect test hook waits until the job's START is durable (jn_started): a job is assigned before its proposal is decided and START journaled, and a kill in that window left ADMIT only, so the effect was not uncertain.
auth.omau_lost: a lost class-2 action (inference, no external effect) is recorded not performed (DONE how 6), as jn_settle does at restart; its objective asks again instead of ending 23.
op.om: omnode-op PORT health.
tests/release-accept.py: twelve scenarios against the real programs; fake (recorded round40 answers only) and live (own model) modes. Exits 0 only when every check passed, 3 when none failed but some were NOT_RUN, 1 on any failure. tests/view-accept.py: a vanished view or missing acknowledgement is a failed check instead of a raised TypeError.
journal-test.om case 16 (RESULT); proofs/Result.lean (RESULT finality and the lost-action rule, Lean 4 core).
Evidence
Host run (native AArch64, no GPU opened)
Head 63b422d8 (tree a0a26431, clean). Command: ~/work/omega-node-run.sh bash ~/work/omega-node-292.sh (cores 3, 7, 15 excluded). Receipt evidence/node/dra-292/receipt.73dfdb03….json: 70 PASS, 0 FAIL, 1 NOT_RUN; native_aarch64: NOT_RUN because release-accept fake mode left 3 checks NOT_RUN (below). Wall time 508 s.
Area
Result
Gates
transport, pool, sched, auth, journal (incl. case 16 RESULT), action: exit 0
Release build
release.sh build twice, six programs byte-identical; DRA-290 build from git archive 79894168 for compatibility
code-unit
57 checks, 16 code mutants killed at their pinned check
view-accept (DRA-291)
46/0; 12 view mutants killed (vm8 now through redirect-invalid-kind, redirect-run-passes, redirect-wrong-goal-unanswered)
release-accept fake
RELSUM pass=34 fail=0 not_run=3, exit 3
release mutants
rm0 baseline fail=0; rm1 RESULT not journaled → full-results-durable; rm2 RESULT not reported → full-results-durable; rm3 lost inference left UNKNOWN → worker-death-rerun
journal mutant
second RESULT accepted → journal gate exit 173
Lean
proofs/Result.lean, Lean 4.35.0: 6 theorems, axioms [propext] only; mutant dropping the "objective already has a result" refusal → exit 1, 2 errors
Release scenarios exercised in fake mode: four objectives with turn-for-turn equality to round40 and independent review; start/health/stop (durable pause, drain)/restore at incarnation 2; kill after replace with no duplicate effect on restart; conflict (15) with the other write kept; dead inference worker rerun (DONE how 6, then performed); uncertain effect (21) with START durable, final after restart; cancellation of a running inference (ended after 0.01 s, model saw 499); stale, burst and duplicate commands; server down (16); a second creator refused (exit 50: one active authority); journal forward old→new, rollback refused by the old reader on RESULT and OPER (exit 54), rollback from snapshot; address-space caps failing closed until 165312 kB.
Measured (fake model, so node overhead only): full scenario wall 2828 ms; peak RSS code-main 684 kB, infer 296 kB; VmPeak code-main 10332 kB, infer 8484 kB, tool 8388 kB.
NOT_RUN (3): restart-resumed-completes, journal-forward-completes, journal-rollback-completes. After a restart the resumed objective reads the file it edited (obj0 state=read sha256=5ba86dd62c934e98), a prompt no round40 recording holds, so fake-serve answers 404 and the objective ends 16. Live mode must answer it.
Live own-model run
PENDING: a host CPU own-model run (ollm serve, aien-train b5dd5042, round40 checkpoint, inside bwrap --unshare-net) is in progress; the GB10 gserve run waits for an authorized window. Until then this section is NOT_RUN.
Status
IMPLEMENTED; host EXERCISED (native AArch64). Fake mode is host regression with recorded answers, not model qualification. Live own-model: FILL. Not QUALIFIED on the Spark gate; not DEPLOYED (deployment waits for Drake).
Apply it
git checkout -b patch-9bbb6eb838c1b3ca81a70c069c3355d139583e30e076c6b565f5cd58
curl -fsSL https://interplane.io/drakestapleton/omega-mv/patches/9bbb6eb838c1b3ca.patch | git am
diff --git a/.crumb b/.crumb
index dba8f2e3c..852f5b4e1 100644
--- a/.crumb
+++ b/.crumb
@@ -108,14 +108,14 @@
}
],
"children_root": "sha256:966bedb54caa4209f9ab84526da66f6b13ce72e8831470170364eb5881355748",
- "compiled_at": "2026-11-07T04:46:27Z",
+ "compiled_at": "2026-11-07T05:59:13Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:44b95f0a61e131ea0e712697e2d29daf02d282cd3e35bf75b15ef4bf756d33b5",
- "evidence_files": 15699,
- "evidence_root": "sha256:8c8bb947da593feaee26338668383ff84a0fccb3d85b32e4e4e3676fedcb3c55",
- "files": 24263,
- "generated_at_commit": "8f2ec38bc88b6d5dafb26aff76e0b0c9bcfc6ed4",
- "source_tree": "sha256:776b18ccee7b22cfb64dba9f1c71b25fa3635fcb82e3d775c65f0b9cfc97f37b"
+ "digest": "sha256:e1b3023d519b5a545242b92acfba79c3affc255e34bbead4c6bb922e02ce2ccc",
+ "evidence_files": 15700,
+ "evidence_root": "sha256:e63faa1fbaebb8f3ac5dff3194567062738859a6fbc025aa8c5dffafe6e59bb4",
+ "files": 24267,
+ "generated_at_commit": "24280595258f66126fb7f4f148f80c58366291d4",
+ "source_tree": "sha256:4262a6f894f2881ce4ee861186391b515a1d0b68f0c75860368f91afbed781f7"
},
"owner_lane": "",
"provenance": {
diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md
index 4fabc14f2..25612baa9 100644
--- a/CONTRIBUTORS.md
+++ b/CONTRIBUTORS.md
@@ -14,6 +14,7 @@ The current development method is [Human-Directed Agentic Engineering (HDAE)](RE
| Claude Opus 5.5 (via omp) | DRA-289 for `seed/node`: `journal.om`, a checksummed append-only journal of every authority transition (OPEN, ADMIT, START, DONE, RELEASE, REVOKE, PAUSE, CANCEL), each checked by the recovery tables, written and fdatasync'd before anything acts on it or publishes it; a failed write or sync stops all later appends. `flock` fencing that forked workers also hold, fence numbers per creator incarnation, torn-tail cutting, refusal of corrupt records, other format versions and other objectives. Restart recovery settles operations left in flight (idempotent class 3 by its key, class 1 UNKNOWN and never rerun), releases or readmits each job, and restores authority generation and pause. `auth.om` journals through it and accepts class 3. `journal-gate.om` crashes real creators at every boundary, SIGKILLs them mid-tool and checks the result with its own reader; ten negative controls. Native AArch64 host evidence only; not QUALIFIED on the Spark gate. |
| Claude Opus 5.5 (via omp) | DRA-290 for `seed/node`: `code.om`, the coding workflow driving the own Omega model (round40 checkpoint, served by aien-train `ollm serve` `/v1/completions`, aien-train #76) through the Node's scheduler, authority and journal: one inference at a time, typed read/check/replace jobs and a review check, each a cancellable child process group, the round40 repair policy enforced by the creator before every grant, explicit failure reasons and no fallback provider. `infer.om`, a bounded loopback-only completion client returning a versioned record; `tool.om`, the read/check/replace tools inside one root with omagent's path rule (moved to `seed/agent/path.om`), durable replace and sandboxed tests; `gram.om`, the repair grammar. `code-test.om` (54 checks, 15 mutants), `tests/tool-replay.py` (all 108 recorded round40 runs) and live own-model runs with cancellation and crash restart. `seed/agent/agent.om` now kills the tool's whole process group; `seed/authority/action.om` renames a local so the node composes as OM-2. Native AArch64 host evidence only; not QUALIFIED on the Spark gate. |
| Claude Opus 5.5 (via omp) | DRA-291 for `seed/node`: `view.om`, the operator view: a shared page the creator writes each loop (seqlocked snapshot of authority, queue, commands, worker health, uncertain effects, objectives and limits, plus a 256-event ring versioned per journal incarnation) and a forked `.om` HTTP view process on 127.0.0.1 serving snapshots, deltas with resync, and a command mailbox; `op.om`, the operator client. `code.om` takes pause, resume, cancel, budget and redirect commands with staleness, incarnation and duplicate checks, commits them as OPER journal records (pause and resume through `auth_pause`) before acting, acknowledges committed state and replays them at restart; a tool job the authority refuses now ends its objective (23) instead of stranding it. `tests/fake-serve.om` and `tests/view-accept.py`: acceptance checks over nine real-process scenarios, an unmutated baseline and 12 mutants. Native AArch64 host evidence only; not QUALIFIED on the Spark gate. |
+| Claude Opus 5.5 (via omp) | DRA-292 for `seed/node`: `release.sh`, the POSIX release lifecycle (reproducible build of the six `.om` programs, own-model serve, start, health, stop through a durable pause and drain, restore at the next incarnation, cutover and rollback by workspace snapshot); objective results made durable (`journal.om` RESULT record type 10, refused when repeated; `code.om` reports a journaled result at restart and never resumes it, so a failed or UNKNOWN objective cannot issue its effect again); a lost inference worker recorded not performed (`auth.om`, class 2, as at restart) so its objective asks again instead of ending 23; the uncertain-effect test hook waits for a durable START; `omnode-op PORT health`. `tests/release-accept.py`: twelve scenarios against the real programs in fake mode (recorded answers only, NOT_RUN where a resumed objective needs an unrecorded prompt) and live own-model mode, with measured latency, RSS and address-space caps, an unmutated baseline and release mutants; journal gate case 16; `proofs/Result.lean` (Lean 4 model of RESULT finality and the lost-action rule). `view-accept.py` records a missing acknowledgement as a failed check instead of raising. Native AArch64 host evidence; the live GB10 run is separate. Not QUALIFIED. |
| Grok 4.7 (via Cursor Agent) | Merged main `fd3751b31` (#1020, carrying #1045 and #1050) into #1052. The only conflict was the generated root `.crumb` (child `last_commit` stamps, the `tests` digest, and the root digest). Recompiled with the crumb.lock tool (`d0f0b95d`); `crumb verify .` current. The #525/#962 pins were left as committed: `src/checker2/c2_check.c`, `src/compiler/osc_ir.c` and `src/compiler/osc_ir.h` still hash to the SHA-256s in `ACCEPTED`. |
| Claude Opus 5.5 (via omp) | #1020 (actions/cache-4.3.0 ->6.1.0): merged main `d3d1b1bc` and recompiled the root crumb with the crumb.lock tool (`d0f0b95d`). The root crumb's source tree covers `.github/workflows/`, so the bump alone left it stale and `AIEN Checks` failed at `crumb verify .` (`1 of 188 crumbs stale`). |
| Claude Opus 5.5 (via omp) | #1018 (actions/upload-artifact-4 ->7): merged main `d3d1b1bc` and recompiled the root crumb with the crumb.lock tool (`d0f0b95d`). The root crumb's source tree covers `.github/workflows/`, so the bump alone left it stale and `AIEN Checks` failed at `crumb verify .` (`1 of 188 crumbs stale`). |
diff --git a/evidence/node/dra-292/receipt.73dfdb0303029e60d0a8843d29d60f51eeecf407744d517fddc99b128947fad5.json b/evidence/node/dra-292/receipt.73dfdb0303029e60d0a8843d29d60f51eeecf407744d517fddc99b128947fad5.json
new file mode 100644
index 000000000..1c105697d
--- /dev/null
+++ b/evidence/node/dra-292/receipt.73dfdb0303029e60d0a8843d29d60f51eeecf407744d517fddc99b128947fad5.json
@@ -0,0 +1,315 @@
+{
+ "issue": "DRA-292",
+ "source_commit": "63b422d8abce9b31abb1c5cc70b4f8ec26610012",
+ "source_tree": "a0a264310154a2e8525f05c9fa04573d51e918dd",
+ "platform": "Linux 7.0.0-1019-nvidia aarch64 spark-b87b",
+ "cpu_affinity_mask_hex": "c00",
+ "execution": "NATIVE Linux AArch64 host CPU (DGX Spark host, no GPU opened); release-accept fake mode = recorded round40 answers only, host regression, not model qualification",
+ "timestamp_utc": "2026-11-07T05:58:59.387671+00:00",
+ "independent_review": false,
+ "native_aarch64": "NOT_RUN",
+ "executed_verdict": "PASS",
+ "not_run": [
+ "release-accept: NOT_RUN restart-resumed-completes fake-serve holds no recorded answer for ['obj0 state=read sha256=5ba86dd62c934e98']; live mode answers it. ['CWO 0 FAIL 16 5'] ",
+ "release-accept: NOT_RUN journal-forward-completes fake-serve holds no recorded answer for ['obj0 state=read sha256=5ba86dd62c934e98']; live mode answers it. ['CWO 0 FAIL 16 5'] ",
+ "release-accept: NOT_RUN journal-rollback-completes fake-serve holds no recorded answer for ['obj0 state=read sha256=5ba86dd62c934e98']; live mode answers it. ['CWO 0 FAIL 16 5'] ",
+ "NOT_RUN release-accept exit=3 RELSUM pass=34 fail=0 not_run=3 mode=fake (recorded answers only: host regression, not model qualification)"
+ ],
+ "spark_gate_judge": "NOT_RUN",
+ "live_hive": "NOT_DEPLOYED",
+ "script": "~/work/omega-node-292.sh (sha256 b0142e0b8ede5403b124db89c6ecc331ab5567e28d6474cd2644f0bb7132ea10): gates, reproducible release build, DRA-290 build from git archive 79894168, code/view/release/journal/Lean mutants, release-accept fake mode, tool controls; run via omega-node-run.sh (cores 3, 7, 15 excluded)",
+ "hashes": {
+ "seed/out/omc": "5f90edea61bac241398df5036990d899361a5acd9decb37954ce088ec0f6f6df",
+ "seed/node/auth-gate.om": "1bb49d9d619e85edae57eee34f85d558cd57586d0afd9f0fa31f434822d78d81",
+ "seed/node/auth.om": "785c0bebff7017f47daa8a0cebab4a279b69a09db9ab1a98009af1cd3ad133d1",
+ "seed/node/auth-test.om": "af66c87f83d73a5bdbaf181378eb69bb0645a86fe9b39de2f1b714041fbc20b8",
+ "seed/node/code-main.om": "8609a3be3fc2520fbcd0e576e672882f7dce3c3eac0f654d4e0e176648bdd6b5",
+ "seed/node/code.om": "1fdbe9d035a909ba879d71df515667f89f8edddc88f4e6e45d53630a9c4a1d28",
+ "seed/node/code-test.om": "1ab37f68181e9676f1bd45b4e9269aedbf3cb46e03e65e45e1fc3c3123d44130",
+ "seed/node/gram.om": "ebba1f4c693f218969dc2f17eb680760977d38d694ac76db477853aefa64b291",
+ "seed/node/infer.om": "8606f2bc917e7942033cf26355e72b92eae75b99c7b25e6f1ced953d8903ff4f",
+ "seed/node/journal-gate.om": "160328bde716a5fa680323ee2ea810e0e58b63c8fec23e0d198a6a556f9293e2",
+ "seed/node/journal.om": "46a8562983cd1e9c47fe0b373026de0f3f178a0bace0caea4383b588a3911926",
+ "seed/node/journal-test.om": "9b7db328e72f14443895dd1c479ca931abb7fd8a413429242a52b46ad36e15f1",
+ "seed/node/op.om": "cf0a6b0f9ec2f734901881f696f668d7a00e4f94223ba8407b5952af81b0a9e9",
+ "seed/node/pool-gate.om": "9354978875c6c3986d7bf0fa3977bf6e59e1fddebfd3fd3407083a4fc1a02339",
+ "seed/node/pool.om": "e7fba928bdc5c4194e7aee42109265de4f172d2b197946133d788b2dbcb30ccc",
+ "seed/node/pool-test.om": "7e18abdc5d0b377995e210aa336ba03a35d88af193d5387d5da3e8b0b6c01042",
+ "seed/node/sched-gate.om": "fbad2340b5dfb6cde909d922f153bbf5889ef4796500d31613462ac9b1d8385e",
+ "seed/node/sched.om": "9bd18158c0b574a9b7d22a54433157fb7216ab4f479c0dd12db2256870150b23",
+ "seed/node/sched-test.om": "29a3587d35a217403c63395eb2b11b4992727812af66512be3e452ea6381a545",
+ "seed/node/super.om": "d104ac8116c6df57fdc93f03791d7315e5b60875d8d6177480ef9967b6f53d5a",
+ "seed/node/tool.om": "49d8eb6a8e2c4ccec5cb28b11233b8ec9fe94165c897239739a1b668d12c9254",
+ "seed/node/transport-gate.om": "7f85aa57b064957734b8ab0a7b925390fcb50a9c657ba2bf08c26ce5b21377db",
+ "seed/node/transport.om": "d0dd69ef5e0b71294a2390b3526865d62ca07accd269b9ce57a028339e34f6da",
+ "seed/node/transport-test.om": "d00b22082c781c5300065faf321f9126a7801fc5b639dbfc47bd75798e5dbae9",
+ "seed/node/view.om": "1bc85c4ceec755f526b7ee88fdc49415ce70ee7549a0d1ff22a8e47229efd441",
+ "seed/node/release.sh": "dcd47a7d4dc6823868e222d23f1ab0e7d6667cce1e941232e0045f629dd38533",
+ "seed/node/proofs/Result.lean": "4764fbbf43821455a6e3c54b127c929d1c83f7a38861e52939422ecb12842c2e",
+ "seed/agent/agent.om": "84a595c27bf23b9562fc2ea7c97f0e2dce17a151ceb28c7928be5adebef1dbce",
+ "seed/agent/path.om": "1daef7e888e45f7cd7f2f8bb1ea34bc061115c261aac3740f3c799803f7079b2",
+ "seed/authority/action.om": "59cb9c3dfdcd9193bc4a272deda4fcd256a0d7693f3bcb58bc4e30ed78faab2b",
+ "seed/authority/action-gate.om": "716761cfee0af722586def0a0e06342bd0d4a8482c64ef75aeb0e92eae21e604",
+ "seed/node/tests/release-accept.py": "aad117dbb2d1e1e1571c6169e51b5fd925c2868eb91c36ec795115ab146c1315",
+ "seed/node/tests/tool-replay.py": "e220595d7912f3d0219825befc227284dc5782cb969f1f06cc969b6c3251db86",
+ "seed/node/tests/view-accept.py": "9ab5667872ca96a67b5825bcda069de684a48d4454c07761a51cae7cfdba1471",
+ "seed/node/tests/view-prep.py": "961ceb99c41b76f8f38b52148f37de98606ce65300cae6affd475c92e5f0c75b",
+ "seed/node/tests/fake-serve.om": "e9b2b09b634d5dba7d35712811db475ffcd59f4530dc87e7557fe6b2afb30a5f",
+ "seed/net/http.om": "7bf2aa428b6c2f4524ac97a6f372434230a530cf2e15844cd393abe4f7ea141a",
+ "seed/net/notls.om": "f6d30fb97893b795338a447ada6be447755250c4a9d479c4a019ac7d8ee166eb",
+ "/home/drakestapleton/work/omega-node-e5b3/seed/out/omc": "2c82480596bbdc50cda9626866209ef662d5834f278f839ff4ce0250c495029f"
+ },
+ "checks": [
+ {
+ "case": "transport-gate",
+ "compile_exit": 0,
+ "expected_exit": "0",
+ "run_exit": 0,
+ "wall_ms": 14,
+ "stdout": "PASS node transport\n",
+ "binary_sha256": "470aefe90345217aa16e9d6ac1de16b8db59566436b842c7a01cbaeee7812234",
+ "verdict": "PASS",
+ "leaked_tool_processes_after_run": 0
+ },
+ {
+ "case": "pool-gate",
+ "compile_exit": 0,
+ "expected_exit": "0",
+ "run_exit": 0,
+ "wall_ms": 5208,
+ "stdout": "stress rolls=2000 busy=6666268 reads=62058 62312\nPASS node pool\n",
+ "binary_sha256": "afd1063c4e534ade5e798cd1b2ef576873ad51eab9d7a4c6a5a73f8b8c3ef5b4",
+ "verdict": "PASS",
+ "leaked_tool_processes_after_run": 0
+ },
+ {
+ "case": "sched-gate",
+ "compile_exit": 0,
+ "expected_exit": "0",
+ "run_exit": 0,
+ "wall_ms": 8024,
+ "stdout": "idle ticks workers=0 creator=0 wake rounds=200 mean_us=44 max_us=488\nPASS node sched\n",
+ "binary_sha256": "68b835c0821b44582adbc08fdfdb3049531075699d7841f3df288e28098b0abb",
+ "verdict": "PASS",
+ "leaked_tool_processes_after_run": 0
+ },
+ {
+ "case": "auth-gate",
+ "compile_exit": 0,
+ "expected_exit": "0",
+ "run_exit": 0,
+ "wall_ms": 778,
+ "stdout": "PASS node authority\n",
+ "binary_sha256": "bca9d2e3deafdb86432cec63eb5cd54afd18c1d583350a4dcdffe449568c15df",
+ "verdict": "PASS",
+ "leaked_tool_processes_after_run": 0
+ },
+ {
+ "case": "journal-gate",
+ "compile_exit": 0,
+ "expected_exit": "0",
+ "run_exit": 0,
+ "wall_ms": 3321,
+ "stdout": "PASS node journal\n",
+ "binary_sha256": "d0c18a16b52fb184c039d5b300718e2825824a6198da5bc4d0efc6b1a6cfdeed",
+ "verdict": "PASS",
+ "leaked_tool_processes_after_run": 0
+ },
+ {
+ "case": "action-gate",
+ "compile_exit": 0,
+ "expected_exit": "0",
+ "run_exit": 0,
+ "wall_ms": 2,
+ "stdout": "action checks=219 000\n",
+ "binary_sha256": "f56e5696dfcfc8a16430147db176eb5b6568ec794fd3de9303f9dcd505f246aa",
+ "verdict": "PASS",
+ "leaked_tool_processes_after_run": 0
+ }
+ ],
+ "results": [
+ "PASS transport-gate compile=0 exit=0 want=0 ms=14 bin=470aefe90345217a leaked_tools=0 stdout=PASS node transport ",
+ "PASS pool-gate compile=0 exit=0 want=0 ms=5208 bin=afd1063c4e534ade leaked_tools=0 stdout=stress rolls=2000 busy=6666268 reads=62058 62312 PASS node pool ",
+ "PASS sched-gate compile=0 exit=0 want=0 ms=8024 bin=68b835c0821b4458 leaked_tools=0 stdout=idle ticks workers=0 creator=0 wake rounds=200 mean_us=44 max_us=488 PASS node sched ",
+ "PASS auth-gate compile=0 exit=0 want=0 ms=778 bin=bca9d2e3deafdb86 leaked_tools=0 stdout=PASS node authority ",
+ "PASS journal-gate compile=0 exit=0 want=0 ms=3321 bin=d0c18a16b52fb184 leaked_tools=0 stdout=PASS node journal ",
+ "PASS action-gate compile=0 exit=0 want=0 ms=2 bin=f56e5696dfcfc8a1 leaked_tools=0 stdout=action checks=219 000 ",
+ "PASS release-build exit=0 6 programs",
+ " BUILD_OK infer 132576 8cc5fb3044c9c794326e66b57aac7c6889c5cf498f4750503637d97505c1f806",
+ " BUILD_OK tool 34396 a1bdecb08c74f89ddbd2bd674b224d21ed2a983268964972dd8f8ee701aa1c8d",
+ " BUILD_OK code-main 245436 272c4ceade0af4d6a9014bbec18fe60ce3c86ab99cba988538bf57e9d8c32871",
+ " BUILD_OK code-test 269948 bbc9690da6efbec262a1de1a5b53feb7e1a620571c1adf4cb17a08312779b97b",
+ " BUILD_OK op 69160 69d2ec67e6d52f6ddf5c1cc81637a9f25b9f7f80e21e4167664d4da6fef00695",
+ " BUILD_OK fake-serve 71808 9397ef1ff5e2250e60109fd51edc009e01ed0c5662176701bbaa84d3735b1a87",
+ " omc 5f90edea61bac241398df5036990d899361a5acd9decb37954ce088ec0f6f6df",
+ "PASS release-build-reproducible second build byte-identical: infer 8cc5fb3044c9c794326e66b57aac7c6889c5cf498f4750503637d97505c1f806 tool a1bdecb08c74f89ddbd2bd674b224d21ed2a983268964972dd8f8ee701aa1c8d code-main 272c4ceade0af4d6a9014bbec18fe60ce3c86ab99cba988538bf57e9d8c32871 code-test bbc9690da6efbec262a1de1a5b53feb7e1a620571c1adf4cb17a08312779b97b op 69d2ec67e6d52f6ddf5c1cc81637a9f25b9f7f80e21e4167664d4da6fef00695 fake-serve 9397ef1ff5e2250e60109fd51edc009e01ed0c5662176701bbaa84d3735b1a875f90edea61bac241398df5036990d899361a5acd9decb37954ce088ec0f6f6df ",
+ "old-build 798941688cc5fb3044c9c794a1bdecb08c74f89d6071fa6c28e12aa7 ",
+ "PASS code-unit exit=0 code checks=57 fail=0",
+ "PASS mutant cm1_path_unchecked exit=154 want=154 (killed)",
+ "PASS mutant cm2_old_not_once exit=103 want=103 (killed)",
+ "PASS mutant cm3_grammar_unchecked exit=162 want=162 (killed)",
+ "PASS mutant cm4_unverified_pass exit=168 want=168 (killed)",
+ "PASS mutant cm5_check_content exit=181 want=181 (killed)",
+ "PASS mutant cm6_exit_ignored exit=192 want=192 (killed)",
+ "PASS mutant cm7_turn_limit exit=202 want=202 (killed)",
+ "PASS mutant cm8_saved_unchecked exit=186 want=186 (killed)",
+ "PASS mutant cm9_notfound_any_state exit=171 want=171 (killed)",
+ "PASS mutant cm10_replace_any_state exit=157 want=157 (killed)",
+ "PASS mutant cm11_goal_text exit=151 want=151 (killed)",
+ "PASS mutant cm12_record_length exit=174 want=174 (killed)",
+ "PASS mutant cm13_cancel_unknown exit=197 want=197 (killed)",
+ "PASS mutant cm14_missing_as_read exit=178 want=178 (killed)",
+ "PASS mutant cm15_prompt_too_long exit=203 want=203 (killed)",
+ "PASS mutant cm16_tool_refusal_strands exit=206 want=206 (killed)",
+ "view-accept: PASS full-view-up port=34551",
+ "view-accept: PASS full-snapshot rc=0 v=0 objs=4",
+ "view-accept: PASS full-run rc=0 CWSUM pass=4 fail=0",
+ "view-accept: PASS full-delta-stream gone=30 kinds=['delta'] gaps=0 job-events=87/87",
+ "view-accept: PASS full-view-stopped port=34551",
+ "view-accept: PASS resync-delta-from-0 v=4 n=4",
+ "view-accept: PASS resync-other-incarnation kind=snapshot",
+ "view-accept: PASS resync-future-since kind=snapshot",
+ "view-accept: PASS op-usage-control rc=2",
+ "view-accept: PASS cmd-stale-409 rc=1 {'id': 11, 'status': 'stale', 'version': 7, 'journal_seq': 11, 'incarnation': 1}",
+ "view-accept: PASS cmd-invalid-budget rc=1 {'id': 12, 'status': 'invalid', 'version': 7, 'journal_seq': 11, 'incarnation': 1}",
+ "view-accept: PASS cmd-other-incarnation rc=1 {'id': 13, 'status': 'stale', 'version': 7, 'journal_seq': 0, 'incarnation': 1}",
+ "view-accept: PASS cmd-budget-committed id=14 {'id': 14, 'status': 'committed', 'version': 8, 'journal_seq': 12, 'incarnation': 1}",
+ "view-accept: PASS cmd-budget-visible budget=6 last=14",
+ "view-accept: PASS cmd-duplicate-ack {'id': 14, 'status': 'duplicate', 'version': 8, 'journal_seq': 12, 'incarnation': 1}",
+ "view-accept: PASS cmd-pause {'id': 40, 'status': 'committed', 'version': 9, 'journal_seq': 14, 'incarnation': 1}",
+ "view-accept: PASS cmd-pause-duplicate-version {'id': 40, 'status': 'duplicate', 'version': 9, 'journal_seq': 14, 'incarnation': 1} original=9",
+ "view-accept: PASS cmd-pause-again-invalid {'id': 41, 'status': 'invalid', 'version': 10, 'journal_seq': 14, 'incarnation': 1}",
+ "view-accept: PASS cmd-paused-holds auth={'generation': 1, 'paused': 1, 'journal_seq': 17, 'journal_failed': 0, 'fence': 1, 'version': 10} queue={'waiting': 0, 'ready': 1, 'running': 0, 'review': 0, 'unknown': 0, 'limit': 8, 'review_limit': 8, 'refused': 0}",
+ "view-accept: PASS cmd-resume {'id': 42, 'status': 'committed', 'version': 14, 'journal_seq': 19, 'incarnation': 1}",
+ "view-accept: PASS cmd-run-completes rc=0 CWSUM pass=1 fail=0",
+ "view-accept: PASS cancel-committed {'id': 60, 'status': 'committed', 'version': 2, 'journal_seq': 5, 'incarnation': 1}",
+ "view-accept: PASS cancel-objective-19 ['CWO 0 FAIL 19 1', 'CWO 1 PASS 1 2'] after 0.0s",
+ "view-accept: PASS cancel-other-objective-passes rc=1 CWSUM pass=1 fail=1",
+ "view-accept: PASS redirect-committed {'id': 80, 'status': 'committed', 'version': 2, 'journal_seq': 5, 'incarnation': 1}",
+ "view-accept: PASS redirect-visible {'kind': 3, 'k': 4, 'n': 3, 'a': 70, 'state': 0, 'turns': 1, 'budget': 7, 'phase': 1, 'job': 1001, 'result': 0, 'version': 2, 'redirect': 1, 'cancel': 0, 'seq': 1}",
+ "view-accept: PASS redirect-invalid-kind {'id': 99, 'status': 'invalid', 'version': 3, 'journal_seq': 6, 'incarnation': 1}",
+ "view-accept: PASS redirect-run-passes rc=0 CWSUM pass=1 fail=0",
+ "view-accept: PASS redirect-wrong-goal-unanswered ['F 404 999 2000', 'F 200 0 2000']",
+ "view-accept: PASS budget-committed {'id': 120, 'status': 'committed', 'version': 2, 'journal_seq': 4, 'incarnation': 1}",
+ "view-accept: PASS budget-ends-12 ['CWO 0 FAIL 12 2']",
+ "view-accept: PASS overload-view-up port=44607",
+ "view-accept: PASS overload-refusals-visible refused=31 limit=1",
+ "view-accept: PASS overload-command-commits {'id': 140, 'status': 'committed', 'version': 8, 'journal_seq': 12, 'incarnation': 1}",
+ "view-accept: PASS overload-run-completes rc=0 CWSUM pass=3 fail=0",
+ "view-accept: PASS uncertain-listed uncertain=[1054]",
+ "view-accept: PASS uncertain-event [[30, 7, 0, 0, 1054, 0]]",
+ "view-accept: PASS uncertain-objective-21 ['CWO 0 FAIL 21 3', 'CWO 1 PASS 1 5', 'CWO 2 PASS 1 3']",
+ "view-accept: PASS uncertain-after-restart started=True inc=2 uncertain=[1054]",
+ "view-accept: PASS crash-commands-committed {200: {'id': 200, 'status': 'committed', 'version': 2, 'journal_seq': 5, 'incarnation': 1}, 201: {'id': 201, 'status': 'committed', 'version': 4, 'journal_seq': 6, 'incarnation': 1}}",
+ "view-accept: PASS crash-view-exits-with-creator port=50067",
+ "view-accept: PASS crash-oper-replayed inc=2 cmds={'committed': 2, 'refused': 0, 'last_id': 201} r1=19 b0=6",
+ "view-accept: PASS crash-old-client-resyncs kind=snapshot",
+ "view-accept: PASS crash-duplicate-after-restart {'id': 200, 'status': 'duplicate', 'version': 2, 'journal_seq': 12, 'incarnation': 2}",
+ "view-accept: PASS crash-cancel-finished-invalid {'id': 1200, 'status': 'invalid', 'version': 2, 'journal_seq': 12, 'incarnation': 2}",
+ "view-accept: PASS crash-run2-results rc=1 ['CWO 1 FAIL 19 0', 'CWO 0 PASS 1 5']",
+ "PASS view-accept exit=0 VIEWSUM pass=46 fail=0",
+ "PASS vmutant vm0_baseline scenario=all killed-by=none VIEWSUM pass=46 fail=0 failing: ",
+ "PASS vmutant vm1_no_stale_check scenario=commands killed-by=cmd-stale-409 VIEWSUM pass=10 fail=2 failing: cmd-stale-409 cmd-duplicate-ack ",
+ "PASS vmutant vm2_no_duplicate_check scenario=commands killed-by=cmd-duplicate-ack VIEWSUM pass=10 fail=2 failing: cmd-duplicate-ack cmd-pause-duplicate-version ",
+ "PASS vmutant vm3_no_oper_replay scenario=crash killed-by=crash-oper-replayed VIEWSUM pass=6 fail=1 failing: crash-oper-replayed ",
+ "PASS vmutant vm4_no_uncertain_event scenario=uncertain killed-by=uncertain-event VIEWSUM pass=3 fail=1 failing: uncertain-event ",
+ "PASS vmutant vm5_delta_off_by_one scenario=resync killed-by=resync-delta-from-0 VIEWSUM pass=3 fail=1 failing: resync-delta-from-0 ",
+ "PASS vmutant vm6_no_incarnation_check scenario=commands killed-by=cmd-other-incarnation VIEWSUM pass=11 fail=1 failing: cmd-other-incarnation ",
+ "PASS vmutant vm7_pause_only_recorded scenario=commands killed-by=cmd-paused-holds VIEWSUM pass=9 fail=3 failing: cmd-pause-again-invalid cmd-paused-holds cmd-resume ",
+ "PASS vmutant vm8_redirect_ends_job scenario=redirect killed-by=redirect-run-passes VIEWSUM pass=2 fail=3 failing: redirect-invalid-kind redirect-run-passes redirect-wrong-goal-unanswered ",
+ "PASS vmutant vm9_budget_ignored scenario=budget killed-by=budget-ends-12 VIEWSUM pass=1 fail=1 failing: budget-ends-12 ",
+ "PASS vmutant vm10_refusals_uncounted scenario=overload killed-by=overload-refusals-visible VIEWSUM pass=2 fail=2 failing: overload-refusals-visible overload-command-commits ",
+ "PASS vmutant vm11_ack_current_version scenario=commands killed-by=cmd-pause-duplicate-version VIEWSUM pass=11 fail=1 failing: cmd-pause-duplicate-version ",
+ "PASS vmutant vm12_view_outlives_creator scenario=crash killed-by=crash-view-exits-with-creator VIEWSUM pass=6 fail=1 failing: crash-view-exits-with-creator ",
+ "release-accept: PASS full-view-up port=37533",
+ "release-accept: PASS full-4-objectives rc=0 ['CWSUM pass=4 fail=0'] ['CWO 1 PASS 1 2', 'CWO 0 PASS 1 5', 'CWO 2 PASS 1 5', 'CWO 3 PASS 1 3']",
+ "release-accept: PASS full-turns-equal-recorded all prompts and model texts equal round40",
+ "release-accept: PASS full-journal-once records=120 opens=1 ops=29 max_starts=1",
+ "release-accept: PASS full-view-stream gaps=0 kinds=['delta', 'snapshot'] last_version=91",
+ "release-accept: PASS full-independent-review objectives checked=[0, 2, 3] reviewed=[0, 2, 3] (a \"File not found.\" answer has no check)",
+ "release-accept: MEASURED full-latency {\"requests\": 0, \"answered\": 0, \"model_ms\": 0, \"completion_tokens\": 0, \"ms_per_token\": null, \"wall_ms\": 2828, \"node_ms\": 2828}",
+ "release-accept: MEASURED full-peak-rss-kB {\"code-main\": 684, \"infer\": 296}",
+ "release-accept: PASS full-results-durable rc=0 ['CWO 0 PASS 1 5', 'CWO 1 PASS 1 2', 'CWO 2 PASS 1 5', 'CWO 3 PASS 1 3'] new_records=[1, 5] model_requests=0",
+ "release-accept: MEASURED full-seconds 3.2",
+ "release-accept: PASS lifecycle-start node pid 369599 view 41985 incarnation 1 version 1",
+ "release-accept: PASS lifecycle-health model 5 node 0 incarnation 1 running 1 journal_failed 0",
+ "release-accept: PASS lifecycle-stop rc=0 gone=True queue={'waiting': 0, 'ready': 2, 'running': 0, 'review': 0, 'unknown': 0, 'limit': 8, 'review_limit': 8, 'refused': 0} {\"id\":4030848297761,\"status\":\"committed\",\"version\":8,\"journal_seq\":13,\"incarnation\":1}",
+ "release-accept: stopped pid 369599 running 0 waiting 0 ready 2",
+ "release-accept: PASS lifecycle-restore rc=0 inc=2 paused=0",
+ "release-accept: PASS lifecycle-journal-once opens=2 max_starts=1",
+ "release-accept: PASS lifecycle-finish ['CWO 1 PASS 1 3', 'CWO 0 PASS 1 6'] ['CWSUM pass=2 fail=0']",
+ "release-accept: MEASURED lifecycle-seconds 16.1",
+ "release-accept: PASS restart-no-duplicate-effect killed_after_replace=True run1=[] run2 rc=1 opens=2 max_starts=1 replace_dones=[[(2, 1)]]",
+ "release-accept: NOT_RUN restart-resumed-completes fake-serve holds no recorded answer for ['obj0 state=read sha256=5ba86dd62c934e98']; live mode answers it. ['CWO 0 FAIL 16 5'] ",
+ "release-accept: MEASURED restart-seconds 2.2",
+ "release-accept: PASS conflict-detected-15 read_done=True ['CWO 0 FAIL 15 2']",
+ "release-accept: PASS conflict-other-write-kept kept=True replace_starts=0",
+ "release-accept: MEASURED conflict-seconds 0.9",
+ "release-accept: PASS worker-death-rerun killed_worker=379162 rc=0 ['CWO 0 PASS 1 5'] lost_ops(DONEs outcome,how)={(1001, 1, 1, 1): [(1, 6), (2, 1)]} starts=[2]",
+ "release-accept: PASS worker-death-turns-equal-recorded equal",
+ "release-accept: MEASURED worker-seconds 24.4",
+ "release-accept: PASS uncertain-objective-21 uncertain=[1054] ['CWO 0 FAIL 21 3', 'CWO 1 PASS 1 5', 'CWO 2 PASS 1 3']",
+ "release-accept: PASS uncertain-start-durable op=[(1054, 4, 1, 1)] starts=[1] done(outcome,how)=[(0, 2)]",
+ "release-accept: PASS uncertain-final-after-restart run2 ['CWO 0 FAIL 21 3', 'CWO 1 PASS 1 5', 'CWO 2 PASS 1 3'] new_records=[1, 5, 5] released_outcome=[0]",
+ "release-accept: MEASURED uncertain-seconds 4.3",
+ "release-accept: PASS cancel-running-inference ack={'id': 60, 'status': 'committed', 'version': 2, 'journal_seq': 5, 'incarnation': 1} ended_after_s=0.01 ['CWO 0 FAIL 19 1', 'CWO 1 PASS 1 2'] model_499=['n/a: fake-serve']",
+ "release-accept: MEASURED cancel-seconds 18.3",
+ "release-accept: PASS commands-future-version-stale {'id': 300, 'status': 'stale', 'version': 1, 'journal_seq': 3, 'incarnation': 1}",
+ "release-accept: PASS commands-burst-each-answered-once statuses={'committed': 2, 'stale': 2} committed_versions=[2, 3]",
+ "release-accept: PASS commands-repost-duplicate [{'id': 310, 'status': 'duplicate', 'version': 2, 'journal_seq': 5, 'incarnation': 1}, {'id': 311, 'status': 'duplicate', 'version': 3, 'journal_seq': 5, 'incarnation': 1}]",
+ "release-accept: PASS commands-run-completes rc=0 ['CWO 1 PASS 1 2', 'CWO 0 PASS 1 5'] oper_records=2",
+ "release-accept: MEASURED commands-seconds 11.1",
+ "release-accept: PASS server-down-16 rc=1 ['CWO 0 FAIL 16 1']",
+ "release-accept: MEASURED down-seconds 0.3",
+ "release-accept: PASS one-active-authority second rc=50 err=b'' first ['CWO 0 PASS 1 5'] opens=1",
+ "release-accept: MEASURED authority-seconds 8.0",
+ "release-accept: PASS journal-forward-old-to-new old killed after its replace=True; new rc=1 opens=2 max_starts=1 result_records=1",
+ "release-accept: NOT_RUN journal-forward-completes fake-serve holds no recorded answer for ['obj0 state=read sha256=5ba86dd62c934e98']; live mode answers it. ['CWO 0 FAIL 16 5'] ",
+ "release-accept: PASS journal-result-after-upgrade ['CWO 0 FAIL 16 5'] new_records=[1, 5]",
+ "release-accept: PASS journal-rollback-refuses-result old rc=54 (30 + 24 unknown record type) unchanged=True",
+ "release-accept: PASS journal-rollback-from-snapshot rc=1 opens=2 max_starts=1",
+ "release-accept: NOT_RUN journal-rollback-completes fake-serve holds no recorded answer for ['obj0 state=read sha256=5ba86dd62c934e98']; live mode answers it. ['CWO 0 FAIL 16 5'] ",
+ "release-accept: PASS journal-rollback-refuses-oper ack=committed oper=1 old rc=54 unchanged=True",
+ "release-accept: MEASURED journal-seconds 2.0",
+ "release-accept: MEASURED memory-peak-kB {\"VmHWM\": {\"code-main\": 660, \"infer\": 296, \"tool\": 76}, \"VmPeak\": {\"code-main\": 10332, \"infer\": 8484, \"tool\": 8388}, \"sampled_every_ms\": 5}",
+ "release-accept: MEASURED memory-caps [{\"as_kB\": 5166, \"rc\": -11, \"out\": [], \"journal\": false, \"max_starts\": null}, {\"as_kB\": 10332, \"rc\": 1, \"out\": [\"CWO 0 FAIL 17 2\"], \"journal\": true, \"max_starts\": 1}, {\"as_kB\": 20664, \"rc\": 1, \"out\": [\"CWO 0 FAIL 17 2\"], \"journal\": true, \"max_starts\": 1}, {\"as_kB\": 41328, \"rc\": 1, \"out\": [\"CWO 0 FAIL 17 2\"], \"journal\": true, \"max_starts\": 1}, {\"as_kB\": 82656, \"rc\": 1, \"out\": [\"CWO 0 FAIL 16 3\"], \"journal\": true, \"max_starts\": 1}, {\"as_kB\": 165312, \"rc\": 0, \"out\": [\"CWO 0 PASS 1 5\"], \"journal\": true, \"max_starts\": 1}]",
+ "release-accept: PASS memory-caps-fail-closed-then-pass smallest passing as_kB=165312 after 5 failing caps, each explicit with a consistent journal",
+ "release-accept: MEASURED memory-seconds 4.7",
+ "NOT_RUN release-accept exit=3 RELSUM pass=34 fail=0 not_run=3 mode=fake (recorded answers only: host regression, not model qualification)",
+ "PASS rmutant rm0_baseline scenario=all killed-by=none RELSUM pass=34 fail=0 not_run=3 mode=fake (recorded answers only: host regression, not model qualification) failing: ",
+ "PASS rmutant rm1_result_not_journaled scenario=full killed-by=full-results-durable RELSUM pass=6 fail=1 not_run=0 mode=fake (recorded answers only: host regression, not model qualification) failing: full-results-durable ",
+ "PASS rmutant rm2_result_not_reported scenario=full killed-by=full-results-durable RELSUM pass=6 fail=1 not_run=0 mode=fake (recorded answers only: host regression, not model qualification) failing: full-results-durable ",
+ "PASS rmutant rm3_lost_infer_unknown scenario=worker killed-by=worker-death-rerun RELSUM pass=0 fail=2 not_run=0 mode=fake (recorded answers only: host regression, not model qualification) failing: worker-death-rerun worker-death-turns-equal-recorded ",
+ "PASS mutant jr-second-result compile=0 exit=173 want=173 ms=3254 bin=01bc42d8e145623b leaked_tools=0 stdout=",
+ "PASS tool-replay TOOL-REPLAY runs=108 pass=108 fail=0 actions=417",
+ "PASS tool-dotdot got=s2 want=s2 ms=6 leaked=0 record=OMNT1 2 13 0|Path refused.",
+ "PASS tool-absolute got=s2 want=s2 ms=3 leaked=0 record=OMNT1 2 13 0|Path refused.",
+ "PASS tool-final-symlink got=s2 want=s2 ms=4 leaked=0 record=OMNT1 2 13 0|Path refused.",
+ "PASS tool-dir-symlink got=s2 want=s2 ms=2 leaked=0 record=OMNT1 2 13 0|Path refused.",
+ "PASS tool-missing got=s1 want=s1 ms=3 leaked=0 record=OMNT1 1 15 0|File not found.",
+ "PASS tool-over-3800 got=s3 want=s3 ms=3 leaked=0 record=OMNT1 3 24 0|File is over 3800 bytes.",
+ "PASS tool-read got=s0 want=s0 ms=3 leaked=0 record=OMNT1 0 15 75|Read succeeded.fn calc x int to int|ret add x int 3|end|fn main to int|ret calc int 5|",
+ "PASS tool-old-twice got=s5 want=s5 ms=2 leaked=0 record=OMNT1 5 33 75|Old text must occur exactly once.fn calc x int to int|ret add x int 3|end|fn main to i",
+ "PASS tool-old-empty got=s5 want=s5 ms=3 leaked=0 record=OMNT1 5 33 0|Old text must occur exactly once.",
+ "PASS tool-replace got=s0 want=s0 ms=15 leaked=0 record=OMNT1 0 11 75|Edit saved.fn calc x int to int|ret add x int 2|end|fn main to int|ret calc int 5|end|",
+ "PASS tool-check-pass got=s0 want=s0 ms=33 leaked=0 record=OMNT1 0 13 75|Tests passed.fn calc x int to int|ret add x int 2|end|fn main to int|ret calc int 5|en",
+ "PASS tool-check-wrong-k got=s6 want=s6 ms=14 leaked=0 record=OMNT1 6 39 75|Test failed: calc(5) expected 7, got 8.fn calc x int to int|ret add x int 3|end|fn mai",
+ "PASS tool-check-main got=s6 want=s6 ms=7 leaked=0 record=OMNT1 6 39 76|main must preserve the requested input.fn calc x int to int|ret add x int 2|end|fn mai",
+ "PASS tool-check-dup got=s6 want=s6 ms=9 leaked=0 record=OMNT1 6 21 116|omc: line 7: error 10fn calc x int to int|ret add x int 2|end|fn main to int|ret calc",
+ "PASS tool-check-no-end got=s6 want=s6 ms=8 leaked=0 record=OMNT1 6 21 71|omc: line 6: error 15fn calc x int to int|ret add x int 2|end|fn main to int|ret calc ",
+ "PASS tool-check-no-loop got=s6 want=s6 ms=9 leaked=0 record=OMNT1 6 22 75|Required loop missing.fn calc x int to int|ret add x int 2|end|fn main to int|ret calc",
+ "PASS tool-argc got=x2 want=x2 ms=3 leaked=0 record=",
+ "PASS tool-verb got=x2 want=x2 ms=3 leaked=0 record=",
+ "PASS tool-relative-work got=s4 want=s4 ms=3 leaked=0 record=OMNT1 4 10 0|I/O error.",
+ "PASS tool-slow-omc got=s4 want=s4 ms=10011 leaked=0 record=OMNT1 4 10 75|I/O error.fn calc x int to int|ret add x int 2|end|fn main to int|ret calc int 5|end|",
+ "PASS tool-replace-durable-no-temp a.om big.om dup.om e.om l.om ok.om syn.om z.om ",
+ "PASS agent-check exit=0 AGENT-CHECK PASS cases=35 mutants=9",
+ "PASS lean-result-model exit=0 Lean (version 4.35.0 theorems_propext_only=6",
+ "PASS mutant lean-second-result-allowed exit=1 errors=2 (killed)",
+ "PASS tree-unchanged-during-run",
+ "PASS count 70",
+ "FAIL count 0",
+ "NOT_RUN count 1"
+ ],
+ "repeat": null
+}
diff --git a/seed/node/.crumb b/seed/node/.crumb
index 4abde528c..012d373d1 100644
--- a/seed/node/.crumb
+++ b/seed/node/.crumb
@@ -3,14 +3,14 @@
"generated": {
"children": [],
"children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
- "compiled_at": "2026-11-07T04:35:31Z",
+ "compiled_at": "2026-11-07T05:50:15Z",
"compiler": "crumb-compile/1",
- "digest": "sha256:8ca7003bde1508c44228b3330ba09e3766f8d2e4290c331e51ffe34fb34e699d",
+ "digest": "sha256:e659cc80889aabe71c567926f1c03a49ac8be2100741357bcdec656038c9a87c",
"evidence_files": 0,
"evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855",
- "files": 29,
- "generated_at_commit": "a3360715db220521a2a6d4ed50295d7884e0e3d6",
- "source_tree": "sha256:4c149502f2c978cbd9d23e6e45a0bf798dbada7c685eca78fe6bbc0d8fb08933"
+ "files": 32,
+ "generated_at_commit": "a4b669903abf63ea631e753d27c225be14902ed2",
+ "source_tree": "sha256:e8a620a647445da6f7b12eb6e9f6f8eea03a0a7ebb91f5aed078dceb95325bdd"
},
"owner_lane": "",
"seed": {
diff --git a/seed/node/README.md b/seed/node/README.md
index 3802d8398..efdf21c7e 100644
--- a/seed/node/README.md
+++ b/seed/node/README.md
@@ -1,4 +1,4 @@
-# Omega Node shared-memory transport, epoch pool, worker supervision, scheduling, authority, journal, coding workflow and operator view
+# Omega Node shared-memory transport, epoch pool, worker supervision, scheduling, authority, journal, coding workflow, operator view and release
This is the first implementation component of [Omega Node](https://github.com/aien-dev/omega-harness/issues/205).
It provides a bounded, single-publisher artifact log for trusted forked Omega
@@ -845,3 +845,103 @@ scenario first and must pass all of them, else the mutant runs are void.
| refusals not counted | `overload-refusals-visible` |
| acknowledgement carries the version current after acting | `cmd-pause-duplicate-version` |
| view process outlives its creator | `crash-view-exits-with-creator` |
+
+## Release lifecycle and durable results (DRA-292)
+
+Status: IMPLEMENTED in `release.sh`, `journal.om` (RESULT records), `code.om`,
+`auth.om` and `op.om`; exercised on native Linux AArch64 by
+`tests/release-accept.py fake`, which answers with the recorded round40 turns
+only. The same driver in `live` mode runs every scenario against the own
+model (aien-train `ollm serve`, or `gserve` on the GB10 inside an authorized
+window); a fake run is host regression, not model qualification. Not
+QUALIFIED and not DEPLOYED.
+
+```sh
+seed/node/release.sh build build/node # BUILD_OK name bytes sha256, six programs
+python3 seed/node/tests/release-accept.py fake $PWD/build/node OLDBIN OMC40 ROUND40 build/node/rel
+OLLM=... VERB=serve CK=... MERGES=... PORT=18294 \
+ python3 seed/node/tests/release-accept.py live $PWD/build/node OLDBIN OMC40 ROUND40 build/node/rel
+```
+
+OLDBIN holds `infer`, `tool` and `code-main` built from the DRA-290 tree
+(git 79894168), the reader before OPER and RESULT.
+
+### Lifecycle
+
+| Command | Effect |
+| --- | --- |
+| `build OUT` | compose and compile the six programs with this checkout's `seed/out/omc`; two builds are byte-identical |
+| `serve STATE PORT OLLM VERB CK MERGES` | start the own-model server; waits for its PORT line |
+| `start STATE BIN OMC PORT VIEW` | start `omnode-code` on STATE (`root/`, `work/`, `journal/`, `objs.txt`); refuses (3) while `node.pid` is alive |
+| `health STATE` | the model's `GET /health` and the node's view; 0 when both answer |
+| `stop STATE` | pause (op 1), wait until nothing runs or is in review (at most 900 s), SIGTERM; `view-at-stop.json` |
+| `restore STATE` | start again on the same journal (incarnation + 1), then resume (op 2) |
+| `unserve STATE` | stop the model server |
+
+The journal's lock is the one active authority: a second `omnode-code` on
+the same journal exits 50 (30 + 20, fenced) and changes nothing.
+
+Cutover: `stop`, copy `root/`, `work/` and `journal/`, `restore` with the new
+BIN. Reversal: `stop`, put the copy back, `start` with the old BIN. A reader
+refuses record types newer than it knows (24, exit 54) before writing
+anything, so the DRA-290 build refuses a journal that holds OPER (9) or
+RESULT (10) and leaves it unchanged; rolling back therefore needs the copy
+taken before the new build ran.
+
+### Durable results
+
+When an objective ends, `cw_end` appends RESULT (type 10: word 3 the
+objective, 4 the result, 5 its turns) before the result is printed. On a
+restart an objective with a RESULT is reported again (`CWO` with the same
+result and turns) and never resumed: a failure is final, as in DRA-290,
+and an objective that ended UNKNOWN (21) cannot issue its effect again. The
+journal refuses a second RESULT for an objective, result 0 and an index
+past 63 (25) before writing. A result the journal refused is still printed;
+that objective resumes after a restart.
+
+An inference worker that dies while it holds a job: inference is class 2
+(no external effect), so `au_lost` records it not performed (DONE how 6),
+as recovery does at a restart, and the objective asks again; only class 1
+and 3 effects stay UNKNOWN. The uncertain-effect test hook kills a worker
+only after the job's START is durable: a job is assigned before its
+worker's proposal is decided and journaled, and the first acceptance run
+killed one holding ADMIT only. That window depends on worker timing, so no
+mutant of the guard is killed deterministically; `uncertain-start-durable`
+fails whenever it is hit.
+
+### Acceptance and controls
+
+`release-accept.py` runs twelve scenarios on the real programs: the full
+four-objective run (prompts and model texts equal the recording, one START
+per operation, independent review, results durable across a rerun with no
+model request), the lifecycle (start, health, stop with jobs ready, restore,
+finish), the creator killed after a replace (no second effect), a conflicting
+write after the read (15, the other write kept), a dead inference worker
+(rerun), an uncertain replace (21, final after restart), cancel of a running
+inference, stale, burst and duplicate commands, the server down (16), a
+second authority, journal compatibility in both directions, and address-space
+caps from the measured peak (each failing cap explicit with a consistent
+journal, then a passing one). Each prints MEASURED latency, RSS and seconds.
+
+A resumed objective reads the file it edited before the restart, a prompt no
+recording holds: in fake mode the three checks that need it
+(`restart-resumed-completes`, `journal-forward-completes`,
+`journal-rollback-completes`) are NOT_RUN, naming the prompt; any other end
+fails them. Live mode answers it and requires PASS. The driver exits 0 only
+when every check passed, 3 when none failed but some were NOT_RUN, 1 when
+one failed.
+
+| Change | Check that fails |
+| --- | --- |
+| RESULT not journaled | `full-results-durable` |
+| journaled RESULT not reported at restart | `full-results-durable` |
+| lost inference left UNKNOWN | `worker-death-rerun` |
+| second RESULT accepted (journal.om) | journal gate case 16 (exit 173) |
+| second RESULT accepted (Lean model) | `second_refused`, `apply_keeps` no longer prove |
+
+`proofs/Result.lean` models `jn_rapply`, the restart decision of `cw_run` and
+`au_lost` in Lean 4 core (checked with Lean 4.35.0; every theorem depends on
+`propext` only): an applied RESULT is never replaced, a second one for the
+objective is refused, every later replay keeps it so the objective is never
+resumed, and only a class-2 lost action is recorded not performed. The proof
+covers the model; its correspondence to the `.om` code is by reading.
diff --git a/seed/node/auth-gate.om b/seed/node/auth-gate.om
index d410104de..1072be01b 100644
--- a/seed/node/auth-gate.om
+++ b/seed/node/auth-gate.om
@@ -1539,6 +1539,16 @@ note 5 RELEASE 3 job id, 4 outcome (the job's outcome; 300 cancelled)
note 6 REVOKE 3 new generation
note 7 PAUSE 3 1 paused, 0 resumed
note 8 CANCEL 3 job id
+note 9 OPER an operator command the creator committed (DRA-291): 3
+note command id (never 0, never repeated), 4 op, 5 target,
+note 6..9 arguments, 10 view version it was acknowledged at.
+note Kept in order in a table of 128 for the creator to replay;
+note a reader without type 9 refuses it as unknown (24).
+note 10 RESULT the result an objective ended with (DRA-292): 3 objective
+note index (< 64), 4 result (1 PASS, else the failure; not 0),
+note 5 model turns performed. At most one per objective; a
+note restart reports it and never resumes that objective. A
+note reader without type 10 refuses it as unknown (24).
note Order: a transition is appended and fdatasync'd before anything acts on
note it or publishes it. An append whose write or sync fails marks the journal
note failed and every later append is refused, so nothing is acted on that
@@ -1572,6 +1582,9 @@ global jpath uchar 160
global jact ulong 1024
global jjob ulong 2048
global jstat ulong 8
+global jopr ulong 1024
+global jnop ulong 1
+global jres ulong 128
note Fault injection for the recovery tests: exit 77 at point p when armed.
fn jn_hit p ulong to void
@@ -1666,6 +1679,13 @@ end
for i ulong 2048
put jjob i 0
end
+for i ulong 1024
+put jopr i 0
+end
+put jnop 0 0
+for i ulong 128
+put jres i 0
+end
for i ulong 8
put jstat i 0
end
@@ -1844,9 +1864,58 @@ if eq t 7
put jstat 2 get r 3
ret 0
end
+if eq t 9
+ret jn_oapply r
+end
+if eq t 10
+ret jn_rapply r
+end
ret 24
end
+note OPER into the operator table: 25 for command id 0, an id already
+note there, or a full table. Entry k: 0 id, 1 op, 2 target, 3..6 arguments,
+note 7 view version.
+fn jn_oapply r view ulong 16 to ulong
+n = get jnop 0
+if or eq get r 3 0 ge n 128
+ret 25
+end
+if ge jn_ofind get r 3 0
+ret 25
+end
+for w ulong 8
+put jopr add mul n 8 w get r add 3 w
+end
+put jnop 0 add n 1
+ret 0
+end
+
+note RESULT into the result table (2 words per objective: result, turns):
+note 25 for an index past 63, result 0, or an objective that has one.
+fn jn_rapply r view ulong 16 to ulong
+i = get r 3
+if or ge i 64 eq get r 4 0
+ret 25
+end
+if ne get jres mul i 2 0
+ret 25
+end
+put jres mul i 2 get r 4
+put jres add mul i 2 1 get r 5
+ret 0
+end
+
+note Operator table index of command id, -1 when absent.
+fn jn_ofind id ulong to long
+for k ulong get jnop 0 bound 128
+if eq get jopr mul k 8 id
+ret long k
+end
+end
+ret neg long 1
+end
+
fn jn_le64 b view uchar 128 off ulong to ulong
v = ulong 0
for k ulong 8
@@ -2305,6 +2374,60 @@ note Action table entry k word i (k < 64, i < 16).
fn jn_act k ulong i ulong to ulong
ret get jact add mul and k 63 16 and i 15
end
+
+note Commit operator command id: OPER (op, target t, arguments a[0..3],
+note view version v) appended and synced. 0, 25 refused, or a write error.
+fn jn_oper id ulong op ulong t ulong a view ulong 4 v ulong to ulong
+r = new ulong 16 0
+put r 0 9
+put r 3 id
+put r 4 op
+put r 5 t
+for i ulong 4
+put r add 6 i get a i
+end
+put r 10 v
+ret jn_append r
+end
+
+note Operator commands in the journal, and word w of the k-th (as jn_oapply).
+fn jn_nops to ulong
+ret get jnop 0
+end
+
+fn jn_opw k ulong w ulong to ulong
+ret get jopr add mul and k 127 8 and w 7
+end
+
+note Commit that objective i ended with result r after t model turns: RESULT
+note appended and synced. 0, 25 refused, or a write error.
+fn jn_result i ulong r ulong t ulong to ulong
+x = new ulong 16 0
+put x 0 10
+put x 3 i
+put x 4 r
+put x 5 t
+ret jn_append x
+end
+
+note The result objective i ended with in the journal (0 none), and its
+note model turns.
+fn jn_res i ulong to ulong
+ret get jres mul and i 63 2
+end
+
+fn jn_rturn i ulong to ulong
+ret get jres add mul and i 63 2 1
+end
+
+note True when job id has a durable START (an operation was granted to it).
+fn jn_started id ulong to bool
+k = jn_jfind id
+if lt k 0
+ret false
+end
+ret ne get jjob add mul ulong k 8 7 0
+end
note Omega Node proposals, authority and cancellation (DRA-288). Concatenate
note after transport.om, pool.om, super.om, sched.om and
note seed/authority/action.om, before one program with fn main.
@@ -2314,7 +2437,9 @@ note assignment seq, the worker slot and incarnation, the input epoch and
note version it read, and the authority generation it holds. Every effect is
note one action record of seed/authority/action.om per operation identity:
note started with actstart, closed with actrecon or actlost. A performed
-note operation is never started again and an UNKNOWN one is never retried.
+note operation is never started again and an UNKNOWN one is never retried;
+note one with no external effect (class 2) whose worker died is closed as
+note not performed, so it may run again.
note Control page (16384 bytes), cell of worker w at 128*w. Creator writes
note 0 control seq, 8 cancel target (assignment seq, 0 none), 16 decided
note proposal seq, 24 verdict, 32 generation at the decision. Worker
@@ -2996,7 +3121,10 @@ e = au_recon sub b 1 au_cell w 88
end
note Creator, after worker w was reaped: kill the process group of a tool
-note it left running and make its in-flight action UNKNOWN (actlost).
+note it left running and close its in-flight action. One of class 2 (no
+note external effect) is not performed (DONE how 6, as jn_settle closes it
+note at a restart), so its rerunnable job may start again; any other is
+note UNKNOWN (actlost, DONE how 2) and never runs again (DRA-292).
fn au_lost w ulong to void
r = new ulong 32 0
p = au_cell w 112
@@ -3008,11 +3136,19 @@ b = get aujob w
if eq b 0
ret
end
+k = sub b 1
+if eq get aurec add mul k 32 20 2
+if ne au_jdone b 1 w 6 0
+ret
+end
+put aujob w 0
+e = au_recon k 1
+ret
+end
if ne au_jdone b 0 w 2 0
ret
end
put aujob w 0
-k = sub b 1
au_load k r
e = actlost r
au_save k r
diff --git a/seed/node/auth.om b/seed/node/auth.om
index a2b2f84ec..93a208558 100644
--- a/seed/node/auth.om
+++ b/seed/node/auth.om
@@ -7,7 +7,9 @@ note assignment seq, the worker slot and incarnation, the input epoch and
note version it read, and the authority generation it holds. Every effect is
note one action record of seed/authority/action.om per operation identity:
note started with actstart, closed with actrecon or actlost. A performed
-note operation is never started again and an UNKNOWN one is never retried.
+note operation is never started again and an UNKNOWN one is never retried;
+note one with no external effect (class 2) whose worker died is closed as
+note not performed, so it may run again.
note Control page (16384 bytes), cell of worker w at 128*w. Creator writes
note 0 control seq, 8 cancel target (assignment seq, 0 none), 16 decided
note proposal seq, 24 verdict, 32 generation at the decision. Worker
@@ -689,7 +691,10 @@ e = au_recon sub b 1 au_cell w 88
end
note Creator, after worker w was reaped: kill the process group of a tool
-note it left running and make its in-flight action UNKNOWN (actlost).
+note it left running and close its in-flight action. One of class 2 (no
+note external effect) is not performed (DONE how 6, as jn_settle closes it
+note at a restart), so its rerunnable job may start again; any other is
+note UNKNOWN (actlost, DONE how 2) and never runs again (DRA-292).
fn au_lost w ulong to void
r = new ulong 32 0
p = au_cell w 112
@@ -701,11 +706,19 @@ b = get aujob w
if eq b 0
ret
end
+k = sub b 1
+if eq get aurec add mul k 32 20 2
+if ne au_jdone b 1 w 6 0
+ret
+end
+put aujob w 0
+e = au_recon k 1
+ret
+end
if ne au_jdone b 0 w 2 0
ret
end
put aujob w 0
-k = sub b 1
au_load k r
e = actlost r
au_save k r
diff --git a/seed/node/code-test.om b/seed/node/code-test.om
index 179dbe2f2..84838af83 100644
--- a/seed/node/code-test.om
+++ b/seed/node/code-test.om
@@ -8,7 +8,8 @@ note auth_cancel once it has run MS milliseconds.
note omnode-code-test overload LIMIT INFER ... OBJ...: omnode-code admitting
note at most LIMIT jobs (DRA-291: the view shows the refusals).
note omnode-code-test uncertain INFER ... OBJ...: omnode-code whose first
-note granted replace has its worker killed (DRA-291: an unknown effect).
+note granted replace has its worker killed once its START is durable
+note (DRA-291, DRA-292: an unknown effect).
text ctunit "unit"
text ctcanc "cancel"
text ctover "overload"
diff --git a/seed/node/code.om b/seed/node/code.om
index ed92e4fc5..685a35058 100644
--- a/seed/node/code.om
+++ b/seed/node/code.om
@@ -33,10 +33,12 @@ note (exit status in the event line; no fallback), 17 tool failed, 18
note malformed record, 19 cancelled, 20 prompt too long, 21 outcome UNKNOWN,
note 22 job input lost, 23 refused by the authority.
note Restart: the journal releases what the last creator left (auth_recover);
-note jobs still waiting for input are cancelled; each objective resumes from
-note the durable workspace in state unread, with the model turns already
-note performed counted against its budget and its job ids continuing; the
-note committed operator commands are then applied again in order.
+note jobs still waiting for input are cancelled; an objective whose result
+note the journal holds (RESULT) is reported with it again and never resumed;
+note every other objective resumes from the durable workspace in state
+note unread, with the model turns already performed counted against its
+note budget and its job ids continuing; the committed operator commands are
+note then applied again in order to the objectives still open.
note Operator (DRA-291): the creator writes a snapshot of its state and an
note event per change to view.om's page every loop, and takes one posted
note command per loop. A command is checked against the version the
@@ -399,8 +401,16 @@ cw_out b len b
cw_out cwnl 1
end
-note Objective i finished with result r (1 PASS, else the failure).
+note Objective i finished with result r (1 PASS, else the failure): RESULT
+note is made durable first (a result the journal refuses is still reported
+note for this run; a restart then resumes that objective), then published.
fn cw_end i ulong r ulong to void
+x = jn_result i r cw_g i 7
+cw_pub i r
+end
+
+note Publish objective i's result r: its CWO line and view event.
+fn cw_pub i ulong r ulong to void
o = new uchar 4096 0
cw_s i 12 r
cw_s i 9 4
@@ -1008,11 +1018,14 @@ end
end
end
-note Test hook cwtu: SIGKILL the worker that was granted a replace, once;
-note whether the edit happened is then unknown to the creator.
+note Test hook cwtu: SIGKILL the worker of the first replace, once, after its
+note START is durable; whether the edit happened is then unknown to the
+note creator and to the journal. A job is assigned (state 3) before its
+note worker's proposal is decided and START journaled, so state 3 alone
+note could kill a worker whose job holds ADMIT only (DRA-292, job 1054).
fn cw_hooku to void
for j ulong 64
-if and eq get sjst j 3 eq rem get sjid j 10 4
+if and and eq get sjst j 3 eq rem get sjid j 10 4 jn_started get sjid j
x = killpid int get swpid get sjw j 9
put cwtu 0 0
ret
@@ -1563,6 +1576,10 @@ ret 55
end
for i ulong get cwno 0 bound 4
cw_resume i
+if ne jn_res i 0
+cw_s i 7 jn_rturn i
+cw_pub i jn_res i
+end
end
cw_replay c
cw_dirs
diff --git a/seed/node/journal-gate.om b/seed/node/journal-gate.om
index 5b0751639..6102158ae 100644
--- a/seed/node/journal-gate.om
+++ b/seed/node/journal-gate.om
@@ -1539,6 +1539,16 @@ note 5 RELEASE 3 job id, 4 outcome (the job's outcome; 300 cancelled)
note 6 REVOKE 3 new generation
note 7 PAUSE 3 1 paused, 0 resumed
note 8 CANCEL 3 job id
+note 9 OPER an operator command the creator committed (DRA-291): 3
+note command id (never 0, never repeated), 4 op, 5 target,
+note 6..9 arguments, 10 view version it was acknowledged at.
+note Kept in order in a table of 128 for the creator to replay;
+note a reader without type 9 refuses it as unknown (24).
+note 10 RESULT the result an objective ended with (DRA-292): 3 objective
+note index (< 64), 4 result (1 PASS, else the failure; not 0),
+note 5 model turns performed. At most one per objective; a
+note restart reports it and never resumes that objective. A
+note reader without type 10 refuses it as unknown (24).
note Order: a transition is appended and fdatasync'd before anything acts on
note it or publishes it. An append whose write or sync fails marks the journal
note failed and every later append is refused, so nothing is acted on that
@@ -1572,6 +1582,9 @@ global jpath uchar 160
global jact ulong 1024
global jjob ulong 2048
global jstat ulong 8
+global jopr ulong 1024
+global jnop ulong 1
+global jres ulong 128
note Fault injection for the recovery tests: exit 77 at point p when armed.
fn jn_hit p ulong to void
@@ -1666,6 +1679,13 @@ end
for i ulong 2048
put jjob i 0
end
+for i ulong 1024
+put jopr i 0
+end
+put jnop 0 0
+for i ulong 128
+put jres i 0
+end
for i ulong 8
put jstat i 0
end
@@ -1844,9 +1864,58 @@ if eq t 7
put jstat 2 get r 3
ret 0
end
+if eq t 9
+ret jn_oapply r
+end
+if eq t 10
+ret jn_rapply r
+end
ret 24
end
+note OPER into the operator table: 25 for command id 0, an id already
+note there, or a full table. Entry k: 0 id, 1 op, 2 target, 3..6 arguments,
+note 7 view version.
+fn jn_oapply r view ulong 16 to ulong
+n = get jnop 0
+if or eq get r 3 0 ge n 128
+ret 25
+end
+if ge jn_ofind get r 3 0
+ret 25
+end
+for w ulong 8
+put jopr add mul n 8 w get r add 3 w
+end
+put jnop 0 add n 1
+ret 0
+end
+
+note RESULT into the result table (2 words per objective: result, turns):
+note 25 for an index past 63, result 0, or an objective that has one.
+fn jn_rapply r view ulong 16 to ulong
+i = get r 3
+if or ge i 64 eq get r 4 0
+ret 25
+end
+if ne get jres mul i 2 0
+ret 25
+end
+put jres mul i 2 get r 4
+put jres add mul i 2 1 get r 5
+ret 0
+end
+
+note Operator table index of command id, -1 when absent.
+fn jn_ofind id ulong to long
+for k ulong get jnop 0 bound 128
+if eq get jopr mul k 8 id
+ret long k
+end
+end
+ret neg long 1
+end
+
fn jn_le64 b view uchar 128 off ulong to ulong
v = ulong 0
for k ulong 8
@@ -2305,6 +2374,60 @@ note Action table entry k word i (k < 64, i < 16).
fn jn_act k ulong i ulong to ulong
ret get jact add mul and k 63 16 and i 15
end
+
+note Commit operator command id: OPER (op, target t, arguments a[0..3],
+note view version v) appended and synced. 0, 25 refused, or a write error.
+fn jn_oper id ulong op ulong t ulong a view ulong 4 v ulong to ulong
+r = new ulong 16 0
+put r 0 9
+put r 3 id
+put r 4 op
+put r 5 t
+for i ulong 4
+put r add 6 i get a i
+end
+put r 10 v
+ret jn_append r
+end
+
+note Operator commands in the journal, and word w of the k-th (as jn_oapply).
+fn jn_nops to ulong
+ret get jnop 0
+end
+
+fn jn_opw k ulong w ulong to ulong
+ret get jopr add mul and k 127 8 and w 7
+end
+
+note Commit that objective i ended with result r after t model turns: RESULT
+note appended and synced. 0, 25 refused, or a write error.
+fn jn_result i ulong r ulong t ulong to ulong
+x = new ulong 16 0
+put x 0 10
+put x 3 i
+put x 4 r
+put x 5 t
+ret jn_append x
+end
+
+note The result objective i ended with in the journal (0 none), and its
+note model turns.
+fn jn_res i ulong to ulong
+ret get jres mul and i 63 2
+end
+
+fn jn_rturn i ulong to ulong
+ret get jres add mul and i 63 2 1
+end
+
+note True when job id has a durable START (an operation was granted to it).
+fn jn_started id ulong to bool
+k = jn_jfind id
+if lt k 0
+ret false
+end
+ret ne get jjob add mul ulong k 8 7 0
+end
note Omega Node proposals, authority and cancellation (DRA-288). Concatenate
note after transport.om, pool.om, super.om, sched.om and
note seed/authority/action.om, before one program with fn main.
@@ -2314,7 +2437,9 @@ note assignment seq, the worker slot and incarnation, the input epoch and
note version it read, and the authority generation it holds. Every effect is
note one action record of seed/authority/action.om per operation identity:
note started with actstart, closed with actrecon or actlost. A performed
-note operation is never started again and an UNKNOWN one is never retried.
+note operation is never started again and an UNKNOWN one is never retried;
+note one with no external effect (class 2) whose worker died is closed as
+note not performed, so it may run again.
note Control page (16384 bytes), cell of worker w at 128*w. Creator writes
note 0 control seq, 8 cancel target (assignment seq, 0 none), 16 decided
note proposal seq, 24 verdict, 32 generation at the decision. Worker
@@ -2996,7 +3121,10 @@ e = au_recon sub b 1 au_cell w 88
end
note Creator, after worker w was reaped: kill the process group of a tool
-note it left running and make its in-flight action UNKNOWN (actlost).
+note it left running and close its in-flight action. One of class 2 (no
+note external effect) is not performed (DONE how 6, as jn_settle closes it
+note at a restart), so its rerunnable job may start again; any other is
+note UNKNOWN (actlost, DONE how 2) and never runs again (DRA-292).
fn au_lost w ulong to void
r = new ulong 32 0
p = au_cell w 112
@@ -3008,11 +3136,19 @@ b = get aujob w
if eq b 0
ret
end
+k = sub b 1
+if eq get aurec add mul k 32 20 2
+if ne au_jdone b 1 w 6 0
+ret
+end
+put aujob w 0
+e = au_recon k 1
+ret
+end
if ne au_jdone b 0 w 2 0
ret
end
put aujob w 0
-k = sub b 1
au_load k r
e = actlost r
au_save k r
@@ -3985,6 +4121,30 @@ jt_common 1001 2 1 160
jt_ok eq jt_cnt 7 0 2 166
end
+note Case 16, RESULT (type 10, DRA-292): an objective's result survives a
+note reopen; a second result for it, result 0 and an index past 63 are
+note refused with 25 before any write, so the file holds exactly one RESULT.
+fn jt_c16 to void
+jt_clean
+jt_ok eq jt_open 9 0 0 170
+jt_ok eq jn_result 3 15 4 0 171
+jt_ok eq jn_res 3 15 172
+jt_ok eq jn_result 3 1 2 25 173
+jt_ok eq jn_result 5 0 2 25 174
+jt_ok eq jn_result 64 1 2 25 175
+jt_ok eq jn_res 5 0 176
+jn_close
+jt_ok eq jt_open 9 0 0 177
+jt_ok eq jn_res 3 15 178
+jt_ok eq jn_rturn 3 4 179
+jt_ok eq jn_result 3 15 4 25 180
+jn_close
+jt_ok jt_load 9 181
+jt_ok eq jt_cnt 10 0 1 182
+jt_ok eq jt_cnt 10 3 1 183
+jt_ok eq jt_cnt 1 0 2 184
+end
+
fn main to int
m = mapnew neg int 1 0 4096 3 33
jt_ok gt m 0 9
@@ -4003,6 +4163,7 @@ jt_c10
jt_c11
jt_c12
jt_c15
+jt_c16
if ne write 1 jtok 0 len jtok long len jtok
ret 100
end
diff --git a/seed/node/journal-test.om b/seed/node/journal-test.om
index fb06f9816..75b5eb6dc 100644
--- a/seed/node/journal-test.om
+++ b/seed/node/journal-test.om
@@ -827,6 +827,30 @@ jt_common 1001 2 1 160
jt_ok eq jt_cnt 7 0 2 166
end
+note Case 16, RESULT (type 10, DRA-292): an objective's result survives a
+note reopen; a second result for it, result 0 and an index past 63 are
+note refused with 25 before any write, so the file holds exactly one RESULT.
+fn jt_c16 to void
+jt_clean
+jt_ok eq jt_open 9 0 0 170
+jt_ok eq jn_result 3 15 4 0 171
+jt_ok eq jn_res 3 15 172
+jt_ok eq jn_result 3 1 2 25 173
+jt_ok eq jn_result 5 0 2 25 174
+jt_ok eq jn_result 64 1 2 25 175
+jt_ok eq jn_res 5 0 176
+jn_close
+jt_ok eq jt_open 9 0 0 177
+jt_ok eq jn_res 3 15 178
+jt_ok eq jn_rturn 3 4 179
+jt_ok eq jn_result 3 15 4 25 180
+jn_close
+jt_ok jt_load 9 181
+jt_ok eq jt_cnt 10 0 1 182
+jt_ok eq jt_cnt 10 3 1 183
+jt_ok eq jt_cnt 1 0 2 184
+end
+
fn main to int
m = mapnew neg int 1 0 4096 3 33
jt_ok gt m 0 9
@@ -845,6 +869,7 @@ jt_c10
jt_c11
jt_c12
jt_c15
+jt_c16
if ne write 1 jtok 0 len jtok long len jtok
ret 100
end
diff --git a/seed/node/journal.om b/seed/node/journal.om
index 9fe78db17..8546bdadc 100644
--- a/seed/node/journal.om
+++ b/seed/node/journal.om
@@ -24,6 +24,11 @@ note command id (never 0, never repeated), 4 op, 5 target,
note 6..9 arguments, 10 view version it was acknowledged at.
note Kept in order in a table of 128 for the creator to replay;
note a reader without type 9 refuses it as unknown (24).
+note 10 RESULT the result an objective ended with (DRA-292): 3 objective
+note index (< 64), 4 result (1 PASS, else the failure; not 0),
+note 5 model turns performed. At most one per objective; a
+note restart reports it and never resumes that objective. A
+note reader without type 10 refuses it as unknown (24).
note Order: a transition is appended and fdatasync'd before anything acts on
note it or publishes it. An append whose write or sync fails marks the journal
note failed and every later append is refused, so nothing is acted on that
@@ -59,6 +64,7 @@ global jjob ulong 2048
global jstat ulong 8
global jopr ulong 1024
global jnop ulong 1
+global jres ulong 128
note Fault injection for the recovery tests: exit 77 at point p when armed.
fn jn_hit p ulong to void
@@ -157,6 +163,9 @@ for i ulong 1024
put jopr i 0
end
put jnop 0 0
+for i ulong 128
+put jres i 0
+end
for i ulong 8
put jstat i 0
end
@@ -338,6 +347,9 @@ end
if eq t 9
ret jn_oapply r
end
+if eq t 10
+ret jn_rapply r
+end
ret 24
end
@@ -359,6 +371,21 @@ put jnop 0 add n 1
ret 0
end
+note RESULT into the result table (2 words per objective: result, turns):
+note 25 for an index past 63, result 0, or an objective that has one.
+fn jn_rapply r view ulong 16 to ulong
+i = get r 3
+if or ge i 64 eq get r 4 0
+ret 25
+end
+if ne get jres mul i 2 0
+ret 25
+end
+put jres mul i 2 get r 4
+put jres add mul i 2 1 get r 5
+ret 0
+end
+
note Operator table index of command id, -1 when absent.
fn jn_ofind id ulong to long
for k ulong get jnop 0 bound 128
@@ -851,3 +878,33 @@ end
fn jn_opw k ulong w ulong to ulong
ret get jopr add mul and k 127 8 and w 7
end
+
+note Commit that objective i ended with result r after t model turns: RESULT
+note appended and synced. 0, 25 refused, or a write error.
+fn jn_result i ulong r ulong t ulong to ulong
+x = new ulong 16 0
+put x 0 10
+put x 3 i
+put x 4 r
+put x 5 t
+ret jn_append x
+end
+
+note The result objective i ended with in the journal (0 none), and its
+note model turns.
+fn jn_res i ulong to ulong
+ret get jres mul and i 63 2
+end
+
+fn jn_rturn i ulong to ulong
+ret get jres add mul and i 63 2 1
+end
+
+note True when job id has a durable START (an operation was granted to it).
+fn jn_started id ulong to bool
+k = jn_jfind id
+if lt k 0
+ret false
+end
+ret ne get jjob add mul ulong k 8 7 0
+end
diff --git a/seed/node/op.om b/seed/node/op.om
index 6dc380b18..f9fca2108 100644
--- a/seed/node/op.om
+++ b/seed/node/op.om
@@ -4,12 +4,16 @@ note and seed/net/notls.om.
note omnode-op PORT view [SINCE INC] GET /view, the body on stdout
note omnode-op PORT cmd ID OP TARGET INC VER [A [B [C [D]]]]
note POST /cmd, the acknowledgement
+note omnode-op PORT health GET /health (the model server's
+note probe, DRA-292), the body on stdout
note PORT is on 127.0.0.1 (never 18091). Exit 0 for 200, 1 for 409 (stale),
note 400 (invalid) or 500 (refused), 3 for 503 (busy) or 504 (pending: post
note again with the same ID), 4 no connection or no response in 10 s, 5
note other statuses, 2 usage.
text opview "view"
text opcmd "cmd"
+text ophlth "health"
+text opph "/health"
text opget "GET"
text oppost "POST"
text ophost "Host"
@@ -84,6 +88,12 @@ p = op_arg t p 3
p = op_cat t p opki
ret op_arg t p 4
end
+if heq view part w 0 ulong n ophlth
+if ne c 3
+ret 0
+end
+ret op_cat t 0 opph
+end
if not heq view part w 0 ulong n opcmd
ret 0
end
@@ -162,14 +172,14 @@ x = write 1 opnl 0 1
ret op_exit st
end
-note Send the request (GET for /view, POST with no body for /cmd); the
-note response status, or negative.
+note Send the request (POST with no body for /cmd, GET for /view and
+note /health); the response status, or negative.
fn op_req cs edit ulong 320 io edit uchar 131072 t view uchar * to long
r = long 0
-if eq get t 1 118
-r = hreqst cs io opget
-else
+if eq get t 1 99
r = hreqst cs io oppost
+else
+r = hreqst cs io opget
end
r = hfe r hreqtg cs io t
r = hfe r hhname cs io ophost
diff --git a/seed/node/proofs/Result.lean b/seed/node/proofs/Result.lean
new file mode 100644
index 000000000..e8cde04fd
--- /dev/null
+++ b/seed/node/proofs/Result.lean
@@ -0,0 +1,89 @@
+/-
+seed/node/proofs/Result.lean -- DRA-292: the RESULT record rule of seed/node/journal.om (jn_rapply)
+and the lost-action rule of seed/node/auth.om (au_lost), as a model checked by Lean 4 core (no
+Mathlib). The model, not the .om code, is what is proved; the correspondence is by reading:
+
+ jn_rapply: refuse (25) when the objective index is 64 or more, the result is 0, or the objective
+ already has a result; otherwise record (result, turns) for it.
+ cw_run at restart: an objective with a recorded result is reported and never resumed.
+ au_lost: a lost action of class 2 (inference, no external effect) is recorded not performed
+ (DONE how 6); any other class stays UNKNOWN.
+-/
+namespace OmegaNode.Result
+
+/-- Recorded results per objective: `some (result, turns)` once a RESULT was applied. -/
+abbrev Table := Nat → Option (Nat × Nat)
+
+/-- A RESULT record: objective, result, turns. -/
+structure Rec where
+ obj : Nat
+ res : Nat
+ turns : Nat
+
+/-- jn_rapply: `none` is the refusal (25), which leaves the table unchanged. -/
+def apply (m : Table) (r : Rec) : Option Table :=
+ if r.obj ≥ 64 ∨ r.res = 0 ∨ (m r.obj).isSome then none
+ else some (fun j => if j = r.obj then some (r.res, r.turns) else m j)
+
+/-- Replay of a journal's RESULT records in order; a refused record is not in the file
+(jn_append applies before it writes), so replay skips nothing it accepted. -/
+def replay : Table → List Rec → Table
+ | m, [] => m
+ | m, r :: rs => match apply m r with
+ | some m' => replay m' rs
+ | none => replay m rs
+
+/-- The restart decision of cw_run: resume only an objective without a result. -/
+def resumes (m : Table) (i : Nat) : Bool := (m i).isNone
+
+theorem apply_sets {m m' : Table} {r : Rec} (h : apply m r = some m') :
+ m' r.obj = some (r.res, r.turns) := by
+ unfold apply at h
+ split at h
+ · cases h
+ · cases h; simp
+
+theorem apply_keeps {m m' : Table} {r : Rec} {j : Nat} {v : Nat × Nat}
+ (h : apply m r = some m') (hj : m j = some v) : m' j = some v := by
+ unfold apply at h
+ split at h
+ · cases h
+ · rename_i hc
+ cases h
+ by_cases e : j = r.obj
+ · subst e; simp [hj] at hc
+ · simp [e, hj]
+
+/-- A second RESULT for an objective is refused. -/
+theorem second_refused {m m' : Table} {r r' : Rec} (h : apply m r = some m')
+ (same : r'.obj = r.obj) : apply m' r' = none := by
+ have hs := apply_sets h
+ unfold apply
+ simp [same, hs]
+
+/-- Finality: once an objective has a result, every later replay keeps exactly that result, so
+a restart never resumes it. -/
+theorem replay_keeps (rs : List Rec) : ∀ (m : Table) (j : Nat) (v : Nat × Nat),
+ m j = some v → replay m rs j = some v := by
+ induction rs with
+ | nil => intro m j v h; simpa [replay] using h
+ | cons r rs ih =>
+ intro m j v h
+ unfold replay
+ cases ha : apply m r with
+ | none => exact ih m j v h
+ | some m' => exact ih m' j v (apply_keeps ha h)
+
+theorem never_resumed_after_result (rs : List Rec) (m : Table) (j : Nat) (v : Nat × Nat)
+ (h : m j = some v) : resumes (replay m rs) j = false := by
+ simp [resumes, replay_keeps rs m j v h]
+
+/-- au_lost: the DONE `how` of a lost action; `none` is UNKNOWN. -/
+def lostHow (cls : Nat) : Option Nat := if cls = 2 then some 6 else none
+
+/-- Only an inference (class 2) is ever recorded not performed when its worker is lost; an
+external (1) or idempotent (3) effect stays UNKNOWN. -/
+theorem lost_not_performed_only_inference (cls : Nat) : lostHow cls = some 6 ↔ cls = 2 := by
+ unfold lostHow; split <;> simp_all
+
+end OmegaNode.Result
diff --git a/seed/node/release.sh b/seed/node/release.sh
new file mode 100755
index 000000000..00167b83e
--- /dev/null
+++ b/seed/node/release.sh
@@ -0,0 +1,185 @@
+#!/bin/sh
+# seed/node/release.sh -- build, start, check, stop and restore one Omega Node coding workflow
+# (DRA-292). Every program it runs is compiled from .om; this script only composes sources, starts
+# processes and reads their state. POSIX sh; no systemd.
+#
+# release.sh build OUT
+# Compose and compile omnode-infer, omnode-tool, omnode-code (code-main), code-test, omnode-op
+# and fake-serve into OUT with this checkout's seed/out/omc; prints one sha256 line each.
+# release.sh serve STATE PORT OLLM VERB CK MERGES
+# Start the own-model server `OLLM VERB PORT CK MERGES` (VERB serve on the CPU, gserve on the
+# GB10 inside an authorized window) in this network namespace; STATE/serve.pid, serve.log.
+# release.sh start STATE BIN OMC PORT VIEW
+# Start omnode-code on STATE (root/, work/, journal/, objs.txt: one objective per line) with the
+# binaries in BIN, the compiler OMC whose messages the prompts carry, the model on 127.0.0.1:PORT
+# and the operator view on VIEW. Writes STATE/release.env and node.pid, appends run.out, and
+# waits until the view listens. Refuses (exit 3) while node.pid is alive.
+# release.sh health STATE
+# The model server's GET /health and the node's GET /view; exit 0 when both answer 200.
+# release.sh stop STATE
+# Pause through the view (op 1: nothing new is granted), wait until no job is running or in
+# review (at most 900 s), then SIGTERM the creator. Waiting jobs stay in the journal; a restore
+# cancels them and resumes each objective from the durable workspace.
+# release.sh restore STATE
+# Start again on the same journal and workspace (incarnation + 1). The journaled pause is
+# replayed, so restore then posts resume (op 2) and prints the view.
+# release.sh unserve STATE
+# SIGTERM the model server started by serve.
+set -u
+here=$(cd "$(dirname "$0")/../.." && pwd)
+die() { echo "release: $*" >&2; exit "${2:-1}"; }
+alive() { [ -f "$1" ] && kill -0 "$(cat "$1")" 2>/dev/null; }
+env_load() { [ -f "$1/release.env" ] || die "no $1/release.env (start first)" 2; . "$1/release.env"; }
+# the view's JSON has a fixed field order: the first "name": is the top-level, authority or queue
+# field (incarnation, version, paused, running, review, journal_failed)
+vfield() { grep -o "\"$2\":[0-9]*" "$1" | head -1 | cut -d: -f2; }
+# the view answers 503 while the creator is between snapshots: retried for 5 s, written whole
+view() {
+ i=0
+ until "$BIN/op" "$VIEW" view > "$1/view.tmp" 2> /dev/null; do
+ i=$((i + 1)); [ $i -lt 50 ] || return 1
+ sleep 0.1
+ done
+ mv "$1/view.tmp" "$1/view.json"
+}
+# post operator op $2 (1 pause, 2 resume) from a fresh view until it is committed; "invalid" is
+# the node already in that state, "stale" a version that moved on (posted again)
+post() {
+ i=0
+ while :; do
+ view "$1" || return 1
+ "$BIN/op" "$VIEW" cmd "$(date +%s%N | cut -c4-16)" "$2" 0 "$(vfield "$1/view.json" incarnation)" \
+ "$(vfield "$1/view.json" version)" > "$1/ack.json"
+ r=$?
+ cat "$1/ack.json"
+ [ $r = 0 ] || grep -q '"invalid"' "$1/ack.json" && return 0
+ i=$((i + 1)); [ $i -lt 50 ] || return 1
+ sleep 0.1
+ done
+}
+
+build() {
+ out=$1
+ mkdir -p "$out"
+ cd "$here" || exit 1
+ N=seed/node A=seed/authority/action.om
+ L="$N/transport.om $N/pool.om $N/super.om $N/sched.om $A $N/journal.om $N/auth.om"
+ V="seed/net/http.om seed/net/notls.om $L $N/view.om"
+ rc=0
+ # shellcheck disable=SC2086
+ for p in "infer:seed/json/json.om seed/json/jsonw.om seed/net/http.om seed/net/notls.om $N/infer.om" \
+ "tool:seed/agent/path.om $N/gram.om $N/tool.om" \
+ "code-main:$V $N/gram.om $N/code.om $N/code-main.om" \
+ "code-test:$V $N/gram.om $N/code.om $N/code-test.om" \
+ "op:seed/net/http.om seed/net/notls.om $N/op.om" \
+ "fake-serve:seed/net/http.om seed/net/notls.om $N/tests/fake-serve.om"; do
+ n=${p%%:*}
+ { printf 'om2\n'; cat ${p#*:}; } > "$out/$n.om" || exit 1
+ if seed/out/omc < "$out/$n.om" > "$out/$n.tmp" 2> "$out/$n.cerr"; then
+ chmod +x "$out/$n.tmp" && mv "$out/$n.tmp" "$out/$n"
+ echo "BUILD_OK $n $(wc -c < "$out/$n") $(sha256sum "$out/$n" | cut -d' ' -f1)"
+ else
+ echo "BUILD_FAIL $n $(cat "$out/$n.cerr")"
+ rm -f "$out/$n.tmp"
+ rc=1
+ fi
+ done
+ echo "omc $(sha256sum seed/out/omc | cut -d' ' -f1)"
+ return $rc
+}
+
+serve() {
+ st=$1 port=$2 ollm=$3 verb=$4 ck=$5 mg=$6
+ [ "$port" != 18091 ] || die "never 18091" 2
+ alive "$st/serve.pid" && die "a server is running (serve.pid $(cat "$st/serve.pid"))" 3
+ mkdir -p "$st"
+ : > "$st/serve.log"
+ "$ollm" "$verb" "$port" "$ck" "$mg" >> "$st/serve.log" 2>&1 &
+ echo $! > "$st/serve.pid"
+ i=0
+ until grep -q "^PORT $port" "$st/serve.log"; do
+ alive "$st/serve.pid" || die "server exited: $(tail -3 "$st/serve.log")"
+ i=$((i + 1)); [ $i -lt 3000 ] || die "no PORT line in 300 s"
+ sleep 0.1
+ done
+ echo "serve pid $(cat "$st/serve.pid") port $port ollm $(sha256sum "$ollm" | cut -d' ' -f1) verb $verb"
+}
+
+run() {
+ st=$1
+ alive "$st/node.pid" && die "the node is running (node.pid $(cat "$st/node.pid"))" 3
+ mkdir -p "$st/journal" "$st/work"
+ n=$(grep -c '^RUN ' "$st/run.out" 2>/dev/null)
+ echo "RUN ${n:-0} $(date -u +%FT%TZ)" >> "$st/run.out"
+ # one objective per line, each one argument (tasks hold spaces)
+ set --
+ while IFS= read -r o; do set -- "$@" "$o"; done < "$st/objs.txt"
+ "$BIN/code-main" "$BIN/infer" "$BIN/tool" "$OMC" "$st/root" "$st/work" "$st/journal" "$PORT" "$VIEW" "$@" \
+ >> "$st/run.out" 2>> "$st/run.err" &
+ echo $! > "$st/node.pid"
+ i=0
+ until "$BIN/op" "$VIEW" view > /dev/null 2>&1; do
+ alive "$st/node.pid" || die "the node exited: $(tail -3 "$st/run.out")"
+ i=$((i + 1)); [ $i -lt 300 ] || die "the view did not answer in 30 s"
+ sleep 0.1
+ done
+ view "$st" || die "the view did not answer twice"
+ echo "node pid $(cat "$st/node.pid") view $VIEW incarnation $(vfield "$st/view.json" incarnation) version $(vfield "$st/view.json" version)"
+}
+
+cmd=${1:-}
+[ $# -ge 2 ] || die "usage: release.sh build OUT | serve STATE PORT OLLM VERB CK MERGES | start STATE BIN OMC PORT VIEW | health|stop|restore|unserve STATE" 2
+case $cmd in
+build) build "$2" ;;
+serve) [ $# -eq 7 ] || die "usage: serve STATE PORT OLLM VERB CK MERGES" 2; serve "$2" "$3" "$4" "$5" "$6" "$7" ;;
+start)
+ [ $# -eq 6 ] || die "usage: start STATE BIN OMC PORT VIEW" 2
+ [ "$5" != 18091 ] && [ "$6" != 18091 ] || die "never 18091" 2
+ st=$2
+ mkdir -p "$st"
+ printf 'BIN=%s\nOMC=%s\nPORT=%s\nVIEW=%s\n' "$(cd "$3" && pwd)" "$4" "$5" "$6" > "$st/release.env"
+ env_load "$st"
+ run "$st" ;;
+health)
+ st=$2; env_load "$st"
+ "$BIN/op" "$PORT" health > "$st/health.json"; m=$?
+ view "$st"; v=$?
+ echo "model $m $(cat "$st/health.json") node $v incarnation $(vfield "$st/view.json" incarnation) running $(vfield "$st/view.json" running) journal_failed $(vfield "$st/view.json" journal_failed)"
+ [ $m = 0 ] && [ $v = 0 ] ;;
+stop)
+ st=$2; env_load "$st"
+ alive "$st/node.pid" || die "the node is not running" 3
+ post "$st" 1 || die "the pause was not committed"
+ i=0
+ while :; do
+ if view "$st"; then
+ [ "$(vfield "$st/view.json" running)" = 0 ] && [ "$(vfield "$st/view.json" review)" = 0 ] && break
+ else
+ alive "$st/node.pid" || die "the node exited while stopping"
+ fi
+ i=$((i + 1)); [ $i -lt 9000 ] || die "jobs still running after 900 s; not stopped"
+ sleep 0.1
+ done
+ cp "$st/view.json" "$st/view-at-stop.json"
+ p=$(cat "$st/node.pid")
+ kill -TERM "$p" 2>/dev/null
+ while kill -0 "$p" 2>/dev/null; do sleep 0.1; done
+ echo "stopped pid $p running $(vfield "$st/view-at-stop.json" running) waiting $(vfield "$st/view-at-stop.json" waiting) ready $(vfield "$st/view-at-stop.json" ready)" ;;
+restore)
+ st=$2; env_load "$st"
+ run "$st" || exit $?
+ if [ "$(vfield "$st/view.json" paused)" = 1 ]; then
+ post "$st" 2 || die "the resume was not committed"
+ echo
+ fi
+ view "$st" || die "the view does not answer"
+ echo "restored incarnation $(vfield "$st/view.json" incarnation) paused $(vfield "$st/view.json" paused)" ;;
+unserve)
+ st=$2
+ alive "$st/serve.pid" || die "no server running" 3
+ p=$(cat "$st/serve.pid")
+ kill -TERM "$p"
+ while kill -0 "$p" 2>/dev/null; do sleep 0.1; done
+ echo "server $p stopped" ;;
+*) die "unknown command $cmd" 2 ;;
+esac
diff --git a/seed/node/tests/release-accept.py b/seed/node/tests/release-accept.py
new file mode 100755
index 000000000..7068f1f09
--- /dev/null
+++ b/seed/node/tests/release-accept.py
@@ -0,0 +1,723 @@
+#!/usr/bin/env python3
+"""DRA-292 release acceptance of the Omega Node coding workflow.
+
+Usage: release-accept.py MODE BUILD OLDBIN OMC ROUND40 OUT [SCENARIO...]
+
+MODE fake: the model is fake-serve answering the recorded round40 turns (any
+host, seconds). MODE live: the own model through `ollm VERB` on 127.0.0.1:PORT,
+started once by release.sh serve; run the whole driver inside a private
+network namespace (bwrap --unshare-net), and with VERB gserve only inside an
+authorized GB10 window. Environment for live: OLLM, VERB (serve|gserve), CK,
+MERGES, PORT (default 18294, never 18091).
+BUILD holds the programs release.sh build makes; OLDBIN the DRA-290 build
+(code-main without the operator view) for the journal compatibility checks;
+OMC the compiler whose messages round40's prompts carry; ROUND40 repair.py and
+final-selected.json. Prints one PASS/FAIL/NOT_RUN line per check, MEASURED lines,
+and "RELSUM pass=P fail=F not_run=N mode=..."; exits 0 when every check passed,
+1 when one failed, 3 when none failed but some were NOT_RUN.
+"""
+import collections, hashlib, json, os, shutil, signal, socket, struct, subprocess, sys, threading, time
+
+MODE = sys.argv[1]
+BUILD, OLDBIN, OMC, R, OUT = (os.path.abspath(a) for a in sys.argv[2:7])
+ONLY = sys.argv[7:]
+HERE = os.path.dirname(os.path.abspath(__file__))
+RELEASE = os.path.join(os.path.dirname(HERE), 'release.sh')
+LIVE = MODE == 'live'
+PORT = int(os.environ.get('PORT', '18294'))
+assert MODE in ('fake', 'live') and PORT != 18091
+os.makedirs(OUT, exist_ok=True)
+NP = [0, 0, 0]
+PROCS = []
+
+
+def res(ok, name, detail=''):
+ NP[0 if ok else 1] += 1
+ print(f"{'PASS' if ok else 'FAIL'} {name} {detail}"[:600], flush=True)
+ return ok
+
+
+def notrun(name, detail):
+ NP[2] += 1
+ print(f'NOT_RUN {name} {detail}'[:900], flush=True)
+ return None
+
+
+def measured(name, detail):
+ print(f'MEASURED {name} {detail}'[:600], flush=True)
+
+
+def free_port():
+ while True:
+ s = socket.socket()
+ s.bind(('127.0.0.1', 0))
+ p = s.getsockname()[1]
+ s.close()
+ if p not in (18091, PORT):
+ return p
+
+
+def wait_for(f, t, step=0.02):
+ end = time.time() + t
+ while time.time() < end:
+ if f():
+ return True
+ time.sleep(step)
+ return f()
+
+
+def sh(*a, timeout=1200):
+ p = subprocess.run(['sh', RELEASE, *map(str, a)], capture_output=True, text=True, timeout=timeout)
+ return p.returncode, p.stdout + p.stderr
+
+
+def op(port, *a):
+ p = subprocess.run([BUILD + '/op', str(port), *map(str, a)], capture_output=True, timeout=30)
+ try:
+ j = json.loads(p.stdout)
+ except ValueError:
+ j = None
+ return p.returncode, j
+
+
+def view(port, since=None, inc=None):
+ return op(port, 'view') if since is None else op(port, 'view', since, inc)
+
+
+def fresh(port, cid, opn, tgt, *args):
+ """Post from a fresh view, again while the target moves on in between."""
+ for _ in range(50):
+ rc, s = view(port)
+ if s is None:
+ return rc, None
+ rc, a = op(port, 'cmd', cid, opn, tgt, s['incarnation'], s['version'], *args)
+ if not (a and a['status'] == 'stale'):
+ return rc, a
+ return rc, a
+
+
+# ---- fixtures and the model
+def prep(name, ids):
+ base = os.path.join(OUT, name)
+ subprocess.run([sys.executable, os.path.join(HERE, 'view-prep.py'), R, base, ','.join(ids)],
+ check=True, capture_output=True)
+ return base, open(base + '/objs.txt').read().splitlines(), json.load(open(base + '/expect.json'))
+
+
+def frames(path):
+ """(kind, objective, bytes) of every CWP/CWR frame in a node's stdout."""
+ raw, ev, p = open(path, 'rb').read(), [], 0
+ while p < len(raw):
+ e = raw.index(b'\n', p)
+ w = raw[p:e].decode(errors='replace').split(' ')
+ p = e + 1
+ if w[0] in ('CWP', 'CWR'):
+ n = int(w[3])
+ ev.append((w[0], int(w[1]), raw[p:p + n].decode(errors='replace')))
+ p += n + 1
+ return ev
+
+
+def finished(name, lines, outs, ex, detail=''):
+ """Every objective of a resumed run passed. In fake mode an objective that resumed into a prompt
+ the recording never held (after its edit it reads the edited file) can only end 16: that check
+ is NOT_RUN there, naming the prompt; the live own model answers it."""
+ if lines and all(l.split()[2] == 'PASS' for l in lines):
+ return res(True, name, f'{lines} {detail}')
+ rec = {t['prompt'] for r in ex['recs'] for t in r['turns']}
+ miss = []
+ for l in lines:
+ if l.split()[2] == 'PASS':
+ continue
+ i = int(l.split()[1])
+ last = [b for o in outs for k, j, b in frames(o) if k == 'CWP' and j == i][-1:]
+ if LIVE or l.split()[3] != '16' or not last or last[0] in rec:
+ return res(False, name, f'{lines} {detail}')
+ st = last[0].split('\nState: ')[1].split('\n')[0]
+ miss.append(f'obj{i} state={st} sha256={hashlib.sha256(last[0].encode()).hexdigest()[:16]}')
+ return notrun(name, f'fake-serve holds no recorded answer for {miss}; live mode answers it. {lines} {detail}')
+
+
+class Model:
+ """The live server (one per session) or a fake-serve per scenario; serve.log lines `C status
+ prompt completion finish ms` (live) mark each answered request."""
+ live = None
+
+ def __init__(self, base, delay=300, name='model'):
+ self.base, self.name = base, name
+ if LIVE:
+ self.port, self.log, self.mark = PORT, Model.live, os.path.getsize(Model.live)
+ self.p = None
+ else:
+ self.port, self.log = free_port(), f'{base}/fake-{name}.log'
+ self.mark = 0
+ self.p = subprocess.Popen([BUILD + '/fake-serve', str(self.port), base + '/map', str(delay)],
+ stdout=open(self.log, 'a'), stderr=subprocess.STDOUT)
+ PROCS.append(self.p)
+ wait_for(lambda: 'PORT' in open(self.log).read(), 5)
+
+ def lines(self):
+ """fake-serve logs no request lines: in fake mode this is always empty."""
+ with open(self.log, 'rb') as f:
+ f.seek(self.mark)
+ return [l for l in f.read().decode(errors='replace').splitlines() if l.startswith('C ')]
+
+ def close(self):
+ open(f'{self.base}/{self.name}.log', 'w').write('\n'.join(self.lines()) + '\n')
+ if self.p:
+ self.p.kill()
+ self.p.wait()
+
+
+# ---- the node and its event lines
+class Node:
+ """omnode-code (or code-test MODE...) on BASE; follows stdout, timestamping each event line
+ (CWP/CWR frames carry n bytes after their line)."""
+
+ def __init__(self, base, objs, port, prog='code-main', mode=(), tag='run', bindir=None, view=True,
+ jdir=None, pre=()):
+ b = bindir or BUILD
+ self.base, self.tag = base, tag
+ self.vport = free_port() if view else 0
+ self.out = f'{base}/{tag}.out'
+ a = [*pre, b + '/' + prog, *mode, b + '/infer', b + '/tool', OMC, base + '/root', base + '/work',
+ jdir or base + '/journal', str(port)]
+ if bindir is None:
+ a.append(str(self.vport))
+ a += objs
+ self.t0 = time.time()
+ self.p = subprocess.Popen(a, stdout=open(self.out, 'wb'), stderr=open(f'{base}/{tag}.err', 'wb'))
+ PROCS.append(self.p)
+ self.ev = []
+ self.t = threading.Thread(target=self.follow, daemon=True)
+ self.t.start()
+ self.up = (not view or bindir is not None or
+ wait_for(lambda: any(e[1] == f'CWV {self.vport}' for e in self.ev) or self.p.poll() is not None, 15))
+
+ def follow(self):
+ buf, pos, skip = b'', 0, 0
+ f = open(self.out, 'rb')
+ while True:
+ c = f.read()
+ done = self.p.poll() is not None
+ if c:
+ buf += c
+ while True:
+ if skip:
+ if len(buf) - pos < skip:
+ break
+ pos += skip
+ skip = 0
+ e = buf.find(b'\n', pos)
+ if e < 0:
+ break
+ line = buf[pos:e].decode(errors='replace')
+ pos = e + 1
+ self.ev.append((time.time(), line))
+ w = line.split(' ')
+ if w[0] in ('CWP', 'CWR') and len(w) >= 4 and w[3].isdigit():
+ skip = int(w[3]) + 1
+ if done and not c:
+ return
+ time.sleep(0.01)
+
+ def wait(self, t=3600):
+ try:
+ rc = self.p.wait(t)
+ except subprocess.TimeoutExpired:
+ self.p.kill()
+ rc = self.p.wait()
+ self.t.join(5)
+ self.wall = time.time() - self.t0
+ return rc
+
+ def until(self, f, t):
+ return wait_for(lambda: any(f(l) for _, l in self.ev) or self.p.poll() is not None, t, 0.01)
+
+ def lines(self, k='CWO'):
+ return [l for _, l in self.ev if l.startswith(k)]
+
+
+def journal(base):
+ b = open(base + '/journal/journal', 'rb').read()
+ recs = [struct.unpack('<16Q', b[64 + i * 128:192 + i * 128]) for i in range((len(b) - 64) // 128)]
+ starts = collections.Counter(r[3:7] for r in recs if r[0] == 3)
+ done = {r[3:7]: (r[7], r[9]) for r in recs if r[0] == 4}
+ dones = collections.defaultdict(list)
+ for r in recs:
+ if r[0] == 4:
+ dones[r[3:7]].append((r[7], r[9]))
+ return dict(recs=recs, opens=sum(r[0] == 1 for r in recs), starts=starts, done=done, dones=dones,
+ max_starts=max(starts.values()) if starts else 0, oper=sum(r[0] == 9 for r in recs))
+
+
+def compare(node, ex):
+ """The prompts and raw model texts each objective saw against the recorded round40 turns."""
+ raw = open(node.out, 'rb').read()
+ ev, p = [], 0
+ while p < len(raw):
+ e = raw.index(b'\n', p)
+ w = raw[p:e].decode(errors='replace').split(' ')
+ p = e + 1
+ if w[0] in ('CWP', 'CWR'):
+ n = int(w[3])
+ ev.append((w[0], int(w[1]), raw[p:p + n].decode(errors='replace')))
+ p += n + 1
+ bad = []
+ for i, r in enumerate(ex['recs']):
+ P = [b for k, j, b in ev if k == 'CWP' and j == i]
+ W = [b for k, j, b in ev if k == 'CWR' and j == i]
+ rec = r['turns']
+ ok = len(P) == len(rec) and P == [t['prompt'] for t in rec] and W == [t['raw'] for t in rec]
+ if not ok:
+ k = next((k for k in range(min(len(W), len(rec))) if W[k] != rec[k]['raw']), None)
+ bad.append(f"obj{i} turns={len(P)}/{len(rec)} first_raw_diff={k}")
+ return bad
+
+
+def inference(node, model):
+ """MEASURED: the model's answered requests in this run and the node's time outside them (one
+ inference at a time, so wall minus the sum of request times is the node's own time)."""
+ cs = [l.split() for l in model.lines()]
+ ok = [c for c in cs if c[1] == '200']
+ ms = sum(int(c[5]) for c in ok)
+ toks = sum(int(c[3]) for c in ok)
+ return dict(requests=len(cs), answered=len(ok), model_ms=ms, completion_tokens=toks,
+ ms_per_token=round(ms / toks, 1) if toks else None,
+ wall_ms=int(node.wall * 1000), node_ms=int(node.wall * 1000) - ms)
+
+
+def peak(pids):
+ """VmHWM (kB) of each live pid."""
+ m = {}
+ for p in pids:
+ try:
+ for l in open(f'/proc/{p}/status'):
+ if l.startswith('VmHWM:'):
+ m[p] = int(l.split()[1])
+ except OSError:
+ pass
+ return m
+
+
+def tree(pid):
+ """pid and its descendants (by /proc/*/stat ppid)."""
+ kids = collections.defaultdict(list)
+ for d in os.listdir('/proc'):
+ if d.isdigit():
+ try:
+ s = open(f'/proc/{d}/stat').read()
+ kids[int(s[s.rindex(')') + 2:].split()[1])].append(int(d))
+ except (OSError, ValueError):
+ pass
+ out, todo = [], [pid]
+ while todo:
+ x = todo.pop()
+ out.append(x)
+ todo += kids.get(x, [])
+ return out
+
+
+def exe(pid):
+ try:
+ return os.path.basename(os.readlink(f'/proc/{pid}/exe'))
+ except OSError:
+ return '?'
+
+
+# ---- 1. one instruction set to a reviewed result: four objectives, the operator view followed
+def t_full():
+ base, objs, ex = prep('full', ['76666', '83423', '82342', '85188'])
+ m = Model(base, 150)
+ n = Node(base, objs, m.port)
+ res(n.up, 'full-view-up', f'port={n.vport}')
+ hw, ver, inc, gaps, kinds = collections.defaultdict(int), 0, None, 0, set()
+ while n.p.poll() is None:
+ for p, k in peak(tree(n.p.pid)).items():
+ nm = exe(p)
+ hw[nm] = max(hw[nm], k)
+ rc, d = view(n.vport, ver, inc) if inc else view(n.vport)
+ if rc == 0 and d:
+ if d['kind'] == 'delta' and d['since'] != ver:
+ gaps += 1
+ inc, ver = d['incarnation'], d['version']
+ kinds.add(d['kind'])
+ time.sleep(0.05)
+ rc = n.wait()
+ m.close()
+ o = n.lines('CWSUM')
+ res(rc == 0 and o == ['CWSUM pass=4 fail=0'], 'full-4-objectives', f'rc={rc} {o} {n.lines()}')
+ bad = compare(n, ex)
+ res(not bad, 'full-turns-equal-recorded', f'{bad or "all prompts and model texts equal round40"}')
+ j = journal(base)
+ res(j['max_starts'] == 1 and j['opens'] == 1, 'full-journal-once',
+ f"records={len(j['recs'])} opens={j['opens']} ops={len(j['starts'])} max_starts={j['max_starts']}")
+ res(gaps == 0 and 'delta' in kinds, 'full-view-stream', f'gaps={gaps} kinds={sorted(kinds)} last_version={ver}')
+ ev = [l.split() for l in n.lines('CWE')]
+ reviewed = {int(w[1]) for w in ev if w[2].endswith('5') and w[3] == '4'}
+ checked = {int(w[1]) for w in ev if w[2].endswith('3') and w[3] == '4'}
+ res(checked and checked <= reviewed, 'full-independent-review',
+ f'objectives checked={sorted(checked)} reviewed={sorted(reviewed)} (a "File not found." answer has no check)')
+ measured('full-latency', json.dumps(inference(n, m)))
+ measured('full-peak-rss-kB', json.dumps(dict(hw)))
+ # the results are durable: a rerun on the finished journal reports them and runs nothing
+ m2 = Model(base, 150, 'rerun')
+ n2 = Node(base, objs, m2.port, tag='rerun')
+ rc2 = n2.wait()
+ m2.close()
+ j2 = journal(base)
+ new = [r[0] for r in j2['recs'][len(j['recs']):]]
+ res(rc2 == 0 and sorted(n2.lines()) == sorted(n.lines()) and not n2.lines('CWE') and not m2.lines() and
+ set(new) <= {1, 5}, 'full-results-durable',
+ f'rc={rc2} {n2.lines()} new_records={new} model_requests={len(m2.lines())}')
+
+
+# ---- 2. release.sh lifecycle: start, health, stop with work outstanding, restore, finish
+def t_lifecycle():
+ base, objs, ex = prep('lifecycle', ['76666', '83423'])
+ m = Model(base, 1500)
+ st = base + '/state'
+ os.makedirs(st)
+ for d in ('root', 'objs.txt'):
+ shutil.move(base + '/' + d, st + '/' + d)
+ vp = free_port()
+ rc, o = sh('start', st, BUILD, OMC, m.port, vp)
+ res(rc == 0, 'lifecycle-start', o.strip()[-200:])
+ rc, o = sh('health', st)
+ want = 0 if LIVE else 1 # fake-serve has no /health: the node half alone answers
+ res(rc == want and 'node 0' in o, 'lifecycle-health', o.strip()[-200:])
+ pid = int(open(st + '/node.pid').read())
+ wait_for(lambda: open(st + '/run.out', 'rb').read().count(b'\nCWE ') >= 6, 1800)
+ rc, o = sh('stop', st)
+ s = json.load(open(st + '/view-at-stop.json'))
+ gone = not os.path.exists(f'/proc/{pid}')
+ res(rc == 0 and gone and s['queue']['running'] == 0 and s['authority']['paused'] == 1, 'lifecycle-stop',
+ f"rc={rc} gone={gone} queue={s['queue']} {o.strip()[-160:]}")
+ rc, o = sh('restore', st)
+ v = json.load(open(st + '/view.json'))
+ res(rc == 0 and v['incarnation'] == 2 and v['authority']['paused'] == 0, 'lifecycle-restore',
+ f"rc={rc} inc={v['incarnation']} paused={v['authority']['paused']}")
+ pid = int(open(st + '/node.pid').read())
+ wait_for(lambda: not os.path.exists(f'/proc/{pid}'), 3600, 0.2)
+ out = open(st + '/run.out', 'rb').read().decode(errors='replace')
+ j = journal(st)
+ cwo = [l for l in out.splitlines() if l.startswith('CWO')]
+ res(j['max_starts'] == 1 and j['opens'] == 2, 'lifecycle-journal-once',
+ f"opens={j['opens']} max_starts={j['max_starts']}")
+ finished('lifecycle-finish', cwo, [st + '/run.out'], ex,
+ [l for l in out.splitlines() if l.startswith('CWSUM')])
+ m.close()
+
+
+# ---- 3. the creator killed after a replace finished: restart without a second effect
+def t_restart():
+ base, objs, ex = prep('restart', ['76666'])
+ m = Model(base, 300)
+ n = Node(base, objs, m.port)
+ hit = n.until(lambda l: l.startswith('CWE 0 ') and l.split()[2].endswith('4') and l.split()[3] == '4', 1800)
+ n.p.send_signal(signal.SIGKILL)
+ n.wait()
+ out1 = n.lines()
+ n2 = Node(base, objs, m.port, tag='run2')
+ rc = n2.wait()
+ m.close()
+ j = journal(base)
+ rep = [o for o in j['starts'] if o[0] % 10 == 4]
+ res(hit and not out1 and len(n2.lines()) == 1 and
+ j['max_starts'] == 1 and j['opens'] == 2 and rep and all(j['dones'][o] == [(2, 1)] for o in rep),
+ 'restart-no-duplicate-effect',
+ f"killed_after_replace={hit} run1={out1} run2 rc={rc} opens={j['opens']} max_starts={j['max_starts']} replace_dones={[j['dones'][o] for o in rep]}")
+ finished('restart-resumed-completes', n2.lines(), [n.out, n2.out], ex)
+
+
+# ---- 4. conflict: another writer changes the file after the model read it
+def t_conflict():
+ base, objs, ex = prep('conflict', ['76666'])
+ m = Model(base, 300)
+ path = base + '/root/' + ex['recs'][0]['path']
+ n = Node(base, objs, m.port)
+ hit = n.until(lambda l: l.startswith('CWE 0 ') and l.split()[2].endswith('2') and l.split()[3] == '4', 1800)
+ mark = b'\nnote changed by another writer (DRA-292 conflict check)\n'
+ with open(path, 'ab') as f:
+ f.write(mark)
+ rc = n.wait()
+ m.close()
+ j = journal(base)
+ rep = [o for o in j['starts'] if o[0] % 10 == 4]
+ kept = open(path, 'rb').read().endswith(mark)
+ res(hit and n.lines() == ['CWO 0 FAIL 15 ' + n.lines()[0].split()[-1]] if n.lines() else False,
+ 'conflict-detected-15', f'read_done={hit} {n.lines()}')
+ res(kept and not rep, 'conflict-other-write-kept', f'kept={kept} replace_starts={len(rep)}')
+
+
+# ---- 5. a worker killed during an inference: the job runs again, nothing is lost
+def t_worker():
+ base, objs, ex = prep('worker', ['76666'])
+ m = Model(base, 4000)
+ n = Node(base, objs, m.port)
+ victim = None
+
+ def infer_parent():
+ nonlocal victim
+ for p in tree(n.p.pid):
+ if exe(p) == 'infer':
+ s = open(f'/proc/{p}/stat').read()
+ victim = int(s[s.rindex(')') + 2:].split()[1])
+ return victim != n.p.pid
+ return False
+ found = wait_for(infer_parent, 600, 0.05)
+ t = time.time()
+ if found:
+ os.kill(victim, signal.SIGKILL)
+ rc = n.wait()
+ m.close()
+ j = journal(base)
+ lost = {o: ds for o, ds in j['dones'].items() if any(d[1] in (2, 6) for d in ds)}
+ res(found and rc == 0 and n.lines() and n.lines()[0].startswith('CWO 0 PASS') and
+ list(lost.values()) == [[(1, 6), (2, 1)]] and all(j['starts'][o] == 2 for o in lost),
+ 'worker-death-rerun', f'killed_worker={victim} rc={rc} {n.lines()} lost_ops(DONEs outcome,how)={dict(lost)} '
+ f'starts={[j["starts"][o] for o in lost]}')
+ res(not compare(n, ex), 'worker-death-turns-equal-recorded', f'{compare(n, ex) or "equal"}')
+
+
+# ---- 6. an uncertain effect: the worker of a granted replace dies; never retried
+def t_uncertain():
+ base, objs, ex = prep('uncertain', ['76666', '82342', '85188'])
+ m = Model(base, 300)
+ n = Node(base, objs, m.port, prog='code-test', mode=('uncertain',))
+ last = None
+ while n.p.poll() is None:
+ rc, s = view(n.vport)
+ if rc == 0 and s and s['uncertain']:
+ last = s
+ time.sleep(0.05)
+ n.wait()
+ u = last and last['uncertain']
+ i = u[0] // 1000 - 1 if u else -1
+ res(u and len(u) == 1 and any(l.startswith(f'CWO {i} FAIL 21') for l in n.lines()), 'uncertain-objective-21',
+ f'uncertain={u} {n.lines()}')
+ j = journal(base)
+ ops = [o for o in j['starts'] if u and o[0] == u[0]]
+ res(len(ops) == 1 and j['starts'][ops[0]] == 1 and j['done'].get(ops[0], (9,))[0] == 0, 'uncertain-start-durable',
+ f"op={ops} starts={[j['starts'][o] for o in ops]} done(outcome,how)={[j['done'].get(o) for o in ops]}")
+ n2 = Node(base, objs, m.port, tag='run2')
+ n2.wait()
+ m.close()
+ j2 = journal(base)
+ tail = j2['recs'][len(j['recs']):]
+ rel = [r[4] for r in tail if r[0] == 5 and u and r[3] == u[0]]
+ res(sorted(n2.lines()) == sorted(n.lines()) and not n2.lines('CWE') and
+ not [r for r in tail if r[0] in (2, 3)] and rel == [0], 'uncertain-final-after-restart',
+ f"run2 {n2.lines()} new_records={[r[0] for r in tail]} released_outcome={rel}")
+
+
+# ---- 7. cancellation of a running inference through the operator
+def t_cancel():
+ base, objs, ex = prep('cancel', ['76666', '83423'])
+ m = Model(base, 6000)
+ n = Node(base, objs, m.port)
+ n.until(lambda l: l.startswith('CWE 0 ') and l.split()[2].endswith('1') and l.split()[3] == '1', 600)
+ time.sleep(1.0)
+ rc, a = fresh(n.vport, 60, 3, 0)
+ t = time.time()
+ n.until(lambda l: l.startswith('CWO 0 '), 120)
+ dt = time.time() - t
+ rc2 = n.wait()
+ m.close()
+ o = n.lines()
+ gone = [l for l in m.lines() if l.split()[1] == '499'] if LIVE else ['n/a: fake-serve']
+ res(a and a['status'] == 'committed' and any(l.startswith('CWO 0 FAIL 19') for l in o) and
+ any(l.startswith('CWO 1 PASS') for l in o) and gone, 'cancel-running-inference',
+ f'ack={a} ended_after_s={dt:.2f} {o} model_499={gone}')
+
+
+# ---- 8. stale and coalesced operator commands during a run
+def t_commands():
+ base, objs, ex = prep('commands', ['76666', '83423'])
+ m = Model(base, 1500)
+ n = Node(base, objs, m.port)
+ rc, s = view(n.vport)
+ # far ahead: the run publishes versions while the command travels, so version + 1 may be current
+ rc1, a = op(n.vport, 'cmd', 300, 4, 1, s['incarnation'], s['version'] + 100000, 7)
+ res(rc1 == 1 and a and a['status'] == 'stale', 'commands-future-version-stale', f'{a}')
+ rc, s = view(n.vport)
+ burst = [subprocess.Popen([BUILD + '/op', str(n.vport), 'cmd', str(310 + k), '4', str(k % 2),
+ str(s['incarnation']), str(s['version']), str(7 - k)], stdout=subprocess.PIPE)
+ for k in range(4)]
+ acks = []
+ for p in burst:
+ out, _ = p.communicate(60)
+ try:
+ acks.append(json.loads(out))
+ except ValueError:
+ acks.append(None)
+ st = collections.Counter(x and x['status'] for x in acks)
+ committed = sorted(x['version'] for x in acks if x and x['status'] == 'committed')
+ res(st['committed'] >= 1 and set(st) <= {'committed', 'stale', 'busy', 'pending'} and
+ len(set(committed)) == len(committed), 'commands-burst-each-answered-once',
+ f'statuses={dict(st)} committed_versions={committed}')
+ again = [op(n.vport, 'cmd', x['id'], 4, 0, x['incarnation'], 0, 1)[1] for x in acks if x and x['status'] == 'committed']
+ res(all(y and y['status'] == 'duplicate' for y in again), 'commands-repost-duplicate', f'{again}')
+ rc = n.wait()
+ m.close()
+ j = journal(base)
+ res(rc in (0, 1) and len(n.lines()) == 2 and j['oper'] == len(committed), 'commands-run-completes',
+ f'rc={rc} {n.lines()} oper_records={j["oper"]}')
+
+
+# ---- 9. no model server: an explicit failure, no fallback
+def t_down():
+ base, objs, ex = prep('down', ['76666'])
+ n = Node(base, objs, free_port())
+ rc = n.wait(120)
+ res(rc == 1 and n.lines() == ['CWO 0 FAIL 16 1'] and
+ any(l.startswith('CWE 0 1001 4 ') for l in n.lines('CWE')), 'server-down-16', f'rc={rc} {n.lines()}')
+
+
+# ---- 10. one active authority: a second creator on the same journal is fenced
+def t_authority():
+ base, objs, ex = prep('authority', ['76666'])
+ m = Model(base, 1500)
+ n = Node(base, objs, m.port)
+ n2 = Node(base, objs, m.port, tag='second')
+ rc2 = n2.wait(60)
+ alive = n.p.poll() is None
+ rc = n.wait()
+ m.close()
+ j = journal(base)
+ res(rc2 != 0 and alive and rc == 0 and j['opens'] == 1 and n.lines()[0].startswith('CWO 0 PASS'),
+ 'one-active-authority', f"second rc={rc2} err={open(base + '/second.err', 'rb').read()[-160:]} first {n.lines()} opens={j['opens']}")
+
+
+# ---- 11. journal compatibility and reversible cutover between the DRA-290 build and this one
+def t_journal():
+ base, objs, ex = prep('compat', ['76666'])
+ m = Model(base, 150)
+ old = Node(base, objs, m.port, bindir=OLDBIN, view=False)
+ hit = old.until(lambda l: l.startswith('CWE 0 ') and l.split()[2].endswith('4') and l.split()[3] == '4', 1800)
+ old.p.send_signal(signal.SIGKILL)
+ old.wait()
+ snap = base + '/snapshot'
+ for d in ('root', 'work', 'journal'):
+ shutil.copytree(f'{base}/{d}', f'{snap}/{d}')
+ new = Node(base, objs, m.port, tag='forward')
+ rcf = new.wait()
+ j = journal(base)
+ nres = sum(r[0] == 10 for r in j['recs'])
+ res(hit and len(new.lines()) == 1 and j['opens'] == 2 and j['max_starts'] == 1 and nres == 1,
+ 'journal-forward-old-to-new',
+ f"old killed after its replace={hit}; new rc={rcf} opens={j['opens']} max_starts={j['max_starts']} result_records={nres}")
+ finished('journal-forward-completes', new.lines(), [old.out, new.out], ex)
+ again = Node(base, objs, m.port, tag='again')
+ again.wait()
+ tail = journal(base)['recs'][len(j['recs']):]
+ res(again.lines() == new.lines() and not [r for r in tail if r[0] in (2, 3)], 'journal-result-after-upgrade',
+ f'{again.lines()} new_records={[r[0] for r in tail]}')
+ before = open(base + '/journal/journal', 'rb').read()
+ back = Node(base, objs, m.port, bindir=OLDBIN, view=False, tag='rollback')
+ rcb = back.wait(120)
+ res(rcb != 0 and not back.lines() and open(base + '/journal/journal', 'rb').read() == before,
+ 'journal-rollback-refuses-result', f"old rc={rcb} (30 + 24 unknown record type) unchanged=True")
+ # cutover reversal: the state copied before the new build ran, under the old build again
+ for d in ('root', 'work', 'journal'):
+ shutil.rmtree(f'{base}/{d}')
+ shutil.copytree(f'{snap}/{d}', f'{base}/{d}')
+ back2 = Node(base, objs, m.port, bindir=OLDBIN, view=False, tag='rollback2')
+ rcb2 = back2.wait()
+ j3 = journal(base)
+ res(len(back2.lines()) == 1 and j3['max_starts'] == 1 and j3['opens'] == 2,
+ 'journal-rollback-from-snapshot', f"rc={rcb2} opens={j3['opens']} max_starts={j3['max_starts']}")
+ finished('journal-rollback-completes', back2.lines(), [old.out, back2.out], ex)
+ m.close()
+ # a committed operator command (DRA-291 OPER): the DRA-290 reader refuses it too, changing nothing
+ base2, objs2, ex2 = prep('compat-oper', ['76666', '83423'])
+ m2 = Model(base2, 1500)
+ n = Node(base2, objs2, m2.port)
+ rc, a = fresh(n.vport, 500, 4, 1, 7)
+ n.p.send_signal(signal.SIGKILL)
+ n.wait()
+ j4 = journal(base2)
+ before = open(base2 + '/journal/journal', 'rb').read()
+ back3 = Node(base2, objs2, m2.port, bindir=OLDBIN, view=False, tag='rollback')
+ rcb3 = back3.wait(120)
+ after = open(base2 + '/journal/journal', 'rb').read()
+ res(a and a['status'] == 'committed' and j4['oper'] == 1 and rcb3 != 0 and before == after,
+ 'journal-rollback-refuses-oper', f"ack={a and a['status']} oper={j4['oper']} old rc={rcb3} unchanged={before == after}")
+ m2.close()
+
+
+# ---- 12. memory limits: address-space caps doubling from the creator's measured peak; each run ends
+# with an explicit result and a consistent journal, and the smallest passing cap is reported
+def t_memory():
+ base, objs, ex = prep('memory', ['76666'])
+ m = Model(base, 150)
+ n = Node(base, objs, m.port, tag='measure')
+ hw = collections.defaultdict(int)
+ vm = collections.defaultdict(int)
+ while n.p.poll() is None:
+ for p in tree(n.p.pid):
+ try:
+ for l in open(f'/proc/{p}/status'):
+ if l.startswith('VmPeak:'):
+ vm[exe(p)] = max(vm[exe(p)], int(l.split()[1]))
+ if l.startswith('VmHWM:'):
+ hw[exe(p)] = max(hw[exe(p)], int(l.split()[1]))
+ except OSError:
+ pass
+ time.sleep(0.005)
+ n.wait()
+ measured('memory-peak-kB', json.dumps(dict(VmHWM=dict(hw), VmPeak=dict(vm), sampled_every_ms=5)))
+ unit = vm['code-main']
+ tries, passed = [], None
+ for k in (0, 1, 2, 3, 4, 5, 6):
+ cap = unit << k >> 1
+ b, o, _ = prep(f'memory-cap{k}', ['76666'])
+ x = Node(b, o, m.port, pre=('prlimit', f'--as={cap * 1024}', '--'), view=False)
+ rc = x.wait(600)
+ jf = b + '/journal/journal'
+ js = journal(b) if os.path.exists(jf) and os.path.getsize(jf) >= 64 else None
+ tries.append(dict(as_kB=cap, rc=rc, out=x.lines(), journal=bool(js), max_starts=js and js['max_starts']))
+ consistent = js is None or js['max_starts'] <= 1
+ explicit = (not x.lines() and rc != 0 and not js) or (len(x.lines()) == 1 and rc in (0, 1))
+ if not (consistent and explicit):
+ res(False, 'memory-cap-explicit', json.dumps(tries[-1]))
+ if x.lines() and x.lines()[0].startswith('CWO 0 PASS'):
+ passed = cap
+ break
+ measured('memory-caps', json.dumps(tries))
+ res(passed is not None and len(tries) > 1, 'memory-caps-fail-closed-then-pass',
+ f'smallest passing as_kB={passed} after {len(tries) - 1} failing caps, each explicit with a consistent journal')
+ m.close()
+
+
+TESTS = (t_full, t_lifecycle, t_restart, t_conflict, t_worker, t_uncertain, t_cancel, t_commands, t_down,
+ t_authority, t_journal, t_memory)
+if LIVE:
+ rc, o = sh('serve', OUT + '/model', PORT, os.environ['OLLM'], os.environ.get('VERB', 'serve'),
+ os.environ['CK'], os.environ['MERGES'])
+ print('SERVE', o.strip(), flush=True)
+ Model.live = OUT + '/model/serve.log'
+ if rc:
+ res(False, 'serve', o)
+ print(f'RELSUM pass={NP[0]} fail={NP[1]} not_run={NP[2]}', flush=True)
+ sys.exit(1)
+for t in TESTS:
+ if ONLY and t.__name__[2:] not in ONLY:
+ continue
+ t0 = time.time()
+ try:
+ t()
+ except Exception as e: # a crashed check is a failed check
+ res(False, t.__name__, f'{type(e).__name__}: {e}')
+ for q in PROCS:
+ if q.poll() is None:
+ q.kill()
+ q.wait()
+ PROCS.clear()
+ measured(t.__name__[2:] + '-seconds', f'{time.time() - t0:.1f}')
+if LIVE:
+ print('UNSERVE', sh('unserve', OUT + '/model')[1].strip(), flush=True)
+MODEL = ('live own model ' + os.environ.get('VERB', 'serve')) if LIVE else \
+ 'fake (recorded answers only: host regression, not model qualification)'
+print(f'RELSUM pass={NP[0]} fail={NP[1]} not_run={NP[2]} mode={MODEL}', flush=True)
+sys.exit(1 if NP[1] else 3 if NP[2] else 0) # 3: nothing failed, something was NOT_RUN (not a pass)
diff --git a/seed/node/tests/view-accept.py b/seed/node/tests/view-accept.py
index b0aa2c313..1e36347b0 100755
--- a/seed/node/tests/view-accept.py
+++ b/seed/node/tests/view-accept.py
@@ -111,6 +111,8 @@ def fresh(port, cid, opn, tgt, *args):
(a stale command is not recorded, so the same id may be posted again)."""
for k in range(20):
rc, s = view(port)
+ if s is None:
+ return rc, None
rc, a = cmd(port, cid, opn, tgt, s, *args)
if not (a and a['status'] == 'stale'):
return rc, a
@@ -205,17 +207,17 @@ def t_commands():
rc, s0 = view(vp)
wait_for(lambda: view(vp)[1]['objectives'][0]['version'] > s0['version'], 10)
rc, a = cmd(vp, 11, 4, 0, s0, 6)
- res(rc == 1 and a['status'] == 'stale', 'cmd-stale-409', f'rc={rc} {a}')
+ res(rc == 1 and a and a['status'] == 'stale', 'cmd-stale-409', f'rc={rc} {a}')
rc, a = fresh(vp, 12, 4, 0, 9)
- res(rc == 1 and a['status'] == 'invalid', 'cmd-invalid-budget', f'rc={rc} {a}')
+ res(rc == 1 and a and a['status'] == 'invalid', 'cmd-invalid-budget', f'rc={rc} {a}')
rc, s1 = view(vp)
# version 0 and op 9: only the view's incarnation check answers stale; were the command
# passed on, the creator would answer invalid (op out of range) whatever the version is now
rc, a = op(vp, 'cmd', 13, 9, 0, s1['incarnation'] + 1, 0, 6)
- res(rc == 1 and a['status'] == 'stale', 'cmd-other-incarnation', f'rc={rc} {a}')
+ res(rc == 1 and a and a['status'] == 'stale', 'cmd-other-incarnation', f'rc={rc} {a}')
cid = 14
rc, a = fresh(vp, cid, 4, 0, 6)
- res(rc == 0 and a['status'] == 'committed', 'cmd-budget-committed', f'id={cid} {a}')
+ res(rc == 0 and a and a['status'] == 'committed', 'cmd-budget-committed', f'id={cid} {a}')
rc, s2 = view(vp)
res(s2['objectives'][0]['budget'] == 6 and s2['commands']['last_id'] == cid,
'cmd-budget-visible', f"budget={s2['objectives'][0]['budget']} last={s2['commands']['last_id']}")
@@ -225,7 +227,7 @@ def t_commands():
# pause: committed through the authority; no new grants while paused
rc, sp = view(vp)
rc, a = cmd(vp, 40, 1, 0, sp)
- res(rc == 0 and a['status'] == 'committed', 'cmd-pause', f'{a}')
+ res(rc == 0 and a and a['status'] == 'committed', 'cmd-pause', f'{a}')
# a pause emits a second event before its ack, so an ack carrying the version current
# after acting (not the one its OPER record holds) differs from the duplicate's
rc, ad = cmd(vp, 40, 1, 0, sp)
@@ -233,7 +235,7 @@ def t_commands():
'cmd-pause-duplicate-version', f"{ad} original={a['version']}")
rc, s3 = view(vp)
rc, a = cmd(vp, 41, 1, 0, s3)
- res(rc == 1 and a['status'] == 'invalid', 'cmd-pause-again-invalid', f'{a}')
+ res(rc == 1 and a and a['status'] == 'invalid', 'cmd-pause-again-invalid', f'{a}')
time.sleep(4)
rc, s4 = view(vp)
if s4 is None:
@@ -244,7 +246,7 @@ def t_commands():
all(w['paused'] == 1 for w in s4['workers']),
'cmd-paused-holds', f"auth={s4['authority']} queue={q}")
rc, a = cmd(vp, 42, 2, 0, s4)
- res(rc == 0 and a['status'] == 'committed', 'cmd-resume', f'{a}')
+ res(rc == 0 and a and a['status'] == 'committed', 'cmd-resume', f'{a}')
rc = finish(p, 120)
fs.kill()
out = lines(base)
@@ -259,7 +261,7 @@ def t_cancel():
wait_for(lambda: view(vp)[1]['objectives'][0]['phase'] == 1, 10)
rc, a = fresh(vp, 60, 3, 0)
t = time.time()
- res(rc == 0 and a['status'] == 'committed', 'cancel-committed', f'{a}')
+ res(rc == 0 and a and a['status'] == 'committed', 'cancel-committed', f'{a}')
wait_for(lambda: any(l.startswith('CWO 0 ') for l in lines(base)), 10)
dt = time.time() - t
rc = finish(p, 120)
@@ -278,12 +280,12 @@ def t_redirect():
kn, K, N, A = ex['recs'][0]['obj'].split(',')
k_, K, N, A = KINDS[kn], int(K), int(N), int(A)
rc, a = fresh(vp, 80, 5, 0, k_, K, N, A)
- res(rc == 0 and a['status'] == 'committed', 'redirect-committed', f'{a}')
+ res(rc == 0 and a and a['status'] == 'committed', 'redirect-committed', f'{a}')
rc, s = view(vp)
o = s['objectives'][0]
res((o['a'], o['k'], o['n']) == (A, K, N), 'redirect-visible', f'{o}')
rc, a = fresh(vp, 99, 5, 0, 4, K, N, A)
- res(rc == 1 and a['status'] == 'invalid', 'redirect-invalid-kind', f'{a}')
+ res(rc == 1 and a and a['status'] == 'invalid', 'redirect-invalid-kind', f'{a}')
rc = finish(p, 120)
fs.kill()
out = lines(base)
@@ -298,7 +300,7 @@ def t_budget():
fs, fp = fake(base, 700)
p, vp, ok = node(base, objs, fp)
rc, a = fresh(vp, 120, 4, 0, 2)
- res(rc == 0 and a['status'] == 'committed', 'budget-committed', f'{a}')
+ res(rc == 0 and a and a['status'] == 'committed', 'budget-committed', f'{a}')
rc = finish(p, 120)
fs.kill()
out = lines(base)
@@ -404,9 +406,9 @@ def t_crash():
res(rc == 0 and d['kind'] == 'snapshot', 'crash-old-client-resyncs', f"kind={d['kind']}")
cid, a0 = sorted(ids.items())[0]
rc, a = op(vp2, 'cmd', cid, 3, 1, s['incarnation'], s['version'])
- res(rc == 0 and a['status'] == 'duplicate' and a['version'] == a0['version'], 'crash-duplicate-after-restart', f'{a}')
+ res(rc == 0 and a and a['status'] == 'duplicate' and a['version'] == a0['version'], 'crash-duplicate-after-restart', f'{a}')
rc, a = cmd(vp2, cid + 1000, 3, 1, s)
- res(rc == 1 and a['status'] == 'invalid', 'crash-cancel-finished-invalid', f'{a}')
+ res(rc == 1 and a and a['status'] == 'invalid', 'crash-cancel-finished-invalid', f'{a}')
rc = finish(p, 120)
fs.kill()
out = lines(base, 'run2')