diff --git a/.crumb b/.crumb index 49e6ee5e7..dba8f2e3c 100644 --- a/.crumb +++ b/.crumb @@ -108,14 +108,14 @@ } ], "children_root": "sha256:966bedb54caa4209f9ab84526da66f6b13ce72e8831470170364eb5881355748", - "compiled_at": "2026-11-07T04:39:25Z", + "compiled_at": "2026-11-07T04:46:27Z", "compiler": "crumb-compile/1", - "digest": "sha256:a6c82328a0c78547a0bdd10b5413abf92c770c77a60d1ff07cecdfe91318248c", - "evidence_files": 15697, - "evidence_root": "sha256:d27e57dca62f72d32e3df2004050ab45a220c65322d8e91a1d018697d89fdb53", - "files": 24256, - "generated_at_commit": "b93031dd0b45fe89bdaacf0956cdda9f51e29b51", - "source_tree": "sha256:1ee369a73a85f886a202b9d6d4debad425c90c490d9b17247718b9128642af7b" + "digest": "sha256:44b95f0a61e131ea0e712697e2d29daf02d282cd3e35bf75b15ef4bf756d33b5", + "evidence_files": 15699, + "evidence_root": "sha256:8c8bb947da593feaee26338668383ff84a0fccb3d85b32e4e4e3676fedcb3c55", + "files": 24263, + "generated_at_commit": "8f2ec38bc88b6d5dafb26aff76e0b0c9bcfc6ed4", + "source_tree": "sha256:776b18ccee7b22cfb64dba9f1c71b25fa3635fcb82e3d775c65f0b9cfc97f37b" }, "owner_lane": "", "provenance": { diff --git a/CONTRIBUTORS.md b/CONTRIBUTORS.md index 2356d08a6..4fabc14f2 100644 --- a/CONTRIBUTORS.md +++ b/CONTRIBUTORS.md @@ -13,6 +13,7 @@ The current development method is [Human-Directed Agentic Engineering (HDAE)](RE | Claude Opus 5.5 (via omp) | DRA-288 for `seed/node`: `auth.om`, typed worker proposals decided and committed by the creator alone through the action records of `seed/authority/action.om` (one record per operation identity; a performed or UNKNOWN operation is never started again). Proposals are refused as malformed, not the current assignment, another incarnation, stale input, revoked authority or cancelled. Granted tools run as their own process group; cancellation, revocation, stop and worker death kill the whole group, and the outcome comes from the wait status, so a tool that already exited stays performed and a killed one stays UNKNOWN. Operator pause, cancel and revoke reach workers through a per-worker control eventfd with acknowledged seqs. `sched.om` gains `sched_pause` and `sched_cancel`. `auth-gate.om` runs real forked workers and `/bin/sh` tools through seven phases, with twelve negative controls. Native AArch64 host evidence only; not QUALIFIED on the Spark gate. | | 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. | | 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-view/receipt.3c2da80d2189237632458c8d888d7c8dedc7a19b6e4dbb469269955bce88e5a6.json b/evidence/node-view/receipt.3c2da80d2189237632458c8d888d7c8dedc7a19b6e4dbb469269955bce88e5a6.json new file mode 100644 index 000000000..254cdd9f3 --- /dev/null +++ b/evidence/node-view/receipt.3c2da80d2189237632458c8d888d7c8dedc7a19b6e4dbb469269955bce88e5a6.json @@ -0,0 +1,238 @@ +{ + "issue": "DRA-291", + "source_commit": "d54bdd6dc1629e36284d778b4b707717520e1032", + "source_tree": "d2f0ef1c537daa961edd1602179e2efd05301faa", + "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); acceptance against seed/node/tests/fake-serve.om replaying recorded round40 turns", + "timestamp_utc": "2026-11-07T04:45:36.056303+00:00", + "independent_review": false, + "native_aarch64": "PASS", + "spark_gate_judge": "NOT_RUN", + "live_hive": "NOT_DEPLOYED", + "script": "~/work/omega-node-291.sh (DRA-291 PR body; run from the worktree of this commit) (compile with seed/out/omc, run under timeout; mutants are one-line sed edits of a disposable copy)", + "hashes": { + "seed/out/omc": "5f90edea61bac241398df5036990d899361a5acd9decb37954ce088ec0f6f6df", + "seed/node/auth-gate.om": "c37e6ee5a041d60840727c1993b08057369099d4042e0456823239b330e2a35a", + "seed/node/auth.om": "edf2f075d3751a8025363bc658252537f865dfc29f975fcf5d93c353b3282b30", + "seed/node/auth-test.om": "af66c87f83d73a5bdbaf181378eb69bb0645a86fe9b39de2f1b714041fbc20b8", + "seed/node/code-main.om": "8609a3be3fc2520fbcd0e576e672882f7dce3c3eac0f654d4e0e176648bdd6b5", + "seed/node/code.om": "560f1ff72e1dd9f2939009125e502e351ed047eb571565b2dbac533e668c5b74", + "seed/node/code-test.om": "f0d2ce3c208333782ebf37577ad94d00b240d4754108f0169208fc94ed81bfe0", + "seed/node/gram.om": "ebba1f4c693f218969dc2f17eb680760977d38d694ac76db477853aefa64b291", + "seed/node/infer.om": "8606f2bc917e7942033cf26355e72b92eae75b99c7b25e6f1ced953d8903ff4f", + "seed/node/journal-gate.om": "d0db0257ac03d00a801ca12598d147201d03cad85c806e4d29d260f34587b19f", + "seed/node/journal.om": "37e07b72bfef4bccb0555625dc1dc515b091e42d03c5a879ef2fde677784e71b", + "seed/node/journal-test.om": "b3f2d93e64c87c4c8c0193174cbc3ef6435085e47360d59641c63cc96f48274e", + "seed/node/op.om": "cc86d0f4099e00e610a25eba10b87b2c79856496c94b808ba26dbaa429712d99", + "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/agent/agent.om": "84a595c27bf23b9562fc2ea7c97f0e2dce17a151ceb28c7928be5adebef1dbce", + "seed/agent/path.om": "1daef7e888e45f7cd7f2f8bb1ea34bc061115c261aac3740f3c799803f7079b2", + "seed/authority/action.om": "59cb9c3dfdcd9193bc4a272deda4fcd256a0d7693f3bcb58bc4e30ed78faab2b", + "seed/authority/action-gate.om": "716761cfee0af722586def0a0e06342bd0d4a8482c64ef75aeb0e92eae21e604", + "seed/node/tests/tool-replay.py": "e220595d7912f3d0219825befc227284dc5782cb969f1f06cc969b6c3251db86", + "seed/node/tests/view-accept.py": "9073cc118b1ad49b6a5a4d23479753a95cf021455a94f54f23eb431e48e50b91", + "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": 15, + "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": 6213, + "stdout": "stress rolls=2000 busy=4243340 reads=170851 88360\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": 7971, + "stdout": "idle ticks workers=0 creator=0 wake rounds=200 mean_us=21 max_us=3213\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": 784, + "stdout": "PASS node authority\n", + "binary_sha256": "1cff100077b76e1d773886f7ada81b8945a07621d024fcc092ee15011583ac67", + "verdict": "PASS", + "leaked_tool_processes_after_run": 0 + }, + { + "case": "journal-gate", + "compile_exit": 0, + "expected_exit": "0", + "run_exit": 0, + "wall_ms": 3362, + "stdout": "PASS node journal\n", + "binary_sha256": "4484672957407ad405302b404b1b844c99e721d217dedd48d88ffa35ee9e580d", + "verdict": "PASS", + "leaked_tool_processes_after_run": 0 + }, + { + "case": "action-gate", + "compile_exit": 0, + "expected_exit": "0", + "run_exit": 0, + "wall_ms": 3, + "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=15 bin=470aefe90345217a leaked_tools=0 stdout=PASS node transport ", + "PASS pool-gate compile=0 exit=0 want=0 ms=6213 bin=afd1063c4e534ade leaked_tools=0 stdout=stress rolls=2000 busy=4243340 reads=170851 88360 PASS node pool ", + "PASS sched-gate compile=0 exit=0 want=0 ms=7971 bin=68b835c0821b4458 leaked_tools=0 stdout=idle ticks workers=0 creator=0 wake rounds=200 mean_us=21 max_us=3213 PASS node sched ", + "PASS auth-gate compile=0 exit=0 want=0 ms=784 bin=1cff100077b76e1d leaked_tools=0 stdout=PASS node authority ", + "PASS journal-gate compile=0 exit=0 want=0 ms=3362 bin=4484672957407ad4 leaked_tools=0 stdout=PASS node journal ", + "PASS action-gate compile=0 exit=0 want=0 ms=3 bin=f56e5696dfcfc8a1 leaked_tools=0 stdout=action checks=219 000 ", + "PASS build-infer compile=0 bytes=132576 sha256=8cc5fb3044c9c794326e66b57aac7c6889c5cf498f4750503637d97505c1f806", + "PASS build-tool compile=0 bytes=34396 sha256=a1bdecb08c74f89ddbd2bd674b224d21ed2a983268964972dd8f8ee701aa1c8d", + "PASS build-code-main compile=0 bytes=243532 sha256=722330cab6549ecb75683e6bbe452dd4f0b54e9f77c1dcd73beea7167ece1282", + "PASS build-code-test compile=0 bytes=268044 sha256=9840e69e14d9e603ce010ef6085908701cfad78ee1003f4eedc8c031a7ea797f", + "PASS build-op compile=0 bytes=68896 sha256=5a03192b6a83f8e0867c9e93f29d1ad58c7c2521ea12c09bc3d29c08bf2b0ccb", + "PASS build-fake-serve compile=0 bytes=71808 sha256=9397ef1ff5e2250e60109fd51edc009e01ed0c5662176701bbaa84d3735b1a87", + "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=52569", + "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=52569", + "view-accept: PASS resync-delta-from-0 v=3 n=3", + "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': 1, 'journal_seq': 3, 'incarnation': 1}", + "view-accept: PASS cmd-invalid-budget rc=1 {'id': 12, 'status': 'invalid', 'version': 1, 'journal_seq': 3, 'incarnation': 1}", + "view-accept: PASS cmd-other-incarnation rc=1 {'id': 13, 'status': 'stale', 'version': 1, 'journal_seq': 0, 'incarnation': 1}", + "view-accept: PASS cmd-budget-committed id=14 {'id': 14, 'status': 'committed', 'version': 2, 'journal_seq': 4, 'incarnation': 1}", + "view-accept: PASS cmd-budget-visible budget=6 last=14", + "view-accept: PASS cmd-duplicate-ack {'id': 14, 'status': 'duplicate', 'version': 2, 'journal_seq': 4, 'incarnation': 1}", + "view-accept: PASS cmd-pause {'id': 40, 'status': 'committed', 'version': 3, 'journal_seq': 6, 'incarnation': 1}", + "view-accept: PASS cmd-pause-duplicate-version {'id': 40, 'status': 'duplicate', 'version': 3, 'journal_seq': 6, 'incarnation': 1} original=3", + "view-accept: PASS cmd-pause-again-invalid {'id': 41, 'status': 'invalid', 'version': 4, 'journal_seq': 6, 'incarnation': 1}", + "view-accept: PASS cmd-paused-holds auth={'generation': 1, 'paused': 1, 'journal_seq': 9, 'journal_failed': 0, 'fence': 1, 'version': 4} 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': 8, 'journal_seq': 11, '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': 4, 'journal_seq': 9, '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=35413", + "view-accept: PASS overload-refusals-visible refused=28 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': 4, 'incarnation': 1}, 201: {'id': 201, 'status': 'committed', 'version': 4, 'journal_seq': 5, 'incarnation': 1}}", + "view-accept: PASS crash-view-exits-with-creator port=35521", + "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': 11, 'incarnation': 2}", + "view-accept: PASS crash-cancel-finished-invalid {'id': 1200, 'status': 'invalid', 'version': 2, 'journal_seq': 11, '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=5 fail=2 failing: crash-oper-replayed crash-cancel-finished-invalid ", + "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=3 fail=2 failing: 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 ", + "PASS tool-replay TOOL-REPLAY runs=108 pass=108 fail=0 actions=417", + "PASS tool-dotdot got=s2 want=s2 ms=3 leaked=0 record=OMNT1 2 13 0|Path refused.", + "PASS tool-absolute got=s2 want=s2 ms=2 leaked=0 record=OMNT1 2 13 0|Path refused.", + "PASS tool-final-symlink got=s2 want=s2 ms=2 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=2 leaked=0 record=OMNT1 1 15 0|File not found.", + "PASS tool-over-3800 got=s3 want=s3 ms=2 leaked=0 record=OMNT1 3 24 0|File is over 3800 bytes.", + "PASS tool-read got=s0 want=s0 ms=2 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=3 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=2 leaked=0 record=OMNT1 5 33 0|Old text must occur exactly once.", + "PASS tool-replace got=s0 want=s0 ms=12 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=30 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=13 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=8 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=7 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=8 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=2 leaked=0 record=", + "PASS tool-verb got=x2 want=x2 ms=2 leaked=0 record=", + "PASS tool-relative-work got=s4 want=s4 ms=2 leaked=0 record=OMNT1 4 10 0|I/O error.", + "PASS tool-slow-omc got=s4 want=s4 ms=10018 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 tree-unchanged-during-run", + "PASS count 67", + "FAIL count 0" + ], + "repeat": null +} diff --git a/evidence/node-view/receipt.a6f6c095d27fc4e3987f245ed550e775cac1ceaa2e7243e08eef13251dd0d951.json b/evidence/node-view/receipt.a6f6c095d27fc4e3987f245ed550e775cac1ceaa2e7243e08eef13251dd0d951.json new file mode 100644 index 000000000..5d45ab565 --- /dev/null +++ b/evidence/node-view/receipt.a6f6c095d27fc4e3987f245ed550e775cac1ceaa2e7243e08eef13251dd0d951.json @@ -0,0 +1,238 @@ +{ + "issue": "DRA-291", + "source_commit": "d54bdd6dc1629e36284d778b4b707717520e1032", + "source_tree": "d2f0ef1c537daa961edd1602179e2efd05301faa", + "platform": "Linux 7.0.0-1019-nvidia aarch64 spark-b87b", + "cpu_affinity_mask_hex": "70000", + "execution": "NATIVE Linux AArch64 host CPU (DGX Spark host, no GPU opened); acceptance against seed/node/tests/fake-serve.om replaying recorded round40 turns", + "timestamp_utc": "2026-11-07T04:45:36.073513+00:00", + "independent_review": false, + "native_aarch64": "PASS", + "spark_gate_judge": "NOT_RUN", + "live_hive": "NOT_DEPLOYED", + "script": "~/work/omega-node-291.sh (DRA-291 PR body; run from the worktree of this commit) (compile with seed/out/omc, run under timeout; mutants are one-line sed edits of a disposable copy)", + "hashes": { + "seed/out/omc": "5f90edea61bac241398df5036990d899361a5acd9decb37954ce088ec0f6f6df", + "seed/node/auth-gate.om": "c37e6ee5a041d60840727c1993b08057369099d4042e0456823239b330e2a35a", + "seed/node/auth.om": "edf2f075d3751a8025363bc658252537f865dfc29f975fcf5d93c353b3282b30", + "seed/node/auth-test.om": "af66c87f83d73a5bdbaf181378eb69bb0645a86fe9b39de2f1b714041fbc20b8", + "seed/node/code-main.om": "8609a3be3fc2520fbcd0e576e672882f7dce3c3eac0f654d4e0e176648bdd6b5", + "seed/node/code.om": "560f1ff72e1dd9f2939009125e502e351ed047eb571565b2dbac533e668c5b74", + "seed/node/code-test.om": "f0d2ce3c208333782ebf37577ad94d00b240d4754108f0169208fc94ed81bfe0", + "seed/node/gram.om": "ebba1f4c693f218969dc2f17eb680760977d38d694ac76db477853aefa64b291", + "seed/node/infer.om": "8606f2bc917e7942033cf26355e72b92eae75b99c7b25e6f1ced953d8903ff4f", + "seed/node/journal-gate.om": "d0db0257ac03d00a801ca12598d147201d03cad85c806e4d29d260f34587b19f", + "seed/node/journal.om": "37e07b72bfef4bccb0555625dc1dc515b091e42d03c5a879ef2fde677784e71b", + "seed/node/journal-test.om": "b3f2d93e64c87c4c8c0193174cbc3ef6435085e47360d59641c63cc96f48274e", + "seed/node/op.om": "cc86d0f4099e00e610a25eba10b87b2c79856496c94b808ba26dbaa429712d99", + "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/agent/agent.om": "84a595c27bf23b9562fc2ea7c97f0e2dce17a151ceb28c7928be5adebef1dbce", + "seed/agent/path.om": "1daef7e888e45f7cd7f2f8bb1ea34bc061115c261aac3740f3c799803f7079b2", + "seed/authority/action.om": "59cb9c3dfdcd9193bc4a272deda4fcd256a0d7693f3bcb58bc4e30ed78faab2b", + "seed/authority/action-gate.om": "716761cfee0af722586def0a0e06342bd0d4a8482c64ef75aeb0e92eae21e604", + "seed/node/tests/tool-replay.py": "e220595d7912f3d0219825befc227284dc5782cb969f1f06cc969b6c3251db86", + "seed/node/tests/view-accept.py": "9073cc118b1ad49b6a5a4d23479753a95cf021455a94f54f23eb431e48e50b91", + "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": 12, + "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": 2164, + "stdout": "stress rolls=2000 busy=2523 reads=2036 2022\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": 8064, + "stdout": "idle ticks workers=0 creator=0 wake rounds=200 mean_us=89 max_us=3405\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": 746, + "stdout": "PASS node authority\n", + "binary_sha256": "1cff100077b76e1d773886f7ada81b8945a07621d024fcc092ee15011583ac67", + "verdict": "PASS", + "leaked_tool_processes_after_run": 0 + }, + { + "case": "journal-gate", + "compile_exit": 0, + "expected_exit": "0", + "run_exit": 0, + "wall_ms": 3238, + "stdout": "PASS node journal\n", + "binary_sha256": "4484672957407ad405302b404b1b844c99e721d217dedd48d88ffa35ee9e580d", + "verdict": "PASS", + "leaked_tool_processes_after_run": 0 + }, + { + "case": "action-gate", + "compile_exit": 0, + "expected_exit": "0", + "run_exit": 0, + "wall_ms": 1, + "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=12 bin=470aefe90345217a leaked_tools=0 stdout=PASS node transport ", + "PASS pool-gate compile=0 exit=0 want=0 ms=2164 bin=afd1063c4e534ade leaked_tools=0 stdout=stress rolls=2000 busy=2523 reads=2036 2022 PASS node pool ", + "PASS sched-gate compile=0 exit=0 want=0 ms=8064 bin=68b835c0821b4458 leaked_tools=0 stdout=idle ticks workers=0 creator=0 wake rounds=200 mean_us=89 max_us=3405 PASS node sched ", + "PASS auth-gate compile=0 exit=0 want=0 ms=746 bin=1cff100077b76e1d leaked_tools=0 stdout=PASS node authority ", + "PASS journal-gate compile=0 exit=0 want=0 ms=3238 bin=4484672957407ad4 leaked_tools=0 stdout=PASS node journal ", + "PASS action-gate compile=0 exit=0 want=0 ms=1 bin=f56e5696dfcfc8a1 leaked_tools=0 stdout=action checks=219 000 ", + "PASS build-infer compile=0 bytes=132576 sha256=8cc5fb3044c9c794326e66b57aac7c6889c5cf498f4750503637d97505c1f806", + "PASS build-tool compile=0 bytes=34396 sha256=a1bdecb08c74f89ddbd2bd674b224d21ed2a983268964972dd8f8ee701aa1c8d", + "PASS build-code-main compile=0 bytes=243532 sha256=722330cab6549ecb75683e6bbe452dd4f0b54e9f77c1dcd73beea7167ece1282", + "PASS build-code-test compile=0 bytes=268044 sha256=9840e69e14d9e603ce010ef6085908701cfad78ee1003f4eedc8c031a7ea797f", + "PASS build-op compile=0 bytes=68896 sha256=5a03192b6a83f8e0867c9e93f29d1ad58c7c2521ea12c09bc3d29c08bf2b0ccb", + "PASS build-fake-serve compile=0 bytes=71808 sha256=9397ef1ff5e2250e60109fd51edc009e01ed0c5662176701bbaa84d3735b1a87", + "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=49797", + "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=49797", + "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': 1, 'journal_seq': 3, 'incarnation': 1}", + "view-accept: PASS cmd-invalid-budget rc=1 {'id': 12, 'status': 'invalid', 'version': 1, 'journal_seq': 3, 'incarnation': 1}", + "view-accept: PASS cmd-other-incarnation rc=1 {'id': 13, 'status': 'stale', 'version': 1, 'journal_seq': 0, 'incarnation': 1}", + "view-accept: PASS cmd-budget-committed id=14 {'id': 14, 'status': 'committed', 'version': 2, 'journal_seq': 4, 'incarnation': 1}", + "view-accept: PASS cmd-budget-visible budget=6 last=14", + "view-accept: PASS cmd-duplicate-ack {'id': 14, 'status': 'duplicate', 'version': 2, 'journal_seq': 4, 'incarnation': 1}", + "view-accept: PASS cmd-pause {'id': 40, 'status': 'committed', 'version': 3, 'journal_seq': 6, 'incarnation': 1}", + "view-accept: PASS cmd-pause-duplicate-version {'id': 40, 'status': 'duplicate', 'version': 3, 'journal_seq': 6, 'incarnation': 1} original=3", + "view-accept: PASS cmd-pause-again-invalid {'id': 41, 'status': 'invalid', 'version': 4, 'journal_seq': 6, 'incarnation': 1}", + "view-accept: PASS cmd-paused-holds auth={'generation': 1, 'paused': 1, 'journal_seq': 9, 'journal_failed': 0, 'fence': 1, 'version': 4} 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': 8, 'journal_seq': 11, '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': 1, 'journal_seq': 2, 'incarnation': 1}", + "view-accept: PASS budget-ends-12 ['CWO 0 FAIL 12 2']", + "view-accept: PASS overload-view-up port=34523", + "view-accept: PASS overload-refusals-visible refused=29 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': 4, 'incarnation': 1}, 201: {'id': 201, 'status': 'committed', 'version': 4, 'journal_seq': 5, 'incarnation': 1}}", + "view-accept: PASS crash-view-exits-with-creator port=40509", + "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': 11, 'incarnation': 2}", + "view-accept: PASS crash-cancel-finished-invalid {'id': 1200, 'status': 'invalid', 'version': 2, 'journal_seq': 11, '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=5 fail=2 failing: crash-oper-replayed crash-cancel-finished-invalid ", + "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=3 fail=2 failing: 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 ", + "PASS tool-replay TOOL-REPLAY runs=108 pass=108 fail=0 actions=417", + "PASS tool-dotdot got=s2 want=s2 ms=1 leaked=0 record=OMNT1 2 13 0|Path refused.", + "PASS tool-absolute got=s2 want=s2 ms=1 leaked=0 record=OMNT1 2 13 0|Path refused.", + "PASS tool-final-symlink got=s2 want=s2 ms=1 leaked=0 record=OMNT1 2 13 0|Path refused.", + "PASS tool-dir-symlink got=s2 want=s2 ms=1 leaked=0 record=OMNT1 2 13 0|Path refused.", + "PASS tool-missing got=s1 want=s1 ms=1 leaked=0 record=OMNT1 1 15 0|File not found.", + "PASS tool-over-3800 got=s3 want=s3 ms=1 leaked=0 record=OMNT1 3 24 0|File is over 3800 bytes.", + "PASS tool-read got=s0 want=s0 ms=1 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=1 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=1 leaked=0 record=OMNT1 5 33 0|Old text must occur exactly once.", + "PASS tool-replace got=s0 want=s0 ms=11 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=26 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=10 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=5 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=5 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=6 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=5 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=1 leaked=0 record=", + "PASS tool-verb got=x2 want=x2 ms=1 leaked=0 record=", + "PASS tool-relative-work got=s4 want=s4 ms=1 leaked=0 record=OMNT1 4 10 0|I/O error.", + "PASS tool-slow-omc got=s4 want=s4 ms=10005 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 tree-unchanged-during-run", + "PASS count 67", + "FAIL count 0" + ], + "repeat": null +} diff --git a/seed/node/.crumb b/seed/node/.crumb index 8225cd12b..4abde528c 100644 --- a/seed/node/.crumb +++ b/seed/node/.crumb @@ -3,14 +3,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-11-07T03:51:26Z", + "compiled_at": "2026-11-07T04:35:31Z", "compiler": "crumb-compile/1", - "digest": "sha256:24501ac83754018dfd584d223112ae43ce47790ce8b9b15871fbc63a7bc317f1", + "digest": "sha256:8ca7003bde1508c44228b3330ba09e3766f8d2e4290c331e51ffe34fb34e699d", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 24, - "generated_at_commit": "507483cd8cb177015006ebcd7d95bd4ae792be56", - "source_tree": "sha256:2c9e620c185d3759a56e4dd7668b796f45515093fc7f2ed4e927bc24039be80c" + "files": 29, + "generated_at_commit": "a3360715db220521a2a6d4ed50295d7884e0e3d6", + "source_tree": "sha256:4c149502f2c978cbd9d23e6e45a0bf798dbada7c685eca78fe6bbc0d8fb08933" }, "owner_lane": "", "seed": { diff --git a/seed/node/README.md b/seed/node/README.md index bdbde47bd..3802d8398 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 and coding workflow +# Omega Node shared-memory transport, epoch pool, worker supervision, scheduling, authority, journal, coding workflow and operator view 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 @@ -599,10 +599,10 @@ All four are OM-2 programs (`printf 'om2\n'` before the sources): L="seed/node/transport.om seed/node/pool.om seed/node/super.om seed/node/sched.om seed/authority/action.om seed/node/journal.om seed/node/auth.om" { printf 'om2\n'; cat seed/json/json.om seed/json/jsonw.om seed/net/http.om seed/net/notls.om seed/node/infer.om; } | seed/out/omc > build/node/infer { printf 'om2\n'; cat seed/agent/path.om seed/node/gram.om seed/node/tool.om; } | seed/out/omc > build/node/tool -{ printf 'om2\n'; cat $L seed/node/gram.om seed/node/code.om seed/node/code-main.om; } | seed/out/omc > build/node/code-main -{ printf 'om2\n'; cat $L seed/node/gram.om seed/node/code.om seed/node/code-test.om; } | seed/out/omc > build/node/code-test +{ printf 'om2\n'; cat seed/net/http.om seed/net/notls.om $L seed/node/view.om seed/node/gram.om seed/node/code.om seed/node/code-main.om; } | seed/out/omc > build/node/code-main +{ printf 'om2\n'; cat seed/net/http.om seed/net/notls.om $L seed/node/view.om seed/node/gram.om seed/node/code.om seed/node/code-test.om; } | seed/out/omc > build/node/code-test chmod +x build/node/infer build/node/tool build/node/code-main build/node/code-test -build/node/code-test unit build/node/cu # "code checks=54 fail=0", exit 0 +build/node/code-test unit build/node/cu # "code checks=57 fail=0", exit 0 python3 seed/node/tests/tool-replay.py build/node/tool OMC40 ROUND40 build/node/replay # pass=108 fail=0 ``` @@ -614,7 +614,7 @@ run directory holding `repair.py` and `final-selected.json`. ### Programs -`omnode-code INFER TOOL OMC ROOT WORK JDIR PORT OBJ...` runs 1..4 objectives +`omnode-code INFER TOOL OMC ROOT WORK JDIR PORT VIEW OBJ...` runs 1..4 objectives `KIND,K,N,A,PATH,TASK` (KIND `add`, `mul` or `loop`) against the files under ROOT, with the journal in JDIR and compile scratch in `WORK/o`. The creator holds every objective's state and alone decides; two workers run the granted @@ -675,7 +675,8 @@ ends the objective as FAIL with its reason; nothing is retried or repaired. Output: `CWP i turn n` and `CWR i turn n` lines, each followed by n bytes (the prompt; the model text) and a newline; `CWE i job event value` job events (1 issued, 2 model action kind, 3 tool status, 4 outcome word, 5 -cancel); `CWO i PASS|FAIL result turns`; `CWSUM pass= fail=`. Exit 0 when +cancel); +`CWO i PASS|FAIL result turns`; `CWSUM pass= fail=`. Exit 0 when every objective passed, 1 otherwise, 2 usage, 62 out of time, 30 + a journal refusal. @@ -693,13 +694,15 @@ only, so a `\r` makes a line fall outside the grammar where Python's ### Acceptance and controls -`code-test unit` (54 checks, no child process) feeds crafted model and tool +`code-test unit` (57 checks, no child process) feeds crafted model and tool records to the creator: the round40 prompts byte for byte; every action in every state; wrong path; old text absent, twice, many times; an edit outside the grammar; `Tests passed.` unverified or after an edit; `File not found.` when not missing; header and length faults; tool content that differs from the source or candidate; outcome words for exit 4, 5 and 8, a killed child, -cancellation, UNKNOWN and a lost input; the turn limit; an over-long prompt. +cancellation, UNKNOWN and a lost input; the turn limit; an over-long prompt; +a full admission queue (DRA-291: a refused inference waits for its next turn, +a refused tool job ends the objective 23, both counted). `code-test cancel MS ...` is `omnode-code` with objective 0's first inference cancelled through `auth_cancel` after MS milliseconds. @@ -720,3 +723,125 @@ cancelled through `auth_cancel` after MS milliseconds. | cancelled read as UNKNOWN | 197 | | missing file read as read | 178 | | prompt limit raised to 4000 | 203 | +| refused tool job left waiting (DRA-291) | 206 | + +## Operator view and commands (DRA-291) + +Status: IMPLEMENTED in `view.om`, `op.om` and `code.om` (with OPER records in +`journal.om`), exercised on native Linux AArch64 by `tests/view-accept.py`, +which drives the real `omnode-code` and `omnode-infer` through `omnode-op` +only, against `tests/fake-serve.om`, a server that answers with the recorded +round40 model turns. Not QUALIFIED on the Spark and not DEPLOYED. + +```sh +{ printf 'om2\n'; cat seed/net/http.om seed/net/notls.om seed/node/op.om; } | seed/out/omc > build/node/op +{ printf 'om2\n'; cat seed/net/http.om seed/net/notls.om seed/node/tests/fake-serve.om; } | seed/out/omc > build/node/fake-serve +chmod +x build/node/op build/node/fake-serve +python3 seed/node/tests/view-accept.py $PWD/build/node OMC40 ROUND40 build/node/accept # VIEWSUM pass=46 fail=0 +``` + +### Model + +The creator alone holds and changes state. Before its workers start it maps +one shared page (32768 bytes, `vw_new`) and, when VIEW is not 0, forks the +view process (`vw_spawn`): an `.om` HTTP server on 127.0.0.1 built on +`seed/net/http.om`. The view process only reads the page and posts commands +into its mailbox; it drops the creator's life-pipe write end and the journal +descriptors, and exits when the creator sets the stop word or is gone (its +parent pid changes). Workers never see it. + +Every creator loop writes a snapshot under a seqlock and appends one event +per change to a ring of 256 events; the version counts the events of this +incarnation, and the incarnation is the journal's fence. Event types: 1 job +(what, id, value; the same values as the `CWE` lines), 2 objective result, +3 command, 4 pause, 5 worker, 6 admission refused, 7 uncertain effect. + +| Request | Answer | +| --- | --- | +| `GET /view` | snapshot: authority (generation, paused, journal seq and failure, fence, version of the last pause change), queue (waiting, ready, running, review, unknown, limit, review limit, admissions refused), commands (committed, refused, last id), workers (pid, incarnation, control acknowledged, paused), uncertain job ids, objectives (kind, K, N, A, state, turns, budget, phase, job in flight, result, version of the last change, redirect and cancel pending, next job seq), limits | +| `GET /view?since=S&inc=I` | delta `[version, type, target, x, a, b]` for every event after S when I is this incarnation and the ring still holds them; otherwise a snapshot (a client resyncs from it) | +| `POST /cmd?id=&op=&target=&inc=&ver=&a=&b=&c=&d=` | acknowledgement `{id, status, version, journal_seq, incarnation}` | +| `GET /health` | `{"ok":true}` | + +Polling, not streaming: one request per connection keeps the single-threaded +view process answering commands while a client is slow or gone. + +### Commands + +Ops: 1 pause, 2 resume, 3 cancel objective, 4 set its turn budget to a +(0..7), 5 redirect it to kind a (1..3), K b, N c, A d (each 0..99). +`omnode-op PORT cmd ID OP TARGET INC VER [A..D]` posts one; `ID` is the +operator's command id, `INC`/`VER` the incarnation and version of the view +the decision was made on. + +| Status | HTTP | When | +| --- | --- | --- | +| committed | 200 | durable in the journal and acted on | +| duplicate | 200 | the id was committed before (also by an earlier incarnation); the original version is returned, nothing runs again | +| stale | 409 | another incarnation, or the target changed after VER (the pause state for 1 and 2, the objective for 3..5) | +| invalid | 400 | unknown op or target, out-of-range argument, a finished objective, pausing when paused | +| refused | 500 | the journal refused the record | +| busy | 503 | another command is posted and not yet taken | +| pending | 504 | no acknowledgement in 5 s: post the same id again | + +The creator takes one command per loop. Pause and resume go through +`auth_pause` (which journals PAUSE and tells every worker), then OPER is +appended and synced; the objective commands append OPER first and then act: +cancel ends the objective with 19 at once when nothing is in flight, else +its job is cancelled through `auth_cancel` and the objective ends 19 when +the job's result arrives; redirect sets the goal and starts over from +unread the same way; budget takes effect at the next turn (out of turns +ends 12). A committed command's acknowledgement carries the version of its +own command event. At a restart the OPER table is replayed in order after +the objectives resume (pause comes back from the PAUSE record), so a +cancelled objective stays cancelled and a budget or goal stays set. + +At the admission limit only inferences are refused: a tool job is issued +after its objective's previous job left the queue, so it takes that job's +place. A refused inference is asked for again at the next turn; a tool job +the authority refuses anyway ends its objective with 23 instead of leaving +it waiting unseen. The view counts the refusals. + +An effect whose worker died while the job was assigned is shown at once as +uncertain (snapshot and event 7) and its objective ends 21. The scheduler +cannot tell whether the tool started; the next incarnation's recovery +settles it from the journal: a START without a DONE stays UNKNOWN for good +(and stays listed), no START proves the effect never ran (the job is +cancelled and no longer listed). + +### Acceptance and controls + +`view-accept.py` (46 checks) runs nine scenarios, each a real +`omnode-code` (or `omnode-code-test overload LIMIT` / `uncertain`, the same +program with a test hook) and the fake server: the full four-objective run +followed only through deltas across a 1.5 s disconnect (no version gaps; the +job events equal the `CWE` lines); resync to a snapshot for another +incarnation or an impossible `since`; stale, invalid, other-incarnation, +committed and duplicate commands (a duplicate pause carries the pause's +original version, though the pause moved the view on before its ack); pause +holding grants for 4 s and resume; +cancel and redirect of an objective whose inference is in flight; a budget +of 2 turns; admission limit 1 with refusals visible, a command committed and +the run completing; a worker killed while assigned a replace; the creator +killed with SIGKILL (the view exits with it, the next incarnation replays +both commands, answers the old id as duplicate with its original version, +and old clients resync). `omnode-op` usage errors exit 2. + +Each change below is built into its own copy of the programs and run on one +scenario; the named check must fail. The same copy with no change runs every +scenario first and must pass all of them, else the mutant runs are void. + +| Change | Check that fails | +| --- | --- | +| staleness not checked | `cmd-stale-409` | +| committed ids not looked up | `cmd-duplicate-ack` | +| OPER not replayed at restart | `crash-oper-replayed` | +| no uncertain event | `uncertain-event` | +| delta starts one event late | `resync-delta-from-0` | +| incarnation not checked | `cmd-other-incarnation` | +| pause recorded but not applied | `cmd-paused-holds` | +| redirect ignored when the cancelled job returns | `redirect-run-passes` | +| budget ignored | `budget-ends-12` | +| 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` | diff --git a/seed/node/code-main.om b/seed/node/code-main.om index 80042c8b4..0b7521cb6 100644 --- a/seed/node/code-main.om +++ b/seed/node/code-main.om @@ -1,7 +1,8 @@ note seed/node/code-main.om -- omnode-code, the coding workflow program: -note omnode-code INFER TOOL OMC ROOT WORK JDIR PORT OBJ [OBJ...] -note with 1..4 objectives "KIND,K,N,A,PATH,TASK" and absolute paths (see -note seed/node/code.om). One hour for the whole run. +note omnode-code INFER TOOL OMC ROOT WORK JDIR PORT VIEW OBJ [OBJ...] +note with 1..4 objectives "KIND,K,N,A,PATH,TASK", absolute paths and the +note operator view's port VIEW on 127.0.0.1 (0 for none; see +note seed/node/code.om and seed/node/view.om). One hour for the whole run. fn main to int ret cw_main 1 3600 end diff --git a/seed/node/code-test.om b/seed/node/code-test.om index e04db8ecc..179dbe2f2 100644 --- a/seed/node/code-test.om +++ b/seed/node/code-test.om @@ -2,11 +2,17 @@ note seed/node/code-test.om -- checks of the coding workflow (DRA-290). note omnode-code-test unit JDIR: the creator's decisions on crafted model note and tool records, no child process; prints "code checks=N fail=F" and note exits 0, or 150 + the number of the first failing check. -note omnode-code-test cancel MS INFER TOOL OMC ROOT WORK JDIR PORT OBJ...: +note omnode-code-test cancel MS INFER TOOL OMC ROOT WORK JDIR PORT VIEW OBJ...: note omnode-code with objective 0's first inference cancelled through 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). text ctunit "unit" text ctcanc "cancel" +text ctover "overload" +text ctunc "uncertain" text ctobj "loop,4,3,70,jobs/item76666.om,Fix the error in this file and confirm its goal." text ctpath "jobs/item76666.om" text ctbadp "jobs/item76667.om" @@ -381,6 +387,25 @@ cw_plan c ct_ok and ct_is 0 1 eq cw_g 0 7 1 end +note A full queue: a refused inference is asked for again (the objective +note keeps waiting for a turn); a refused tool job ends the objective with +note 23; both refusals are counted for the view. +fn ct_full c long to void +for k ulong 64 +if lt jn_admit add 9001 k 0 1 0 +break +end +end +r0 = vw_cget 0 +ct_set 0 0 0 +cw_plan c +ct_ok and ct_is 0 0 eq cw_g 0 9 0 +ct_set 1 0 1 +cw_tool c 0 3 +ct_ok ct_is 23 0 +ct_ok eq vw_cget 0 add r0 2 +end + fn ct_unit to int d = new uchar 1024 0 n = argread 2 d 0 1000 @@ -423,6 +448,7 @@ ct_bad ct_tools ct_fates ct_limits c +ct_full c jn_close ret ct_end end @@ -453,6 +479,12 @@ end if cw_eq view part b 0 ulong n ctcanc ret 2 end +if cw_eq view part b 0 ulong n ctover +ret 3 +end +if cw_eq view part b 0 ulong n ctunc +ret 4 +end ret 0 end @@ -467,6 +499,18 @@ put cwtk 0 1 put cwtk 1 ms ret cw_main 3 3600 end +if eq m 3 +q = ct_num 2 +if eq q 0 +ret 2 +end +put cwql 0 q +ret cw_main 3 3600 +end +if eq m 4 +put cwtu 0 1 +ret cw_main 2 3600 +end ret 2 end diff --git a/seed/node/code.om b/seed/node/code.om index 1f1403f91..ed92e4fc5 100644 --- a/seed/node/code.om +++ b/seed/node/code.om @@ -1,9 +1,11 @@ note seed/node/code.om -- the Omega Node coding workflow (DRA-290): the note round40 repair protocol (read, check, edit, check again, answer) driven note by the own Omega model through the Node's scheduler, authority and -note journal. OM-2. Compose after transport.om, pool.om, super.om, sched.om, -note seed/authority/action.om, journal.om, auth.om, seed/node/gram.om, and -note before one program with fn main (code-main.om or code-test.om). +note journal, under live operator control (DRA-291). OM-2. Compose after +note seed/net/http.om, seed/net/notls.om, transport.om, pool.om, super.om, +note sched.om, seed/authority/action.om, journal.om, auth.om, view.om, +note seed/node/gram.om, and before one program with fn main (code-main.om +note or code-test.om). note Processes. The creator holds every objective's state; it alone reads note model output and decides. Two workers run granted jobs, each one child note process in its own process group (auth_wtool): omnode-infer for a model @@ -33,9 +35,21 @@ 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 7 and its job ids continuing. +note performed counted against its budget and its job ids continuing; the +note committed operator commands are then applied again in order. +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 +note operator saw (stale when its target changed since), committed in the +note journal (OPER; pause and resume first through auth_pause), then acted +note on and acknowledged: pause and resume, cancel an objective (its job in +note flight is cancelled through the authority and the objective ends 19), +note set its turn budget (0..7; out of turns ends 12), or redirect it to +note another goal (its job in flight is cancelled and it starts over from +note unread). A tool job the authority refuses ends its objective with 23. note Events on stdout, one line each: CWP (prompt) and CWR (model text) are -note followed by their bytes and a newline; CWE job events; CWO results. +note followed by their bytes and a newline; CWE job events; CWO results; +note CWV the operator view's port once it listens. const CWOBJ ulong 4 text cwtask "Task: " text cwfile "\nFile: " @@ -83,7 +97,7 @@ global cwcf uchar 8192 global cwcl ulong 8 global cwno ulong 1 global cwos uchar 2048 -global cwob ulong 64 +global cwob ulong 128 global cwsrc uchar 16384 global cwobs uchar 4096 global cwcan uchar 16384 @@ -91,19 +105,27 @@ global cwinf ulong 1 global cwgot ulong 64 global cwt0 ulong 4 global cwtk ulong 2 - -note ======== objective words: cwob[16 i + w]: 0 kind (1 add, 2 mul, 3 loop), +global cwpv ulong 1 +global cwql ulong 1 +global cwtu ulong 1 +text cwcwv "CWV " +note Objective words shown in the view's rows, as characters '0' + word. +text cwvw "012367@9: \n" then klen key bytes and vlen value +note bytes. Every answer comes DELAY_MS ms after the request was read: POST +note /v1/completions whose body contains a key gets 200 with that key's +note value as the body; any other request 404. +note One request at a time, 127.0.0.1 only. Prints PORT n, then one line +note per request: F status key-index ms. +text fsurl "/v1/completions" +text fsjson "application/json" +text fsctype "Content-Type" +text fsport "PORT " +text fsf "F " +text fssp " " +text fsnl "\n" +global fsmap uchar 2097152 +global fsn ulong 1 +global fsk ulong 1024 + +fn fs_num i ulong to ulong +b = new uchar 32 0 +n = argread i b 0 32 +if or lt n 1 gt n 9 +ret not ulong 0 +end +v = ulong 0 +for j ulong ulong n +c = ulong get b j +if or lt c 48 gt c 57 +ret not ulong 0 +end +v = add mul v 10 sub c 48 +end +ret v +end + +note Load MAP: false when unreadable or malformed. fsk[4k..]: key offset, +note key length, value offset, value length. +fn fs_load to bool +p = new uchar 1024 0 +n = argread 2 p 0 1000 +if lt n 1 +ret false +end +fd = fopen p 0 ulong n 524288 0 +if lt fd 0 +ret false +end +t = ulong 0 +for it ulong 4096 +r = read int fd fsmap t sub 2097152 t +if le r 0 +break +end +t = add t ulong r +end +x = fclose int fd +ret fs_index t +end + +fn fs_index t ulong to bool +p = ulong 0 +k = ulong 0 +for it ulong 256 +if ge p t +put fsn 0 k +ret true +end +a = fs_dnum p +p = add p add fs_dlen p 1 +b = fs_dnum p +p = add p add fs_dlen p 1 +if gt add add p a b t +ret false +end +o = mul k 4 +put fsk o p +put fsk add o 1 a +put fsk add o 2 add p a +put fsk add o 3 b +p = add add p a b +k = add k 1 +end +ret false +end + +fn fs_dlen p ulong to ulong +for i ulong 12 +c = ulong get fsmap add p i +if or lt c 48 gt c 57 +ret i +end +end +ret 12 +end + +fn fs_dnum p ulong to ulong +v = ulong 0 +for i ulong fs_dlen p +v = add mul v 10 sub ulong get fsmap add p i 48 +end +ret v +end + +note The entry whose key occurs in body b[0, n), or -1. +fn fs_find b view uchar 1048576 n ulong to long +for k ulong get fsn 0 bound 256 +o = mul k 4 +ko = get fsk o +kl = get fsk add o 1 +if and gt kl 0 le kl n +for s ulong add sub n kl 1 +if fs_at b s ko kl +ret long k +end +end +end +end +ret neg long 1 +end + +fn fs_at b view uchar 1048576 s ulong ko ulong kl ulong to bool +for i ulong kl +if ne get b add s i get fsmap add ko i +ret false +end +end +ret true +end + +fn fs_out a view uchar * n ulong to void +x = write 1 a 0 n +end + +fn fs_dec v ulong to void +d = new uchar 20 0 +k = ulong 20 +x = v +for it ulong 20 +k = sub k 1 +put d k uchar add rem x 10 48 +x = div x 10 +if eq x 0 +break +end +end +fs_out view part d k sub 20 k sub 20 k +end + +fn fs_log st ulong k long ms ulong to void +fs_out fsf len fsf +fs_dec st +fs_out fssp 1 +if lt k 0 +fs_dec ulong 999 +else +fs_dec ulong k +end +fs_out fssp 1 +fs_dec ms +fs_out fsnl 1 +end + +fn fs_one fd int cs edit ulong 320 io edit uchar 131072 bd edit uchar 1048576 dl ulong to void +t0 = monons +r = hinit cs io fd 1 +hsettmo cs 5000000000 5000000000 +hsetbdl cs 5000000000 +r = hreqrd cs io +if le r 0 +x = hclose cs +ret +end +put cs HBCAP 1048576 +n = hbodyall cs io bd +k = neg long 1 +if and gt n 0 hispath cs io fsurl +k = fs_find bd ulong n +end +x = sleepns long mul dl 1000000 +if lt k 0 +r = hrsperr cs io 404 +x = hclose cs +fs_log ulong 404 k ulong div sub monons t0 1000000 +ret +end +fs_reply cs io bd ulong k +x = hclose cs +fs_log ulong 200 k ulong div sub monons t0 1000000 +end + +note Answer with entry k's value (copied into vb, a global is never a call +note argument). +fn fs_reply cs edit ulong 320 io edit uchar 131072 vb edit uchar 1048576 k ulong to void +o = mul k 4 +vo = get fsk add o 2 +vl = get fsk add o 3 +for i ulong vl +put vb i get fsmap add vo i +end +put cs HKEEP 0 +r = hrspst cs io 200 +r = hfe r hhname cs io fsctype +r = hfe r hhval cs io fsjson +r = hfe r hhend cs io 0 vl +r = hfe r hput cs io view part vb 0 vl +r = hfe r hwfin cs io +end + +fn main to int +cs = new ulong 320 0 +io = new uchar 131072 0 +bd = new uchar 1048576 0 +a = new uchar 16 0 +if ne argcnt 4 +ret 2 +end +po = fs_num 1 +dl = fs_num 3 +if or or eq po 0 gt po 65535 or eq po 18091 gt dl 600000 +ret 2 +end +if not fs_load +ret 3 +end +r = haddr4 a 2130706433 po +lf = hlisten a 16 +if lt lf 0 +ret 4 +end +fs_out fsport len fsport +fs_dec hport a +fs_out fsnl 1 +for it ulong 1000000000 +c = haccept int lf neg long 1 +if ge c 0 +fs_one int c cs io bd dl +end +end +ret 0 +end diff --git a/seed/node/tests/view-accept.py b/seed/node/tests/view-accept.py new file mode 100755 index 000000000..b0aa2c313 --- /dev/null +++ b/seed/node/tests/view-accept.py @@ -0,0 +1,431 @@ +#!/usr/bin/env python3 +"""DRA-291 acceptance: the operator view and commands of omnode-code, driven +only through omnode-op (seed/node/op.om) against the real workflow. + +Usage: view-accept.py BUILD OMC ROUND40 OUTDIR [SCENARIO...] +BUILD holds code-main, code-test, infer, tool, op and fake-serve (all built +from .om). OMC is the compiler round40 used (its error text is part of the +prompts). ROUND40 holds repair.py and final-selected.json. The model is +replaced by fake-serve, which answers the real omnode-infer with the +recorded round40 turns (view-prep.py writes its map), so every run is +deterministic and takes seconds. Prints one PASS/FAIL line per check and +"VIEWSUM pass=P fail=F"; exits 0 when nothing failed. +""" +import json, os, signal, socket, struct, subprocess, sys, time + +# the node takes absolute paths only +BUILD, OMC, R, OUT = (os.path.abspath(a) for a in sys.argv[1:5]) +HERE = os.path.dirname(os.path.abspath(__file__)) +os.makedirs(OUT, exist_ok=True) +NP = [0, 0] +PROCS = [] + + +def res(ok, name, detail=''): + NP[0 if ok else 1] += 1 + print(f"{'PASS' if ok else 'FAIL'} {name} {detail}"[:400], flush=True) + return ok + + +def free_port(): + s = socket.socket() + s.bind(('127.0.0.1', 0)) + p = s.getsockname()[1] + s.close() + assert p != 18091 + return p + + +def prep(name, ids, wrong=False): + base = os.path.join(OUT, name) + a = [sys.executable, os.path.join(HERE, 'view-prep.py'), R, base, ','.join(ids)] + if wrong: + a.append('wrong') + subprocess.run(a, check=True, capture_output=True) + objs = open(base + '/objs.txt').read().splitlines() + return base, objs, json.load(open(base + '/expect.json')) + + +def fake(base, delay): + port = free_port() + log = open(base + '/fake.log', 'a') + p = subprocess.Popen([BUILD + '/fake-serve', str(port), base + '/map', str(delay)], stdout=log, stderr=log) + PROCS.append(p) + wait_for(lambda: 'PORT' in open(base + '/fake.log').read(), 5) + return p, port + + +def node(base, objs, fport, mode=(), prog='code-main', tag='run'): + vport = free_port() + out = open(f'{base}/{tag}.out', 'w') + err = open(f'{base}/{tag}.err', 'w') + a = [BUILD + '/' + prog, *mode, BUILD + '/infer', BUILD + '/tool', OMC, base + '/root', base + '/work', + base + '/journal', str(fport), str(vport), *objs] + p = subprocess.Popen(a, stdout=out, stderr=err) + PROCS.append(p) + ok = wait_for(lambda: f'CWV {vport}\n' in open(f'{base}/{tag}.out').read() or p.poll() is not None, 10) + return p, vport, ok and p.poll() is None + + +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 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): + if since is None: + return op(port, 'view') + return op(port, 'view', since, inc) + + +def finish(p, t=60): + try: + return p.wait(t) + except subprocess.TimeoutExpired: + p.kill() + return p.wait() + + +def lines(base, tag='run'): + return open(f'{base}/{tag}.out').read().splitlines() + + +def cmd(port, cid, opn, tgt, snap, *args): + return op(port, 'cmd', cid, opn, tgt, snap['incarnation'], snap['version'], *args) + +def fresh(port, cid, opn, tgt, *args): + """Post from a fresh view, again while the target moves on in between + (a stale command is not recorded, so the same id may be posted again).""" + for k in range(20): + rc, s = view(port) + rc, a = cmd(port, cid, opn, tgt, s, *args) + if not (a and a['status'] == 'stale'): + return rc, a + return rc, a + + +KINDS = {'add': 1, 'mul': 2, 'loop': 3} + + +def journal_started(base, jid): + """True when job jid has a START whose operation has no settled DONE in + BASE/journal/journal: none, or only DONE with outcome 0 (UNKNOWN, as + the creator records a started job whose worker was lost). Records are 16 + little-endian words after a 64-byte header; word 0 type, 3..6 the + operation, 7 a DONE's outcome, 8 the job id of a START.""" + 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)] + ops = {r[3:7] for r in recs if r[0] == 3 and r[8] == jid} + settled = {r[3:7] for r in recs if r[0] == 4 and r[7] != 0} + return bool(ops - settled) + + +# ---- 1. full workflow, followed through snapshot + deltas, with a disconnect +def t_full(): + base, objs, ex = prep('full', ['76666', '83423', '82342', '85188']) + fs, fp = fake(base, 150) + p, vp, ok = node(base, objs, fp) + res(ok, 'full-view-up', f'port={vp}') + rc, s = view(vp) + res(rc == 0 and s and s['kind'] == 'snapshot' and s['layout'] == 1 and len(s['objectives']) == 4, + 'full-snapshot', f"rc={rc} v={s and s['version']} objs={s and len(s['objectives'])}") + # follow every event from the start of the incarnation (the ring holds it) + inc, ver, evs, gaps, kinds = s['incarnation'], 0, [], 0, set() + gone = 0 + t0 = time.time() + while p.poll() is None: + if 1.0 < time.time() - t0 < 2.5: + gone += 1 # disconnected: no polling for 1.5 s + time.sleep(0.05) + continue + rc, d = view(vp, ver, inc) + if rc != 0 or d is None: + break + kinds.add(d['kind']) + if d['kind'] == 'delta': + for e in d['events']: + if e[0] != ver + 1: + gaps += 1 + ver = e[0] + evs.append(e) + else: + ver = d['version'] + time.sleep(0.03) + rc = finish(p) + fs.kill() + out = lines(base) + cwe = [list(map(int, l.split()[1:5])) for l in out if l.startswith('CWE ')] + mine = [[e[2], e[4], e[3], e[5]] for e in evs if e[1] == 1] + res(rc == 0 and 'CWSUM pass=4 fail=0' in out, 'full-run', f'rc={rc} {out[-1]}') + res(gone > 0 and kinds == {'delta'} and gaps == 0 and len(mine) > 20 and cwe[:len(mine)] == mine, + 'full-delta-stream', f'gone={gone} kinds={sorted(kinds)} gaps={gaps} job-events={len(mine)}/{len(cwe)}') + res(subprocess.run(['ss', '-ltn', f'sport = :{vp}'], capture_output=True, text=True).stdout.count('LISTEN') == 0, + 'full-view-stopped', f'port={vp}') + + +# ---- 2. resync: wrong incarnation and impossible since give a snapshot +def t_resync(): + base, objs, ex = prep('resync', ['76666']) + fs, fp = fake(base, 400) + p, vp, ok = node(base, objs, fp) + # a delta from 0 must hold events: at version 0 an off-by-one in the event loop is invisible + wait_for(lambda: (view(vp)[1] or {}).get('version', 0) >= 2, 10) + rc, s = view(vp) + rc1, d1 = view(vp, 0, s['incarnation']) + rc2, d2 = view(vp, 0, s['incarnation'] + 7) + rc3, d3 = view(vp, s['version'] + 1000, s['incarnation']) + res(rc1 == 0 and d1['kind'] == 'delta' and d1['version'] >= 2 and [e[0] for e in d1['events']] == list(range(1, d1['version'] + 1)), + 'resync-delta-from-0', f"v={d1 and d1['version']} n={d1 and len(d1.get('events', []))}") + res(rc2 == 0 and d2['kind'] == 'snapshot', 'resync-other-incarnation', f"kind={d2 and d2['kind']}") + res(rc3 == 0 and d3['kind'] == 'snapshot', 'resync-future-since', f"kind={d3 and d3['kind']}") + rc, h = op(vp, 'view', 'x', 1) + res(rc == 2, 'op-usage-control', f'rc={rc}') + finish(p) + fs.kill() + + +# ---- 3. commands: stale, invalid, committed, duplicate, pause/resume +def t_commands(): + base, objs, ex = prep('cmds', ['76666']) + fs, fp = fake(base, 1200) + p, vp, ok = node(base, objs, fp) + 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}') + rc, a = fresh(vp, 12, 4, 0, 9) + res(rc == 1 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}') + cid = 14 + rc, a = fresh(vp, cid, 4, 0, 6) + res(rc == 0 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']}") + rc, a2 = cmd(vp, cid, 4, 0, s2, 6) + res(rc == 0 and a2['status'] == 'duplicate' and a2['version'] == a['version'] and + view(vp)[1]['commands']['committed'] == 1, 'cmd-duplicate-ack', f'{a2}') + # 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}') + # 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) + res(rc == 0 and ad['status'] == 'duplicate' and ad['version'] == a['version'], + '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}') + time.sleep(4) + rc, s4 = view(vp) + if s4 is None: + res(False, 'cmd-paused-holds', f'view gone rc={rc}') + else: + q = s4['queue'] + res(s4['authority']['paused'] == 1 and q['running'] == 0 and q['waiting'] + q['ready'] >= 1 and + 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}') + rc = finish(p, 120) + fs.kill() + out = lines(base) + res(rc == 0 and 'CWSUM pass=1 fail=0' in out, 'cmd-run-completes', f'rc={rc} {out[-1]}') + + +# ---- 4. cancel an objective whose inference is in flight +def t_cancel(): + base, objs, ex = prep('cancel', ['76666', '83423']) + fs, fp = fake(base, 4000) + p, vp, ok = node(base, objs, fp) + 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}') + wait_for(lambda: any(l.startswith('CWO 0 ') for l in lines(base)), 10) + dt = time.time() - t + rc = finish(p, 120) + fs.kill() + out = lines(base) + res('CWO 0 FAIL 19 1' in out and dt < 3.5, 'cancel-objective-19', f"{[l for l in out if l.startswith('CWO')]} after {dt:.1f}s") + res(rc == 1 and 'CWSUM pass=1 fail=1' in out, 'cancel-other-objective-passes', f'rc={rc} {out[-1]}') + + +# ---- 5. redirect a wrong goal while its inference is in flight +def t_redirect(): + base, objs, ex = prep('redirect', ['76666'], wrong=True) + fs, fp = fake(base, 2000) + p, vp, ok = node(base, objs, fp) + wait_for(lambda: view(vp)[1]['objectives'][0]['phase'] == 1, 10) + 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}') + 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}') + rc = finish(p, 120) + fs.kill() + out = lines(base) + res(rc == 0 and 'CWSUM pass=1 fail=0' in out, 'redirect-run-passes', f'rc={rc} {out[-1]}') + fl = open(base + '/fake.log').read().split('\n') + res(any(l.startswith('F 404') for l in fl), 'redirect-wrong-goal-unanswered', f'{fl[1:3]}') + + +# ---- 6. budget: fewer turns than the objective needs +def t_budget(): + base, objs, ex = prep('budget', ['76666']) + 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}') + rc = finish(p, 120) + fs.kill() + out = lines(base) + res('CWO 0 FAIL 12 2' in out and rc == 1, 'budget-ends-12', f"{[l for l in out if l.startswith('CWO')]}") + + +# ---- 7. overloaded queue: admission limit 1, refusals visible, commands still commit +# A tool job the authority refuses ends its objective with 23, so the run +# completing 3/3 also shows every refusal here was an inference (issued +# into the slot a tool job's own predecessor left); code-test unit covers a +# refused tool job. +def t_overload(): + base, objs, ex = prep('overload', ['76666', '83423', '82342']) + fs, fp = fake(base, 300) + p, vp, ok = node(base, objs, fp, mode=('overload', '1'), prog='code-test') + res(ok, 'overload-view-up', f'port={vp}') + seen, comm = 0, None + while p.poll() is None: + rc, s = view(vp) + if rc != 0: + break + seen = max(seen, s['queue']['refused']) + if seen > 0 and comm is None: + rc, a = cmd(vp, 140, 4, 2, s, 7) + if a and a['status'] != 'stale': + comm = a + time.sleep(0.05) + rc = finish(p, 120) + fs.kill() + out = lines(base) + res(seen > 0 and s['queue']['limit'] == 1, 'overload-refusals-visible', f"refused={seen} limit={s['queue']['limit']}") + res(comm is not None and comm['status'] == 'committed', 'overload-command-commits', f'{comm}') + res(rc == 0 and 'CWSUM pass=3 fail=0' in out, 'overload-run-completes', f'rc={rc} {out[-1]}') + + +# ---- 8. uncertain effect: the worker running a replace is killed +def t_uncertain(): + # objectives with as many turns as the one that loses its replace keep + # the node (and its view) running after the kill + base, objs, ex = prep('uncertain', ['76666', '82342', '85188']) + fs, fp = fake(base, 300) + p, vp, ok = node(base, objs, fp, mode=('uncertain',), prog='code-test') + last, ver, inc, ev7 = None, 0, None, [] + while p.poll() is None: + rc, s = view(vp) + if rc != 0: + break + inc = s['incarnation'] + if s['uncertain']: + last = s + rc, d = view(vp, ver, inc) + if rc != 0: + break + if d['kind'] == 'delta': + ev7 += [e for e in d['events'] if e[1] == 7] + ver = d['version'] + time.sleep(0.02) + rc2 = finish(p, 60) + fs.kill() + out = lines(base) + u = last and last['uncertain'] + res(u and len(u) == 1 and u[0] % 10 == 4, 'uncertain-listed', f'uncertain={u}') + i = u[0] // 1000 - 1 if u else -1 + res(len(ev7) == 1 and ev7[0][4] == u[0] and ev7[0][2] == i, 'uncertain-event', f'{ev7}') + res(any(l.startswith(f'CWO {i} FAIL 21') for l in out), 'uncertain-objective-21', + f"{[l for l in out if l.startswith('CWO')]}") + # The next incarnation's recovery settles it from the journal: a START + # without a DONE stays UNKNOWN for good; no START proves it never ran. + st = journal_started(base, u[0]) if u else None + fs, fp = fake(base, 100) + p, vp, ok = node(base, objs, fp, tag='run2') + rc, s = view(vp) + want = u if st else [] + res(rc == 0 and s['incarnation'] == last['incarnation'] + 1 and s['uncertain'] == want, + 'uncertain-after-restart', f"started={st} inc={s and s['incarnation']} uncertain={s and s['uncertain']}") + finish(p, 60) + fs.kill() + + +# ---- 9. creator killed: OPER replayed, duplicate acknowledged, old clients resync +def t_crash(): + base, objs, ex = prep('crash', ['76666', '83423']) + fs, fp = fake(base, 1500) + p, vp, ok = node(base, objs, fp) + ids = {} + for cid, opn, tgt, args in ((200, 3, 1, ()), (201, 4, 0, (6,))): + rc, a = fresh(vp, cid, opn, tgt, *args) + ids[cid] = a + res(all(a['status'] == 'committed' for a in ids.values()), 'crash-commands-committed', f'{ids}') + rc, old = view(vp) + p.send_signal(signal.SIGKILL) + p.wait() + gone = wait_for(lambda: subprocess.run(['ss', '-ltn', f'sport = :{vp}'], capture_output=True, + text=True).stdout.count('LISTEN') == 0, 3) + res(gone, 'crash-view-exits-with-creator', f'port={vp}') + p, vp2, ok = node(base, objs, fp, tag='run2') + rc, s = view(vp2) + o = s['objectives'] + res(s['incarnation'] == old['incarnation'] + 1 and s['commands']['committed'] == 2 and + o[1]['result'] == 19 and o[0]['budget'] == 6, 'crash-oper-replayed', + f"inc={s['incarnation']} cmds={s['commands']} r1={o[1]['result']} b0={o[0]['budget']}") + rc, d = view(vp2, old['version'], old['incarnation']) + 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}') + rc, a = cmd(vp2, cid + 1000, 3, 1, s) + res(rc == 1 and a['status'] == 'invalid', 'crash-cancel-finished-invalid', f'{a}') + rc = finish(p, 120) + fs.kill() + out = lines(base, 'run2') + res(rc == 1 and 'CWO 1 FAIL 19 0' in out and any(l.startswith('CWO 0 PASS') for l in out), + 'crash-run2-results', f"rc={rc} {[l for l in out if l.startswith('CWO')]}") + + +ONLY = sys.argv[5:] +for t in (t_full, t_resync, t_commands, t_cancel, t_redirect, t_budget, t_overload, t_uncertain, t_crash): + if ONLY and t.__name__[2:] not in ONLY: + continue + 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() +print(f'VIEWSUM pass={NP[0]} fail={NP[1]}', flush=True) +sys.exit(1 if NP[1] else 0) diff --git a/seed/node/tests/view-prep.py b/seed/node/tests/view-prep.py new file mode 100644 index 000000000..d0c709ec0 --- /dev/null +++ b/seed/node/tests/view-prep.py @@ -0,0 +1,47 @@ +"""Fixture for the DRA-291 view tests: objectives from the recorded round40 +episodes and the map of recorded model turns that fake-serve.om answers from. + +python3 view-prep.py ROUND40 BASE ID[,ID...] [WRONG] + +ROUND40 holds final-selected.json and repair.py. BASE gets root/ (the broken +files), work/, objs.txt (one objective argument per line), expect.json and +map (fake-serve's format: " \\n" key value). A key is the prompt as +a JSON string, which is how omnode-infer writes it into its request body; the +value is the completion response carrying the recorded raw model output. +With WRONG, the first objective's goal is changed to K+N+A+1 (a goal the map +has no turns for), which a redirect then corrects. +""" +import json, os, shutil, sys + +R, base, want = sys.argv[1], sys.argv[2], sys.argv[3].split(',') +wrong = len(sys.argv) > 4 +sys.path.insert(0, R) +import repair # noqa: E402 + +d = json.load(open(R + '/final-selected.json')) +shutil.rmtree(base, ignore_errors=True) +os.makedirs(base + '/root/jobs') +os.makedirs(base + '/work') +objs, recs, mp = [], [], [] +for w in want: + r = [x for x in d if w in x['job']['path']][0] + j = r['job'] + if j['fault'] != 'missing': + open(base + '/root/' + j['path'], 'w').write(j['broken']) + a = j['a'] + if wrong and not objs: + a = j['k'] + j.get('n', 0) + j['a'] + 1 + objs.append(f"{j['kind']},{j['k']},{j.get('n', 0)},{a},{j['path']},{repair.STYLES[j['style']]}") + recs.append(dict(path=j['path'], obj=f"{j['kind']},{j['k']},{j.get('n', 0)},{j['a']}", + turns=[dict(state=t['state'], prompt=t['prompt'], raw=t['raw']) for t in r['turns']], + pass_=r['pass'], state=r['state'])) + for t in r['turns']: + k = json.dumps(t['prompt']).encode() + v = json.dumps({"object": "text_completion", + "choices": [{"index": 0, "text": t['raw'], "finish_reason": "stop"}], + "usage": {"prompt_tokens": 1, "completion_tokens": 1}}).encode() + mp.append(b'%d %d\n' % (len(k), len(v)) + k + v) +json.dump(dict(objs=objs, recs=recs), open(base + '/expect.json', 'w'), indent=1) +open(base + '/objs.txt', 'w').write('\n'.join(objs) + '\n') +open(base + '/map', 'wb').write(b''.join(mp)) +print('\n'.join(objs)) diff --git a/seed/node/view.om b/seed/node/view.om new file mode 100644 index 000000000..3e73dc715 --- /dev/null +++ b/seed/node/view.om @@ -0,0 +1,704 @@ +note seed/node/view.om -- the Omega Node operator view (DRA-291). OM-2. +note Compose after seed/net/http.om, transport.om, pool.om, super.om, +note sched.om, seed/authority/action.om, journal.om and auth.om, before the +note program that drives the creator (code.om). +note One shared page (32768 bytes) carries the creator's state to a view +note process it forks, and operator commands back. The view process only +note reads state and posts commands; the creator alone decides them, +note through the authority and the journal, and then acknowledges them. +note Page words: 0 magic, 1 layout 1, 2 snapshot seqlock (odd while the +note creator writes), 3 version (events so far, this incarnation), 4 +note incarnation (the journal fence), 5 creator pid, 6 stop, 7 view port, +note 8 requests served, 9 view pid. +note Snapshot words, written by the creator under the seqlock: +note 16..21 authority: generation, paused, journal seq, journal failed, +note fence, version of the last pause change; 32..39 queue: waiting, +note ready, running, in review, UNKNOWN, admission limit, review limit, +note admissions refused while full; 44..46 commands committed, refused, +note last id; 48 workers, then 4 words each at 64+4w: pid (0 none), +note incarnation, control seq acknowledged, paused as seen; 96 uncertain +note jobs (outcome UNKNOWN), their ids at 97..112; 128 objectives, then 16 +note words each at 136+16i (set by the driver); 200..205 limits. +note Events: a ring of 256 at word 1024, 4 words each: version, type | +note target << 8 | x << 16, a, b. Types: 1 job (x what, a job id, b +note value), 2 objective result (a result, b turns), 3 command (x op, a +note id, b status), 4 pause (a 1 paused 0 resumed), 5 worker (x slot, a +note pid, b 1 started 0 lost), 6 admission refused (a job id), 7 uncertain +note (a job id). +note Mailbox at word 2048: 0 state (0 free, 1 posted, 2 acknowledged), 1 +note command id, 2 op, 3 target, 4 view version the command was based on, +note 5..8 arguments, 9 status, 10 version, 11 journal seq, 12 incarnation. +note Ops: 1 pause, 2 resume, 3 cancel objective, 4 budget objective a +note (model turns), 5 redirect objective to kind a, K b, N c, A d. +note Status: 0 committed, 1 stale, 2 invalid, 3 refused, 4 duplicate (the +note id was committed before; the version is the original one). +const VWBYTES ulong 32768 +const VWMAG ulong 1330466390 +const VWRING ulong 1024 +const VWBOX ulong 2048 +text vwjson "application/json" +text vwctype "Content-Type" +text vwpview "/view" +text vwpcmd "/cmd" +text vwphlth "/health" +text vwget "GET" +text vwpost "POST" +text vwkhd "{\"layout\":1,\"incarnation\":" +text vwkver ",\"version\":" +text vwksnap ",\"kind\":\"snapshot\"" +text vwkdel ",\"kind\":\"delta\",\"since\":" +text vwkev ",\"events\":[" +text vwkauth ",\"authority\":" +text vwnauth "generation,paused,journal_seq,journal_failed,fence,version," +text vwkq ",\"queue\":" +text vwnq "waiting,ready,running,review,unknown,limit,review_limit,refused," +text vwkc ",\"commands\":" +text vwnc "committed,refused,last_id," +text vwkw ",\"workers\":[" +text vwnw "pid,incarnation,ack,paused," +text vwku "],\"uncertain\":[" +text vwko "],\"objectives\":[" +text vwno "kind,k,n,a,state,turns,budget,phase,job,result,version,redirect,cancel,seq," +text vwkl "],\"limits\":" +text vwnl "max_turns,deadline_s,max_tokens,max_objectives,action_slots,ring," +text vwkid "{\"id\":" +text vwkst ",\"status\":\"" +text vwkst2 "\",\"version\":" +text vwkjs ",\"journal_seq\":" +text vwkinc ",\"incarnation\":" +text vwsts "committed,stale,invalid,refused,duplicate,busy,pending," +text vwhlth "{\"ok\":true}" +text vwqsin "since" +text vwqinc "inc" +text vwqid "id" +text vwqop "op" +text vwqtg "target" +text vwqver "ver" +text vwqa "a" +text vwqb "b" +text vwqc "c" +text vwqd "d" +global vwmap long 1 +global vwver ulong 1 +global vwcnt ulong 4 + +note ======== the page (without vw_new every write is dropped and reads are 0, +note so the driver also runs without a view) + +fn vw_g o ulong to ulong +if le get vwmap 0 0 +ret 0 +end +ret mapget get vwmap 0 mul o 8 8 +end + +fn vw_s o ulong v ulong to void +if le get vwmap 0 0 +ret +end +r = mapset get vwmap 0 mul o 8 8 v +end + +note Creator, before it forks anything: map the page for incarnation inc. +note 0 or a mapping errno. +fn vw_new inc ulong to long +h = mapnew neg int 1 0 VWBYTES 3 33 +if le h 0 +ret h +end +put vwmap 0 h +put vwver 0 0 +for i ulong 4 +put vwcnt i 0 +end +vw_s 1 1 +vw_s 4 inc +vw_s 5 ulong getpid +vw_s 0 VWMAG +ret 0 +end + +note Creator: append an event; its version. Words first, version last. +fn vw_ev ty ulong t ulong x ulong a ulong b ulong to ulong +v = add get vwver 0 1 +o = add VWRING mul and v 255 4 +vw_s add o 1 or or ty shl t 8 shl x 16 +vw_s add o 2 a +vw_s add o 3 b +vw_s o v +put vwver 0 v +vw_s 3 v +ret v +end + +fn vw_ver to ulong +ret get vwver 0 +end + +note Creator: count c (0 admissions refused, 1 commands committed, 2 +note commands refused, 3 last command id). +fn vw_cnt c ulong v ulong to void +put vwcnt c v +end + +fn vw_cget c ulong to ulong +ret get vwcnt c +end + +fn vw_begin to void +vw_s 2 or vw_g 2 1 +end + +fn vw_end to void +vw_s 2 add vw_g 2 1 +end + +note Creator, between vw_begin and vw_end: the generic sections. +fn vw_gen c long to void +vw_s 16 get augen 0 +vw_s 17 get scpause 0 +vw_s 18 get jseq 0 +vw_s 19 get jbad 0 +vw_s 20 get jfence 0 +for s ulong 4 +vw_s add 32 s sched_count add s 1 add s 1 +end +vw_s 36 sched_count 6 6 +vw_s 37 get sclim 0 +vw_s 38 get sclim 1 +vw_s 39 get vwcnt 0 +vw_s 44 get vwcnt 1 +vw_s 45 get vwcnt 2 +vw_s 46 get vwcnt 3 +n = mapget c 48 8 +vw_s 48 n +for w ulong n bound 8 +o = add 64 mul w 4 +vw_s o ulong get swpid w +vw_s add o 1 get auinc w +vw_s add o 2 auth_wctl w +vw_s add o 3 au_cell w 104 +end +vw_unc +end + +note Uncertain jobs: UNKNOWN in the scheduler, or released by the journal +note with outcome UNKNOWN (a class 1 effect whose fate nobody knows). +fn vw_unc to void +k = ulong 0 +for j ulong 64 +if and eq get sjst j 6 lt k 16 +vw_s add 97 k get sjid j +k = add k 1 +end +end +for e ulong 256 +b = mul e 8 +if and and ne get jjob b 0 ne get jjob add b 4 0 lt k 16 +if eq and get jjob add b 5 255 0 +vw_s add 97 k get jjob add b 1 +k = add k 1 +end +end +end +vw_s 96 k +end + +note Creator: the posted command into d (id, op, target, version, a..d); +note false when none is posted. +fn vw_take d edit ulong 8 to bool +if ne vw_g VWBOX 1 +ret false +end +for i ulong 8 +put d i vw_g add VWBOX add 1 i +end +ret true +end + +note Creator: acknowledge the posted command. +fn vw_ack st ulong v ulong js ulong to void +vw_s add VWBOX 9 st +vw_s add VWBOX 10 v +vw_s add VWBOX 11 js +vw_s add VWBOX 12 vw_g 4 +vw_s VWBOX 2 +end + +note Creator: fork the view process on 127.0.0.1:port. Its pid (it writes +note the bound port to word 7 once listening), or a negative errno. The +note child is not a worker: it drops the creator's life-pipe write end (so +note workers still see the creator's death) and the journal descriptors. +fn vw_spawn port ulong to long +pid = fork +if eq pid 0 +r = fclose get swpar 1 +r = fclose get jfd 0 +r = fclose get jlk 0 +exit vw_serve port +end +if gt pid 0 +vw_s 9 ulong pid +end +ret pid +end + +note Creator: stop the view process and reap it. +fn vw_stop to void +pid = vw_g 9 +if eq pid 0 +ret +end +vw_s 6 1 +st = new uchar 8 0 +for t ulong 300 +r = waitpid int pid st 0 4 1 +if eq r long pid +vw_s 9 0 +ret +end +x = sleepns 10000000 +end +r = killpid int pid 9 +r = waitpid int pid st 0 4 0 +vw_s 9 0 +end + +note ======== the view process + +note Serve until the creator stops or is gone: 0, or 2 when the port +note cannot be bound. +fn vw_serve port ulong to int +cs = new ulong 320 0 +io = new uchar 131072 0 +ob = new uchar 32768 0 +a = new uchar 16 0 +r = haddr4 a 2130706433 port +lf = hlisten a 16 +if lt lf 0 +ret 2 +end +vw_s 7 hport a +me = vw_g 5 +for t ulong 1000000000 +if or ne vw_g 6 0 ne ulong getppid me +break +end +c = haccept int lf 200000000 +if ge c 0 +vw_one int c cs io ob +end +end +x = fclose int lf +ret 0 +end + +note One request on connection fd, then close it. +fn vw_one fd int cs edit ulong 320 io edit uchar 131072 ob edit uchar 32768 to void +r = hinit cs io fd 1 +if lt r 0 +x = hclose cs +ret +end +hsettmo cs 2000000000 2000000000 +hsetbdl cs 2000000000 +r = hreqrd cs io +if le r 0 +if lt r 0 +x = hreject cs io r +end +x = hclose cs +ret +end +vw_s 8 add vw_g 8 1 +r = vw_route cs io ob +x = hclose cs +end + +fn vw_route cs edit ulong 320 io edit uchar 131072 ob edit uchar 32768 to long +if hispath cs io vwpview +if hismeth cs io vwget +n = vw_view cs io ob +ret vw_send cs io ob n 200 +end +ret hrsperr cs io 405 +end +if hispath cs io vwpcmd +if hismeth cs io vwpost +ret vw_post cs io ob +end +ret hrsperr cs io 405 +end +if hispath cs io vwphlth +n = vw_cat ob 0 vwhlth +ret vw_send cs io ob n 200 +end +ret hrsperr cs io 404 +end + +fn vw_send cs edit ulong 320 io edit uchar 131072 ob view uchar 32768 n ulong code ulong to long +put cs HKEEP 0 +r = hrspst cs io code +r = hfe r hhname cs io vwctype +r = hfe r hhval cs io vwjson +r = hfe r hhend cs io 0 n +r = hfe r hput cs io view part ob 0 n +ret hfe r hwfin cs io +end + +note Query parameter key of the request target as a decimal; all ones +note when absent or not a number of 1..19 digits. +fn vw_qnum cs edit ulong 320 io view uchar 131072 key view uchar * to ulong +t = get cs HTOFF +n = get cs HTLEN +q = ulong 0 +for i ulong n +if eq get io add t i 63 +q = add i 1 +break +end +end +if eq q 0 +ret not ulong 0 +end +p = q +for it ulong 64 +if ge p n +break +end +e = vw_seg io t p n +if vw_keq io add t p key +ret vw_qdec io add add t p add len key 1 sub sub e p add len key 1 +end +p = add e 1 +end +ret not ulong 0 +end + +note End of the query segment starting at p (index of '&' or n). +fn vw_seg io view uchar 131072 t ulong p ulong n ulong to ulong +for i ulong sub n p +if eq get io add t add p i 38 +ret add p i +end +end +ret n +end + +note key= at io[o]. +fn vw_keq io view uchar 131072 o ulong key view uchar * to bool +for i ulong len key +if ne get io add o i get key i +ret false +end +end +ret eq get io add o len key 61 +end + +fn vw_qdec io view uchar 131072 o ulong m ulong to ulong +if or eq m 0 gt m 19 +ret not ulong 0 +end +v = ulong 0 +for i ulong m +c = ulong get io add o i +if or lt c 48 gt c 57 +ret not ulong 0 +end +v = add mul v 10 sub c 48 +end +ret v +end + +note ======== JSON + +fn vw_cat o edit uchar 32768 p ulong a view uchar * to ulong +for i ulong len a +if lt add p i 32768 +put o add p i get a i +end +end +ret hmin add p len a 32768 +end + +fn vw_dec o edit uchar 32768 p ulong v ulong to ulong +d = new uchar 20 0 +k = ulong 20 +x = v +for it ulong 20 +k = sub k 1 +put d k uchar add rem x 10 48 +x = div x 10 +if eq x 0 +break +end +end +q = p +for i ulong sub 20 k +if lt q 32768 +put o q get d add k i +end +q = add q 1 +end +ret hmin q 32768 +end + +fn vw_ch o edit uchar 32768 p ulong c ulong to ulong +if lt p 32768 +put o p uchar c +end +ret hmin add p 1 32768 +end + +note "name": for the k-th comma-terminated name in names. +fn vw_key o edit uchar 32768 p ulong names view uchar * k ulong to ulong +s = ulong 0 +m = ulong 0 +for i ulong len names +if eq get names i 44 +if eq m k +q = vw_ch o p 34 +q = vw_cat o q view part names s sub i s +q = vw_ch o q 34 +ret vw_ch o q 58 +end +m = add m 1 +s = add i 1 +end +end +ret p +end + +note {"name":s[b],...}, one member per comma-terminated name. +fn vw_obj o edit uchar 32768 p ulong names view uchar * s view ulong 1024 b ulong to ulong +n = ulong 0 +for i ulong len names +if eq get names i 44 +n = add n 1 +end +end +q = vw_ch o p 123 +for k ulong n +if gt k 0 +q = vw_ch o q 44 +end +q = vw_key o q names k +q = vw_dec o q get s add b k +end +ret vw_ch o q 125 +end + +note A stable copy of words 0..1023 (retries while the creator writes). +fn vw_load s edit ulong 1024 to bool +for t ulong 1000 +a = vw_g 2 +if eq and a 1 0 +for i ulong 1024 +put s i vw_g i +end +if eq vw_g 2 a +ret true +end +end +x = sleepns 100000 +end +ret false +end + +note The view: a delta since the client's version when the client holds +note this incarnation and every event since it is still in the ring, else +note a snapshot. The length. +fn vw_view cs edit ulong 320 io view uchar 131072 ob edit uchar 32768 to ulong +s = new ulong 1024 0 +sv = vw_qnum cs io vwqsin +ic = vw_qnum cs io vwqinc +x = vw_load s +v = get s 3 +p = vw_cat ob 0 vwkhd +p = vw_dec ob p get s 4 +p = vw_cat ob p vwkver +p = vw_dec ob p v +if and and eq ic get s 4 le sv v le sub v sv 255 +ret vw_delta ob p sv v +end +ret vw_snap ob p s +end + +fn vw_delta ob edit uchar 32768 p0 ulong sv ulong v ulong to ulong +p = vw_cat ob p0 vwkdel +p = vw_dec ob p sv +p = vw_cat ob p vwkev +for k ulong sub v sv +e = add sv add k 1 +o = add VWRING mul and e 255 4 +if gt k 0 +p = vw_ch ob p 44 +end +p = vw_evj ob p o e +end +p = vw_ch ob p 93 +ret vw_ch ob p 125 +end + +note [version,type,target,x,a,b] of the event at word o. +fn vw_evj ob edit uchar 32768 p0 ulong o ulong e ulong to ulong +w = vw_g add o 1 +p = vw_ch ob p0 91 +p = vw_dec ob p vw_g o +p = vw_ch ob p 44 +p = vw_dec ob p and w 255 +p = vw_ch ob p 44 +p = vw_dec ob p and shr w 8 255 +p = vw_ch ob p 44 +p = vw_dec ob p shr w 16 +p = vw_ch ob p 44 +p = vw_dec ob p vw_g add o 2 +p = vw_ch ob p 44 +p = vw_dec ob p vw_g add o 3 +ret vw_ch ob p 93 +end + +fn vw_snap ob edit uchar 32768 p0 ulong s view ulong 1024 to ulong +p = vw_cat ob p0 vwksnap +p = vw_cat ob p vwkauth +p = vw_obj ob p vwnauth s 16 +p = vw_cat ob p vwkq +p = vw_obj ob p vwnq s 32 +p = vw_cat ob p vwkc +p = vw_obj ob p vwnc s 44 +p = vw_cat ob p vwkw +for w ulong get s 48 bound 8 +if gt w 0 +p = vw_ch ob p 44 +end +p = vw_obj ob p vwnw s add 64 mul w 4 +end +p = vw_cat ob p vwku +for k ulong get s 96 bound 16 +if gt k 0 +p = vw_ch ob p 44 +end +p = vw_dec ob p get s add 97 k +end +p = vw_cat ob p vwko +for i ulong get s 128 bound 4 +if gt i 0 +p = vw_ch ob p 44 +end +p = vw_obj ob p vwno s add 136 mul i 16 +end +p = vw_cat ob p vwkl +p = vw_obj ob p vwnl s 200 +ret vw_ch ob p 125 +end + +note ======== commands + +note POST /cmd?id=&op=&target=&inc=&ver=&a=&b=&c=&d=: post it to the creator +note and wait up to 5 s for the acknowledgement. A command made for another +note incarnation (inc) is stale without reaching the creator, since its ver +note counts another incarnation's events. 503 while another command is +note posted and not yet taken, 504 when no acknowledgement came in time +note (the command may still commit: post it again with the same id). +fn vw_post cs edit ulong 320 io edit uchar 131072 ob edit uchar 32768 to long +d = new ulong 8 0 +id = vw_qnum cs io vwqid +put d 0 vw_qnum cs io vwqop +put d 1 vw_qnum cs io vwqtg +put d 2 vw_qnum cs io vwqver +put d 3 vw_qnum cs io vwqa +put d 4 vw_qnum cs io vwqb +put d 5 vw_qnum cs io vwqc +put d 6 vw_qnum cs io vwqd +if or eq id 0 eq id not ulong 0 +ret hrsperr cs io 400 +end +st = ulong 1 +bx = false +if eq vw_qnum cs io vwqinc vw_g 4 +st = vw_box id d +bx = lt st 5 +end +n = vw_ackj ob id st bx +ret vw_send cs io ob n vw_code st +end + +note Post command id with d[0..6] = op, target, version, a..d; the status +note (0..4 from the creator, 5 busy, 6 pending). +fn vw_box id ulong d view ulong 8 to ulong +b = vw_g VWBOX +if eq b 1 +ret 5 +end +vw_s add VWBOX 1 id +for i ulong 7 +vw_s add VWBOX add 2 i get d i +end +vw_s VWBOX 1 +for t ulong 5000 +if eq vw_g VWBOX 2 +st = vw_g add VWBOX 9 +vw_s VWBOX 0 +ret st +end +x = sleepns 1000000 +end +ret 6 +end + +fn vw_code st ulong to ulong +if or eq st 0 eq st 4 +ret 200 +end +if eq st 1 +ret 409 +end +if eq st 2 +ret 400 +end +if eq st 3 +ret 500 +end +if eq st 5 +ret 503 +end +ret 504 +end + +note The acknowledgement: the creator's version and journal seq when bx, +note else the current version (the view's own verdict) and 0. +fn vw_ackj ob edit uchar 32768 id ulong st ulong bx bool to ulong +p = vw_cat ob 0 vwkid +p = vw_dec ob p id +p = vw_cat ob p vwkst +p = vw_name ob p vwsts st +p = vw_cat ob p vwkst2 +v = vw_g 3 +js = ulong 0 +if bx +v = vw_g add VWBOX 10 +js = vw_g add VWBOX 11 +end +p = vw_dec ob p v +p = vw_cat ob p vwkjs +p = vw_dec ob p js +p = vw_cat ob p vwkinc +p = vw_dec ob p vw_g 4 +ret vw_ch ob p 125 +end + +note The k-th comma-terminated name of names, unquoted. +fn vw_name o edit uchar 32768 p ulong names view uchar * k ulong to ulong +s = ulong 0 +m = ulong 0 +for i ulong len names +if eq get names i 44 +if eq m k +ret vw_cat o p view part names s sub i s +end +m = add m 1 +s = add i 1 +end +end +ret p +end