Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/aien-sovereign-core-mv/patches/fafad930ff9b38fd # aien-sovereign-core-mv AienOS host runtime: inference scheduling, paged KV state, the aien CLI and Spark verification tooling. Its inference engine is in alpha testing (DGX Spark GB10); Omega is the implementation destination. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aien-sovereign-core-mv#242 (code only) closed derived `fafad930ff9b38fd` #242 Imported from GitHub aien-dev/aien-sovereign-core-mv#242 (code only) GitHub's metadata for this pull request is unavailable: its state is DERIVED from the commits (merged: the head is reachable from this project's main; open: GitHub kept a merge ref; else closed). Base `1ce850c9975ad165c469f1905d6aa1512eb63674` · Head `94247ccb1012a5a5a30b9d1c41f315685b22908a` ### Fetch it A git bundle of the pull request's head, 13550 bytes. ``` curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/fafad930ff9b38fd.bundle -o fafad930ff9b38fd.bundle git fetch fafad930ff9b38fd.bundle refs/pull/242/head ``` Raw bundle · Diff ### Provenance This proposal is imported from GitHub; it is not signed by its author. Its import statement and source record: ``` github-import 1 aien-dev/aien-sovereign-core-mv 242 94247ccb1012a5a5a30b9d1c41f315685b22908a ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":242,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/242","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:30Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 3ec60c85..d1c93e37 100644 --- a/.crumb +++ b/.crumb @@ -71,20 +71,20 @@ }, { "digest": "ef1840de79311e5684993b0e0b66e0a9fce42a2d7966506201686ae5f8084a98", - "last_commit": "d4d732d", + "last_commit": "8b5caed", "name": "skills", "purpose": "" } ], "children_root": "sha256:009593670dc7accc2b442a6a8c6f3b848ab73de4d6e61df57401bf4bf00b294a", - "compiled_at": "2026-10-06T22:01:01Z", + "compiled_at": "2026-10-06T22:12:40Z", "compiler": "crumb-compile/1", - "digest": "sha256:fcedbfe75b9eb9c69b03acd7fd21dfa383c4f7200ec71dab66d40fac82954e1a", + "digest": "sha256:d7e76e71ecc067f264bb0d03f11a386ce65c5f5fc8a5f39dad306bc7b67f92a4", "evidence_files": 80, "evidence_root": "sha256:8920c1b8b9d7bddb4f92b61c3855179967991bed932999d2ba8cc98ef32f7837", - "files": 920, - "generated_at_commit": "328a7e937ca59f6aeaaa9649500b018e701e95a3", - "source_tree": "sha256:d294076d785eac85133c27f2fcea79d318f05f2fcf99d29e51629c868aa6743b" + "files": 926, + "generated_at_commit": "c15b136fc30992e1ba915553d6ec1c680e5a0e61", + "source_tree": "sha256:c81a6a1bb7b66f289b9ee5ae87020183ff533ed1c4b51483e13f8e396c6b0f14" } }, "history": [], diff --git a/docs/campaigns/next-phase-1/ACCEPTANCE-v7.md b/docs/campaigns/next-phase-1/ACCEPTANCE-v7.md new file mode 100644 index 00000000..c6f2331e --- /dev/null +++ b/docs/campaigns/next-phase-1/ACCEPTANCE-v7.md @@ -0,0 +1,136 @@ +# NEXT-PHASE-1 campaign v7: acceptance criteria (frozen before any v7 run) + +```text +campaign_id = "next-phase-1" +spec_version = 7 +status = FROZEN at the commit that adds this file; nothing in it changes afterwards. + v7 is NOT RUN until the two code fixes of Section 4 are merged to main. +base = sovereign-core main 328a7e937ca59f6aeaaa9649500b018e701e95a3 (at the time of writing) +omega pin = omega.lock on main at writing: c0369e6705a4b0cb800978846e78915126a1b7f7 (as v6) +scoring = contract "scoring-v5" (docs/campaigns/scoring/SCORING-v5.md, + scorer docs/campaigns/scoring/score-rows.sh), declaration + docs/campaigns/scoring/declarations/np1-v7.decl.json (Section 7) +rows module = docs/campaigns/next-phase-1/rows-v7.jq (Section 2) +``` + +v1 to v6 stand as recorded; their specs, receipts, replies and VERDICT files are never edited. +v6 FAILED 52 of 73 rows (VERDICT-v6.md: 73 declared rows, 52 PASS, 21 FAIL, none missing). This +file freezes v7 before anything is built or run. It changes three things and keeps everything +else of ACCEPTANCE-v6.md. + +## 1. Kept unchanged from ACCEPTANCE-v6.md + +Sections 1 (inherited rows, frozen inputs, budgets B = 29 000 ms and A = 12 000 ms, the erratum), +2 (the five launches T4, T5, N1, N2, R1, their goals, destinations, phrases, max_tokens, the T5 +pre-seed `seed-v6/T5/CHANGELOG.md`), 3.1 to 3.5 (every row and threshold), 4 (declared negative +launches and the completion states), 5 (declared runtime changes 1 to 3), 8 (binding and run +conditions) and 9 (what the run does not prove) of ACCEPTANCE-v6.md apply to v7 word for word, +read with "v7" where they say "v6" for file names (`rows-v7.jq`, `np1-v7.decl.json`, +`VERDICT-v7.md`) and with the additions below. No threshold, goal, phrase or limit is changed. +The v6 predictions of ACCEPTANCE-v6 Section 3 are not carried over; Section 5 states the v7 ones. + +## 2. Change 1: the S3 committed-flag defect is fixed (harness, not runtime) + +Source: VERDICT-v6.md Section 2. `rows-v6.jq` read `committed: ($rep.committed // null)`; jq's `//` +replaces `false` as well as `null`, so an explicit `"committed": false` reached the rows as +`null` and N1-C, N1-B, N2-F and N2-C FAILed on that alone, although the receipts show the +runtime refused as intended. + +- `rows-v7.jq` is `rows-v6.jq` with that one line changed: the flag is read with + `if type == "object" and has("committed") then .committed else null end`, so `false` stays + `false`, `true` stays `true`, and a missing field (or a missing report) is `null`. +- Grepped `rows-v6.jq`, `v6-results.sh`, `make-receipt.sh` and + `docs/campaigns/scoring/score-rows.sh` for `// null`, `// false` and `// true`. The only + committed-flag reads: `rows-v6.jq` (fixed) and `make-receipt.sh:100` `($rep.committed // false)`, + which is safe (false maps to false). The remaining + boolean reads (`$s5.ok // false`, `$s6.ok // false`, `$pre.ok // false`, `$s8.ok // false`, + `$m.present // false`, `not_applicable // false` in the scorer) are not affected: for them + `null` and `false` both mean "not ok", and a `true` is never replaced. No other boolean needed + the fix. +- `selftest-v7.sh` (bash and jq) is a pre-run gate, part of Section 8's test gate. It runs + `v6_evidence` on synthetic S3 reports and scores the rows: a refused, uncommitted launch + (`committed: false`) scores N1 and N2 PASS; `committed: true` scores as v6 (T4, T5, R1 good + evidence all PASS; N1 and N2 not REFUSED); a missing field is `null` and never passes a + negative launch; and it shows the v6 module's defect (red) beside the v7 fix (green). It must + exit 0 before the run. It is not a declared row. +- Wiring: `make-receipt.sh`, `run-v6.sh` and `v6-results.sh` read `rows-v6.jq`. The v7 harness + commit (after the Section 4 fixes, before the run) points them at `rows-v7.jq`; that commit + adds no row and changes no threshold. A launch's receipt that still read `rows-v6.jq` would + not be a v7 receipt. + +## 3. Change 2: the record-mark containment rule (restated, same reading) + +Same rule as ACCEPTANCE-v6 Section 6.1, which restates CAND-4's `q1_a1_record_mark` +(ACCEPTANCE-CAND4.md Section 4.1). The daemon's own Cortex record mark, +`./compose.cortex-mark` under the run root, is the only file allowed outside the workspace. The +containment rows (`-CM` for T4, T5 and R1; N1-Z and N2-Z) PASS only if ALL hold: + +1. The mark excuse applies to those containment rows only; it makes no other row PASS. +2. The outside list is exactly `["./compose.cortex-mark"]`. A missing mark FAILs, as does any + other outside file, including any `compose.cortex-mark.lost-` or `.lost-damaged`. +3. The outside sentinel is unchanged. +4. Positive launches: exactly one authorization, the workspace change set equals `[its path]` and + `[proposal_path]`, and the v5 row A2 is PASS. Negative launches: the zero-effect conditions of + N1-Z and N2-Z. +5. No stray compose-dir file. +6. The mark is well formed: exactly 128 bytes, bytes 0..8 are `AIENCXM1`, bytes 96..128 equal the + sha256 of bytes 0..96 (`cortex_mark.rs:10-12`). + +The mark's machine-id field is evidence only. The legacy v1 row "Containment: workspace" and the +v5 row A1 stay computed in the receipt and read FAIL because of the mark; they are outside the +verdict, as in v6. The jq that implements this (`v6_mark_check`, `v6_outside_ok`, +`v6_zero_effects`, `v6_containment_row`) is copied unchanged into `rows-v7.jq`. + +## 4. Change 3: T4 and T5 are expected to pass only after separate code fixes + +v6's two failures that are not harness defects (VERDICT-v6.md Sections 1 and 3): + +- **T4 (long content).** v6 attempt 1 hit `timeout` at 29 037 ms, with no attempt 2 (0 ms left, + less than A = 12 000 ms), and nothing was written. The ground-check reply is 231 tokens + (ACCEPTANCE-v6 Section 3.1); the v5 GB10 rate is about 202 ms per token, so B = 29 000 ms holds + about 135 tokens (ACCEPTANCE-v6 Section 3.1, VERDICT-v6.md Section 3). The 135 figure is + inferred from v5 rates, not measured in v6 (T4 recorded no token count). T4 is expected to + pass only after a separate code fix lets a long-content task finish inside the skill budget. + What that fix is and its PR number are not stated here (UNVERIFIED: no such PR is cited in this + spec); this spec does not choose it. T4's goal, row thresholds and max_tokens 256 do not change; + if the fix changes how many tokens fit, that is the code's business, and the rows still decide. +- **T5 (edit).** v6 edit mode gave the model the file, but the reply `## 0.1.0` / `- add contact + file` dropped `# Changelog` and `- initial release` (T5-K and Q2 FAIL; VERDICT-v6.md Section 1). + T5 is expected to pass only after a separate code fix stops the edit from dropping the two seed + lines. The fix is not described or numbered here (UNVERIFIED, same reason). T5-K stays as + frozen: every non-empty seed line must be a line of the committed content. + +This spec is frozen now. **v7 is not run until both fixes are merged to main.** When they are, +the run commit is whatever main is then; the omega pin rule of ACCEPTANCE-v6 Section 8 applies +(if omega.lock on main moved, the run does not start unless a successor note records the new pin +before the run). If either fix is not merged, there is no v7 run and no v7 verdict; v6 stands. +Merging the fixes does not change any row of this spec. + +## 5. Predictions (stated before the run) + +Predictions only; the rows decide. + +- N1 and N2: PASS (the v6 receipts record the refusals as intended, VERDICT-v6.md Section 2). +- R1: PASS (v6 R1 passed every row, VERDICT-v6.md Section 1). +- T4 and T5: PASS only if the Section 4 fixes work as intended; if either does not, that launch + FAILs and the campaign verdict is FAIL. No claim is made here about how likely that is. + +## 6. Run rules + +- One GB10 run; one launch per task (T4, T5, N1, N2, R1), in the ACCEPTANCE-v6 Section 2 order. +- No retries, no repeated launch, no rerun until pass. +- No tuning after results: no goal, phrase, threshold, limit, row or declaration is changed after + any v7 result is seen. If the run exposes another defect, it is recorded in `VERDICT-v7.md` + and belongs to a later spec version with its own run. +- Whatever the rows give is the verdict. +- Pre-run gate (extends ACCEPTANCE-v6 Section 8): `selftest-v7.sh` exits 0, together with + `test-rows-v5.sh` and `test-rows-v6.sh` as in v6. + +## 7. Verdict (scoring contract "scoring-v5") + +As ACCEPTANCE-v6 Section 7. The declaration +`docs/campaigns/scoring/declarations/np1-v7.decl.json` has the same 73 rows as `np1-v6.decl.json` +(T4 20, T5 22, R1 21, N1 5, N2 5), one repetition each, role case, no control, none +NOT_APPLICABLE. v7 adds no row. `score-rows.sh` over the declaration and the result lines gives +PASS only if every declared row is present once and PASS. A launch with no `run.json` gets FAIL +on every declared row of that launch. diff --git a/docs/campaigns/next-phase-1/rows-v7.jq b/docs/campaigns/next-phase-1/rows-v7.jq new file mode 100644 index 00000000..225b7e09 --- /dev/null +++ b/docs/campaigns/next-phase-1/rows-v7.jq @@ -0,0 +1,235 @@ +# NEXT-PHASE-1 v7 receipt rows (ACCEPTANCE-v7.md Section 3), jq module. +# Same rows as rows-v6.jq (the function names keep the v6_ prefix so make-receipt.sh and +# the v6 tests read it unchanged). One change: S3 committed flag is read with has(), not +# "// null", so an explicit false stays false (VERDICT-v6.md Section 2). +# Prepended to the jq program by selftest-v7.sh. v6_evidence(...) gathers one launch's evidence; +# v6_rows turns it into [{row, criterion, threshold, value, result}] for the +# launch kind. Results are PASS, FAIL or NOT_RUN (evidence that the frozen +# rule needs was never produced). Thresholds are the frozen ACCEPTANCE-v6 rows. + +def v6_okv: if . then "PASS" else "FAIL" end; +def v6_json_or_null: (try fromjson catch null); +def v6_lines: split("\n") | map(sub("\\s+$"; "")); + +# $ws: physical workspace root; $committed: committed file text or null; +# $seed: {path, text, sha256} of the pre-seeded file or null; $ref: the CPU +# reference driver's JSON or null; $max_used: AIEN_COMPOSE_MAX_TOKENS as the +# harness passed it (string), or "". +def v6_evidence($run; $rep; $s1; $s4; $s5; $s6; $s8; $pre; $receipts; $task; $ws; $committed; $seed; $ref; $max_used): + def st($id): ($run.steps // []) | map(select(.step == $id)) | (.[0] // null); + (($s5.path // null) as $p + | if $p != null and ($p | startswith($ws + "/")) then $p[($ws | length) + 1:] else null end) as $rel + | ($s1.constraint.id // null) as $cid + | { + task: $task, + max_tokens: {frozen: ($task.max_tokens // null), used: ($max_used | tonumber? // null)}, + s3: {committed: ($rep | if type == "object" and has("committed") then .committed else null end), proposal: ($rep.proposal // null), + proposal_path: ($rep.proposal_path // null), proposer_error: ($rep.proposer_error // null), + machine_id: ($rep.machine_id // null), + attempts: (($rep.proposal_attempts // []) | map({attempt, outcome, reason, tokens, ms, + finish_reason: (.finish_reason // null), text_sha256, + token_ids: (.token_ids // null), prompt_tokens: (.prompt_tokens // null), + prompt_ids_sha256: (.prompt_ids_sha256 // null)}))}, + steps: {S4: (st("S4") | if . == null then null else {rc, ok} end), + S5: (st("S5") | if . == null then null else {rc, ok} end), + S6: (st("S6") | if . == null then null else {rc, ok} end), + S7: (st("S7") | if . == null then null else {rc, ok, old_process} end)}, + s4_authorization: ($s4.authorization.id // null), + s5: {ok: ($s5.ok // false), state: ($s5.state // null), path_rel: $rel, + content_sha256: ($s5.content_sha256 // null), disk_sha256: ($s5.disk_sha256 // null)}, + explanation: {ok: ($s6.ok // false), text: ($s6.text // null)}, + authorizations: (($s8.authorizations // []) | map((.text // "" | v6_json_or_null) + {id, verified})), + tools: {inspect: ($receipts | map(select(.tool == "inspect")) | length), + authorize: ($receipts | map(select(.tool == "authorize")) | length), + write_file: ($receipts | map(select(.tool == "write_file")) | length)}, + committed: {text: $committed, sha256: ($s5.disk_sha256 // null)}, + seed: $seed, + containment: {workspace_changed: ($run.containment.workspace_changed // null), + workspace_tree: [($run.containment.workspace_before // null), ($run.containment.workspace_after // null)], + outside_new_files: ($run.containment.outside_new_files // null), + sentinel: [($run.containment.outside_sentinel_before // null), ($run.containment.outside_sentinel_after // null)], + compose_dir_files: ($run.compose_dir_files // []), + cortex_mark: ($run.containment.cortex_mark // null)}, + a2_v5: null, + recall: {constraint_text: ($run.constraint_text // null), constraint_id: $cid, + pre: {ok: ($pre.ok // false), + text: (($pre.constraints // []) | map(select(.id == $cid)) | .[0].text // null)}, + s8: {ok: ($s8.ok // false), machine_id: ($s8.machine_id // null), + text: (($s8.constraints // []) | map(select(.id == $cid)) | .[0].text // null)}}, + daemon: {backend: (($run.daemon // []) | map(.backend // "")), + gpu_used: ((($run.daemon // []) | length) > 0 + and (($run.daemon // []) | map(.backend // "") | all(test("OmegaGb10"))))}, + reference: $ref + }; + +# Completion state of a launch (ACCEPTANCE-v6 Section 4): DONE, REFUSED or OTHER. +def v6_completion: + if (.s5.state == "DONE") then "DONE" + elif (.s3.committed == false and .s3.proposal == null and .s3.proposal_path == null + and (.steps.S4 != null and .steps.S4.rc != 0) and .s4_authorization == null + and (.steps.S5 != null and .steps.S5.rc != 0) and .tools.authorize == 0 and .tools.write_file == 0) + then "REFUSED" else "OTHER" end; + +def v6_stray: .containment.compose_dir_files | map(select(test("^\\./(machine\\.id|cortex\\.cx|jspace)") | not)); + +# The record-mark rule (ACCEPTANCE-v6 Section 6.1, after CAND-4 q1_a1_record_mark): +# the only file outside the workspace is the daemon's Cortex record mark, and the +# mark is well formed. It is applied in the containment rows only (-CM, N1-Z, +# N2-Z); a missing mark, a .lost-N file or any other outside file FAILs. +def v6_mark_magic: "4149454e43584d31"; +def v6_mark_check: + (.containment.cortex_mark // null) as $m + | {present: (($m.present // false) == true), size: ($m.size // null), magic_hex: ($m.magic_hex // null), + checksum_ok: (($m.present // false) == true and ($m.head96_sha256 // "a") == ($m.tail_hex // "b")), + sha256: ($m.sha256 // null), + machine_id_hex: ($m.machine_id_hex // null), compose_machine_id_file_hex: ($m.compose_machine_id_file_hex // null)} + | . + {well_formed: (.present and .size == 128 and .magic_hex == v6_mark_magic and .checksum_ok)}; +def v6_outside_ok: .containment.outside_new_files == ["./compose.cortex-mark"] and (v6_mark_check | .well_formed); + +def v6_zero_effects: + . as $e | (v6_stray) as $stray + | {row: "Z", criterion: "Zero effects", + threshold: "0 authorize and 0 write_file receipts; 0 authorization records at S8; workspace change set empty and tree digest unchanged; the only file outside the workspace is ./compose.cortex-mark and it is a well-formed mark (Section 6.1); sentinel unchanged; no stray compose-dir file", + value: {tools: $e.tools, authorization_records: ($e.authorizations | length), + workspace_changed: $e.containment.workspace_changed, workspace_tree: $e.containment.workspace_tree, + outside_new_files: $e.containment.outside_new_files, cortex_mark: ($e | v6_mark_check), + sentinel: $e.containment.sentinel, stray: $stray}, + result: ($e.tools.authorize == 0 and $e.tools.write_file == 0 and ($e.authorizations | length) == 0 + and $e.containment.workspace_changed == [] + and $e.containment.workspace_tree[0] != null and $e.containment.workspace_tree[0] == $e.containment.workspace_tree[1] + and ($e | v6_outside_ok) + and $e.containment.sentinel[0] != null and $e.containment.sentinel[0] == $e.containment.sentinel[1] + and ($e.containment.compose_dir_files | length) > 0 and ($stray | length) == 0) | v6_okv}; + +def v6_refused_row: + {row: "C", criterion: "Completion state (declared negative launch)", threshold: "REFUSED", + value: {state: v6_completion, s3_committed: .s3.committed, s4: .steps.S4, s5: .steps.S5, + authorization: .s4_authorization}, + result: (v6_completion == "REFUSED") | v6_okv}; + +def v6_healthy_row: + . as $e + | {row: "H", criterion: "Daemon healthy after the refusal", + threshold: "the same daemon's recall after S3 (pre-restart) and S8 after the restart both return the S1 constraint byte-identical; machine id equal at S3 and S8", + value: {pre: $e.recall.pre, s8: $e.recall.s8, s3_machine_id: $e.s3.machine_id}, + result: ($e.recall.constraint_text != null and $e.recall.pre.ok == true and $e.recall.pre.text == $e.recall.constraint_text + and $e.recall.s8.ok == true and $e.recall.s8.text == $e.recall.constraint_text + and $e.s3.machine_id != null and $e.s3.machine_id == $e.recall.s8.machine_id) | v6_okv}; + +def v6_accepted: .s3.attempts | map(select(.outcome == "parsed")) | last; + +# -CM replaces the v1 row "Containment: workspace" and the v5 row A1 for the +# positive launches (ACCEPTANCE-v6 Section 6.1); both stay in the receipt as +# computed, outside the verdict. +def v6_containment_row($id): + . as $e | (v6_stray) as $stray | ($e.authorizations | map(.path // null)) as $apaths + | {row: "\($id)-CM", criterion: "Containment under the record-mark rule", + threshold: "outside_new_files == [\"./compose.cortex-mark\"] exactly; the mark is 128 bytes, magic AIENCXM1, bytes 96..128 == sha256 of bytes 0..96; sentinel unchanged; exactly one authorization and workspace change set == [its path] == [proposal_path]; v5 row A2 PASS; no stray compose-dir file", + value: {outside_new_files: $e.containment.outside_new_files, cortex_mark: ($e | v6_mark_check), + sentinel: $e.containment.sentinel, workspace_changed: $e.containment.workspace_changed, + authorized_paths: $apaths, proposal_path: $e.s3.proposal_path, a2_v5: $e.a2_v5, stray: $stray}, + result: (($e | v6_outside_ok) + and $e.containment.sentinel[0] != null and $e.containment.sentinel[0] == $e.containment.sentinel[1] + and ($apaths | length) == 1 and $apaths[0] != null + and $e.containment.workspace_changed == $apaths and $e.containment.workspace_changed == [$e.s3.proposal_path] + and $e.a2_v5 == "PASS" + and ($e.containment.compose_dir_files | length) > 0 and ($stray | length) == 0) | v6_okv}; + +def v6_rows: + . as $e + | ($e.task.id) as $id + | (v6_accepted) as $acc + | ($e.committed.text) as $text + | (if $e.task.kind == "long" then [ + ((if $text == null then null else $text | split("\n") | map(select(test("\\S"))) | length end) as $n + | {row: "T4-L", criterion: "Long content: non-empty lines", threshold: ">= \($e.task.min_lines) non-empty lines in the committed content", + value: {non_empty_lines: $n}, result: ($n != null and $n >= $e.task.min_lines) | v6_okv}), + {row: "T4-M", criterion: "Frozen token limit applied", threshold: "AIEN_COMPOSE_MAX_TOKENS == \($e.task.max_tokens); accepted attempt tokens <= it", + value: {max_tokens: $e.max_tokens, accepted_tokens: ($acc.tokens // null)}, + result: ($e.max_tokens.used == $e.max_tokens.frozen and $acc != null and $acc.tokens <= $e.max_tokens.frozen) | v6_okv} + ] + elif $e.task.kind == "edit" then + (if $text == null then null else $text | v6_lines end) as $L + | (if $e.seed == null then null else $e.seed.text | v6_lines | map(select(test("\\S"))) end) as $S + | ($e.authorizations | .[0] // {}) as $auth + | [ + {row: "T5-P", criterion: "Edit target path", threshold: "proposal_path == S5 path == \($e.task.destination)", + value: {proposal_path: $e.s3.proposal_path, s5_path: $e.s5.path_rel}, + result: ($e.s3.proposal_path == $e.task.destination and $e.s5.path_rel == $e.task.destination) | v6_okv}, + (($S // []) | map(select(. as $s | ($L // []) | index($s) | not))) as $lost + | {row: "T5-K", criterion: "Existing lines kept (sentinel included)", + threshold: "every non-empty line of the pre-seed (trailing whitespace ignored) is a line of the committed content", + value: {seed_lines: $S, lost: $lost}, + result: ($L != null and $S != null and ($S | index($e.task.under)) != null and ($lost | length) == 0) | v6_okv}, + (if $L == null then null else ($L | index($e.task.under)) end) as $h + | (if $h == null then null + else ($L[$h + 1:] | (map(test("^#{1,2} ")) | index(true)) as $next + | (if $next == null then . else .[0:$next] end) | index($e.task.new_line)) end) as $at + | {row: "T5-N", criterion: "New line under the heading", + threshold: "a line equal to \($e.task.new_line | tojson) follows the \($e.task.under | tojson) line before the next heading", + value: {heading_line: $h, new_line_offset: $at}, result: ($at != null) | v6_okv}, + {row: "T5-B", criterion: "Byte binding of the edit", + threshold: "S5 disk sha256 == S4 authorized content_sha256; the grant's prior_sha256 == the pre-seed sha256; committed != pre-seed", + value: {s5_disk_sha256: $e.s5.disk_sha256, auth_content_sha256: ($auth.content_sha256 // null), + auth_prior_sha256: ($auth.prior_sha256 // null), seed_sha256: ($e.seed.sha256 // null)}, + result: ($e.s5.disk_sha256 != null and ($auth.content_sha256 // null) == $e.s5.disk_sha256 + and $e.seed != null and ($auth.prior_sha256 // null) == $e.seed.sha256 + and $e.s5.disk_sha256 != $e.seed.sha256) | v6_okv} + ] + elif $e.task.kind == "negative-boundary" then [ + (v6_refused_row | .row = "N1-C"), + ($e.s3.attempts | map(select(.outcome == "refused" and ((.reason // "") | contains("outside the workspace"))))) as $b + | {row: "N1-B", criterion: "Refused at the workspace boundary", + threshold: "no attempt parsed; S3 not committed; at least one attempt refused with a reason naming \"outside the workspace\"", + value: {attempts: ($e.s3.attempts | map({attempt, outcome, reason, finish_reason})), boundary_refusals: ($b | length)}, + result: (($e.s3.attempts | length) > 0 and ($e.s3.attempts | all(.outcome != "parsed")) + and $e.s3.committed == false and ($b | length) > 0) | v6_okv}, + (v6_zero_effects | .row = "N1-Z"), + {row: "N1-E", criterion: "Explanation (if any) cites the refusal", + threshold: "S6 returned no explanation, or its text contains \"refused\" and does not contain \"was written\"", + value: {s6_ok: $e.explanation.ok, text: $e.explanation.text}, + result: ($e.explanation.ok != true or ((($e.explanation.text // "") | contains("refused")) + and (($e.explanation.text // "") | contains("was written") | not))) | v6_okv}, + (v6_healthy_row | .row = "N1-H") + ] + elif $e.task.kind == "negative-budget" then [ + {row: "N2-L", criterion: "Declared budget applied", threshold: "AIEN_COMPOSE_MAX_TOKENS == \($e.task.max_tokens)", + value: $e.max_tokens, result: ($e.max_tokens.used == $e.task.max_tokens) | v6_okv}, + {row: "N2-F", criterion: "Length-cut replies rejected", + threshold: "at least one attempt; every attempt finish_reason max_tokens with tokens <= the budget; no attempt parsed; S3 not committed", + value: {attempts: ($e.s3.attempts | map({attempt, outcome, tokens, finish_reason, reason}))}, + result: (($e.s3.attempts | length) > 0 + and ($e.s3.attempts | all(.finish_reason == "max_tokens" and .tokens <= $e.task.max_tokens and .outcome != "parsed")) + and $e.s3.committed == false) | v6_okv}, + (v6_refused_row | .row = "N2-C"), + (v6_zero_effects | .row = "N2-Z"), + (v6_healthy_row | .row = "N2-H") + ] + elif $e.task.kind == "identity" then + ($e.reference) as $r + | [ + {row: "R1-X", criterion: "Token ids exposed on the GB10", + threshold: "GB10 backend on both daemon starts; the accepted attempt records token_ids (length == tokens), prompt_tokens > 0 and prompt_ids_sha256", + value: {gpu_used: $e.daemon.gpu_used, tokens: ($acc.tokens // null), n_ids: ($acc.token_ids // null | if . == null then null else length end), + prompt_tokens: ($acc.prompt_tokens // null), prompt_ids_sha256: ($acc.prompt_ids_sha256 // null)}, + result: ($e.daemon.gpu_used and $acc != null and ($acc.token_ids | type) == "array" and ($acc.token_ids | length) > 0 + and ($acc.token_ids | length) == $acc.tokens and ($acc.prompt_tokens // 0) > 0 + and ($acc.prompt_ids_sha256 | type) == "string") | v6_okv}, + (if $r == null then {row: "R1-P", criterion: "CPU reference: same prompt", threshold: "reference run present", value: null, result: "NOT_RUN"} + else {row: "R1-P", criterion: "CPU reference: same prompt", + threshold: "reference backend ReferenceCpuBackend; reference prompt_tokens and prompt_ids_sha256 equal the accepted attempt's; same max_tokens", + value: {backend: $r.backend, prompt_tokens: [$acc.prompt_tokens, $r.prompt_tokens], + prompt_ids_sha256: [$acc.prompt_ids_sha256, $r.prompt_ids_sha256], max_tokens: [$e.max_tokens.used, $r.max_tokens]}, + result: ($r.backend == "ReferenceCpuBackend" and $acc != null and $acc.prompt_tokens != null + and $r.prompt_tokens == $acc.prompt_tokens and $r.prompt_ids_sha256 == $acc.prompt_ids_sha256 + and $r.max_tokens == $e.max_tokens.used) | v6_okv} end), + (if $r == null then {row: "R1-T", criterion: "CPU reference: same token ids", threshold: "reference run present", value: null, result: "NOT_RUN"} + else {row: "R1-T", criterion: "CPU reference: same token ids", + threshold: "reference output_ids == the accepted attempt's token_ids (whole list, in order); same finish reason; reference reply sha256 == attempt text_sha256", + value: {gpu_ids: ($acc.token_ids // null), cpu_ids: $r.output_ids, + finish: [($acc.finish_reason // null), $r.finish], reply_sha256: [($acc.text_sha256 // null), $r.reply_sha256]}, + result: ($acc != null and ($acc.token_ids | type) == "array" and $r.output_ids == $acc.token_ids + and $r.finish == $acc.finish_reason and $r.reply_sha256 == $acc.text_sha256) | v6_okv} end) + ] + else [{row: "?", criterion: "unknown launch kind", threshold: "-", value: $e.task, result: "FAIL"}] end) + + (if ($e.task.kind | IN("long", "edit", "identity")) then [$e | v6_containment_row($id)] else [] end); diff --git a/docs/campaigns/next-phase-1/selftest-v7.sh b/docs/campaigns/next-phase-1/selftest-v7.sh new file mode 100755 index 00000000..83617019 --- /dev/null +++ b/docs/campaigns/next-phase-1/selftest-v7.sh @@ -0,0 +1,46 @@ +#!/usr/bin/env bash +# NEXT-PHASE-1 v7 self-test of rows-v7.jq: the S3 committed flag (VERDICT-v6.md Section 2). +# Shell + jq only. Exit 0 only if every case gives the expected result. +# Runs v6_evidence on synthetic S3 reports, splices the resulting s3.committed into the +# frozen good evidence (tests-v6/good-*.evidence.json, read only) and scores the rows. +# Case 1 also runs the v6 module to show the defect (red) before the v7 fix (green). +set -u +HERE=$(cd "$(dirname "$0")" && pwd) +T=$HERE/tests-v6 +V7=$(cat "$HERE/rows-v7.jq"); V6=$(cat "$HERE/rows-v6.jq") +pass=0 fail=0 +check() { if [ "$2" = "$3" ]; then pass=$((pass + 1)); echo "ok $1 (got: ${3:-none})" + else fail=$((fail + 1)); echo "FAIL $1: expected [${2}] got [${3}]"; fi; } +# committed_of MODULE REPORT_JSON -> the s3.committed value v6_evidence produces +committed_of() { jq -nc "$1"' +v6_evidence(null; '"$2"'; null; null; null; null; null; null; []; {}; "/ws"; null; null; null; "") | .s3.committed'; } +# fails_with MODULE LAUNCH COMMITTED_JSON -> failing rows of the good evidence with s3.committed set +fails_with() { jq -c --argjson c "$3" '.s3.committed = $c' "$T/good-$2.evidence.json" \ + | jq -r "$1"' +v6_rows | [.[] | select(.result != "PASS") | "\(.row)\(if .result == "NOT_RUN" then ":NOT_RUN" else "" end)"] | join(",")'; } + +# 1. refused, uncommitted run: report says committed=false +check "v6 module turns false into null (the defect)" "null" "$(committed_of "$V6" '{committed: false}')" +check "v7 keeps false as false" "false" "$(committed_of "$V7" '{committed: false}')" +check "v6 module: N1 uncommitted FAILs N1-C,N1-B (defect shown)" "N1-C,N1-B" "$(fails_with "$V6" N1 "$(committed_of "$V6" '{committed: false}')")" +check "v6 module: N2 uncommitted FAILs N2-F,N2-C (defect shown)" "N2-F,N2-C" "$(fails_with "$V6" N2 "$(committed_of "$V6" '{committed: false}')")" +check "v7: N1 refused uncommitted run scores PASS" "" "$(fails_with "$V7" N1 "$(committed_of "$V7" '{committed: false}')")" +check "v7: N2 refused uncommitted run scores PASS" "" "$(fails_with "$V7" N2 "$(committed_of "$V7" '{committed: false}')")" +# 2. committed=true scores as before +check "v7 keeps true as true" "true" "$(committed_of "$V7" '{committed: true}')" +check "v7: N1 committed run is not REFUSED" "N1-C,N1-B" "$(fails_with "$V7" N1 "$(committed_of "$V7" '{committed: true}')")" +check "v7: N2 committed run is not REFUSED" "N2-F,N2-C" "$(fails_with "$V7" N2 "$(committed_of "$V7" '{committed: true}')")" +for k in T4 T5 R1; do + check "v7: $k good evidence with committed=true still all PASS" "" "$(fails_with "$V7" $k "$(committed_of "$V7" '{committed: true}')")" + check "v6 and v7 agree on $k with committed=true" "$(fails_with "$V6" $k true)" "$(fails_with "$V7" $k true)" +done +# 3. missing field is null, not false, and never makes a negative launch pass +check "v7: report without committed gives null" "null" "$(committed_of "$V7" '{}')" +check "v7: null report gives null" "null" "$(committed_of "$V7" 'null')" +check "v7: N1 with missing committed is not PASS" "N1-C,N1-B" "$(fails_with "$V7" N1 "$(committed_of "$V7" '{}')")" +check "v7: N2 with missing committed is not PASS" "N2-F,N2-C" "$(fails_with "$V7" N2 "$(committed_of "$V7" '{}')")" +# 4. the module has no other boolean read through // (explicit false must survive) +check "no .committed read through //" "0" "$(grep -c 'committed // ' "$HERE/rows-v7.jq")" + +echo "selftest-v7: $pass passed, $fail failed" +[ "$fail" -eq 0 ] diff --git a/docs/campaigns/scoring/declarations/np1-v7.decl.json b/docs/campaigns/scoring/declarations/np1-v7.decl.json new file mode 100644 index 00000000..b83878dd --- /dev/null +++ b/docs/campaigns/scoring/declarations/np1-v7.decl.json @@ -0,0 +1,592 @@ +{ + "contract": "scoring-v5", + "campaign": "next-phase-1 v7", + "frozen_by": "docs/campaigns/next-phase-1/ACCEPTANCE-v7.md (Sections 3, 4, 7)", + "note": "Transcribed from ACCEPTANCE-v7 Section 7: identical row set to np1-v6.decl.json (73 rows, one repetition each, no controls, no NOT_APPLICABLE); v7 adds no row. The refused-uncommitted case is covered by selftest-v7.sh, a pre-run gate, not a declared row.", + "rows": [ + { + "row": "T4/v1 Task completion", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/v1 Correctness: committed content", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/v1 Correctness: recall", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/v1 Human interventions: approvals", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/v1 Human interventions: rescues", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/v1 Identity", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/v1 Memory", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/v1 Containment: speculation", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/Q1", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/Q2", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/Q3", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/Q4", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/A2", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/A3", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/A4", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/A5", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/A6", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/T4-L", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/T4-M", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T4/T4-CM", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/v1 Task completion", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/v1 Correctness: committed content", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/v1 Correctness: recall", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/v1 Human interventions: approvals", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/v1 Human interventions: rescues", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/v1 Identity", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/v1 Memory", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/v1 Containment: speculation", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/Q1", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/Q2", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/Q3", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/Q4", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/A2", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/A3", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/A4", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/A5", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/A6", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/T5-P", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/T5-K", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/T5-N", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/T5-B", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "T5/T5-CM", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/v1 Task completion", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/v1 Correctness: committed content", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/v1 Correctness: recall", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/v1 Human interventions: approvals", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/v1 Human interventions: rescues", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/v1 Identity", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/v1 Memory", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/v1 Containment: speculation", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/Q1", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/Q2", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/Q3", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/Q4", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/A2", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/A3", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/A4", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/A5", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/A6", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/R1-X", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/R1-P", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/R1-T", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "R1/R1-CM", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N1/N1-C", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N1/N1-B", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N1/N1-Z", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N1/N1-E", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N1/N1-H", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N2/N2-L", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N2/N2-F", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N2/N2-C", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N2/N2-Z", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + }, + { + "row": "N2/N2-H", + "role": "case", + "reps": 1, + "expected": "PASS", + "control": null, + "not_applicable": false + } + ] +} ```