interplane.Get Omega
Read in your language

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

GitHub aien-dev/aien-sovereign-core-mv#444 (code only)

closed derived 75be104649ab2947 #444

Imported from GitHub aien-dev/aien-sovereign-core-mv#444 (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 bd438bccdc2ba1e2df8f50c5f6456f901a20d6f6 · Head 2bfd533cf7a41dc346a5597a26b73c41fc9815fd

Fetch it

A git bundle of the pull request's head, 20521 bytes.

curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/75be104649ab2947.bundle -o 75be104649ab2947.bundle
git fetch 75be104649ab2947.bundle refs/pull/444/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
444
2bfd533cf7a41dc346a5597a26b73c41fc9815fd
{"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":444,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/444","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:12Z","metadata":"unavailable","state_derived":true}

Changes

diff --git a/.aien/always b/.aien/always
new file mode 100644
index 00000000..ed58dc1a
--- /dev/null
+++ b/.aien/always
@@ -0,0 +1,6 @@
+# Gates that run on every commit regardless of changed paths (ADR 0033 Decision 12
+# allow-list; inventory contract C6). One gate name per line. Read from the base ref.
+CRUMB-VERIFY
+SC-ZERO-CUDA
+SC-ZERO-DISK-SECRETS
+SC-ANTI-SLOP
diff --git a/.aien/unmapped-ok b/.aien/unmapped-ok
new file mode 100644
index 00000000..56a3817b
--- /dev/null
+++ b/.aien/unmapped-ok
@@ -0,0 +1,8 @@
+# Changed paths matching these globs need only the always-run set (.aien/always).
+# Everything else must be covered by a manifest's inputs or the commit is NOT_RUN.
+# Conservative: prose only. docs/ as a whole is NOT listed because docs/campaigns/scoring
+# holds a hosted test and the anti-slop audit (always-run) scans docs/. Read from the base ref.
+*.md
+LICENSE
+.gitignore
+docs/adr/**
diff --git a/.aien/verify.pub b/.aien/verify.pub
new file mode 100644
index 00000000..3e654113
--- /dev/null
+++ b/.aien/verify.pub
@@ -0,0 +1 @@
+01368e0b02dc1113ae7425ad6ab00fdf5aa7dd97e0690745918a52f051d5cf68
diff --git a/.crumb b/.crumb
index b458a855..8f9b8396 100644
--- a/.crumb
+++ b/.crumb
@@ -119,14 +119,14 @@
         }
       ],
       "children_root": "sha256:1a5d56ce42bb2bd03bc0f5bd87ee6009e8971c0cb07294376a3fb32b248071f7",
-      "compiled_at": "2026-10-11T17:35:26Z",
+      "compiled_at": "2026-10-11T18:43:47Z",
       "compiler": "crumb-compile/1",
-      "digest": "sha256:335e229cfac6cf886ab4d4598c317898069bbaa27d336243162424aa57cc1ee2",
+      "digest": "sha256:0bdf568ecbc4ec0b0a092f567b544d710356d272c75629f11825002c9c7302df",
       "evidence_files": 187,
       "evidence_root": "sha256:27ee0353cb4d4aae2b7dbce2bfe0d9f4ef2a94cd7a4555b84684d59372503280",
-      "files": 3806,
-      "generated_at_commit": "8d4842d4f1d0a985812a4c83cf6aad6ceebd8dfb",
-      "source_tree": "sha256:47d5eba81a896b00de3f58c5aa9e0e906f6a92abd23d6168a7652f6ac90611b6"
+      "files": 3835,
+      "generated_at_commit": "7b5ec057a88fdd1cea47f8f6b084ebab7dc0eef9",
+      "source_tree": "sha256:e3a3dd63d9642bae18152cae2f5d9da535243c5880e7cb223b39ad046ea1d0a0"
     }
   },
   "history": [],
diff --git a/.github/workflows/aien-verification.yml b/.github/workflows/aien-verification.yml
new file mode 100644
index 00000000..bc941e01
--- /dev/null
+++ b/.github/workflows/aien-verification.yml
@@ -0,0 +1,186 @@
+# AIEN Verification: the GitHub thin gate (ADR 0033 Decision 11, inventory contract C5).
+#
+# PHASE 2 DRAFT (2026-10-11, lane REPOS). This workflow is NOT a required check yet. It runs
+# beside the existing hosted workflows so that, for N >= 3 commits, the hosted verdict and the
+# locally signed bundle verdict can be compared (advisor amendment A7). Nothing here changes
+# the repository's required contexts; that switch is phase 3 and needs Drake's agreement.
+#
+# What it does: checkout; read the trust anchors from the BASE ref (origin/main), never from
+# the head under test (amendment A1); crumb verify; fetch <repo>/<sha>/bundle.json from
+# aien-dev/aien-receipts; verify the bundle signature and content with the pinned aien-test
+# build; run the repository's portable smoke set (gates whose requires is only "portable").
+#
+# GitHub-hosted compute: this workflow compiles only the two pinned verifier tools (the crumb
+# checker, and aien-test once the repository is enrolled). It never builds or tests this
+# repository's own code; the portable smoke set is text scans and format checks only.
+#
+# PHASE 3 FLIPS (marked "PHASE3" below): a missing bundle becomes NOT_RUN (status pending with
+# a retry window) instead of a neutral note, and a trust-surface change becomes a failure
+# unless the operator ran it by hand (BLOCKED_OPERATOR).
+name: AIEN Verification
+
+on:
+  pull_request:
+  push:
+    branches: [main]
+
+permissions:
+  contents: read
+
+jobs:
+  verify:
+    name: AIEN Verification
+    runs-on: ubuntu-latest
+    timeout-minutes: 30
+    env:
+      REPO_SLUG: aien-dev/aien-sovereign-core
+      AIEN_TEST_PIN: c26f4d7ac3156088469b27462390f5b08ef4f436
+      RECEIPTS_RAW: https://raw.githubusercontent.com/aien-dev/aien-receipts/main
+    steps:
+      - name: Checkout the head under test
+        uses: actions/checkout@v4
+        with:
+          fetch-depth: 0
+
+      - name: Resolve the commit under test and the base ref
+        id: ids
+        run: |
+          if [ "${{ github.event_name }}" = pull_request ]; then
+            sha="${{ github.event.pull_request.head.sha }}"
+          else
+            sha="${{ github.sha }}"
+          fi
+          git fetch -q origin main
+          echo "sha=$sha" >> "$GITHUB_OUTPUT"
+          echo "base=$(git rev-parse origin/main)" >> "$GITHUB_OUTPUT"
+          echo "commit under test: $sha"
+          echo "base (trust anchors): $(git rev-parse origin/main)"
+
+      - name: "Trust anchors from the base ref (A1: never from the head under test)"
+        id: anchors
+        run: |
+          mkdir -p "$RUNNER_TEMP/anchors"
+          base="${{ steps.ids.outputs.base }}"
+          if git show "$base:.aien/verify.pub" > "$RUNNER_TEMP/anchors/verify.pub" 2>/dev/null; then
+            echo "enrolled=true" >> "$GITHUB_OUTPUT"
+            git show "$base:.aien/always" > "$RUNNER_TEMP/anchors/always" 2>/dev/null || : > "$RUNNER_TEMP/anchors/always"
+            git show "$base:.aien/unmapped-ok" > "$RUNNER_TEMP/anchors/unmapped-ok" 2>/dev/null || : > "$RUNNER_TEMP/anchors/unmapped-ok"
+            echo "verify.pub (base): $(cat "$RUNNER_TEMP/anchors/verify.pub")"
+          else
+            echo "enrolled=false" >> "$GITHUB_OUTPUT"
+            echo "::notice::.aien/verify.pub is not on the base ref yet: this repository is not enrolled. Phase 2: neutral."
+          fi
+          # Trust-surface changes are run by the operator by hand (A1): BLOCKED_OPERATOR.
+          changed=$(git diff --name-only "$base...${{ steps.ids.outputs.sha }}" -- .aien tests/gates .github/workflows .forgejo tools/aien-test || true)
+          if [ -n "$changed" ]; then
+            echo "blocked=true" >> "$GITHUB_OUTPUT"
+            echo "::notice::BLOCKED_OPERATOR: this head changes the trust surface:"; echo "$changed"
+            # PHASE3: fail here unless an operator attestation for this sha is present.
+          else
+            echo "blocked=false" >> "$GITHUB_OUTPUT"
+          fi
+
+      - name: Checkout the pinned crumb tool source (aien-architecture @ 94fffbcf88492c5a1c54211b5126c8a6c370a98d)
+        uses: actions/checkout@v4
+        with:
+          repository: aien-dev/aien-architecture
+          ref: 94fffbcf88492c5a1c54211b5126c8a6c370a98d
+          path: .crumb-tool-src
+
+      - name: Build the crumb tool, then remove its source from this tree
+        run: |
+          make -C .crumb-tool-src/tools/crumb crumb
+          mkdir -p "$RUNNER_TEMP/bin" && cp .crumb-tool-src/tools/crumb/crumb "$RUNNER_TEMP/bin/crumb"
+          rm -rf .crumb-tool-src
+          echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"
+
+      - name: Crumbs must be exactly what the compiler produces now (stays GitHub-hosted, D11)
+        run: crumb verify .
+
+      - name: Install Stable Rust Toolchain (for the pinned aien-test build and the smoke set)
+        if: steps.anchors.outputs.enrolled == 'true'
+        uses: dtolnay/rust-toolchain@stable
+        with:
+          components: rustfmt
+
+      - name: Checkout the pinned aien-test source (aien-sovereign-core @ ${{ env.AIEN_TEST_PIN }})
+        if: steps.anchors.outputs.enrolled == 'true'
+        uses: actions/checkout@v4
+        with:
+          repository: aien-dev/aien-sovereign-core
+          ref: ${{ env.AIEN_TEST_PIN }}
+          path: .aien-test-src
+
+      - name: Cache the pinned aien-test build
+        if: steps.anchors.outputs.enrolled == 'true'
+        uses: actions/cache@v4
+        with:
+          path: |
+            ~/.cargo/registry
+            ~/.cargo/git
+            .aien-test-src/target
+          key: aien-test-${{ runner.os }}-${{ env.AIEN_TEST_PIN }}
+
+      - name: Build aien-test from the pin (never from the tree under test), then remove the source
+        if: steps.anchors.outputs.enrolled == 'true'
+        run: |
+          cargo build --release -p aien-test --manifest-path .aien-test-src/Cargo.toml
+          cp .aien-test-src/target/release/aien-test "$RUNNER_TEMP/bin/aien-test" 2>/dev/null || { mkdir -p "$RUNNER_TEMP/bin"; cp .aien-test-src/target/release/aien-test "$RUNNER_TEMP/bin/aien-test"; }
+          echo "$RUNNER_TEMP/bin" >> "$GITHUB_PATH"
+          rm -rf .aien-test-src
+          git status --porcelain --untracked-files=normal
+
+      - name: Fetch the signed verification bundle for this commit
+        id: bundle
+        run: |
+          url="$RECEIPTS_RAW/aien-sovereign-core/${{ steps.ids.outputs.sha }}/bundle.json"
+          echo "bundle url: $url"
+          if curl -fsSL "$url" -o "$RUNNER_TEMP/bundle.json"; then
+            echo "present=true" >> "$GITHUB_OUTPUT"
+          else
+            echo "present=false" >> "$GITHUB_OUTPUT"
+            echo "::notice::bundle not published yet for ${{ steps.ids.outputs.sha }} (phase 2: neutral)."
+            # PHASE3: exit 2 here (NOT_RUN, status pending with a retry window) instead of a neutral note.
+          fi
+
+      - name: Verify the bundle with the base-ref public key
+        if: steps.bundle.outputs.present == 'true' && steps.anchors.outputs.enrolled == 'true'
+        run: |
+          required=$(grep -v '^#' "$RUNNER_TEMP/anchors/always" | grep -v '^$' | paste -sd, -)
+          set +e
+          aien-test verify-bundle "$RUNNER_TEMP/bundle.json" \
+            --repo "github.com/$REPO_SLUG" \
+            --commit "${{ steps.ids.outputs.sha }}" \
+            --pubkey "$RUNNER_TEMP/anchors/verify.pub" \
+            ${required:+--require "$required"}
+          rc=$?
+          set -e
+          echo "verify-bundle exit $rc (0 PASS, 1 FAIL, 2 NOT_RUN, 3 REJECTED)"
+          [ "$rc" = 0 ] || exit "$rc"
+
+      - name: Portable smoke set (gates whose requires is only portable, named at the base ref)
+        if: steps.anchors.outputs.enrolled == 'true' && steps.anchors.outputs.blocked == 'false'
+        run: |
+          base="${{ steps.ids.outputs.base }}"
+          names=$(for f in $(git ls-tree -r --name-only "$base" -- tests/gates | grep '\.gate$'); do
+            git show "$base:$f" | awk '
+              /^gate:/ {g=$2}
+              /^requires:/ {inr=1; next}
+              inr && /^  - / { if ($2 != "portable") other=1; next }
+              /^[a-z]/ {inr=0}
+              END { if (g != "" && !other) print g }'
+          done)
+          echo "portable smoke set: $(echo $names)"
+          mkdir -p "$RUNNER_TEMP/evidence"
+          fail=0
+          for g in $names; do
+            echo "::group::$g"
+            if timeout 600 aien-test run "$g" --evidence-dir "$RUNNER_TEMP/evidence"; then echo "$g: PASS"; else echo "::error::$g: not PASS"; fail=1; fi
+            echo "::endgroup::"
+          done
+          exit $fail
+
+      - name: "Not enrolled or blocked: nothing to verify in this phase"
+        if: steps.anchors.outputs.enrolled != 'true' || steps.anchors.outputs.blocked == 'true'
+        run: |
+          echo "AIEN Verification: neutral (enrolled=${{ steps.anchors.outputs.enrolled }}, blocked=${{ steps.anchors.outputs.blocked }}). PHASE3 turns this into a failure."
diff --git a/tests/gates/crumb.gate b/tests/gates/crumb.gate
new file mode 100644
index 00000000..7eaebed0
--- /dev/null
+++ b/tests/gates/crumb.gate
@@ -0,0 +1,21 @@
+# tests/gates/crumb.gate
+# Mirrors hosted: no hosted crumb job in this repository; crumb verify . is the always-run structural check
+# cache: never because crumbs live in many directories and inputs are literal paths; the check is sub-second.
+gate: CRUMB-VERIFY
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - portable
+inputs:
+  - .crumb
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["crumb-verify"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 5m
+exactness: EXACT
+cache_scope: portable
+cache: never
diff --git a/tests/gates/run.sh b/tests/gates/run.sh
new file mode 100755
index 00000000..8bf6efb8
--- /dev/null
+++ b/tests/gates/run.sh
@@ -0,0 +1,157 @@
+#!/usr/bin/env bash
+# tests/gates/run.sh: the one entry point for the local verification gates of aien-sovereign-core.
+# Every step runs the SAME command as the hosted job it mirrors (.github/workflows/ci.yml,
+# hardening.yml, crumb-visible-conformance.yml, verify-closure.yml, release-dry-run.yml,
+# sovereign-inquisitor.yml). Manifests under tests/gates/ name this script plus one step word,
+# so no manifest needs shell expansion (ADR 0028 P6). The PREFILL-E2E-2 gates under
+# crates/aien-runtime/tests are separate and untouched.
+#
+# Pinned sibling sources: the hosted jobs check out omega at omega.lock, physics and aienos at
+# omega's own locks, and aien-protocols at two fixed commits (TRN1 and CRB1 vector corpora).
+# Here the same commits are materialised under $CARGO_TARGET_DIR/aien-pins (default target/aien-pins) from
+# the sibling local clones ../omega ../physics ../aienos ../aien-protocols, offline.
+set -euo pipefail
+ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)"
+cd "$ROOT"
+step="${1:?usage: tests/gates/run.sh <step>}"
+obs() { printf 'AIEN-OBS %s %s\n' "$1" "$2"; }
+# Outside the worktree when CARGO_TARGET_DIR is, and under target/ otherwise: the hosted test job
+# has no pin checkouts in its tree, and test_t2_f65 scans the tree (minus target/) for *.pem files,
+# which the vendored crates of a pinned aienos ship as test fixtures.
+PINS="${CARGO_TARGET_DIR:-$ROOT/target}/aien-pins"
+TARGET="${CARGO_TARGET_DIR:-$ROOT/target}"
+
+pin() {  # pin <dir-name> <sibling repo> <sha40>
+  local name="$1" repo="$2" sha="$3" dir="$PINS/$1"
+  if [ ! -e "../$repo/.git" ]; then
+    echo "run.sh: ../$repo is missing; the hosted job checks out aien-dev/$repo at $sha" >&2
+    exit 3
+  fi
+  if [ ! -d "$dir" ] || [ "$(git -C "$dir" rev-parse HEAD 2>/dev/null)" != "$sha" ]; then
+    rm -rf "$dir"; mkdir -p "$PINS"
+    git clone --quiet --shared --no-checkout "../$repo" "$dir"
+    git -C "$dir" checkout --quiet --detach "$sha"
+  fi
+  obs "pin_${name//-/_}" "\"$sha\""
+}
+
+case "$step" in
+  crumb-verify)        "${CRUMB:-crumb}" verify . ;;
+  # ci.yml job verify ("Workspace Verification & Invariant Audit")
+  fmt)                 cargo fmt --all -- --check ;;
+  release-gate-negatives)
+    bash scripts/test-install-release.sh
+    bash scripts/test-offline-signing.sh
+    bash scripts/test-public-key-integration.sh
+    bash scripts/check-release-trust-config.sh
+    bash scripts/test-release-checks.sh
+    ;;
+  aien-verify-tests)   sh tools/aien-verify/tests/run.sh ;;
+  pins-selftest)       bash scripts/test-pins.sh ;;
+  install-test)        bash scripts/test-install.sh ;;
+  scoring-v5)          bash docs/campaigns/scoring/test-scoring-v5.sh ;;
+  check)               cargo check --workspace --all-targets ;;
+  clippy)              cargo clippy --workspace --all-targets -- -D warnings ;;
+  test)
+    # GitHub Actions sets CI=true in every job. Tests that reach live services or check the
+    # branch name (spark-adapters tier1-4) skip themselves under CI, so the hosted job never runs
+    # them; without it they fail here on any branch not named feat/, fix/... or on a detached head.
+    CI=true AIEN_DEV_FALLBACK=1 cargo test --workspace --verbose -- --test-threads=1
+    ;;
+  strict-mode)
+    cargo test -p aien-inference-abi --lib --test attention_wiring --test transformer_parity -- --test-threads=1
+    cargo test -p aien-inference-runtime --test strict_real_model -- --test-threads=1
+    ;;
+  zero-cuda)
+    bash scripts/zero-cuda-gate.sh --self-test
+    cargo build -p aien-cli
+    bash scripts/zero-cuda-gate.sh "$TARGET/debug/aien-cli"
+    ;;
+  preflight-guard)     bash scripts/test-preflight-branch-guard.sh ;;
+  agent-preflight)
+    # Hosted: developer context on pull requests, merged-tree on pushes to main.
+    # CI=true as on GitHub (see the test step): the script runs cargo test --workspace.
+    CI=true AIEN_PROOF_OFF=1 AIEN_DEV_FALLBACK=1 AIEN_PREFLIGHT_CONTEXT="${AIEN_PREFLIGHT_CONTEXT:-developer}" bash scripts/agent-preflight.sh
+    ;;
+  zero-disk-secrets)
+    echo "Auditing repository for prohibited plaintext secret files..."
+    if find . -maxdepth 4 -name ".env*" -not -path "*/.git/*" -not -path "*/target/*" | grep -q .; then
+      echo "::error::Prohibited plaintext .env file found. Use an approved AIEN SecretProvider."
+      obs env_files_found true; exit 1
+    fi
+    obs env_files_found false
+    echo "Zero plaintext .env files verified."
+    ;;
+  anti-slop)
+    echo "Auditing repository for em dashes, en dashes, and formulaic tropes..."
+    # Pattern is em dash OR en dash, built from UTF-8 bytes so this file never carries the
+    # characters it scans for. Same pattern and scope as the hosted step.
+    DASH_PATTERN="$(printf '\xe2\x80\x94|\xe2\x80\x93')"
+    BAD_CHARS=$(grep -rnE --exclude-dir=target --exclude-dir=.git --exclude-dir=aien-protocols --exclude="*.rs" --exclude="*.json" --exclude="*.safetensors" --exclude="FORGEJO_CI.md" "$DASH_PATTERN" crates/ docs/ README.md || true)
+    BAD_CHARS=$(printf "%s\n" "$BAD_CHARS" | grep -vE "^docs/campaigns/[^:]*/replies/[0-9a-f]{64}\.txt:" || true)
+    if [ -n "$BAD_CHARS" ]; then
+      echo "::error::Em dashes or en dashes detected:"; echo "$BAD_CHARS"
+      obs dash_hits "$(printf '%s\n' "$BAD_CHARS" | grep -c .)"; exit 1
+    fi
+    obs dash_hits 0
+    echo "Sovereign voice compliance verified."
+    ;;
+  # ci.yml job linked-compose
+  linked-compose)
+    omega_sha="$(tr -d '[:space:]' < omega.lock)"
+    pin omega omega "$omega_sha"
+    pin physics physics "$(tr -d '[:space:]' < "$PINS/omega/physics.lock")"
+    pin aienos aienos "$(awk 'NF && $1 !~ /^#/ {print $1; exit}' "$PINS/omega/aienos.lock")"
+    bash scripts/test-linked-compose.sh "$PINS/omega" "$PINS/physics" "$PINS/aienos"
+    ;;
+  # hardening.yml
+  kv-props)
+    cargo fetch --manifest-path crates/aien-replay/Cargo.toml
+    cargo test --manifest-path crates/aien-replay/Cargo.toml --test kv_ownership_props
+    sh crates/aien-replay/mutations/run_mutants.sh native
+    ;;
+  miri)
+    cargo +nightly miri setup
+    cargo +nightly miri test -p aien-capability
+    cargo +nightly miri test -p aien-kv-cache
+    sh crates/aien-replay/mutations/run_mutants.sh miri
+    ;;
+  trn1)
+    pin trn1-protocols aien-protocols 353b7d4be3f00169545caec1615cffa61f7d311a
+    export TRN1_VECTORS="$PINS/trn1-protocols/specs/execution-transcript/vectors"
+    TRN1_REQUIRE=1 cargo test --manifest-path crates/aien-replay/Cargo.toml --test trn1_conformance -- --nocapture
+    sh crates/aien-replay/mutations/run_mutants.sh trn1
+    ;;
+  # crumb-visible-conformance.yml
+  crb1)
+    pin crb1-protocols aien-protocols b50c00d737fa5c57ea7280e2aa4b0354ff166cf5
+    export CRB1_VECTORS="$PINS/crb1-protocols/specs/crumb-visible/vectors"
+    CRB1_REQUIRE=1 cargo test -p crumbs --test visible_conformance -- --nocapture
+    ;;
+  # verify-closure.yml
+  verify-closure)
+    cargo build --locked -p aien-closure --bin verify-closure
+    cargo test --locked -p aien-closure
+    (cd crates/aien-closure/tests/fixtures/seeded && "$TARGET/debug/verify-closure" --root . --store store)
+    ;;
+  # release-dry-run.yml (pull_request only)
+  release-dry-run)
+    bash scripts/test-dry-run-workflow.sh
+    bash scripts/test-release-gate-wiring.sh
+    bash scripts/test-release-signing-workflow.sh
+    # Report only on the hosted side (continue-on-error): recorded here as an observation.
+    if out="$(scripts/check-release-candidate.sh 2>&1)"; then
+      echo "Release gate: this tree IS releasable as ${out#candidate=}"; obs tree_releasable true
+    else
+      echo "Release gate: this tree is NOT releasable as the candidate: $out"; obs tree_releasable false
+    fi
+    bash scripts/test-release-real-tree.sh
+    ;;
+  # sovereign-inquisitor.yml (pull_request_target: needs the PR diff and GITHUB_TOKEN)
+  inquisitor)
+    cargo build --release -p spark-inquisitor
+    echo "run.sh: the review step needs a GitHub pull request diff and token (pull_request_target); nothing to run locally" >&2
+    exit 3
+    ;;
+  *) echo "run.sh: unknown step '$step'" >&2; exit 2 ;;
+esac
diff --git a/tests/gates/sc-agent-preflight.gate b/tests/gates/sc-agent-preflight.gate
new file mode 100644
index 00000000..eca8a848
--- /dev/null
+++ b/tests/gates/sc-agent-preflight.gate
@@ -0,0 +1,26 @@
+# tests/gates/sc-agent-preflight.gate
+# Mirrors hosted: ci.yml verify 'Run Required Agent Preflight' (AIEN_PROOF_OFF=1 AIEN_DEV_FALLBACK=1, developer context; merged-tree on pushes to main)
+# cache: never because the preflight reads branch state, not only tracked files.
+gate: SC-AGENT-PREFLIGHT
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - scripts/
+  - Cargo.toml
+  - Cargo.lock
+  - rust-toolchain.toml
+  - crates/
+  - tools/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["agent-preflight"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 20m
+exactness: EXACT
+cache_scope: machine
+cache: never
diff --git a/tests/gates/sc-aien-verify-tests.gate b/tests/gates/sc-aien-verify-tests.gate
new file mode 100644
index 00000000..e98ca012
--- /dev/null
+++ b/tests/gates/sc-aien-verify-tests.gate
@@ -0,0 +1,19 @@
+# tests/gates/sc-aien-verify-tests.gate
+# Mirrors hosted: ci.yml verify 'sh tools/aien-verify/tests/run.sh'
+gate: SC-AIEN-VERIFY-TESTS
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - tools/aien-verify/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["aien-verify-tests"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 10m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-anti-slop.gate b/tests/gates/sc-anti-slop.gate
new file mode 100644
index 00000000..541a3c4a
--- /dev/null
+++ b/tests/gates/sc-anti-slop.gate
@@ -0,0 +1,22 @@
+# tests/gates/sc-anti-slop.gate
+# Mirrors hosted: ci.yml verify 'Enforce Sovereign Voice and Anti-Slop Invariant' over crates/ docs/ README.md (always-run)
+gate: SC-ANTI-SLOP
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - portable
+inputs:
+  - crates/
+  - docs/
+  - README.md
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["anti-slop"]
+expects:
+  exit: 0
+  observe: ["dash_hits == 0"]
+  verdict: PASS
+timeout: 2m
+exactness: EXACT
+cache_scope: portable
diff --git a/tests/gates/sc-check.gate b/tests/gates/sc-check.gate
new file mode 100644
index 00000000..364d42fc
--- /dev/null
+++ b/tests/gates/sc-check.gate
@@ -0,0 +1,23 @@
+# tests/gates/sc-check.gate
+# Mirrors hosted: ci.yml verify 'cargo check --workspace --all-targets'
+gate: SC-CHECK
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - Cargo.toml
+  - Cargo.lock
+  - rust-toolchain.toml
+  - crates/
+  - tools/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["check"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 30m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-clippy.gate b/tests/gates/sc-clippy.gate
new file mode 100644
index 00000000..1e53a39f
--- /dev/null
+++ b/tests/gates/sc-clippy.gate
@@ -0,0 +1,23 @@
+# tests/gates/sc-clippy.gate
+# Mirrors hosted: ci.yml verify 'cargo clippy --workspace --all-targets -- -D warnings'
+gate: SC-CLIPPY
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - Cargo.toml
+  - Cargo.lock
+  - rust-toolchain.toml
+  - crates/
+  - tools/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["clippy"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 30m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-crb1.gate b/tests/gates/sc-crb1.gate
new file mode 100644
index 00000000..552b2df5
--- /dev/null
+++ b/tests/gates/sc-crb1.gate
@@ -0,0 +1,22 @@
+# tests/gates/sc-crb1.gate
+# Mirrors hosted: crumb-visible-conformance.yml: crumbs visible_conformance with the aien-protocols corpus at b50c00d (hosted 26 s)
+# cache: never because the vector corpus is a pinned sibling checkout outside this repository.
+gate: SC-CRB1
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - crates/crumbs/
+  - Cargo.lock
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["crb1"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 15m
+exactness: EXACT
+cache_scope: machine
+cache: never
diff --git a/tests/gates/sc-fmt.gate b/tests/gates/sc-fmt.gate
new file mode 100644
index 00000000..28d2f3ea
--- /dev/null
+++ b/tests/gates/sc-fmt.gate
@@ -0,0 +1,23 @@
+# tests/gates/sc-fmt.gate
+# Mirrors hosted: ci.yml verify 'cargo fmt --all -- --check'
+gate: SC-FMT
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - portable
+inputs:
+  - Cargo.toml
+  - Cargo.lock
+  - rust-toolchain.toml
+  - crates/
+  - tools/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["fmt"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 5m
+exactness: EXACT
+cache_scope: portable
diff --git a/tests/gates/sc-inquisitor.gate b/tests/gates/sc-inquisitor.gate
new file mode 100644
index 00000000..2e9aef9f
--- /dev/null
+++ b/tests/gates/sc-inquisitor.gate
@@ -0,0 +1,21 @@
+# tests/gates/sc-inquisitor.gate
+# Mirrors hosted: sovereign-inquisitor.yml (pull_request_target): builds spark-inquisitor and reviews the PR diff fetched with GITHUB_TOKEN
+# requires: operator because the review needs a GitHub pull request diff and token (pull_request_target context) that do not exist locally.
+gate: SC-INQUISITOR
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+  - operator
+inputs:
+  - crates/spark-inquisitor/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["inquisitor"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 30m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-install.gate b/tests/gates/sc-install.gate
new file mode 100644
index 00000000..c23f26ff
--- /dev/null
+++ b/tests/gates/sc-install.gate
@@ -0,0 +1,19 @@
+# tests/gates/sc-install.gate
+# Mirrors hosted: ci.yml verify 'bash scripts/test-install.sh'
+gate: SC-INSTALL
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - scripts/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["install-test"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 10m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-kv-props.gate b/tests/gates/sc-kv-props.gate
new file mode 100644
index 00000000..5c8a49d1
--- /dev/null
+++ b/tests/gates/sc-kv-props.gate
@@ -0,0 +1,24 @@
+# tests/gates/sc-kv-props.gate
+# Mirrors hosted: hardening.yml kv-props: aien-replay kv_ownership_props + run_mutants.sh native (hosted 43 s)
+gate: SC-KV-PROPS
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - crates/aien-replay/
+  - crates/aien-kv-cache/
+  - crates/aien-capability/
+  - crates/aien-platform/
+  - crates/aien-platform-linux/
+  - Cargo.lock
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["kv-props"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 15m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-linked-compose.gate b/tests/gates/sc-linked-compose.gate
new file mode 100644
index 00000000..e5ebd923
--- /dev/null
+++ b/tests/gates/sc-linked-compose.gate
@@ -0,0 +1,28 @@
+# tests/gates/sc-linked-compose.gate
+# Mirrors hosted: ci.yml linked-compose: scripts/test-linked-compose.sh with omega at omega.lock, physics and aienos at omega's locks (hosted 241 s)
+# cache: never because the pinned sibling sources are outside this repository; omega.lock is the input that names them.
+gate: SC-LINKED-COMPOSE
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - omega.lock
+  - scripts/test-linked-compose.sh
+  - scripts/pins.sh
+  - Cargo.toml
+  - Cargo.lock
+  - rust-toolchain.toml
+  - crates/
+  - tools/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["linked-compose"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 30m
+exactness: EXACT
+cache_scope: machine
+cache: never
diff --git a/tests/gates/sc-miri.gate b/tests/gates/sc-miri.gate
new file mode 100644
index 00000000..87bf9144
--- /dev/null
+++ b/tests/gates/sc-miri.gate
@@ -0,0 +1,24 @@
+# tests/gates/sc-miri.gate
+# Mirrors hosted: hardening.yml miri: cargo +nightly miri test for aien-capability and aien-kv-cache + run_mutants.sh miri (hosted 1622 s)
+# requires: operator in addition to host because the nightly miri component is not installed on this machine (rustup component add miri --toolchain nightly); the operator decides whether to install it. Hosted installs it on every run.
+gate: SC-MIRI
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+  - operator
+inputs:
+  - crates/aien-capability/
+  - crates/aien-kv-cache/
+  - crates/aien-replay/
+  - Cargo.lock
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["miri"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 60m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-pins-selftest.gate b/tests/gates/sc-pins-selftest.gate
new file mode 100644
index 00000000..d8f03774
--- /dev/null
+++ b/tests/gates/sc-pins-selftest.gate
@@ -0,0 +1,21 @@
+# tests/gates/sc-pins-selftest.gate
+# Mirrors hosted: ci.yml verify 'bash scripts/test-pins.sh'
+gate: SC-PINS-SELFTEST
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - scripts/pins.sh
+  - scripts/test-pins.sh
+  - omega.lock
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["pins-selftest"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 10m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-preflight-guard.gate b/tests/gates/sc-preflight-guard.gate
new file mode 100644
index 00000000..4cd97709
--- /dev/null
+++ b/tests/gates/sc-preflight-guard.gate
@@ -0,0 +1,19 @@
+# tests/gates/sc-preflight-guard.gate
+# Mirrors hosted: ci.yml verify 'bash scripts/test-preflight-branch-guard.sh'
+gate: SC-PREFLIGHT-GUARD
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - scripts/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["preflight-guard"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 10m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-release-dry-run.gate b/tests/gates/sc-release-dry-run.gate
new file mode 100644
index 00000000..5c9b082c
--- /dev/null
+++ b/tests/gates/sc-release-dry-run.gate
@@ -0,0 +1,21 @@
+# tests/gates/sc-release-dry-run.gate
+# Mirrors hosted: release-dry-run.yml (pull_request): test-dry-run-workflow, test-release-gate-wiring, test-release-signing-workflow, tree gate report (observation only, as hosted continue-on-error), test-release-real-tree (hosted 8 s)
+gate: SC-RELEASE-DRY-RUN
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - scripts/
+  - release/
+  - .github/workflows/release.yml
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["release-dry-run"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 15m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-release-gate-negatives.gate b/tests/gates/sc-release-gate-negatives.gate
new file mode 100644
index 00000000..8ba67a2d
--- /dev/null
+++ b/tests/gates/sc-release-gate-negatives.gate
@@ -0,0 +1,21 @@
+# tests/gates/sc-release-gate-negatives.gate
+# Mirrors hosted: ci.yml verify: test-install-release, test-offline-signing, test-public-key-integration, check-release-trust-config, test-release-checks
+gate: SC-RELEASE-GATE-NEGATIVES
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - scripts/
+  - tools/
+  - release/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["release-gate-negatives"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 15m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-scoring-v5.gate b/tests/gates/sc-scoring-v5.gate
new file mode 100644
index 00000000..351f227a
--- /dev/null
+++ b/tests/gates/sc-scoring-v5.gate
@@ -0,0 +1,19 @@
+# tests/gates/sc-scoring-v5.gate
+# Mirrors hosted: ci.yml verify 'bash docs/campaigns/scoring/test-scoring-v5.sh'
+gate: SC-SCORING-V5
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - portable
+inputs:
+  - docs/campaigns/scoring/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["scoring-v5"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 5m
+exactness: EXACT
+cache_scope: portable
diff --git a/tests/gates/sc-strict-mode.gate b/tests/gates/sc-strict-mode.gate
new file mode 100644
index 00000000..12fdbd5f
--- /dev/null
+++ b/tests/gates/sc-strict-mode.gate
@@ -0,0 +1,22 @@
+# tests/gates/sc-strict-mode.gate
+# Mirrors hosted: ci.yml verify 'Strict-Mode Controls (no AIEN_DEV_FALLBACK)': aien-inference-abi lib + attention_wiring + transformer_parity, aien-inference-runtime strict_real_model
+gate: SC-STRICT-MODE
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - Cargo.toml
+  - Cargo.lock
+  - crates/aien-inference-abi/
+  - crates/aien-inference-runtime/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["strict-mode"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 30m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-test.gate b/tests/gates/sc-test.gate
new file mode 100644
index 00000000..766f1ba4
--- /dev/null
+++ b/tests/gates/sc-test.gate
@@ -0,0 +1,24 @@
+# tests/gates/sc-test.gate
+# Mirrors hosted: ci.yml verify 'AIEN_DEV_FALLBACK=1 cargo test --workspace --verbose -- --test-threads=1' (hosted verify job 543 s total)
+gate: SC-TEST
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - Cargo.toml
+  - Cargo.lock
+  - rust-toolchain.toml
+  - crates/
+  - tools/
+  - tests/gates/
+  - scripts/
+run:
+  exec: tests/gates/run.sh
+  args: ["test"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 60m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-trn1.gate b/tests/gates/sc-trn1.gate
new file mode 100644
index 00000000..b1ec90b0
--- /dev/null
+++ b/tests/gates/sc-trn1.gate
@@ -0,0 +1,22 @@
+# tests/gates/sc-trn1.gate
+# Mirrors hosted: hardening.yml trn1: aien-replay trn1_conformance with the aien-protocols corpus at 353b7d4 + run_mutants.sh trn1 (hosted 50 s)
+# cache: never because the vector corpus is a pinned sibling checkout outside this repository.
+gate: SC-TRN1
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - crates/aien-replay/
+  - Cargo.lock
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["trn1"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 15m
+exactness: EXACT
+cache_scope: machine
+cache: never
diff --git a/tests/gates/sc-verify-closure.gate b/tests/gates/sc-verify-closure.gate
new file mode 100644
index 00000000..4f021110
--- /dev/null
+++ b/tests/gates/sc-verify-closure.gate
@@ -0,0 +1,21 @@
+# tests/gates/sc-verify-closure.gate
+# Mirrors hosted: verify-closure.yml: build and test aien-closure, run verify-closure on the seeded fixture (hosted 28 s)
+gate: SC-VERIFY-CLOSURE
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - crates/aien-closure/
+  - crates/aien-proof/
+  - Cargo.lock
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["verify-closure"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 15m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-zero-cuda.gate b/tests/gates/sc-zero-cuda.gate
new file mode 100644
index 00000000..c9cbb764
--- /dev/null
+++ b/tests/gates/sc-zero-cuda.gate
@@ -0,0 +1,24 @@
+# tests/gates/sc-zero-cuda.gate
+# Mirrors hosted: ci.yml verify 'Zero-CUDA Gate': zero-cuda-gate.sh --self-test, cargo build -p aien-cli, zero-cuda-gate.sh on the binary (always-run)
+gate: SC-ZERO-CUDA
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - host
+inputs:
+  - scripts/zero-cuda-gate.sh
+  - Cargo.toml
+  - Cargo.lock
+  - rust-toolchain.toml
+  - crates/
+  - tools/
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["zero-cuda"]
+expects:
+  exit: 0
+  verdict: PASS
+timeout: 30m
+exactness: EXACT
+cache_scope: machine
diff --git a/tests/gates/sc-zero-disk-plaintext.gate b/tests/gates/sc-zero-disk-plaintext.gate
new file mode 100644
index 00000000..8f572a65
--- /dev/null
+++ b/tests/gates/sc-zero-disk-plaintext.gate
@@ -0,0 +1,19 @@
+# tests/gates/sc-zero-disk-plaintext.gate (file name avoids "secret": scripts/agent-preflight.sh flags any *secret* file within depth 3)
+# Mirrors hosted: ci.yml verify 'Enforce Zero Disk Secrets Invariant' (always-run)
+gate: SC-ZERO-DISK-SECRETS
+manifest_version: 2
+owner: aien-sovereign-core
+requires:
+  - portable
+inputs:
+  - tests/gates/
+run:
+  exec: tests/gates/run.sh
+  args: ["zero-disk-secrets"]
+expects:
+  exit: 0
+  observe: ["env_files_found == false"]
+  verdict: PASS
+timeout: 2m
+exactness: EXACT
+cache_scope: portable