interplane.Get Omega
Read in your language

spark-rsi-mv

Native Rust recursive self-improvement engine with paired bootstrap evaluation and cryptographic ledger

Brought by drakestapleton

branch main Branches Tags History

spark-rsi-mv / AUDIT_SCOPE.md

125 lines · 7004 bytes Raw Blame History Source

Audit scope

Written for an outside, independent security audit. Revision described: fc13d3f77e6cfec789fce1b0e15125df8feac3d8 on main, 2026-10-26. Everything below is taken from the repository's own files at that revision; items marked NOT_RUN were not executed while writing this document.

What this repository is

A Rust crate spark-rsi 0.1.0 (AGPL-3.0-or-later) that runs a five-phase cycle against a target repository: observe, propose (model proposals applied in a sandbox copy), verify (unslop check, secret refusal, cargo check, cargo test), balance (src/balance.rs), ratify (review branch rsi/<proposal id> plus a patch; a human merges). Binaries: spark-rsi (src/main.rs), spark-rsi-supervisor (src/bin/supervisor.rs) and spark-rsi-judge (src/actor/judge.rs). It depends on aien-protocols-mv crates by path, so it is not a standalone checkout.

What to review, in priority order

  1. src/isolation/cargo_sandbox.rs, src/isolation/container.rs, src/isolation/rollback.rs: the bubblewrap build jail, environment clearing, toolchain binding (CARGO_HOME, RUSTUP_HOME and the PATH directory are bound read-only; a directory that is or holds the judge's home is never exposed, per README), and the cgroup limits. rollback.rs holds 12 Command::new calls.
  2. src/supervisor/ (canary_exec.rs, daemon.rs, ipc.rs) and src/canary/: canary worker namespaces, the one IPC socket, the worker environment allowlist, and how supervisor evidence stays outside the jail. Contract: docs/CANARY-CONTRACT.md.
  3. src/ratify.rs and src/diff_gate.rs: protected-file checks on the real git diff.
  4. src/promotion_gate.rs, src/actor/judge.rs, src/verifier.rs: version 2 receipts (docs/RECEIPT-V2.md), judge policy and public key pins (--judge-policy-file, --judge-public-key and the RSI_JUDGE_* environment variables); malformed pins are meant to be refused at startup.
  5. src/ledger/ (merkle.rs, db.rs, record.rs): the improvement ledger and its signing keys (README: kept off the command line).
  6. src/propose/ (model_seat.rs, cortex.rs): model replies are untrusted input that becomes a candidate patch.
  7. src/observe.rs, src/measure/profile.rs, src/propose/kernel_autotune.rs, src/soak/runner.rs: other process launches.

Trust boundaries

Threat model summary

Build from source at a pin

Needs Rust/Cargo, bubblewrap, and aien-protocols-mv cloned next to this repository as aien-protocols. README asks for the sibling at 28bc49ec57a89398fcb463cf71c0add7fcd2ef6c until aien-protocols-mv#59 merges; #59 merged as f3785177fcaaab7c0f2ce1126616e9fecb4e47b4, so the default branch of aien-protocols-mv carries it. Cargo.lock committed (265 packages).

git clone https://github.com/aien-dev/spark-rsi-mv spark-rsi
git clone https://github.com/aien-dev/aien-protocols-mv aien-protocols
cd spark-rsi
cargo build --locked

Run every test

NOT_RUN while writing this document. From README and tests/gates/run.sh:

cargo test --locked -- --test-threads=1
tests/gates/run.sh zero-disk-secrets
tests/gates/run.sh fmt
tests/gates/run.sh check               # cargo check --offline --locked -j2 --all-targets
tests/gates/run.sh test                # release build, then cargo test --offline --locked
sh scripts/check-no-python.sh

The tree has 21 top-level test files under tests/ and 340 #[test] or #[tokio::test] attributes in src/ and tests/. The jail tests need bubblewrap and a systemd user manager with cgroup v2.

Known limitations and NOT_RUN

Dependencies and provenance

Evidence