synapse
A component of the AienOS ecosystem.
Brought by drakestapleton
synapse / README.md
| 1 | <!-- github-native-navigation --> |
| 2 | [Source](https://github.com/aien-dev/synapse) · [Walkthrough](TEACHING.md) · [Replay receipt](TEACHING-REPLAY.txt) · [Issues](https://github.com/aien-dev/synapse/issues) |
| 3 | <!-- /github-native-navigation --> |
| 4 | |
| 5 | # Synapse |
| 6 | |
| 7 | Synapse is AIEN's high-throughput, agent-native changeset and integration service with deterministic Git object materialization and Radicle canonicality verification ([aien-dev/aien-sovereign-core-mv#515](https://github.com/aien-dev/aien-sovereign-core-mv/issues/515)). |
| 8 | |
| 9 | **Direction (2026-10-14):** Synapse is becoming the new Git for AI: source control for AI agents only, built from the best ideas of every system, with Git kept as a small machine bridge for import, export, and existing tooling ([ADR 0002](docs/adr/0002-synapse-first-git-as-bridge.md), tracked in [aien-dev/synapse#8](https://github.com/aien-dev/synapse/issues/8)). |
| 10 | |
| 11 | ## How I built it: a small result you can reproduce |
| 12 | |
| 13 | I follow a changeset from submission and WAL persistence to a checkout-free tree and standard Git objects. [The worked lesson](TEACHING.md) includes a corrupt-object refusal; [the latest replay record](docs/teaching-replay-2026-11-05.txt) is a host fixture, separate from canonical Radicle promotion. |
| 14 | |
| 15 | ## Architecture Overview |
| 16 | |
| 17 | Synapse accelerates the high-frequency multi-agent inner loop (changeset creation, virtual tree/diff inspection without working-tree checkout, test evidence attachment, conflict detection, and integration queueing) while enforcing three non-negotiable boundaries: |
| 18 | |
| 19 | 1. **Git Compatibility**: Accepted changesets deterministically materialize into standard Git `blob`, `tree`, and `commit` objects compatible with `git fsck`, `git clone`, and `git fetch`. |
| 20 | 2. **GitHub Human Projection**: Human review projections (`GitHubPullRequestProjection`) publish compact summaries and evidence digests without uploading bulky machine logs or silently force-moving human branches. |
| 21 | 3. **Radicle Canonical Authority**: Fast WAL ingest order (`WalSeq`) and GitHub PR state never confer authority to advance canonical branches. Canonical promotion (`RadicleCanonicalHead`) requires cryptographic verification of `refs/rad/id` and `refs/namespaces/<nid>/refs/rad/sigrefs` against the repository's delegate quorum threshold. |
| 22 | |
| 23 | ## Workspace Crates |
| 24 | |
| 25 | | Crate | Gate | Responsibility | |
| 26 | | :--- | :--- | :--- | |
| 27 | | [`synapse-core`](crates/synapse-core) | Gate 0 | Distinct identity types (`ChangesetId`, `BlobDigest`, `GitOid`, `RadicleCanonicalHead`, `GitHubPullRequestProjection`, `IdempotencyKey`, `WalSeq`), `ChangesetEnvelope` v1, `did:key` Ed25519 verification, and `RefusalCode` taxonomy | |
| 28 | | [`synapse-store`](crates/synapse-store) | Gate 1 | Single-writer append-only WAL (`SWAL` v1) with CRC32C and SHA-256 hash chain, configurable `fsync` policy, content-addressed blob store, checkpoint compaction, GC, crash fault injection, and the R1 raw block store with its signed repair tool (`synapse-bench store-repair`, [spec](docs/R1_RAW_BLOCK_STORE.md#41-repair-after-a-checkpointcorrupt-refusal-issue-105)) | |
| 29 | | [`synapse-auth`](crates/synapse-auth) | Gate 2 | Ed25519 capability grants (`Read`, `Propose`, `Evaluate`, `Review`, `Publish`), expiry/replay guards, rate/size quotas, and hash-chained security audit log | |
| 30 | | [`synapse-api`](crates/synapse-api) | Gate 2 | Bounded paginated API (`submit`, `get`, `diff`, `tree`, `history`, `provenance`, `conflicts`, `status`, `watch`), checkout-free virtual tree overlay, and exact path-index invalidation | |
| 31 | | [`synapse-git`](crates/synapse-git) | Gate 3 | Deterministic Git loose object writer/reader, bidirectional `ChangesetId <-> GitOid` map, ref namespace separation, and GitHub PR projection builder | |
| 32 | | [`synapse-radicle`](crates/synapse-radicle) | Gate 3 | Radicle `refs/rad/id` and `refs/rad/sigrefs` Ed25519 delegate threshold verifier and split-brain refusal engine | |
| 33 | | [`synapse-bench`](crates/synapse-bench) | Gate 4 | Comparative qualification harness (Synapse ingest and checkout-free queries versus Git worktree and Git plumbing workflows) plus WAL, Git materialization, and Radicle canonicality conformance suites | |
| 34 | |
| 35 | ## Connected repos |
| 36 | |
| 37 | Each tool below is its own repository whose root `.crumb` names `aien-dev/synapse@099a980` as parent (`extensions.map.parent`). They coordinate the agents that work across aien-dev; change them there, not here. |
| 38 | |
| 39 | * [`synapse-claims`](https://github.com/aien-dev/synapse-claims): append-only, hash-chained, Ed25519-signed lease ledger for repos, branches, path globs, PRs and outside targets. Conflicting leases are refused with exit 2 and the holder named. |
| 40 | * [`synapse-map`](https://github.com/aien-dev/synapse-map): the org repository graph; `where` routes a task to its repository, `new` scaffolds a connected repository, `check` reports orphans and duplicate purposes. |
| 41 | * [`synapse-pulse`](https://github.com/aien-dev/synapse-pulse): reconciles the ledger against GitHub (through the gh guard, conditional requests) and live agent sessions, and raises one `COORD-DRIFT:` watchdog alarm. |
| 42 | * [`synapse-mcp`](https://github.com/aien-dev/synapse-mcp): MCP stdio server that executes the CLIs above for agents. |
| 43 | * [`synapse-board`](https://github.com/aien-dev/synapse-board): renders the human board (Markdown and a tailnet-only page) from the ledger. |
| 44 | |
| 45 | ## Documentation and Evidence |
| 46 | |
| 47 | * [Domain Glossary (`CONTEXT.md`)](CONTEXT.md) |
| 48 | * [ADR 0001: Synapse Architecture, Owning Boundary, and Compatibility Invariants](docs/adr/0001-synapse-architecture-and-boundaries.md) |
| 49 | * [ADR 0002: Synapse-First Source Control for AI Agents, with Git as a Bridge](docs/adr/0002-synapse-first-git-as-bridge.md) |
| 50 | * [Gate 0 Reality Check Audit and Reproducible Baseline](docs/GATE0_REALITY_CHECK_AND_BASELINE.md) |
| 51 | * [Threat Model and Capability Permission Matrix](docs/THREAT_MODEL.md) |
| 52 | * [Changeset Schema, WAL Format, Consistency, and GC Specification](docs/SCHEMA_AND_CONSISTENCY.md) |
| 53 | * [Gate 0 Empirical Baseline Receipt (`evidence/gate0-baseline/`)](evidence/gate0-baseline/baseline_report.json) |
| 54 | * [Gate 4 Comparative Qualification Report](docs/GATE4_QUALIFICATION.md) |
| 55 | * [Gate 4 Qualification Evidence (`evidence/gate4-qualification/`)](evidence/gate4-qualification/report.json), reproduced with `scripts/run_gate4_qualification.sh` |
| 56 | * [D1 merge tier T1 (`docs/D1_MERGE_TIER_T1.md`)](docs/D1_MERGE_TIER_T1.md): line-level three-way merge of one file, checked against `git merge-tree` and `git merge-file` ([evidence](evidence/d1-merge-tier-t1/)) |
| 57 | * [Spark verification gates (`docs/PIPELINE.md`)](docs/PIPELINE.md): the interop and Gate 4 scripts honour `CARGO_TARGET_DIR`, so `SYNAPSE-CONFORMANCE` runs the same on the Spark as in a plain checkout |
| 58 | |
| 59 | ## License |
| 60 | |
| 61 | Licensed under the Apache License, Version 2.0 (Apache-2.0). |
| 62 | |
| 63 | ## Human-Directed Agentic Engineering |
| 64 | |
| 65 | Development follows Human-Directed Agentic Engineering (HDAE): humans define goals, architecture, |
| 66 | constraints, acceptance criteria, and stopping points; agents implement, execute checks, diagnose |
| 67 | failures, and revise within those boundaries. Human review retains responsibility for claims, |
| 68 | acceptance, and release decisions. This development method is distinct from Synapse's agent-native |
| 69 | runtime interfaces and does not change its canonical promotion rules. |
| 70 | |
| 71 | For the documented method and a systems-software case study, see Gregory M. Kurtzer, |
| 72 | [*Ginux: Building an Independent Kernel That Runs Linux Userspace through Human-Directed Agentic |
| 73 | Engineering* (2026)](https://doi.org/10.5281/zenodo.23682548). |