diff --git a/.crumb b/.crumb index 94ccf63..851e586 100644 --- a/.crumb +++ b/.crumb @@ -21,8 +21,8 @@ "generated": { "children": [ { - "digest": "7a274e73dd98c83d87711fb503bf433361846084959462cc56e01a70b11f1871", - "last_commit": "9403e34", + "digest": "4e1642f63092b7a66dba3b40e8cffe7a748d025a201ed2effb4c37ad1ab81957", + "last_commit": "d8bd4d9", "name": "docs", "purpose": "Directory docs. Purpose not yet described by a human." }, @@ -33,8 +33,8 @@ "purpose": "Directory doctrine. Purpose not yet described by a human." }, { - "digest": "fa990e71f6e3b3dbe1ab8072cf5ed51f8a4bcb0759756c60fc09b647bfcc6904", - "last_commit": "a44d5da", + "digest": "4e4e56f7069b2df5065f7020589175735a5f9fae2c99e75173c843a35b569ec5", + "last_commit": "d8bd4d9", "name": "scripts", "purpose": "Directory scripts. Purpose not yet described by a human." }, @@ -45,15 +45,15 @@ "purpose": "Directory tools. Purpose not yet described by a human." } ], - "children_root": "sha256:e06d2dd2d9c99dd3961b3578b2f5785aae4053595f77dffac35c710525764e0a", - "compiled_at": "2026-10-05T14:07:13Z", + "children_root": "sha256:efc732facfc8380986a44ccf869d480965f0f4e27af5593e1e27fc66a04bcd1c", + "compiled_at": "2026-10-05T17:54:40Z", "compiler": "crumb-compile/1", - "digest": "sha256:fa8dac7d8ad92a1f3d2007f6f86fb5434e67010a74d58f23a46932517459cab8", + "digest": "sha256:99184c1e6c3d4617d360ec0646c232117365c754ce695c241ee42aad15f94fe8", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 219, - "generated_at_commit": "86266343f979875419e3239226bbd9e2a287b9d1", - "source_tree": "sha256:2ee849f0678d85a7a1f298d1507e60811097edf46ed4a839d98e0bd69000aca0" + "files": 221, + "generated_at_commit": "d8bd4d922a556e00af2fb4d4b2dd8059c0740d2f", + "source_tree": "sha256:bb8bf90cd7181ccbf21b83017e4a08208c5701d455ee72a5360b6f1f5836be0d" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index dac8c3d..06cab60 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -56,7 +56,7 @@ }, { "digest": "2812aeb880835afae274e0a164ed976362b191717bd958d54a4c5c5f48ed05af", - "last_commit": "d2a49e0", + "last_commit": "9403e34", "name": "plans", "purpose": "Directory docs/plans. Purpose not yet described by a human." }, @@ -74,14 +74,14 @@ } ], "children_root": "sha256:bde813bd3da2022fdea0b51909fffcaf9185928075df4868d9520f7c42fcff99", - "compiled_at": "2026-10-05T12:34:11Z", + "compiled_at": "2026-10-05T17:52:10Z", "compiler": "crumb-compile/1", - "digest": "sha256:7a274e73dd98c83d87711fb503bf433361846084959462cc56e01a70b11f1871", + "digest": "sha256:4e1642f63092b7a66dba3b40e8cffe7a748d025a201ed2effb4c37ad1ab81957", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 121, - "generated_at_commit": "d2a49e0fb4dac777271bf7c184ff048d5c63b4ba", - "source_tree": "sha256:11300a4e990a14754138c6d4a38cb2c2288a6b90136d405792df12cf49089d6b" + "generated_at_commit": "d0fe710a7289b7ad025dd73b062835fbb75f659c", + "source_tree": "sha256:2efff52ac67b33d36a95ee3da2dc3c342a8d91edd802a07f126658db46efb08e" }, "owner_lane": "", "provenance": { diff --git a/docs/qualification/CANDIDATE.md b/docs/qualification/CANDIDATE.md index 8b73076..7aab384 100644 --- a/docs/qualification/CANDIDATE.md +++ b/docs/qualification/CANDIDATE.md @@ -58,3 +58,5 @@ Promotion checks (for example `evidence-immutable`) are mandatory. A bypass need ## Checker `scripts/check_candidate.sh ` verifies that all required fields are present, that each pinned commit (`[commits]` and `[contracts]`) is 40 hex digits and exists in its repo (checked with `gh api`), that executable digests are 64 hex and not all zero, that a `#` inside a quoted value is kept (only a trailing comment is dropped), and that a non-draft manifest has real executable digests. Test: `scripts/test_check_candidate.sh` (the 2026-10-01 draft is kept as `scripts/testdata/cand-draft-fixture.toml`; offline: a fake `gh` on PATH exercises the real `gh` code path, and mutant copies of the checker prove each check bites). Wiring into CI is not done and needs Drake's approval. + +`scripts/check_candidate_pins.sh ` verifies that the pins agree with what the pinned code consumes: the sovereign-core `omega.lock` equals `[commits] omega`; the sovereign-core `Cargo.lock` git revisions of aien-protocols, crumb-spec and spark-crumbs equal `[commits] aien-protocols` and the two `[contracts]`; the omega `physics.lock` and `aienos.lock` equal `[commits] physics` and `aienos`; each known `[consumed_pins]` entry equals the value read. Lock files are read from GitHub at the pinned commits. A repo with two revisions in `Cargo.lock`, or an unreadable lock file, fails. Test: `scripts/test_check_candidate_pins.sh` (offline, lock files served by a stub). Results on the frozen manifests (2026-10-05): CAND-0 disagrees on aienos (its recorded gap G1); CAND-1 disagrees on both contracts: it pins the crumb-spec and spark-crumbs heads (`10b8251`, `98bb7cb`), while its sovereign-core `Cargo.lock` consumes `24194d1` and `9355a92`, the values CAND-0 pins. Frozen manifests are not edited; CAND-1.gates.md and later candidates record it. diff --git a/qualification/candidates/CAND-1.gates.md b/qualification/candidates/CAND-1.gates.md index 725ae47..8e2ef6f 100644 --- a/qualification/candidates/CAND-1.gates.md +++ b/qualification/candidates/CAND-1.gates.md @@ -75,6 +75,11 @@ omega #290 (the R15 sampler no longer leaves a 24 h `sleep` holding the quiet fl - **TRUST-1 M5:** 11 gates need attended hardware boots or operator ceremonies; 5 have no implementation; the Gate 7 preflight refuses because Secure Boot is off on this machine (operator setting). Not qualified. - **Physical machine:** every AIENOS result is QEMU. Nothing here qualifies the Spark booting AIENOS. +- **Contract pins in the manifest are wrong** (found 2026-10-05 by `scripts/check_candidate_pins.sh`). `CAND-1.toml` + `[contracts]` pins the crumb-spec and spark-crumbs heads (`10b8251`, `98bb7cb`); the sovereign-core `Cargo.lock` at + `2eec75b` consumes `24194d1` and `9355a92` (two commits behind each head, the revisions CAND-0 pins). The built + executables used the consumed revisions, so the digests are unaffected; the manifest line is wrong. A frozen + manifest is not edited; CAND-2 pins the consumed revisions. - **Path independence** tested 2026-10-05 by a build at a second checkout path (`CAND1-PATH2-2eec75b`): 8 of 9 executables reproduce the CAND-1 digests, including aien-cli. omegatool (`omega-runtime`) does not: it embeds the physics checkout path in three strings (control: the second-path omega checkout built with the physics path set diff --git a/scripts/.crumb b/scripts/.crumb index dc606b8..c58a43d 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-05T03:32:07Z", + "compiled_at": "2026-10-05T17:54:40Z", "compiler": "crumb-compile/1", - "digest": "sha256:fa990e71f6e3b3dbe1ab8072cf5ed51f8a4bcb0759756c60fc09b647bfcc6904", + "digest": "sha256:4e4e56f7069b2df5065f7020589175735a5f9fae2c99e75173c843a35b569ec5", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 5, - "generated_at_commit": "c5d80978c7a22cc039e67def9745cede5010f388", - "source_tree": "sha256:9fcc43ef8155c0c5705c20333999b2a919de931f6d160ea822e13bfb6894f6cc" + "files": 7, + "generated_at_commit": "d8bd4d922a556e00af2fb4d4b2dd8059c0740d2f", + "source_tree": "sha256:ccbda5ed9f36d4c23fb42dc0955b4e51ff4f1cd1f23c15432948c9267acff73f" }, "owner_lane": "", "provenance": { diff --git a/scripts/check_candidate_pins.sh b/scripts/check_candidate_pins.sh new file mode 100755 index 0000000..a07fb00 --- /dev/null +++ b/scripts/check_candidate_pins.sh @@ -0,0 +1,114 @@ +#!/usr/bin/env bash +# check_candidate_pins.sh: do the pins of a candidate manifest equal what the pinned code consumes? +# Usage: scripts/check_candidate_pins.sh +# check_candidate.sh proves each pinned commit exists; this script proves the pins agree with each other. +# It reads the lock files of the pinned commits from GitHub and compares: +# sovereign-core omega.lock = [commits] omega +# sovereign-core Cargo.lock aien-protocols rev = [commits] aien-protocols +# sovereign-core Cargo.lock crumb-spec rev = [contracts] crumb-spec +# sovereign-core Cargo.lock spark-crumbs rev = [contracts] spark-crumbs +# omega physics.lock = [commits] physics (when pinned) +# omega aienos.lock = [commits] aienos +# every [consumed_pins] key below = the value read from its lock file +# A Cargo.lock package with more than one git revision, or a lock file that cannot be read, fails. +# Exit 0 = every pin agrees, 1 = any mismatch or read failure. Pure bash plus `gh api`. +# Override the reader with CAND_FILE_AT (a command run as: $CAND_FILE_AT , printing the +# file) for offline tests. +set -u +f="${1:-}" +[ -f "$f" ] || { echo "usage: $0 " >&2; exit 1; } +fail=0 +ok() { echo "OK: $*"; } +err() { echo "FAIL: $*" >&2; fail=1; } + +file_at() { + if [ -n "${CAND_FILE_AT:-}" ]; then $CAND_FILE_AT "$1" "$2" "$3" + else gh api -H "Accept: application/vnd.github.raw" "repos/aien-dev/$1/contents/$3?ref=$2"; fi +} + +# Same parser as check_candidate.sh: "section.key" -> value, for lines `key = "value"`. +declare -A kv +sec="" +while IFS= read -r line; do + if [[ "$line" =~ ^[[:space:]]*([A-Za-z0-9_.-]+)[[:space:]]*=[[:space:]]*\"([^\"]*)\"[[:space:]]*(#.*)?$ ]]; then + kv["${sec}${BASH_REMATCH[1]}"]="${BASH_REMATCH[2]}"; continue + fi + line="$(echo "$line" | sed -e 's/^[[:space:]]*#.*//' -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//')" + [ -z "$line" ] && continue + if [[ "$line" =~ ^\[([A-Za-z0-9_.-]+)\][[:space:]]*(#.*)?$ ]]; then sec="${BASH_REMATCH[1]}."; continue; fi +done < "$f" + +# The pin of a lock file: its first line that is not blank and not a comment must be exactly 40 lowercase hex +# (comment lines after it are allowed). Anything else, or a failed read, prints nothing and fails. The read is +# captured with its exit status before parsing: on a missing commit `gh api` prints an error body that itself +# contains the 40-hex ref, which must never be taken for the file. +read_lock() { # read_lock + local text line + text=$(file_at "$1" "$2" "$3") || return 1 + line=$(printf '%s\n' "$text" | sed -e 's/^[[:space:]]*//' -e 's/[[:space:]]*$//' | grep -v -m1 -e '^$' -e '^#') + [[ "$line" =~ ^[0-9a-f]{40}$ ]] || return 1 + echo "$line" +} + +# git revision of the aien-dev repo $2 in Cargo.lock text $1: every package whose source is that repo (a repo +# that ships several crates, such as aien-protocols, counts once); fails on zero or several revisions +cargo_rev() { + local revs + revs=$(printf '%s\n' "$1" | grep -E "^source = \"git\+https://github\.com/aien-dev/$2(\.git)?[?#]" \ + | grep -oE '#[0-9a-f]{40}"' | cut -c2-41 | sort -u) + [ -n "$revs" ] || { echo "none"; return 1; } + [ "$(printf '%s\n' "$revs" | wc -l)" -eq 1 ] || { echo "several:$(echo $revs)"; return 1; } + echo "$revs" +} + +same() { # same