Expand description
The registry: the co-tenant tables behind the family adapter pattern (ADR-019 §3–4, substrate.md §registry, POC-R’s validated shape) — the engine-generic half of the family.
One trait pair, two implements per surface:
RegistryRead— the sync read side (resolve): the advertisement path’s hot read. Noasync, no I/O — implementors serve in-memory state. A miss is definitive: implementations promise the whole record table as their cached set, soresolvenever falls through to backing-store I/O. The unknown-repo ≡ unauthorized rule (ADR-008) is evaluated at resolve’s caller — this trait returnsNoneand leaks no more than that.RegistryWrite— the async write side:RegistryWrite::put/RegistryWrite::update/RegistryWrite::removeplus the reconcile machinery’sRegistryWrite::watermark/RegistryWrite::rows_since. Every mutation assigns the mutation’s monotone sequence number inside the row-write transaction (transactionally exact — the watermark’s anchor, ADR-019 §5) and returns it; write-side announce (publish/notify/ enqueue) is the reactor’s post-commit business, never the pair’s.
The complete in-memory implementations:
InMemoryRegistry— the in-memory default adapter, the batteries-included degenerate case: always-populated, always-correct, single-process, stamp-free (ADR-024 §6), no engine dependency; the completeness shape in the crate’s base (no feature gates — the ADR-025 placement rule).CachedRegistryProvider— the coherence contract’s read side (ADR-019 §4, POC-R’s named deliverable): the whole record table as one immutable snapshot swapped under a short lock; the hot path is one lock read +Arcclone + lookup with zero I/O; invalidation is write-through on the store’s own writes plus wake-driven/tick-driven whole-table refreshes (the delivery wiring is the reactor module’s); refresh failures leave the previous snapshot serving.RegistryBackend— the binding of the pair onto the core’s published registry traits (GitRegistry/GitRegistryStore): resolve over the read side (a miss on the whole-table snapshot is a definitive unresolved id —RegistryError::NotFound; the unknown ≡ unauthorized collapse stays at resolve’s wire-layer caller),put_repo/update_repo/remove_repoover the write side with write-through on the optional provider. The in-memory adapter is the first complete impl (bound viaRegistryBackend::with_cached_provideroverInMemoryRegistry— the mem pair is test-only now, review 006 R-4; the production mem composition is the entry’s mem shape); the engine twins implement the same pair so the same wrapper binds over them.
The exact Rust names pinned here are the OQ-03 substrate-side
inventory for this wave’s members: RegistryRead, RegistryWrite,
RegistryRow, InMemoryRegistry, CachedRegistryProvider,
RegistryBackend.
Structs§
- Cached
Registry Provider - The coherence contract as a type (ADR-019 §4, POC-R’s named deliverable; substrate.md §the coherence contract) — the cached read provider the advertisement path rides:
- InMemory
Registry - The in-memory default adapter — the batteries-included degenerate case of the family: always-populated, always-correct, single-process; the completeness shape in the crate’s base (no engine dependency, stamp-free per ADR-024 §6 — it builds fresh every construction).
- Registry
Backend - The registry backend — the pair bound onto the core’s published
registry traits (
GitRegistry/GitRegistryStore); the first complete impl is the in-memory binding (test-only now — review 006 R-4, the bare mem pair is not a production surface; the production mem composition is the entry’s mem shape) and the engine twins bind through the same type. - Registry
Row - One durable registry row — the record plus its mutation sequence number.
Constants§
- HEAD_
SEED_ TARGET - The v1 HEAD seed target — the unborn symref row both engine twins’ record-write transactions insert (substrate.md §refs pins the value; a constructor knob is additive later, two-way — the row is CAS-rewriteable).
Traits§
- Registry
Read - The sync read side of the family adapter pair — the advertisement
path’s hot read (the alkcall
OwnershipProviderposture, POC-R’s validated shape). - Registry
Write - The async write side of the family adapter pair (the alkcall
OwnershipStoreposture).