aien-protocols-mv
Canonical specifications, wire protocols, and schemas for the AIEN sovereign ecosystem
Brought by drakestapleton
aien-protocols-mv / AGENTS.md
| 1 | # aien-protocols (the written contracts between the parts of AIEN) |
| 2 | |
| 3 | > Specifications for the byte formats and rules the parts of AienOS (the whole AIEN system) agree on: agent state, inference, evaluation, evidence receipts, crumbs, execution transcripts, compiled Omega units, the Omega shell platform boundary and the task messages between a Raspberry Pi and the DGX Spark. Each contract is a specification in `specs/`, often with test vectors and a small C checker that proves the vectors match the text. Reference Rust crates live in `crates/`. The repository holds contracts only, never private implementations. |
| 4 | |
| 5 | Shared rules: read https://www.aienos.com/agents/RULES.md first. This file adds what is specific to this repository; where the two differ, this file wins here. |
| 6 | |
| 7 | ## Scope |
| 8 | |
| 9 | - Applies to the whole repository. |
| 10 | - `specs/<name>/`: one directory per specification (Community Specification License 1.0), with `tools/` (generators and C checkers) and `vectors/` where they exist. The `Status` line at the top of each specification says whether it is Draft, Stable or FROZEN. |
| 11 | - `crates/`: ten reference Rust crates (Apache-2.0) in one Cargo workspace. Rust is scaffolding and Omega is the destination (aien-architecture ADR 0024), so the specifications are the lasting part. |
| 12 | - Implementations of a contract live with their owner, not here: the Omega language repository (omega-mv) and the Aienux kernel (https://github.com/aien-dev/aienux) implement some contracts in C; aien-sovereign-core-mv uses some crates (`CONSUMERS.md`). |
| 13 | - Rule of direction: protocols point inward to nothing, implementations point downward to protocols, and implementations never point sideways at each other. |
| 14 | |
| 15 | ## Installation |
| 16 | |
| 17 | ```bash |
| 18 | git clone https://github.com/aien-dev/aien-protocols-mv.git |
| 19 | cd aien-protocols-mv |
| 20 | cargo check --workspace --all-targets |
| 21 | ``` |
| 22 | |
| 23 | The crates need a stable Rust toolchain (there is no `rust-toolchain.toml`). The spec checkers need only bash, coreutils and a C99 compiler (`cc`). No Python, no CUDA toolkit and no outside dependencies in the trusted base. |
| 24 | |
| 25 | ## Configuration |
| 26 | |
| 27 | - There is no runtime configuration. The crates are libraries and the checkers take no settings. |
| 28 | - `tests/gates/*.gate` and `tests/gates/run.sh` define the Spark gates. `.aien/always` lists the gates that run on every change (`PROTO-ZERO-DISK-SECRETS`, `PROTO-ANTI-SLOP`); `.aien/unmapped-ok` lists the paths that need only those. |
| 29 | - Crumbs are retired from the active workflow (DRA-97, 2026-11-07): no gate, step or workflow checks `.crumb` freshness, and the `.crumb` files stay as history. |
| 30 | |
| 31 | ## Usage |
| 32 | |
| 33 | ```bash |
| 34 | # The Rust gates |
| 35 | cargo fmt --all -- --check |
| 36 | cargo check --workspace --all-targets |
| 37 | cargo clippy --workspace --all-targets -- -D warnings |
| 38 | cargo test --workspace |
| 39 | |
| 40 | # The spec checkers (each builds its C checker with cc and runs the vectors) |
| 41 | bash specs/verified-crumb/tools/check-golden.sh |
| 42 | bash specs/osc-unit-artifact/tools/check-vectors.sh |
| 43 | bash specs/execution-transcript/tools/check-corpus.sh |
| 44 | bash specs/pi-spark-task/tools/check-vectors.sh |
| 45 | bash specs/osh-platform/tools/check-stream-vectors.sh |
| 46 | |
| 47 | # The LTP0 native suite (seeded Omega; needs an omega-mv checkout at the sources.json revision) |
| 48 | sh specs/latent-payload/run-native.sh /path/to/omega-mv |
| 49 | ``` |
| 50 | |
| 51 | Every gate is also one step of `tests/gates/run.sh <step>`: `fmt`, `check`, `clippy`, `test`, `zero-disk-secrets`, `anti-slop` and `c-vectors`. `c-vectors` runs every `specs/*/tools/check-*.sh` and passes only when all of them pass, so a new checker named `check-*.sh` is picked up automatically. `anti-slop` fails on any em dash or en dash in `crates/`, `docs/`, `README.md` and `ANTI_ENCLOSURE.md`. |
| 52 | |
| 53 | The `make-*.sh` scripts in `specs/*/tools/` regenerate vectors. Run one only when the specification itself changes, and commit the regenerated vectors together with the text. |
| 54 | |
| 55 | `specs/latent-payload/run-native.sh` is not part of `c-vectors`, because it needs an outside omega-mv checkout. It resolves this repository root from its own location, checks that every Omega input (`seed/out/omc` at the pinned sha256, the om2 conductor and its two SHA-256 constant fixtures, `om/tls/sha2.om`) exists and names any missing path, then creates the temporary root `seed` link that the unchanged conductor needs and removes it on exit. Without that link the conductor prints `INVALID SHA-256 constant fixture unreadable or malformed` and exits 3. |
| 56 | |
| 57 | ## Conventions |
| 58 | |
| 59 | - Specification changes follow `GOVERNANCE.md` and `VERSIONING.md`. Specifications and crates are versioned together with `vX.Y.Z` tags; while the major version is zero a breaking change needs a minor bump and migration notes in `CHANGELOG.md`. |
| 60 | - A FROZEN specification (osc-unit-artifact v1) does not change without explicit approval; consumers carry copies of its vectors. |
| 61 | - A specification and its vectors change in the same pull request, and the checker must pass on them. Do not edit a vector by hand to make a checker pass. |
| 62 | - Deprecate before removing: mark the item and name its replacement for at least one minor release, then list the removal in `CHANGELOG.md`. |
| 63 | - A consumer that adopts a new tag records it in `CONSUMERS.md` in the same change. |
| 64 | - No em dashes or en dashes in prose; the `PROTO-ANTI-SLOP` gate enforces it for the paths above. |
| 65 | |
| 66 | ## Safety and approvals |
| 67 | |
| 68 | - The DGX Spark is the only test judge (`docs/PIPELINE.md`); GitHub checks on pull requests are advisory and build nothing from this repository. |
| 69 | - A change to `.aien/`, `tests/gates/` or `.github/workflows/` is `BLOCKED_OPERATOR`: it runs only when the operator starts it by hand. Ask before touching those paths, and never relax a gate or a checker to make a change pass. |
| 70 | - Ask before changing the `Status` of a specification, freezing one, or changing a wire format that a consumer in `CONSUMERS.md` depends on. |
| 71 | - No plaintext secrets: `.env*` files fail `PROTO-ZERO-DISK-SECRETS`. Never commit keys or tokens. |
| 72 | - Contributions are licensed under the Community Specification License 1.0 (specifications) and Apache-2.0 (code) under the Developer Certificate of Origin. Keep `ANTI_ENCLOSURE.md` commitments intact. |
| 73 | - Open a pull request against `main` with the commands you ran and their output. Nothing on GitHub gates a merge and `main` requires no status check (`.github/workflows/aien-verification.yml`); the local Spark pipeline merges a pull request only after a maintainer adds the `ready-to-merge` label and its gates pass on the current head (see `docs/PIPELINE.md`). |
| 74 | |
| 75 | ## Further reading |
| 76 | |
| 77 | - `README.md`: the specification table, the crate table and the build steps. |
| 78 | - `GOVERNANCE.md`, `SCOPE.md`, `VERSIONING.md`, `CHANGELOG.md`, `CONSUMERS.md`: process, scope, versioning, history and consumers. |
| 79 | - `ANTI_ENCLOSURE.md`, `NOTICES.md`, `TRADEMARKS.md`: licensing commitments and notices. |
| 80 | - `docs/PIPELINE.md`: how the Spark gates test and merge a pull request. |
| 81 | - https://github.com/aien-dev/aien-architecture-mv: the plan, the ADRs and the status of the whole system. |