3.4 KiB
Biological destination staging
Authority: ADR-0148, SQL schema 48. This extends source preparation with destination-authorized read-only evidence. Biological/checkpoint/trace versions retain their meanings. There is no new active checkpoint profile or migration result receipt.
The caller supplies the exact retained migration trace, both predecessor manifests and current destination authority. The adapter verifies manifests and payload SHA-256/length, replays the complete pair, copies the source predecessor into the destination namespace and uploads/reads back the derived destination candidate. Its content address and byte length form the exact retry input with the canonical trace. Unpublished uploads remain retained orphans on failure.
SQL independently checks the retained preparation's exact trace, current destination lease, both exact heads and source pending pointer. Both regional lease rows are locked in increasing region order. Destination pending intervals, unpublished mutation choices, successful outstanding life reservations and any other local migration role block first staging. Moving the destination before staging refuses the request; no implicit rebase is performed.
Schema 48 retains immutable cellular_migration_stages, keyed by the preparation
request UUID, with ghost SHA-256, byte length and staging holder/epoch. One
cellular_migration_destination_pending pointer per region bounds active lookup.
The source/destination pending roles are exclusive. Existing indexed publication
and interval/player-reservation guards cover either role.
The source owns all outgoing organisms and material until a future paired commit. The staged candidate owns nothing. Neither region head changes. No tick, feeding, passive healing, movement, birth or death is performed by staging. In particular, a ghost cannot supply an owned census or terminal extinction count.
Destination recovery uses its own namespace's two predecessor capsules and ghost. It rederives the whole pair and compares the complete destination bytes, including membership, policy, biology and history. Missing or same-length corrupt objects fail strong binding; a valid object with false biology fails semantic replay. There is no fallback to the live source or an older head.
Both first staging and replacement pause host readiness/advancement. Unknown replies retain the exact trace/content address; reconciliation keeps the same request and polls paused work at most once per second. Normal stepping has no per-tick migration query. The existing fixed unlabelled migration-freeze metric covers either role; no request/organism labels are introduced.
Explicit current-source abort appends the existing immutable outcome and clears
both pointers in the same transaction. It serializes with staging on the source
lease row. If abort wins first, new staging is refused. If stage wins first,
abort releases both pauses. Exact retries of a retained stage after abort return
aborted and do not reopen either role. Neither expiry, drain nor timeout implies
abort. Keep staged objects/capsules and journals after abort; no GC is authorized.
Schema 49/ADR-0149 now adds atomic paired publication, its common receipt, exclusive commit/abort outcome and full recovery before host readiness. Linked ecology and independent network partitions remain separate gates. No automatic movement, route, atlas or deployment is enabled.