Expand description
The sqlite registry twin — the family adapter pattern’s default
engine assembly (ADR-019 §3, substrate.md §registry: “one trait
pair, two implements — the sqlite adapter (sqlite feature,
alkstore-sqlite + the co-tenant rusqlite connection)”).
SqliteRegistry— the durable write side (RegistryWrite) over the co-tenantgit_reposrows. Every mutation bumps the durableregistry_seqsingleton inside the row-write transaction (transactionally exact — the watermark’s anchor, ADR-019 §5; failed mutations consume none, the tx rolls back whole), and the twins’ row commits also carry the refs-table legs the composition owes: put_repo seedsHEAD → refs/heads/main(substrate.md §refs — git parity:git init --barecreates the dangling HEAD at init, not at first push; git’s push grammar carries no HEAD. The dangling symref is exactly the unborn-HEAD shapels-refs=unbornserves — the OQ-19 rider (a) fixture — and is CAS-unreachable from a push per git parity; the row is CAS-rewriteable, so the v1-pinned target is a two-way door, the constructor knob additive later) and remove_repo removes the registry row, the repo’s ref rows, and the repo’s mutation-marker rows together (backend.md — deletion is a GC consequence; objects stay for the sweep, no synchronous object deletion exists — the removal only touches co-tenant rows). PlusSqliteRegistry::record_mutation— the per-push mutation-marker write (ADR-019 §7, composition-internal: bumps the seq/watermark legs without touching the record; the receive-pack composition is the consumer).SqliteRegistryAssembly— the adapter constructor: one fallible assembly call (loud failure — ADR-024 §1) that opens the co-tenant connection (CoTenantSqlite::open— WAL, the pinnedbusy_timeout5000 ms, the migrations run at construction) beside the engine on one file, opens thealkstore-sqliteengine, loads the cached read provider’s initial snapshot, wires the reactive halves (Reactor) plus the announced write side (AnnouncingRegistry) and the refs twin, and hands back the pieces. The wave-8 single composition entry unifies construction; this is the per-piece constructor (the recorded interpretation). Post-commit announce (publish + notify + enqueue — each independent, fail-soft) is wired by default: mutations rideAnnouncingRegistry, never a non-reactive shipped path (ADR-019 §5).
§The sqlite asymmetry carried (substrate.md §the reactive halves)
The co-tenant file is itself the invalidation bus: the watcher’s
file-wide data_version bump fans a wake to listeners on any
commit to the file — including alkgit’s own registry writes on
their own connection, including cross-process (~3.2 ms measured,
POC-R; the probe is test-pinned here). A lost hint cannot exist
while any write lands; the reconcile sweep is the correctness
backstop, not a latency bound. The post-commit notify leg stays
redundant but kept — for semantics and for postgres.
Concurrency model: rusqlite is blocking — the trait methods bridge
their SQL off the async executor (spawn_blocking) under the
co-tenant handle’s short-held lock, exactly the refs twin’s shape;
the pinned busy timeout absorbs the cross-process write-lock waits.
Re-exports§
pub use crate::registry::HEAD_SEED_TARGET;
Structs§
- Sqlite
Registry - The durable write side of the family pair over the co-tenant
git_reposrows (the pair’s sqlite implement). Reads ride the cached provider in the composed assemblies — the hot path never touches this side except the refresh reads. - Sqlite
Registry Assembly - The sqlite twin assembly — the pieces one adapter constructor wires
over the default engine assembly (single-host shape, substrate.md
§assembly:
alkstore-sqlite+ the co-tenant twin on one file):