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/96b6e064e03a426e # 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#224 (code only) closed derived `96b6e064e03a426e` #224 Imported from GitHub aien-dev/aien-sovereign-core-mv#224 (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 `33b27e2efe098ca5c1e12f0dc8f3f4d026f255bc` · Head `b1302ecd06cbe9edd6c89c6bbabc3c7b690e1c5f` ### Fetch it A git bundle of the pull request's head, 10355 bytes. ``` curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/96b6e064e03a426e.bundle -o 96b6e064e03a426e.bundle git fetch 96b6e064e03a426e.bundle refs/pull/224/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 224 b1302ecd06cbe9edd6c89c6bbabc3c7b690e1c5f ``` ``` {"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":224,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/224","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:36:22Z","metadata":"unavailable","state_derived":true} ``` ### Changes ``` diff --git a/.crumb b/.crumb index a2818a8b..1d78b135 100644 --- a/.crumb +++ b/.crumb @@ -64,8 +64,8 @@ "generated": { "children": [ { - "digest": "e0b44c224e311bd7a834d7e3161863f4ef041b54809ba80ff46e15832797c02a", - "last_commit": "adb419e", + "digest": "8adb9b86301dab19b5d674d5ef0eba0936f76f15eeccbfa88cdfd5d11adddac0", + "last_commit": "ce3ef86", "name": "scripts", "purpose": "" }, @@ -76,15 +76,15 @@ "purpose": "" } ], - "children_root": "sha256:072aa626d2f91f969d5e1c07254222ec0cec0a84310fa983fe8a989228fe1e84", - "compiled_at": "2026-10-06T14:19:35Z", + "children_root": "sha256:5bc6c40c7fc034d6f7a949a438fcc78ed8c452232e3a6ab7bb6ef6b622ebaf49", + "compiled_at": "2026-10-06T14:54:01Z", "compiler": "crumb-compile/1", - "digest": "sha256:c988c68866c4cec4d4a30948ab648dd17e7ba9479fbb7980729531e0fd48ee49", + "digest": "sha256:bed2358c7401e831857f16643cf3ed1aa4a3b7acf8c2f98ab2be8a0a45f4f223", "evidence_files": 24, "evidence_root": "sha256:16192fc4be2f886385affd6e26faae4b831eb62b87ceac4ab39d662e0859d7f8", - "files": 725, - "generated_at_commit": "a57da1982d90c97116cb2c2490eeecf0211008aa", - "source_tree": "sha256:e4746dac6c9de08848a1805c472002d64f1eac90c07601fa8a6aeaaea446e44f" + "files": 728, + "generated_at_commit": "ce3ef865cee16800c9e96d15534154a0bc443912", + "source_tree": "sha256:275313a93f5fe2dd1241123deabd493301e76a0937d303310e906cbec268b7aa" } }, "history": [], diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index b4bad08f..7c2983be 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -46,6 +46,9 @@ jobs: rustup toolchain install "$(sed -n 's/^channel *= *"\(.*\)"/\1/p' rust-toolchain.toml)" --profile minimal rustc --version + - name: Release gate (candidate named, omega.lock equals the candidate's omega commit) + run: scripts/check-release-candidate.sh + - name: Read pins (omega.lock, then omega physics.lock) id: pins run: echo "omega=$(tr -d '[:space:]' < omega.lock)" >> "$GITHUB_OUTPUT" @@ -89,8 +92,6 @@ jobs: scripts/repro-build.sh -p aien-cli - name: Package Release Assets (reproducible tarball, release.toml inside) - env: - AIEN_CANDIDATE_ID: ${{ vars.AIEN_CANDIDATE_ID }} run: | bash scripts/package-release.sh "${{ matrix.artifact_name }}" AIEN_SHA="$(sha256sum target/release/aien-cli 2>/dev/null || shasum -a 256 target/release/aien-cli)" @@ -126,14 +127,14 @@ jobs: sha256sum sovereign-* aien-cli-digests.txt > SHA256SUMS.txt cat SHA256SUMS.txt - - name: Sign Checksums (when the release key secret is configured) + - name: Sign Checksums (fails the job when the release key secret is absent) working-directory: release-artifacts env: AIEN_RELEASE_SIGNING_KEY: ${{ secrets.AIEN_RELEASE_SIGNING_KEY }} run: | if [ -z "$AIEN_RELEASE_SIGNING_KEY" ]; then - echo "No signing key secret; release will carry checksums only. Sign by hand per docs/release/RELEASE_SIGNING.md and upload SHA256SUMS.txt.sig." - exit 0 + echo "AIEN_RELEASE_SIGNING_KEY secret is not configured. Refusing to publish an unsigned release." >&2 + exit 1 fi umask 077 printf "%s\n" "$AIEN_RELEASE_SIGNING_KEY" > ../release_key @@ -172,7 +173,8 @@ jobs: cd release-artifacts SIG="" - [ ! -f SHA256SUMS.txt.sig ] || SIG="SHA256SUMS.txt.sig" + [ -f SHA256SUMS.txt.sig ] || { echo "SHA256SUMS.txt.sig is missing; refusing to publish" >&2; exit 1; } + SIG="SHA256SUMS.txt.sig" gh release create "$TAG" sovereign-* aien-cli-digests.txt SHA256SUMS.txt $SIG \ --title "AIEN Sovereign Core ${TAG}" \ --notes-file ../"$NOTES_FILE" \ diff --git a/docs/release/F1-binary-digest-difference.md b/docs/release/F1-binary-digest-difference.md new file mode 100644 index 00000000..c89190b2 --- /dev/null +++ b/docs/release/F1-binary-digest-difference.md @@ -0,0 +1,23 @@ +# F1: why the same source gives two different aien-cli digests + +Measured 2026-10-06 on the Spark (aarch64, host CPU only). Source: sovereign-core 80e071a (the CAND-3 source), omega +f816473 and physics 6d7cf0d (CAND-3), rustc 1.98.1, fresh CARGO_HOME, `scripts/repro-build.sh`, three target directories. + +| Build | Command | aien-cli sha256 | +|---|---|---| +| A | the six other packages together, then `-p aien-cli` alone | 3a17ee79a238... (equals CAND-3 `aien-cli-native-release`) | +| B | same as A, second target directory | 3a17ee79a238... (identical) | +| C | all seven packages in one cargo command | ccecf9a13ef2... (differs) | + +- A and B are byte-identical for all seven binaries: the CAND-3 recipe is reproducible here, and `aien-cli` equals the CAND-3 digest. +- C differs from A in all seven binaries, not only aien-cli. spark-debugger: 6,386,800 bytes (A) vs 6,452,400 bytes (C), so the + code itself differs. aien-cli: same file size, 6,399,222 differing bytes; the first differing ELF section is `.text` + (0x5e7f4c in A, 0x5e7fcc in C); the build-id differs, as expected. +- Cause (verified at the dependency level, not by bisecting bytes): Cargo unifies features across every package named in one + command. `cargo tree -f '{p} {f}'` for `-p spark-debugger` alone and for all seven together shows 31 shared crates with a + different feature set (examples: cc `parallel`, bitflags `std`, futures-util `async-await,sink,...`, hyper, rustls, reqwest, + rusqlite, log, memchr). Different features, different code. Not timestamps, not paths (the remap works), not the compiler. +- Consequence: a binary's digest depends on which other packages are in the same cargo command. The release workflow + therefore builds `aien-cli` in its own last command and builds the other six as one fixed group; the six-group digests + are stable (A equals B) but have no CAND-3 manifest entry to compare with. +- Not done: a byte-level map of which feature changes which function; a cargo-config fix that stops unification. diff --git a/release/candidate.toml b/release/candidate.toml new file mode 100644 index 00000000..e30c15b8 --- /dev/null +++ b/release/candidate.toml @@ -0,0 +1,19 @@ +# The candidate this tree is allowed to be released as. Read by scripts/check-release-candidate.sh +# (called from .github/workflows/release.yml and scripts/package-release.sh). A release fails +# unless omega.lock equals omega-commit below. Copied from aien-architecture +# qualification/candidates/CAND-3.toml ([commits] omega and [model]); change both together. +candidate = "CAND-3" +omega-commit = "f816473df391bc4fbcf99df722edd70ed26ebef1" +source-manifest = "aien-architecture qualification/candidates/CAND-3.toml" + +[model] +model-id = "TinyLlama/TinyLlama-1.1B-Chat-v1.0" +format = "safetensors, torch_dtype bfloat16" +model-safetensors-sha256 = "6e6001da2106d4757498752a021df6c2bdc332c650aae4bae6b0c004dcf14933" +model-safetensors-bytes = "2200119864" +tokenizer-json-sha256 = "bcd04f0eadf90287bd26e1a183ac487d8a141b09b06aecb7725bbdd343640f2e" +config-json-sha256 = "486bedda3a6988332e60d9638a09ca4b260d34ebcf1b19e22cf3b140b63d8fe9" +geometry = "LlamaForCausalLM: layers 22, hidden 2048, heads 32, kv heads 4, head_dim 64 (hidden/heads), intermediate 5632, vocab 32000, max positions 2048, rope_theta 10000.0, rms_norm_eps 1e-05" +oracle-fixture-safetensors-sha256 = "4707e3ba5c75f6c953217235528b38b3dffa334f68b8356f7356f9a5f6a6a6ea" +oracle-fixture-manifest-sha256 = "d9871e7834513dfff5d453e6915440e4976098a7e84bc75086a3ab7833dcefd9" + diff --git a/scripts/.crumb b/scripts/.crumb index b2eec9a9..556bf4a2 100644 --- a/scripts/.crumb +++ b/scripts/.crumb @@ -4,14 +4,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-06T14:00:58Z", + "compiled_at": "2026-10-06T14:54:01Z", "compiler": "crumb-compile/1", - "digest": "sha256:e0b44c224e311bd7a834d7e3161863f4ef041b54809ba80ff46e15832797c02a", + "digest": "sha256:8adb9b86301dab19b5d674d5ef0eba0936f76f15eeccbfa88cdfd5d11adddac0", "evidence_files": 0, "evidence_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "files": 16, - "generated_at_commit": "4d7b90715cbf4cb2549309b2179c3c6dca86cbda", - "source_tree": "sha256:a433c669fb4f7d93d5a5f6be9a96b04eb23cf77d4cc6f919bbb18b8215cb38b6" + "files": 17, + "generated_at_commit": "ce3ef865cee16800c9e96d15534154a0bc443912", + "source_tree": "sha256:fad41b8709964e1f5e3d59f536be71c5c166d32000c8d61d1c8072cbbbf24f64" } }, "parent": { diff --git a/scripts/check-release-candidate.sh b/scripts/check-release-candidate.sh new file mode 100755 index 00000000..b2fe7b67 --- /dev/null +++ b/scripts/check-release-candidate.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash +# Fail closed unless this tree may be released as the candidate named in release/candidate.toml. +# scripts/check-release-candidate.sh check; prints "candidate=" on success +# scripts/check-release-candidate.sh --model F also write the [model] table to file F +# Checks: candidate is set and is not "unknown"; omega.lock equals omega-commit. +set -euo pipefail +cd "$(dirname "${BASH_SOURCE[0]}")/.." +M=release/candidate.toml +[[ -f "$M" ]] || { echo "release gate: $M is missing" >&2; exit 1; } +get() { sed -n "s/^$1 *= *\"\(.*\)\"\$/\1/p" "$M" | head -1; } +cand="$(get candidate)"; omega="$(get omega-commit)" +[[ -n "$cand" && "$cand" != unknown ]] || { echo "release gate: candidate in $M is missing or 'unknown'" >&2; exit 1; } +[[ "$omega" =~ ^[0-9a-f]{40}$ ]] || { echo "release gate: omega-commit in $M is not a full commit hash" >&2; exit 1; } +lock="$(tr -d '[:space:]' < omega.lock)" +[[ "$lock" == "$omega" ]] || { echo "release gate: omega.lock is $lock but candidate $cand names omega $omega. This tree is not $cand and cannot be released as it." >&2; exit 1; } +grep -q '^\[model\]' "$M" || { echo "release gate: no [model] table in $M" >&2; exit 1; } +if [[ "${1:-}" == --model ]]; then sed -n '/^\[model\]/,$p' "$M" | sed '/^$/q' > "${2:?file}"; fi +echo "candidate=$cand" diff --git a/scripts/test-install-release.sh b/scripts/test-install-release.sh index 35f17b06..1b69e9e5 100755 --- a/scripts/test-install-release.sh +++ b/scripts/test-install-release.sh @@ -184,9 +184,28 @@ for point in mid-copy after-copy before-swap; do [[ "$(live "$WORK/cfg-good")" == "$OLD" ]] || fail "killed at $point changed the live release" out="$("$WORK/bin-good/aien")"; [[ "$out" == "aien-b" || "$out" == "aien-c" ]] || fail "live install does not run after kill at $point ($out)" done +# 11b. kill after the single rename (current already switched, links and record not yet written): +# the new release is live and runs, the record still names the old one, a rerun repairs the record +ID_NEW="$(sha256sum "$WORK/pkg/bin/aien" | cut -c1-12)" +OLD="$(live "$WORK/cfg-good")" +[[ "$OLD" != "$ID_NEW" ]] || fail "setup for the after-swap case failed" +env AIEN_TEST_PAUSE_AT=after-swap AIEN_RELEASE_TAG=v0.0.0-test AIEN_RELEASE_BASE_URL="file://$WORK/rel3" \ + AIEN_BIN_DIR="$WORK/bin-good" AIEN_CONFIG_DIR="$WORK/cfg-good" AIEN_INSTALL_NO_PROFILE=1 \ + AIEN_SOURCE_DIR="$ROOT" AIEN_ALLOWED_SIGNERS="$WORK/allowed_signers" \ + bash "$ROOT/install.sh" > "$WORK/log-int" 2>&1 & +IPID=$! +for _ in $(seq 1 100); do grep -q "paused at after-swap" "$WORK/log-int" 2>/dev/null && break; sleep 0.1; done +grep -q "paused at after-swap" "$WORK/log-int" || fail "installer never reached after-swap" +pkill -9 -P "$IPID" 2>/dev/null || true; kill -9 "$IPID"; wait "$IPID" 2>/dev/null || true +[[ "$(live "$WORK/cfg-good")" == "$ID_NEW" ]] || fail "after-swap: the rename did not take effect" +[[ "$("$WORK/bin-good/aien")" == "aien-e" ]] || fail "after-swap: the live release does not run" +grep -q "^current = \"$OLD\"" "$WORK/cfg-good/installed.toml" || fail "after-swap: record unexpectedly updated before the kill" +[[ -d "$WORK/cfg-good/releases/$OLD" ]] || fail "after-swap: the previous release was pruned before the record was written" run_install "$WORK/rel3" "$WORK/bin-good" "$WORK/cfg-good" "$ROOT/install.sh" "${SIGN_ENV[@]}" \ || { cat "$WORK/log" >&2; fail "rerun after interruption failed"; } [[ "$("$WORK/bin-good/aien")" == "aien-e" ]] || fail "rerun did not install the new release" +grep -q "^current = \"$ID_NEW\"" "$WORK/cfg-good/installed.toml" || fail "rerun after the after-swap kill did not repair the record" +grep -q "^previous = \"$OLD\"" "$WORK/cfg-good/installed.toml" || fail "rerun after the after-swap kill lost the previous release" [[ -z "$(ls -A "$WORK/cfg-good/releases" | grep '^\.stage\.' || true)" ]] || fail "leftover stage after rerun" # 12. an existing release directory that is incomplete is never overwritten @@ -199,4 +218,21 @@ if run_install "$WORK/rel4" "$WORK/bin-good" "$WORK/cfg-good" "$ROOT/install.sh" fi grep -q "was not overwritten" "$WORK/log" || fail "incomplete release directory not reported" [[ "$(live "$WORK/cfg-good")" == "$ID3" && -f "$WORK/cfg-good/releases/$ID4/junk" ]] || fail "refusal changed state" -echo "PASS: release install verifies signature, checksum and every package file, rejects tampered and forged releases, installs standalone offline, pinned key matches allowed_signers, upgrades atomically, keeps one previous release, rolls back, refuses downgrades, survives an interrupted install" + +# 13. release gate: the candidate must be named and omega.lock must be the candidate's omega commit +GT="$WORK/gate"; mkdir -p "$GT/scripts" "$GT/release" +cp "$ROOT/scripts/check-release-candidate.sh" "$GT/scripts/"; cp "$ROOT/release/candidate.toml" "$GT/release/" +gate() { (cd "$GT" && bash scripts/check-release-candidate.sh "$@" > "$WORK/log-gate" 2>&1); } +OM="$(sed -n 's/^omega-commit *= *"\(.*\)"$/\1/p' "$GT/release/candidate.toml")" +echo "$OM" > "$GT/omega.lock" +gate --model "$WORK/model.toml" || { cat "$WORK/log-gate" >&2; fail "gate refused a matching tree"; } +grep -q '^\[model\]' "$WORK/model.toml" && grep -q '^model-safetensors-sha256' "$WORK/model.toml" || fail "gate did not extract the model table" +echo 0000000000000000000000000000000000000000 > "$GT/omega.lock" +if gate; then fail "gate accepted an omega.lock that is not the candidate's"; fi +grep -q "cannot be released" "$WORK/log-gate" || fail "omega mismatch not explained" +echo "$OM" > "$GT/omega.lock" +sed -i 's/^candidate = .*/candidate = "unknown"/' "$GT/release/candidate.toml" +if gate; then fail "gate accepted candidate unknown"; fi +rm "$GT/release/candidate.toml" +if gate; then fail "gate accepted a missing candidate file"; fi +echo "PASS: release gate fails closed, release install verifies signature, checksum and every package file, rejects tampered and forged releases, installs standalone offline, pinned key matches allowed_signers, upgrades atomically, keeps one previous release, rolls back, refuses downgrades, survives an interrupted install (including a kill after the swap)" ```