3.2 KiB
Consistent scoped cellular census snapshot v1
Semantic backend read contract under
ADR-0153, not a
persistent/wire codec. Linux API: persistence::load_cellular_census_snapshot.
Input names one nonzero world and 1..64 requests with strictly ascending nonzero region IDs. Each request retains a non-owning object-store pointer and a grant for the existing historical recovery checks. Stores must remain alive throughout the call. The connected PostgreSQL session must be idle; all caller transactions, including read-only transactions and pending publications, are refused unchanged. The timeout for each PostgreSQL query is 1..30000 ms; local object reads retain their existing blocking semantics. No automatic retry or whole-query SLO.
- Begin an owned
REPEATABLE READ READ ONLYtransaction and read every requested current committed head plus exact manifest. The first read establishes the snapshot; later head reads use the same database view. Retain request order. - Commit the metadata transaction before any object restoration/replay. Metadata errors roll back. Failure to begin/finish/clean up safely closes a non-idle connection; an exception during capture also disconnects it. Results from a failed capture never escape as a partial census.
- On the now-idle session, recover each exact selected cut through the committed history reader. Validate full manifest binding, retained builds, strong object digests, complete payload/trace/transition/paired replay and existing fenced evidence. The returned head and manifest must equal their captured values.
- Build the scoped census set, requiring all captured states to agree on frame, completed tick, owner format, rules and quantum, with consistent complete shared-genome records and disjoint resident organism identities. Different current ticks fail; no catch-up or earlier common-tick selection is inferred.
- Return exact captured head/manifest pairs and the detached scoped census only after all regions pass. Any later failure discards the entire result. There is no fallback, skipped region or missing-as-zero behavior.
When both endpoints are declared, one atomic migration committed between head reads appears at neither endpoint of that captured cut; a later capture sees both new heads. More generally each atomic pair is visible at both endpoints or neither in the selected database snapshot. Replay remains pinned to those exact immutable cuts even if the current heads advance before replay begins. Frozen source stock remains owned; staged ghosts and uncommitted uploads are excluded. Existing per-call lease locks still apply during recovery outside the metadata transaction. No long read transaction is held over payload I/O.
Returned references are historical evidence, not current lease/activation proof. The region list remains caller-declared and need not include outside migration endpoints or all world owners. This supplies neither a durable world catalog nor external branch/rewind identity, reserve viability reconciliation, freshness or complete global watermark. No world absence/terminal-extinction acceptance, account advantage, new client permissions or public endpoint is provided.