physics-mv
FORGE: request-bound machine realization, providers and verification for AienOS. Host, simulated and GB10 hardware paths have separate evidence.
Brought by drakestapleton
physics-mv / tests / gates / run.sh
| 1 | #!/usr/bin/env bash |
| 2 | # tests/gates/run.sh: the one entry point for the local verification gates of physics. |
| 3 | # Every step runs the SAME command as the hosted job it mirrors (.github/workflows/host-gates.yml |
| 4 | # matrix, with working-directory physics and OMEGA_DIR pointing at a sibling omega checkout, and |
| 5 | # the SKIP jobs that only ever name their GB10/NVRM script). Manifests under tests/gates/ name |
| 6 | # this script plus one step word, so no manifest needs shell expansion (ADR 0028 P6). |
| 7 | set -euo pipefail |
| 8 | ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" |
| 9 | cd "$ROOT" |
| 10 | step="${1:?usage: tests/gates/run.sh <step>}" |
| 11 | obs() { printf 'AIEN-OBS %s %s\n' "$1" "$2"; } |
| 12 | |
| 13 | # Hosted layout: physics/ with sibling checkouts omega/ (main) and aien-architecture/ (main). |
| 14 | # Several gate scripts look for ../omega (or $OMEGA_DIR) and ../aien-architecture. |
| 15 | need_sibling() { |
| 16 | local name="$1" |
| 17 | if [ ! -d "../$name" ]; then |
| 18 | echo "run.sh: ../$name is missing; the hosted job checks out aien-dev/$name (main) as a sibling" >&2 |
| 19 | exit 3 |
| 20 | fi |
| 21 | obs "sibling_${name//-/_}_commit" "\"$(git -C "../$name" rev-parse HEAD 2>/dev/null || echo unknown)\"" |
| 22 | } |
| 23 | export OMEGA_DIR="${OMEGA_DIR:-$ROOT/../omega}" |
| 24 | |
| 25 | # Gates that regenerate tracked receipts or evidence files (m3, m15, m16-requal) |
| 26 | # run in a private temporary copy of the repository so concurrent gates never |
| 27 | # observe a transiently dirty worktree. |
| 28 | run_in_temp_copy() { |
| 29 | local tmp |
| 30 | tmp=$(mktemp -d /tmp/physics-gate.XXXXXX) |
| 31 | trap "rm -rf \"$tmp\"" EXIT |
| 32 | mkdir -p "$tmp/physics" |
| 33 | git -C "$ROOT" archive HEAD | tar -C "$tmp/physics" -xf - |
| 34 | ln -s "$ROOT/.git" "$tmp/physics/.git" |
| 35 | for sib in aien-architecture omega; do |
| 36 | if [ -d "$ROOT/../$sib" ]; then |
| 37 | ln -s "$(cd "$ROOT/../$sib" && pwd -P)" "$tmp/$sib" |
| 38 | fi |
| 39 | done |
| 40 | (cd "$tmp/physics" && "$@") |
| 41 | } |
| 42 | |
| 43 | case "$step" in |
| 44 | # crumb-verify (gate CRUMB-VERIFY) is retired (DRA-97, 2026-11-07): Crumbs are off the active |
| 45 | # workflow, so no gate checks crumb freshness. The .crumb files and crumb.lock stay as history. |
| 46 | forge-v2) tests/run_forge_v2_gates.sh ;; |
| 47 | forge-aegis) tests/run_forge_aegis_host_gates.sh ;; |
| 48 | analog-sim) need_sibling omega; tests/run_forge_analog_sim_gates.sh ;; |
| 49 | form0) need_sibling omega; tests/run_forge_form_gates.sh ;; |
| 50 | gate34-writer) need_sibling omega; tests/test_forge_gates_receipt.sh "$OMEGA_DIR" ;; |
| 51 | gb10-lock) tests/test_gb10_lock.sh ;; |
| 52 | m2) ./run_m2_gates.sh ;; |
| 53 | m3) |
| 54 | need_sibling aien-architecture |
| 55 | run_in_temp_copy sh -c ' |
| 56 | rc=0; m3/tests/run_m3_gates.sh || rc=$? |
| 57 | echo "run.sh: receipt written by this run (isolated copy):"; cat m3/m3_qualification_receipt.json |
| 58 | exit "$rc" |
| 59 | ' ;; |
| 60 | # The five jobs below are SKIP on GitHub (if: false, never green). Their manifests declare |
| 61 | # the real requirement (gb10 or nvrm) and the commands are the scripts those jobs name. |
| 62 | forge-gate34) tests/run_forge_gates.sh ;; |
| 63 | m15) run_in_temp_copy tests/run_m15_gates.sh ;; |
| 64 | m16-requal) run_in_temp_copy tests/run_m16_requalification.sh ;; |
| 65 | # The two nvrm scripts compile into nvrm/ (lifecycle_gates is a tracked |
| 66 | # binary); in the shared worktree that is a concurrent gate's dirty_after. |
| 67 | nvrm-lifecycle) run_in_temp_copy tests/run_nvrm_lifecycle_gates.sh ;; |
| 68 | submission-visibility) run_in_temp_copy tests/run_submission_visibility_gates.sh ;; |
| 69 | zero-disk-secrets) |
| 70 | # Not a hosted step in this repository; the same invariant the Rust repos enforce. |
| 71 | echo "Auditing repository for prohibited plaintext secret files..." |
| 72 | if find . -maxdepth 4 -name ".env*" -not -path "*/.git/*" -not -path "*/build/*" | grep -q .; then |
| 73 | echo "::error::Prohibited plaintext .env file found. Use an approved AIEN SecretProvider." |
| 74 | obs env_files_found true |
| 75 | exit 1 |
| 76 | fi |
| 77 | obs env_files_found false |
| 78 | echo "Zero plaintext .env files verified." |
| 79 | ;; |
| 80 | *) |
| 81 | echo "run.sh: unknown step '$step'" >&2 |
| 82 | exit 2 |
| 83 | ;; |
| 84 | esac |