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#419 (code only)
Apply it
git checkout -b patch-d24a35cb4d1eb6c0 bb16e5c6e6db75e807b0349898b20bcd49e6318c curl -fsSL https://interplane.io/drakestapleton/aien-sovereign-core-mv/patches/d24a35cb4d1eb6c0.patch | git am
Provenance
github-import 1
aien-dev/aien-sovereign-core-mv
419
1331c03e1bfbad4df3fddee60734550bec0008ab
{"kind":"github-import","owner":"aien-dev","repo":"aien-sovereign-core-mv","number":419,"url":"https://github.com/aien-dev/aien-sovereign-core-mv/pull/419","export_sha256":"967c79e26a893657b5cdaa45efd442be5dbd2ecfe68e25f9a8c1b5da4d60d452","imported_utc":"2026-11-18T16:37:07Z","metadata":"unavailable","state_derived":true}
Changes
diff --git a/.crumb b/.crumb index 9204ca3d..ddb2997e 100644 --- a/.crumb +++ b/.crumb @@ -77,14 +77,14 @@ } ], "children_root": "sha256:9a27d2c98660aef35ed94ecfcb47d82d317ef88f97d0303db847c52915aad07f", - "compiled_at": "2026-10-11T04:00:54Z", + "compiled_at": "2026-10-11T04:12:27Z", "compiler": "crumb-compile/1", - "digest": "sha256:2d48bdca21179a844c8c44b9adf55735cb5c51e04c97621c0ec1fd30f516943d", + "digest": "sha256:db24cc4711b30eb27ca769b2bd0d4dd80aad35bf364fdd6acb1cf2b904ba8e4f", "evidence_files": 187, "evidence_root": "sha256:27ee0353cb4d4aae2b7dbce2bfe0d9f4ef2a94cd7a4555b84684d59372503280", - "files": 2940, - "generated_at_commit": "ecb7b00f13c83a6900f18afb2c3a7d32660a83e9", - "source_tree": "sha256:d90afddb26e6f678a3d0ed4cdafcc008ca98566a24f6bb06bdb4b877dbbb197f" + "files": 2942, + "generated_at_commit": "83117eb21970208dd6d6093b513d04ad38e35994", + "source_tree": "sha256:dedc93839cbbe724d827081c4241dd79892a54db881cf1491cdcfb7268f3c1ad" } }, "history": [], diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 371ae216..6d30d014 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -36,6 +36,9 @@ jobs: - name: Release gate negative tests (pins, digests, model inputs, signatures) run: bash scripts/test-release-checks.sh + - name: Whole-system verifier tests (tools/aien-verify/tests/run.sh) + run: sh tools/aien-verify/tests/run.sh + - name: Pin materializer self-test (scripts/pins.sh, offline) run: bash scripts/test-pins.sh diff --git a/CONTEXT.md b/CONTEXT.md new file mode 100644 index 00000000..ae40c28a --- /dev/null +++ b/CONTEXT.md @@ -0,0 +1,51 @@ +# aien-sovereign-core + +The Rust workspace for the AIEN host runtime on Linux (DGX Spark target): the `aien` command line, a single-process runtime daemon, the inference ABI and scheduler, and the supporting services around them. This file lists what exists and who owns what. It makes no claim that any part is complete or released; the README states the release state, and `docs/audits/` in aien-architecture holds the integration audit. + +Ownership: this repository has no `CODEOWNERS` file, so per-component owners are not recorded here (UNVERIFIED who owns each crate). Cross-repo plans and decisions are owned by aien-architecture (`PLAN_AUTHORITY.md`, `CURRENT_EXECUTION_PLAN.md`, ADRs). Decisions made in this repo live in `docs/adr/`. + +## Language + +**Runtime daemon**: +The long-running process started by `aien start` (it runs as `aien --daemon`). It owns the model, the KV memory and the socket the command line talks to. Code: `crates/aien-runtime`, started from `crates/aien-cli/src/commands.rs`. +_Avoid_: server, service + +**Approval desk**: +The operator's approval step for effects. It is required by default; a desk key created by `aien compose desk-key --create 1` must exist before the daemon starts. Code: `aien-runtime/src/spine.rs`, `approved_auth.rs`. +_Avoid_: login, auth + +**Objective record**: +The operator's written objective, stored as `objectives/<id>.json` under the provenance folder, re-read by the daemon when a grant is bound to it. Code: `aien-runtime/src/objective.rs`, `aien-cli/src/objective.rs`. +_Avoid_: task, ticket + +**Compose home**: +The state folder holding the desk key and composition state (`AIEN_COMPOSE_DIR`, else under `AIEN_RUNTIME_STATE_DIR`, else XDG state, else `~/.local/state/aien-runtime/compose`). + +**Candidate**: +The release candidate this tree may be released as, named in `release/candidate.toml` with its model digests and source pins. `omega.lock` pins the omega commit that is linked. Changed only with aien-architecture's candidate manifest. + +## Components (from crate descriptions) + +Runtime and inference +- `aien-runtime`: single-process runtime spine (daemon, compose bridge, objective and desk logic). +- `aien-cli`: the `aien` command line and terminal agent harness. +- `aien-inference-abi`, `aien-abi-core`, `aien-inference-runtime`, `aien-inference-service`: inference ABI, backend trait, weights loader, service protocols. +- `aien-kv-cache`, `aien-scheduler`: paged KV cache and continuous-batching scheduler. +- `aien-omega-gpu`, `aien-omega-compose`: bindings to the omega GPU matmul engine and omega composition (pinned by `omega.lock`). +- `aien-platform`, `aien-platform-linux`: platform ABI and the Linux / GB10 driver cell. + +Identity, memory, evidence +- `aien-allen`, `aien-allen-memory`, `aien-allen-profile`: ALLEN identity gate, scoped memory, persona profile. +- `cortex-rs`, `cortex-encoder-rs`, `cortex-path-m1`: Cortex memory engine, embeddings, a read-only retrieval experiment. +- `aien-capability`, `aien-mcp`, `aien-security`: tool and effect descriptors, MCP sessions, security abstractions. +- `aien-proof`, `aien-closure`, `aien-trace`, `aien-dual-observation`, `aien-replay`, `aien-campaign-verifier`, `crumbs`: test board, closure check, correlation trace, observation snapshot, transcript reader, campaign verifier, curriculum substrate. + +Services and tools +- `spark-*` crates (cockpit, supervisor, debugger, harness, aegis, hive, dream, mail, discord hub, harvester, inquisitor, adapters, crumbs, max bridge) and `rad-id-sync`, `aien-switchboard`, `aien-drive`: supporting services and tools; see each crate's Cargo description. `spark-max-*` is the Modular MAX yardstick bridge, not part of any default build. +- `tools/aien-verify`: independent verifier of the whole-system end-to-end run folders; standard library only. Tests: `tools/aien-verify/tests/run.sh` (run in CI). + +## Where things are + +- Release machinery: `install.sh`, `scripts/check-release-candidate.sh`, `scripts/package-release.sh`, `docs/release/`. +- First-run steps for an operator: `docs/FIRST_RUN.md`. +- End-to-end and campaign material: `scripts/whole_system_e2e.sh`, `docs/campaigns/`. diff --git a/README.md b/README.md index 205ec9a0..2705825f 100644 --- a/README.md +++ b/README.md @@ -43,7 +43,7 @@ Installing a release (state on 2026-10-11, from `install.sh` and the dry-run art - `install.sh` with no arguments builds from source and verifies no signature. With `AIEN_RELEASE_TAG=vX.Y.Z` it installs a published release instead: it downloads the archive, `SHA256SUMS.txt` and `SHA256SUMS.txt.sig`, checks the signature with `ssh-keygen`, then the archive checksum, and writes `install-receipt.json` with a `signature_check` of `release`, `internal-test-key` or `dry-run-key` (see [docs/release/RELEASE_SIGNING.md](docs/release/RELEASE_SIGNING.md)). - No public release exists. The public release key is not pinned yet (`AIEN_RELEASE_SIGNER` is empty until the key ceremony in [docs/release/KEY_CEREMONY.md](docs/release/KEY_CEREMONY.md)), so nothing can install as `release`. v0.1.0 and v0.1.1 are internal test releases. The release gate (`scripts/check-release-candidate.sh`) fails on current main (omega.lock differs from the CAND-4 manifest), see [#414](https://github.com/aien-dev/aien-sovereign-core/issues/414). -- After a release install, the daemon refuses to start until an approval desk key exists: run `aien compose desk-key --create 1` first. `aien objective record --text "..."` then records an objective; the record is written under `$AIEN_PROVENANCE_DIR/objectives`, which defaults to `/tmp/aien-provenance`, so set `AIEN_PROVENANCE_DIR` to keep records across reboots. The installer does not provision a model (the harness sets `AIEN_MODEL_PATH`); `aien harness` is not usable from a release install (it calls `spark-harness check`, which is not shipped). +- After an install, follow [docs/FIRST_RUN.md](docs/FIRST_RUN.md): create the desk key (`aien compose desk-key --create 1`; `aien start` refuses without it), provision the model, start, record an objective. Objective records default to a durable per-user folder (`~/.local/state/aien-runtime/provenance`), not `/tmp`. The installer does not provision a model. `aien harness` is not shipped in this release and exits with a refusal. ## Contributing diff --git a/docs/FIRST_RUN.md b/docs/FIRST_RUN.md new file mode 100644 index 00000000..560eb382 --- /dev/null +++ b/docs/FIRST_RUN.md @@ -0,0 +1,51 @@ +# First run: from install to a recorded objective + +This is the order a new operator follows on a machine where AIEN was installed from a build or a release archive. Every step below is read from the code or scripts named in brackets. Nothing here claims a public release exists (see the README for the current release state). + +## 1. Install + +`install.sh` builds from source, or with `AIEN_RELEASE_TAG` installs a published archive after checking its signature (see the README). It puts the `aien` command on your path. It does not provision a model and does not create the desk key. + +## 2. Create the approval desk key (once) + +``` +aien compose desk-key --create 1 +``` + +The desk key is how you approve what AIEN is allowed to do. `aien start` refuses to run without it and tells you this exact command [`commands.rs: handle_start_command`, `spine.rs: check_desk_key_at_start`]. The key is stored in the compose home: `$AIEN_COMPOSE_DIR`, else `$AIEN_RUNTIME_STATE_DIR/compose`, else `$XDG_STATE_HOME/aien-runtime/compose`, else `~/.local/state/aien-runtime/compose` [`spine.rs: compose_dir_from_env`]. The command prints the key id and path, never the key. + +## 3. Provision the model + +The installer ships no model weights. The daemon needs one `*.safetensors` checkpoint of a `LlamaForCausalLM` model, with `tokenizer.json` and `config.json` in the same folder [`commands.rs: CheckpointPolicy`]. + +The candidate this tree is released against is named in `release/candidate.toml`, table `[model]`: `model-id` (currently `unsloth/Llama-3.2-1B-Instruct`), the `snapshot`, and the sha256 of `model.safetensors` and `tokenizer.json`. Its licence (Llama 3.2 Community License) and its distribution note ("internal-only until an open-licence model passes") are in the same table. Put the files in one folder, for example `~/models/llama-3.2-1b-instruct/`. + +Tell the daemon where they are, by one of (first match wins): + +- `AIEN_MODEL_PATH=/path/to/model.safetensors`, and optionally `AIEN_TOKENIZER_PATH=/path/to/tokenizer.json` (default: `tokenizer.json` beside the model file); +- `AIEN_MODEL_DIR=/path/to/folder`, scanned for a `*.safetensors` file directly or one folder down; +- otherwise the folders `./models` and `~/models` are scanned. + +A release build is strict by default: with no checkpoint found the daemon refuses to start instead of falling back to reference weights. `AIEN_REQUIRE_CHECKPOINT=0` or `AIEN_DEV_FALLBACK=1` are development switches, not for a real run [`commands.rs: CheckpointPolicy::from_lookup`, `strict.rs: production_strict`]. + +Checking the files: the daemon computes the sha256 of the model file and of `tokenizer.json` it loaded and records them in its generation records [`commands.rs: model_identity`]. It does not compare them to `release/candidate.toml` itself. You compare them: run `sha256sum model.safetensors tokenizer.json` and check the two values against `model-safetensors-sha256` and `tokenizer-json-sha256` in `[model]`. `scripts/whole_system_e2e.sh` makes the same comparison for its own runs. A mismatch means a different model than the one qualified; do not treat results as the candidate's. + +## 4. Start + +``` +aien start +``` + +This starts the runtime daemon and waits for its socket. Without the desk key (step 2) it stops with a plain message naming the command. A missing model (step 3) is refused by the daemon it starts, with the reason printed in its own output, and `aien start` then reports that the socket did not become ready. `aien status` shows whether it is running. + +## 5. Record an objective + +``` +aien objective record --text "what you want done" +``` + +The record is written under the provenance folder, `objectives/<id>.json` [`aien-runtime/src/objective.rs`]. The folder is `$AIEN_PROVENANCE_DIR` if set, else `$AIEN_RUNTIME_STATE_DIR/provenance`, else `$XDG_STATE_HOME/aien-runtime/provenance`, else `~/.local/state/aien-runtime/provenance`. It is never `/tmp`. The daemon and the command line use the same rule; if they ever pointed at different folders an approval would be refused as `ObjectiveMissing`, so set the same environment for both. + +## What is not covered here + +`aien harness` is not shipped in this release and exits with a refusal.