aien-architecture-mv
Canonical architecture for the AIEN ecosystem: flows, boundaries, ADRs, and the map from design to implementation repositories.
Brought by drakestapleton
aien-architecture-mv / AUDIT_SCOPE.md
| 1 | # Audit scope |
| 2 | |
| 3 | Written for an outside, independent security audit. Revision described: |
| 4 | `fabf7b765a29d1e9b7d45c5b52852ee39bbfad56` on `main`, 2026-10-26. Everything below is taken from the repository's own files at |
| 5 | that revision; items marked NOT_RUN were not executed while writing this document. |
| 6 | |
| 7 | ## What this repository is |
| 8 | |
| 9 | The AIEN architecture authority (AGPL-3.0-or-later): `PLAN_AUTHORITY.md`, |
| 10 | `CURRENT_EXECUTION_PLAN.md`, `doctrine/` (architecture and milestone registry), `docs/` (ADRs, |
| 11 | plans, research, archive), `qualification/` (release candidate manifests and gate results), |
| 12 | `formal/invariants/` and `bootstrap/formal-oracles/lean/` (Lean models). Code that runs: |
| 13 | |
| 14 | - `tools/crumb/` (`crumb.c`, 2,380 lines of C11, with `Makefile` and three test scripts). |
| 15 | - `tools/candidate/check_candidate.om`, `check_pins.om` and a parity oracle with 477 case files and 117 expected outputs. |
| 16 | - `tools/doctrine/doctrine.om`, `gate.om`; `tools/zero-legacy/closure.om`, `expect.om`, |
| 17 | `gate.om`, `sha256.om`, with fixtures. |
| 18 | - `scripts/` shell tools and `scripts/pipeline-proofs/`. |
| 19 | |
| 20 | ## What an auditor can and cannot check here |
| 21 | |
| 22 | - Can check: the crumb tool and its tests, the Omega checkers and their fixtures, the gate |
| 23 | scripts, and whether each status line in `doctrine/ROADMAP.md` and `CURRENT_EXECUTION_PLAN.md` |
| 24 | cites a receipt. |
| 25 | - Cannot check here: the receipts themselves, which live mostly in omega-mv `evidence/` and in |
| 26 | aien-dev/aien-receipts; any hardware result. |
| 27 | |
| 28 | ## What to review, in priority order |
| 29 | |
| 30 | 1. `tools/crumb/crumb.c`: parsing of `.crumb` files and store records, path handling, the store |
| 31 | identity refusal (exit 3) and refused store file (exit 4) paths. |
| 32 | 2. `tools/candidate/check_candidate.om` and `check_pins.om`: they spawn processes (`gh api ...`, |
| 33 | or the command in `CAND_SHA_CHECK` run as `$CAND_SHA_CHECK <repo> <sha>`); check how repository |
| 34 | names and shas from a manifest reach those argument lists. |
| 35 | 3. `tools/zero-legacy/gate.om` and `closure.om`: the closure checker; `gate.om` checks the omc pin |
| 36 | with its own SHA-256 (`sha256.om`). |
| 37 | 4. `scripts/pr-gate.sh`: merge gate with `--dry-run` and `--admin-authorized-by`; check what |
| 38 | merges when a step is SKIP. |
| 39 | 5. `tests/gates/run.sh` and `scripts/pipeline-proofs/18-crumb-only-no-rebuild.sh` (uses a |
| 40 | persistent target cache under `XDG_CACHE_HOME`). |
| 41 | 6. `.github/workflows/aien-verification.yml`: advisory AIEN Checks and the AIEN Alpha tag check. |
| 42 | |
| 43 | ## Trust boundaries |
| 44 | |
| 45 | - Untrusted input to the tools: `.crumb` files and store records, candidate manifests and |
| 46 | amendments, trees scanned by the zero-legacy checker, GitHub API responses. |
| 47 | - Trusted: the pinned seed compiler in `tools/zero-legacy/omega.pin`, `gh` and `git`, and |
| 48 | `.aien/verify.pub` as the Alpha trust anchor. |
| 49 | - Workflow header: GitHub-hosted compute builds only the pinned verifier tools, never this |
| 50 | repository's code. |
| 51 | |
| 52 | ## Threat model summary |
| 53 | |
| 54 | - Assets: the honesty of the status of record; the integrity of qualification manifests and pins. |
| 55 | - Attackers considered: hostile store files (FIFOs, unbounded reads per `test-hostile.sh`), forged |
| 56 | or zero digests in manifests, amendments that change frozen fields, legacy sources hidden in a |
| 57 | tree. |
| 58 | - Defended: refusal exit codes in crumb, manifest rules in `docs/qualification/CANDIDATE.md`, |
| 59 | byte-for-byte parity of the Omega checkers against recorded outputs, a watchdog and 1 GiB |
| 60 | address-space limit in the hostile tests. |
| 61 | - Not defended / explicitly out of scope: the truth of receipts held elsewhere; GitHub account |
| 62 | security. README: hosted checks are advisory and do not gate a merge. |
| 63 | |
| 64 | ## Build from source at a pin |
| 65 | |
| 66 | The crumb tool needs a C11 compiler and `make`. The Omega tools need omc from omega-mv |
| 67 | `a0eafa39ac9a92786dac68f7aa6d8564a28fa981` with sha256 |
| 68 | `734f0a39319fbfa930bcc62cb30dbf06d47d78e126372b74f5baf478e6126b61` |
| 69 | (`tools/zero-legacy/omega.pin`, built with `sh seed/omega-from-seed.sh`). The Lean models name |
| 70 | `leanprover/lean4:v4.34.1`. |
| 71 | |
| 72 | ```sh |
| 73 | make -C tools/crumb test |
| 74 | $AIEN_OMC < tools/candidate/check_candidate.om > check_candidate && chmod +x check_candidate |
| 75 | ``` |
| 76 | |
| 77 | ## Run every test |
| 78 | |
| 79 | NOT_RUN while writing this document. From README and `tests/gates/run.sh`: |
| 80 | |
| 81 | ```sh |
| 82 | ./tools/crumb/crumb verify . # optional: Crumbs are retired (DRA-97), no gate runs it |
| 83 | bash tests/gates/run.sh crumb-tool-test |
| 84 | bash tests/gates/run.sh script-tests |
| 85 | AIEN_OMC=<pinned omc> bash tests/gates/run.sh doctrine |
| 86 | AIEN_OMC=<pinned omc> bash tests/gates/run.sh zero-legacy |
| 87 | bash tests/gates/run.sh qualification-status # needs an omega checkout at ../omega |
| 88 | bash tools/candidate/parity/run.sh <check_candidate-bin> <check_pins-bin> |
| 89 | bash scripts/pipeline-proofs/run-all.sh |
| 90 | ``` |
| 91 | |
| 92 | `doctrine` and `zero-legacy` report NOT_RUN (exit 3) without the pinned compiler. |
| 93 | |
| 94 | ## Known limitations and NOT_RUN |
| 95 | |
| 96 | - `tools/zero-legacy/README.md`: v0; release mode implemented and gate-tested on fixtures, not yet |
| 97 | wired into any release decision. |
| 98 | - README: the Aienux kernel is not physically qualified; CAND-3 as a whole is not claimed |
| 99 | qualified; CAND-4 has no R15 or R16 rerun. |
| 100 | - The crumb tool is C, outside the Omega rule; README describes it as the one program. |
| 101 | - `omega.pin` names an SSH clone URL (`git@github.com:...`); an outside auditor will use HTTPS. |
| 102 | |
| 103 | ## Dependencies and provenance |
| 104 | |
| 105 | - Crumb tool: libc only (C11, `make`). |
| 106 | - Omega tools: the omc pin above. Lean models: `lakefile.toml` and `lean-toolchain`. |
| 107 | - Workflow: `aien-test` built from `aien-spark/aien-sovereign-core` at |
| 108 | `a51042b61b87355c0850ef82ba409a46e153a1ff`; actions pinned by full commit sha (tag noted in a comment). |
| 109 | |
| 110 | ## Evidence |
| 111 | |
| 112 | - `qualification/candidates/` (manifests and `*.gates.md` results) and `qualification/exceptions/`. |
| 113 | - `scripts/pipeline-proofs/RESULTS-2026-10-11.md`. |
| 114 | - `tools/candidate/parity/cases/` and `expected/`: recorded checker outputs. |
| 115 | - Run receipts cited from `CURRENT_EXECUTION_PLAN.md` and `doctrine/ROADMAP.md` live in other |
| 116 | repositories. |