diff --git a/.crumb b/.crumb index 6a12dd2..7de857c 100644 --- a/.crumb +++ b/.crumb @@ -45,14 +45,14 @@ "generated": { "children": [], "children_root": "sha256:e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", - "compiled_at": "2026-10-17T12:02:42Z", + "compiled_at": "2026-10-18T04:40:27Z", "compiler": "crumb-compile/1", - "digest": "sha256:fb301066e5ae4d15cead28f810814b4f4772e79638563bee1c13b56c86c3a501", + "digest": "sha256:0029cacaf6ea013dc87d8279287bd43d8e041b2bcbd48dd304750c1ea74de1c4", "evidence_files": 262, "evidence_root": "sha256:b25d2fcc4dd431ffce85a91a08342766e8f5d4b0309e16df46c008083835d98a", "files": 456, - "generated_at_commit": "77227b6b132bbd9ca2d0fbd86bffd84b3c509dbc", - "source_tree": "sha256:0b135d43305597f16d1212342c522b05be78f06b5fa8befc2e645c28cb31e584" + "generated_at_commit": "48a3dbf5cea57806617618f997c5887db1e4211c", + "source_tree": "sha256:ea3500e17b8d8a1477159807754c2fa4cec9deba580035629aa5c6350c4af7f2" }, "synapse": { "component_paths": { diff --git a/README.md b/README.md index 0edc0d8..94dcb95 100644 --- a/README.md +++ b/README.md @@ -1,41 +1,54 @@ # Synapse -Synapse is AIEN's high-throughput, agent-native changeset and integration service with deterministic Git object materialization and Radicle canonicality verification ([aien-spark/aien-sovereign-core#515](https://github.com/aien-spark/aien-sovereign-core/issues/515)). +Synapse is source control built for AI agents. Agents propose changes, inspect trees and diffs without checking files out, attach test evidence, and coordinate who is working where. Git stays as a bridge for import, export and existing tools. -**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-spark/synapse#8](https://github.com/aien-spark/synapse/issues/8)). +An attachment of [Aienix](https://github.com/aien-dev/aienix), the core tree of AIEN. Synapse lives in its own repository and plugs into the core at a boundary. -## Architecture Overview +**Status (2026-10-18): pre-alpha, under active development.** Synapse is a Rust library workspace with tests and qualification evidence. There is no deployed Synapse server yet; the API runs in-process. New steps from [ADR 0003](docs/adr/0003-ai-native-source-control-model.md) land most days (the most recent merges are listed under [pull requests](https://github.com/aien-dev/synapse/pulls?q=is%3Apr+is%3Amerged)). Pull requests are judged on the DGX Spark by AIEN's own pipeline ([docs/PIPELINE.md](docs/PIPELINE.md)). -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: +**Direction (2026-10-14):** Synapse is becoming source control for AI agents first, with Git kept as a small machine bridge ([ADR 0002](docs/adr/0002-synapse-first-git-as-bridge.md), tracked in [synapse#8](https://github.com/aien-dev/synapse/issues/8)). The original tracker is [aien-sovereign-core#515](https://github.com/aien-dev/aien-sovereign-core/issues/515). -1. **Git Compatibility**: Accepted changesets deterministically materialize into standard Git `blob`, `tree`, and `commit` objects compatible with `git fsck`, `git clone`, and `git fetch`. -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. -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//refs/rad/sigrefs` against the repository's delegate quorum threshold. +## Boundaries Synapse keeps -## Workspace Crates +1. **Git compatibility.** Accepted changes materialize into standard Git `blob`, `tree` and `commit` objects that `git fsck`, `git clone` and `git fetch` accept. +2. **Human review on GitHub.** Pull request projections (`GitHubPullRequestProjection`) publish short summaries and evidence digests. They never upload bulky machine logs or silently force-move a human branch. +3. **Radicle canonical authority.** WAL ingest order (`WalSeq`) and GitHub pull request state never grant authority to advance a canonical branch. Canonical promotion (`RadicleCanonicalHead`) requires verifying `refs/rad/id` and `refs/namespaces//refs/rad/sigrefs` against the repository's delegate quorum. -| Crate | Gate | Responsibility | -| :--- | :--- | :--- | -| [`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 | -| [`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, and crash fault injection | -| [`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 | -| [`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 | -| [`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 | -| [`synapse-radicle`](crates/synapse-radicle) | Gate 3 | Radicle `refs/rad/id` and `refs/rad/sigrefs` Ed25519 delegate threshold verifier and split-brain refusal engine | -| [`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 | +## Workspace crates -## Documentation and Evidence +| Crate | What it does | +| :--- | :--- | +| [`synapse-core`](crates/synapse-core) | Identity types (`ChangesetId`, `BlobDigest`, `GitOid`, `RadicleCanonicalHead`, `IdempotencyKey`, `WalSeq` and others), the changeset envelope, `did:key` Ed25519 verification, and the `RefusalCode` list | +| [`synapse-store`](crates/synapse-store) | Single-writer append-only WAL with CRC32C and a SHA-256 hash chain, durable group commit, a segment store for blobs (ADR 0003 step A2), checkpoints, garbage collection, and crash fault injection | +| [`synapse-auth`](crates/synapse-auth) | Ed25519 capability grants (`Read`, `Propose`, `Evaluate`, `Review`, `Publish`), attenuated capability chains (step F1), signed state moves, expiry and replay guards, quotas, and a hash-chained audit log | +| [`synapse-api`](crates/synapse-api) | Bounded, paginated read and proposal API, checkout-free tree inspection over shared Merkle trees (step C1), exact path-index invalidation, and durable watch cursors | +| [`synapse-git`](crates/synapse-git) | The Git bridge: native Git objects, packfiles, full-history read and export (step H1, cut 1 of 2), the `ChangesetId <-> GitOid` map, and the GitHub pull request projection | +| [`synapse-radicle`](crates/synapse-radicle) | Radicle `refs/rad/id` and `refs/rad/sigrefs` delegate threshold verifier and split-brain refusal | +| [`synapse-wire`](crates/synapse-wire) | Binary wire frames with a fuzzed decoder, have-want chunk negotiation, and stream transports (step G1) | +| [`synapse-crumb`](crates/synapse-crumb) | Strict, bounded reader for `.crumb` files and the `CrumbContext` digest over Synapse snapshots (ADR 0004) | +| [`synapse-coord`](crates/synapse-coord) | Shared agent coordination (claims, presence, whispers) on the same store as the Crumb tool, so a claim made through either is seen by both ([README](crates/synapse-coord/README.md)) | +| [`synapse-evidence`](crates/synapse-evidence) | Signed evidence receipts bound to a `ChangesetId` and the crumb context the runner saw (ADR 0004) | +| [`synapse-bench`](crates/synapse-bench) | Qualification harness, WAL, Git and Radicle conformance suites, transport measurement, and opt-in CPU counter diagnostics | -* [Domain Glossary (`CONTEXT.md`)](CONTEXT.md) -* [ADR 0001: Synapse Architecture, Owning Boundary, and Compatibility Invariants](docs/adr/0001-synapse-architecture-and-boundaries.md) -* [ADR 0002: Synapse-First Source Control for AI Agents, with Git as a Bridge](docs/adr/0002-synapse-first-git-as-bridge.md) -* [Gate 0 Reality Check Audit and Reproducible Baseline](docs/GATE0_REALITY_CHECK_AND_BASELINE.md) -* [Threat Model and Capability Permission Matrix](docs/THREAT_MODEL.md) -* [Changeset Schema, WAL Format, Consistency, and GC Specification](docs/SCHEMA_AND_CONSISTENCY.md) -* [Gate 0 Empirical Baseline Receipt (`evidence/gate0-baseline/`)](evidence/gate0-baseline/baseline_report.json) -* [Gate 4 Comparative Qualification Report](docs/GATE4_QUALIFICATION.md) -* [Gate 4 Qualification Evidence (`evidence/gate4-qualification/`)](evidence/gate4-qualification/report.json), reproduced with `scripts/run_gate4_qualification.sh` +## Build and test + +```sh +cargo test --locked --workspace +bash scripts/ci/portable.sh workspace # fmt, clippy -D warnings, tests (the SYNAPSE-WORKSPACE gate) +``` + +The Spark gates live in [`tests/gates/`](tests/gates). [docs/PIPELINE.md](docs/PIPELINE.md) explains how a pull request is tested and merged. + +## Documentation and evidence + +* [Domain glossary (`CONTEXT.md`)](CONTEXT.md) +* Decision records: [ADR 0001](docs/adr/0001-synapse-architecture-and-boundaries.md) (architecture and boundaries), [ADR 0002](docs/adr/0002-synapse-first-git-as-bridge.md) (Synapse first, Git as a bridge), [ADR 0003](docs/adr/0003-ai-native-source-control-model.md) (the source control model and its numbered steps), [ADR 0004](docs/adr/0004-crumb-synapse-integration.md) (Crumb and Synapse) +* [Threat model and capability matrix](docs/THREAT_MODEL.md) +* [Changeset schema, WAL format, consistency and garbage collection](docs/SCHEMA_AND_CONSISTENCY.md) +* One document per ADR 0003 step in [`docs/`](docs) (for example [A2 segment store](docs/A2_SEGMENT_STORE.md), [B4 revision states](docs/B4_REVISION_STATES.md), [H1 Git bridge](docs/H1_GIT_BRIDGE.md)), each with its receipts under [`evidence/`](evidence) +* [Gate 0 reality check and baseline](docs/GATE0_REALITY_CHECK_AND_BASELINE.md) with its [receipt](evidence/gate0-baseline/baseline_report.json) +* [Gate 4 qualification report](docs/GATE4_QUALIFICATION.md) with its [evidence](evidence/gate4-qualification/report.json), reproduced with `scripts/run_gate4_qualification.sh` ## License -Licensed under the GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later). +GNU Affero General Public License v3.0 or later (AGPL-3.0-or-later).