Crates
Gin is a Cargo workspace. The product crates are listed below, roughly from the core outwards. All are licensed MIT OR Apache-2.0. Workspace lints forbid unsafe code; the SQLite FFI boundary is isolated in gin-sqlite.
Product crates
| Crate | Role |
|---|---|
gin-core | The source-state engine library: typed identities and canonical encodings, trees, checkpoints, change sets, the pack store, evidence envelopes, annotations and retention. |
gin-compose | Deterministic multi-parent composition: composing effective trees from a DAG of immutable change sets, previews, advance and conflict decisions. |
gin-compose-model | A slow, executable reference model of composition. The optimised engine is checked against it with differential tests. |
gin-workspace | The worker side: private journals, savepoints, local checkpoints, publication to the shared plane, lazy parent-update candidates, pinned execution snapshots and the headless source operations. Also the embedded coordinator API (agent::v1). |
gin-meta | The control-plane metadata store in embedded SQLite: channels, publications, leases, fencing, the publish transaction, evidence acknowledgements and the event outbox. |
gin-cas | The packed content-addressed object service of gin serve: verified uploads, batched fetch and staged publication. |
gin-api | The versioned library and protobuf contract (gin.v1). Changes within a major version are additive only. |
gin-server | The one core behind embedded mode and the daemon: tonic gRPC, Unix-socket local IPC with peer credentials, and the embedded entry point. |
gin-auth | Machine-identity tokens, per-operation authorisation, the snapshot-scoped content read API and the scoped workspace inventory. |
gin-evidence | Evidence ingestion: idempotent execution receipts, verified CI-run uploads, baseline classification of failing tests, hermetic clearance and strict reuse decisions. |
gin-git | The Git adapter, and the only crate that reads Git: the import endpoint, history on request, SHA mappings, checkpoint export and push blocking. |
gin-checkout | Stable native source checkouts and content-detected source times. Runs no commands and never removes a caller's build outputs. |
gin-view | Source materialisation and the gin.view/1 view lifecycle over public gin.v1 calls, without a build system. |
gin-cli | The gin command line over the core API: request builders, the compact JSON renderer and client sessions. |
gin-mcp | The compact MCP adapter on stdio, reusing gin-cli's builders, renderer and session. |
gin-observability | Optional OpenTelemetry export. Disabled by default: no collector, threads or network I/O unless the embedding application enables it. |
gin-sqlite | An isolated SQLite checksum VFS FFI boundary used by the stores. |
gin | The binary: gin serve, gin mcp, gin view, gin ci upload, gin retention, gin verify and the headless commands. |
How they fit together
| Layer | Crates |
|---|---|
| Contract | gin-api (depends on no other Gin crate) |
| Engine | gin-core, gin-compose |
| Stores and services | gin-meta, gin-cas, gin-server, gin-auth, gin-evidence, gin-git |
| Worker | gin-workspace (composition, stores, authorisation and evidence for one worker) |
| Adapters | gin-cli, gin-mcp (built on gin-cli), gin-view (built on gin-api and gin-checkout) |
| Binary | gin |
Every adapter (CLI, MCP, gRPC, local IPC, embedded) ends in the same core call, so validation, envelopes, batch semantics and behaviour are identical however a caller arrives.
Not product code
The repository also contains discovery prototypes under proto/ and tools under tools/. They are workspace members so that CI builds and tests them, but they are not product code or production dependencies.