interplane.Get Omega
Read in your language

synapse

A component of the AienOS ecosystem.

Brought by drakestapleton

branch main Branches Tags History

synapse / AUDIT_SCOPE.md

131 lines · 7075 bytes Raw Blame History Source

Audit scope

Written for an outside, independent security audit. Revision described: 5f9a638d6be5c271748dc740f69159422788ca81 on main, 2026-10-30. 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

Synapse is source control for AI agents. Agents submit signed changesets, inspect virtual trees and diffs without a working-tree checkout, attach evidence and queue integration. Accepted changesets materialize deterministically into standard Git objects; GitHub pull requests are only a human projection; canonical promotion needs a verified Radicle delegate quorum. One Rust Cargo workspace under crates/: synapse-core, -store, -auth, -api, -git, -radicle, -bench, -crumb, -coord, -evidence, -wire. The library crates read no configuration files.

What to review, in priority order

  1. crates/synapse-auth: did:key Ed25519 extraction and signature verification, capability grants (Read, Propose, Evaluate, Review, Publish), expiry, replay nonces, quotas, self-review refusal, PolicyEnforcer::authorize and authorize_chain, the audit log.
  2. crates/synapse-radicle: delegate threshold verification over refs/rad/id and refs/namespaces/<nid>/refs/rad/sigrefs; split-brain refusal.
  3. crates/synapse-wire: frame decoding (docs/G1_WIRE_FRAMES.md), the stream transport (any ordered byte stream, including UnixStream and TcpStream), the shared-memory ring (docs/G3_SHM_RING.md), connection closing after 64 refusals.
  4. crates/synapse-store: SWAL v1 parsing and recovery, blob store, compaction and GC, torn write handling; malformed corpus tests; the R1 raw block store repair after CheckpointCorrupt (src/blockdev/repair.rs, docs/R1_RAW_BLOCK_STORE.md), which writes to the device; the G2 content-defined chunking and WAL v2 path (src/chunk.rs, src/wal2.rs, src/segment.rs, docs/G2_CONTENT_DEFINED_CHUNKING.md), which parses committed v2 checkpoints and logs.
  5. crates/synapse-api: bounds, pagination, cross-repository lookups; the M1 admission secret scanner (src/secret_scan.rs: hand-written single pass, refuse by default, no allowlist). With crates/synapse-core/src/merge.rs and both derivation.rs files: merge tier T1, which combines changes to different parts of one file (docs/D1_MERGE_TIER_T1.md).
  6. crates/synapse-git: loose object writer and reader, ChangesetId <-> GitOid map, ref namespaces, GitHub pull request projection.
  7. crates/synapse-coord (Unix datagram socket notifications in src/board/notify.rs) and crates/synapse-evidence.
  8. tests/gates/run.sh, scripts/ci/portable.sh, .aien/always, .aien/unmapped-ok, .aien/verify.pub.
  9. .github/workflows/aien-verification.yml: pull request and push, contents: read, advisory; nothing on GitHub builds this repository's code (AGENTS.md).

AGENTS.md: a change to .aien/, tests/gates/, .github/workflows/ or .forgejo/ is BLOCKED_OPERATOR and runs only when the operator starts it by hand.

Trust boundaries

From docs/THREAT_MODEL.md:

Threat model summary

Build from source at a pin

Rust toolchain (the gates record Rust 1.98.1; there is no rust-toolchain.toml), git, and cc for the crumb qualification scripts. Cargo.lock is committed.

git clone https://github.com/aien-dev/synapse.git
cd synapse
git checkout 5f9a638d6be5c271748dc740f69159422788ca81
cargo build --locked --workspace

Run every test

bash scripts/ci/portable.sh workspace
cargo fmt --all --check
cargo clippy --locked --workspace --all-targets -- -D warnings
cargo test --locked --workspace
tests/gates/run.sh zero-disk-secrets
tests/gates/run.sh workspace
tests/gates/run.sh conformance

Known limitations and NOT_RUN

Dependencies and provenance

Evidence