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-architecture-mv/patches/5da78c4fd85a5630 # aien-architecture-mv Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories. Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers ## GitHub aien-dev/aien-architecture-mv#152 (code only) closed derived `5da78c4fd85a5630` #152 Imported from GitHub aien-dev/aien-architecture-mv#152 (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 `7f99d7ee4221bb3cd8b3bc23bf167a64baac24e4` · Head `11bdbde3c534e6ba021f448390fd2c145800110a` ### Apply it ``` git checkout -b patch-5da78c4fd85a5630 7f99d7ee4221bb3cd8b3bc23bf167a64baac24e4 curl -fsSL https://interplane.io/drakestapleton/aien-architecture-mv/patches/5da78c4fd85a5630.patch | git am ``` Raw patch (mbox) · 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-architecture-mv 152 11bdbde3c534e6ba021f448390fd2c145800110a ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-architecture-mv","number":152,"url":"https://github.com/aien-dev/aien-architecture-mv/pull/152","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:50Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index 86ecfc7..fb1a79c 100644 --- a/.crumb +++ b/.crumb @@ -21,8 +21,8 @@ "generated": { "children": [ { - "digest": "3c878e787a01b1ec4f1dc90012cf250de9e538e84af79365a71871ed89df6a49", - "last_commit": "a3cbc46", + "digest": "920f4a700f4c4e191542c9fba3c81fbb26daad9726781d4d7f80b9544796c1c5", + "last_commit": "3341e98", "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": "4e4e56f7069b2df5065f7020589175735a5f9fae2c99e75173c843a35b569ec5", - "last_commit": "7390f5d", + "digest": "c34f88bb1ba323a3712efd9fd12cbefa5d0b8d92b3ea66375c5b0b916cfdebd7", + "last_commit": "3341e98", "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:b8c9b7bb73068cec2992676cf6271a9e8daf80d3e36e0a4aa0715acce015232d", - "compiled_at": "2026-10-06T20:25:28Z", + "children_root": "sha256:8069b728d3193a925a2fb78871efb08f2e321e57f287751684fa25ad46a9c777", + "compiled_at": "2026-10-06T20:50:43Z", "compiler": "crumb-compile/1", - "digest": "sha256:4caeeb3e3be3ba9ff9fb6002090ea6a2294a107bda4136f7594e59429c448dfc", + "digest": "sha256:68fb5c8964d1e014d4bf40b79b6078a82b2237c12edc6dae667a622f14760b05", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 228, - "generated_at_commit": "4d1f9d0a37c1ece5c4189bc2c5bdb33f64791e57", - "source_tree": "sha256:abd760830ecb133f37d83cac72bda08480c20352e15415d5dadedc17a8864a6e" + "files": 229, + "generated_at_commit": "3341e98f15d2daef96f534e32d03c9d2592eda2c", + "source_tree": "sha256:c08a388f4136a86de8a526a3fd410517d041e490e776a808cadff5c6354525fc" }, "owner_lane": "", "provenance": { diff --git a/docs/.crumb b/docs/.crumb index 11fe1a5..5f0b189 100644 --- a/docs/.crumb +++ b/docs/.crumb @@ -74,14 +74,14 @@ } ], "children_root": "sha256:bde813bd3da2022fdea0b51909fffcaf9185928075df4868d9520f7c42fcff99", - "compiled_at": "2026-10-06T02:18:29Z", + "compiled_at": "2026-10-06T20:50:34Z", "compiler": "crumb-compile/1", - "digest": "sha256:3c878e787a01b1ec4f1dc90012cf250de9e538e84af79365a71871ed89df6a49", + "digest": "sha256:920f4a700f4c4e191542c9fba3c81fbb26daad9726781d4d7f80b9544796c1c5", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 121, - "generated_at_commit": "03409499070f18a246237625267d24a08fe01ffd", - "source_tree": "sha256:1b1c0ac46b59b11e3c2e04cf698a4c17513896137485f998b6ade0384dfa65ee" + "generated_at_commit": "abda85392f829daeefd57b126eac299df8397325", + "source_tree": "sha256:150e85b43536f47f4266280038a9d6c46501246c3e022a28a98ed175378b8da5" }, "owner_lane": "", "provenance": { diff --git a/docs/qualification/CANDIDATE.md b/docs/qualification/CANDIDATE.md index 5f963bd..e91d42e 100644 --- a/docs/qualification/CANDIDATE.md +++ b/docs/qualification/CANDIDATE.md @@ -72,4 +72,6 @@ Promotion checks (for example `evidence-immutable`) are mandatory. A bypass need `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. +Amendments: a frozen manifest is not edited. Evidence recorded after the freeze goes in `.amendment-.toml` next to the manifest (schema `CandidateAmendmentV1`: `candidate`, `amendment`, `date`, `reason`, `manifest-sha256` = the sha256 of the frozen manifest file, then the added keys), with a dated note in `.gates.md`. `check_candidate.sh` reads every amendment with its manifest and refuses one that names another candidate or number, pins a manifest sha256 that is not the file's (so a later manifest edit fails), re-states a key the manifest already has, touches `[commits]`, `[contracts]`, `[executables]` or `[consumed_pins]`, or adds a `*-sha256` that is not a real digest. `check_candidate_pins.sh` is unaffected, since an amendment cannot change pins. First use: CAND-4 Amendment 1 (oracle fixture digests, 2026-10-06). + `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-4.amendment-1.toml b/qualification/candidates/CAND-4.amendment-1.toml new file mode 100644 index 0000000..0fc8998 --- /dev/null +++ b/qualification/candidates/CAND-4.amendment-1.toml @@ -0,0 +1,13 @@ +# CAND-4 Amendment 1: oracle fixture recorded (2026-10-06). The frozen manifest CAND-4.toml is not edited; +# this file adds evidence about its already-pinned model input. Note and provenance: CAND-4.gates.md +# "Amendment 1" and sovereign-core docs/release/ORACLE-FIXTURE-CAND4.md. Checked by scripts/check_candidate.sh. +schema = "CandidateAmendmentV1" +candidate = "CAND-4" +amendment = "1" +date = "2026-10-06" +reason = "oracle fixture recorded: independent Hugging Face Transformers FP32 CPU reference for the pinned model (an outside yardstick made as scratch; AIEN does not depend on it at build, test or run time)" +manifest-sha256 = "5f1cf9d7fefce087f256f25f884e9bb2e1ed21e7c6a8470f795a76fc13dd97ee" # CAND-4.toml at 7f99d7e + +[model] +oracle-fixture-safetensors-sha256 = "bf1d83edc1b802ad25cfbbce7a043658d3d4797bd67955447ce8630b51f515ed" # llama32_1b_oracle.safetensors, 50834760 bytes +oracle-fixture-manifest-sha256 = "6df1b39eb351db7f8626734e8de882b572c8678bab924b932640621b21235e82" # llama32_1b_oracle_manifest.json, 23139 bytes diff --git a/qualification/candidates/CAND-4.gates.md b/qualification/candidates/CAND-4.gates.md index 8ae02a6..e6cfe83 100644 --- a/qualification/candidates/CAND-4.gates.md +++ b/qualification/candidates/CAND-4.gates.md @@ -33,3 +33,27 @@ production images; every worktree clean after the build. so updating the pin needs either a fixture or a gate change. - Distribution: internal-only until an open-licence model passes (Drake decision 2026-10-06, Option 3). - Chip results: none; the build is host only. + +## Amendment 1 (2026-10-06): oracle fixture recorded + +Additive evidence only; the candidate is unchanged (same commits, executables, model and model digests), and the frozen +`CAND-4.toml` is not edited (byte-identical to 7f99d7e). The machine-readable record is +`CAND-4.amendment-1.toml`, which pins the sha256 of the frozen manifest (5f1cf9d7...) and adds two `[model]` digests; +`scripts/check_candidate.sh` reads it with the manifest and refuses a later manifest edit. + +At freeze `[model] oracle-fixture` said none was recorded for this model. An independent reference fixture for +unsloth/Llama-3.2-1B-Instruct snapshot 5a8abab now exists: + +- `llama32_1b_oracle.safetensors` sha256 `bf1d83edc1b802ad25cfbbce7a043658d3d4797bd67955447ce8630b51f515ed` (50834760 bytes) +- `llama32_1b_oracle_manifest.json` sha256 `6df1b39eb351db7f8626734e8de882b572c8678bab924b932640621b21235e82` (23139 bytes) + +Provenance: Hugging Face Transformers runs the model on the CPU in FP32 (generator: CAND-3's +`scripts/generate_tinyllama_oracle.py` from sovereign-core `d2cacfa^`, constants-only changes; torch 2.14.0+cu130, +transformers 5.17.0, safetensors 0.8.0; `python3 -I`). It is an outside yardstick, made as scratch outside every +repository; AIEN does not depend on it at build, test or run time, and no Python is committed. Two runs gave +byte-identical files. Files and full record: sovereign-core `crates/aien-inference-abi/fixtures/` and +`docs/release/ORACLE-FIXTURE-CAND4.md` (release pin PR sovereign-core#238). + +Independence check: the CAND-4 aien-cli (ad6b7eb5..., GB10 native backend) greedy 16 tokens on the same prompt gave +the same text as the oracle ("An operating system (OS) is a software layer that manages computer hardware resources,"). +Text level only: aien-cli exposes no token ids or logits, so the fixture's logits and activations were not compared. diff --git a/scripts/.crumb b/scripts/.crumb index c58a43d..2ee4a9c 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -7,14 +7,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-05T17:54:40Z", + "compiled_at": "2026-10-06T20:50:34Z", "compiler": "crumb-compile/1", - "digest": "sha256:4e4e56f7069b2df5065f7020589175735a5f9fae2c99e75173c843a35b569ec5", + "digest": "sha256:c34f88bb1ba323a3712efd9fd12cbefa5d0b8d92b3ea66375c5b0b916cfdebd7", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", "files": 7, - "generated_at_commit": "d8bd4d922a556e00af2fb4d4b2dd8059c0740d2f", - "source_tree": "sha256:ccbda5ed9f36d4c23fb42dc0955b4e51ff4f1cd1f23c15432948c9267acff73f" + "generated_at_commit": "abda85392f829daeefd57b126eac299df8397325", + "source_tree": "sha256:ad70f421e2dca07f97cdf023e1b747fd0c3871f861f7ed206556222e4c1183b5" }, "owner_lane": "", "provenance": { diff --git a/scripts/check_candidate.sh b/scripts/check_candidate.sh index 65f7256..7467d85 100755 --- a/scripts/check_candidate.sh +++ b/scripts/check_candidate.sh @@ -1,9 +1,10 @@ #!/usr/bin/env bash -# check_candidate.sh: validate a candidate manifest (docs/qualification/CANDIDATE.md). +# check_candidate.sh: validate a candidate manifest (docs/qualification/CANDIDATE.md) and its amendments. # Usage: scripts/check_candidate.sh # Exit 0 = valid, 1 = invalid. Pure bash; sha existence is checked with # `gh api repos/aien-dev//commits/`. Override with env var # CAND_SHA_CHECK (a command run as: $CAND_SHA_CHECK ) for tests. +# Amendments: every .amendment-.toml next to the manifest is read and checked too (see below). set -u # Commit pins: [commits] (5 repos) and [contracts] (crumb-spec, spark-crumbs). f="${1:-}" @@ -16,19 +17,21 @@ sha_exists() { else gh api "repos/aien-dev/$1/commits/$2" -q .sha >/dev/null 2>&1; fi } -# Parse: "section.key" -> value, for lines `key = "value"`. +# parse : "section.key" -> value, for lines `key = "value"`. +parse() { + local -n out="$2"; local sec="" line + while IFS= read -r line; do + # A quoted value may contain #; only a trailing comment after the closing quote is dropped. + if [[ "$line" =~ ^[[:space:]]*([A-Za-z0-9_.-]+)[[:space:]]*=[[:space:]]*\"([^\"]*)\"[[:space:]]*(#.*)?$ ]]; then + out["${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 < "$1" +} declare -A kv -sec="" -while IFS= read -r line; do - # A quoted value may contain #; only a trailing comment after the closing quote is dropped. - 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" - +parse "$f" kv for k in schema id status created; do [ -n "${kv[$k]:-}" ] || err "missing field: $k" done @@ -68,5 +71,40 @@ for k in "${!kv[@]}"; do done [ "$nexe" -gt 0 ] || err "no [executables] entries" -[ "$fail" -eq 0 ] && echo "OK: $f" && exit 0 + +# Amendments. A frozen manifest is never edited; evidence recorded after the freeze goes in +# .amendment-.toml next to it, with the dated note in .gates.md. Each amendment must: +# have schema CandidateAmendmentV1, name this candidate, carry its own number, a date and a reason; pin the +# sha256 of the manifest it amends (so a later edit of the frozen manifest is refused); and only ADD keys, never +# in [commits], [contracts], [executables] or [consumed_pins] (those define what the candidate is). Added +# *-sha256 values must be real digests. +mf_sha="$(sha256sum "$f" | cut -d' ' -f1)" +stem="${f%.toml}"; namend=0 +for a in "$stem".amendment-*.toml; do + [ -f "$a" ] || continue + n="${a#"$stem".amendment-}"; n="${n%.toml}" + unset am; declare -A am=(); parse "$a" am + [ "${am[schema]:-}" = "CandidateAmendmentV1" ] || err "$a: schema must be CandidateAmendmentV1" + [ "${am[candidate]:-}" = "${kv[id]:-}" ] || err "$a: candidate '${am[candidate]:-}' is not the manifest id '${kv[id]:-}'" + [ "${am[amendment]:-}" = "$n" ] || err "$a: amendment '${am[amendment]:-}' does not match its file name ($n)" + { [ -n "${am[date]:-}" ] && [ -n "${am[reason]:-}" ]; } || err "$a: date and reason are required" + [ "${am[manifest-sha256]:-}" = "$mf_sha" ] \ + || err "$a: pins manifest sha256 '${am[manifest-sha256]:-}' but $f is $mf_sha (frozen manifests are not edited)" + nk=0 + for k in "${!am[@]}"; do + case "$k" in schema|candidate|amendment|date|reason|manifest-sha256) continue ;; esac + case "$k" in *.*) ;; *) err "$a: unknown top-level key '$k'"; continue ;; esac + case "$k" in commits.*|contracts.*|executables.*|consumed_pins.*) + err "$a: $k cannot be amended (it would change what the candidate is)"; continue ;; esac + [ -z "${kv[$k]+x}" ] || err "$a: $k is already in the manifest; an amendment only adds keys" + if [[ "$k" == *-sha256 ]]; then + { [[ "${am[$k]}" =~ ^[0-9a-f]{64}$ ]] && ! [[ "${am[$k]}" =~ ^0{64}$ ]]; } || err "$a: $k is not a real sha256" + fi + nk=$((nk+1)) + done + [ "$nk" -gt 0 ] || err "$a: adds no keys" + namend=$((namend+1)) +done + +[ "$fail" -eq 0 ] && echo "OK: $f (amendments: $namend)" && exit 0 exit 1 diff --git a/scripts/test_check_candidate.sh b/scripts/test_check_candidate.sh index 91443df..a4953e7 100755 --- a/scripts/test_check_candidate.sh +++ b/scripts/test_check_candidate.sh @@ -82,6 +82,33 @@ sed 's/^physics = .*/physics = "abc123"/' "$live" > "$tmp/p1.toml"; expect 1 " sed 's/^interplane = .*/interplane = "deadbeefdeadbeefdeadbeefdeadbeefdeadbeef"/' "$live" > "$tmp/p2.toml"; expect 1 "nonexistent interplane sha" "$tmp/p2.toml" sed 's/^omega-runtime = .*/omega-runtime = "UNBUILT"/' "$live" > "$tmp/p3.toml"; expect 1 "frozen live manifest with UNBUILT" "$tmp/p3.toml" +# --- amendments: .amendment-.toml next to the manifest is read; a frozen manifest edit is refused. +amd="$tmp/amd"; mkdir -p "$amd"; frozen "$amd/CX.toml"; printf '\n[model]\nmodel-id = "m"\n' >> "$amd/CX.toml" +amend() { # amend [extra line...] : write CX.amendment-.toml + local n="$1" s="$2"; shift 2 + { printf 'schema = "CandidateAmendmentV1"\ncandidate = "CAND-0"\namendment = "%s"\ndate = "2026-10-06"\nreason = "test"\nmanifest-sha256 = "%s"\n\n[model]\n' "$n" "$s" + printf 'oracle-fixture-safetensors-sha256 = "%s"\n' "$H64a"; for l in "$@"; do printf '%s\n' "$l"; done; } > "$amd/CX.amendment-$n.toml" +} +MSHA=$(sha256sum "$amd/CX.toml" | cut -d' ' -f1) +amend 1 "$MSHA"; expect 0 "amendment: valid amendment accepted" "$amd/CX.toml" +"$chk" "$amd/CX.toml" 2>/dev/null | grep -q '(amendments: 1)' && pass=$((pass+1)) || { bad=$((bad+1)); echo "TEST FAIL: amendment file not picked up"; } +amend 1 "$MSHA" "tokenizer-json-sha256 = \"$Z64\""; expect 1 "amendment: all-zero digest in amendment refused (file is read)" "$amd/CX.toml" +cp "$amd/CX.toml" "$amd/CX.orig"; amend 1 "$MSHA" +echo '# edited after the freeze' >> "$amd/CX.toml"; expect 1 "amendment: frozen manifest edited after amendment refused" "$amd/CX.toml" +cp "$amd/CX.orig" "$amd/CX.toml" +amend 1 "$MSHA" "[executables]" "omega-runtime = \"$H64b\""; expect 1 "amendment: [executables] cannot be amended" "$amd/CX.toml" +amend 1 "$MSHA" "[commits]" "physics = \"0123456789012345678901234567890123456789\""; expect 1 "amendment: [commits] cannot be amended" "$amd/CX.toml" +amend 1 "$MSHA" "model-id = \"other\""; expect 1 "amendment: a key already in the manifest is not overridden" "$amd/CX.toml" +cp -r "$amd" "$tmp/amdov" # kept for the override mutant below +amend 1 "$MSHA"; sed -i 's/^candidate = .*/candidate = "CAND-9"/' "$amd/CX.amendment-1.toml"; expect 1 "amendment: wrong candidate refused" "$amd/CX.toml" +amend 1 "$MSHA"; sed -i 's/^amendment = .*/amendment = "2"/' "$amd/CX.amendment-1.toml"; expect 1 "amendment: number must match file name" "$amd/CX.toml" +amend 1 "$MSHA" +live4="$here/../qualification/candidates/CAND-4.toml" +expect 0 "live CAND-4 with Amendment 1 valid" "$live4" +"$chk" "$live4" 2>/dev/null | grep -q '(amendments: 1)' && pass=$((pass+1)) || { bad=$((bad+1)); echo "TEST FAIL: live CAND-4 amendment not picked up"; } +[ -z "$(cd "$here/.." && git diff 7f99d7ee4221bb3cd8b3bc23bf167a64baac24e4 -- qualification/candidates/CAND-4.toml 2>/dev/null)" ] && pass=$((pass+1)) || { bad=$((bad+1)); echo "TEST FAIL: frozen CAND-4.toml differs from 7f99d7e"; } +echo '# edited' >> "$amd/CX.toml" # left edited for the mutant below + # --- new: mutants. Each broken copy of the checker must wrongly accept the bad input, # proving the new test above really depends on the new check. mutant() { # mutant