Files
aevolution/schemas/ecology/cellular-migration-freeze-v1.md
dingo d3a867a662
Foundation / checks (ecs) (push) Successful in 2m20s
Foundation / checks (deploy) (push) Successful in 4m7s
Foundation / checks (network) (push) Successful in 21m2s
Foundation / checks (client) (push) Successful in 22m21s
Foundation / checks (tsan) (push) Successful in 28m57s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (postgres) (push) Canceled after 38m8s
Foundation / checks (checks) (push) Canceled after 38m19s
feat(persistence): admit durable maturing wildlife migrations
2026-10-19 11:57:00 -04:00

4.3 KiB

Biological migration preparation and source freeze

Authority: ADR-0147, SQL schema 47. This retains preparation and explicit abort, not a migration result or destination activation receipt. Checkpoint profiles, rules 8, owner 7 and population batch 2 retain their existing bytes and meanings.

One source-authorized request binds canonical migration trace 1, both retained predecessor commits/manifests and their exact payloads. Both cuts use bundle 10, the same representation, world/frame/completed tick and compatible geometry/biology. ADR-0161/schema 54 additionally admits equal bundle-11 cuts with trace 2 (rules 9). Bundle 10/trace 1 retains rules 8; mixed tuples, cross-rule traces and unknown versions fail. Both paths use the same journals and source/head/eligibility guards. The source lease/head is fenced; the destination head is checked optimistically and remains free to advance. Later staging must check it again. Preparation does not establish a simultaneous world cut or a physical route.

The adapter restores both SHA-256-verified payloads and derives the complete biological pair before publication. It copies/verifies the destination cut into the source's immutable object namespace as a replay capsule. This copy owns no stock. The source keeps every organism, reserve, body, nursery/habitat compartment, heat and historical fact at its unchanged committed head. The destination also keeps its existing head. Proposed transferred material in the trace is metadata, not an additional account or an applied boundary flow.

SQL retains:

  • Immutable cellular_migration_preparations, keyed by globally unique request UUID: source/destination region and predecessor commit references, canonical trace (272..2,312 bytes), preparing holder and epoch.
  • Immutable cellular_migration_aborts, keyed by request, with the deciding current source holder/epoch.
  • One operational cellular_migration_pending pointer per source region.

Preparation refuses an active source workflow, pending ecological interval, unpublished player choice or outstanding successful life reservation. C++ also requires fully suspended controlled cells and an eligible whole wildlife group. SQL independently validates trace identity/length/member bounds, exact FNV-1a64, both committed manifest bindings and the declared representation/tuple. Checksum/UUID metadata alone does not qualify the biology: recovery restores both cuts from the source namespace and rederives every recorded member/channel.

While pending, indexed trigger guards refuse new region commits, interval admissions, mutation reservations and life reservations at that source. Historical exact operation retries keep their old meanings. The whole region is paused; there is no per-member advancement or passive healing. The host withholds readiness during preparation uncertainty and a recovered freeze, renews authority, and polls paused work at most once per second. Normal unpaused stepping adds no per-tick migration query. evo_region_migration_frozen is a fixed, unlabelled 0/1 gauge for a known durable freeze; it does not grant authority.

Explicit source-authorized abort appends its outcome and removes the pending pointer atomically, without changing either biological head. Exact preparation and abort retries return the recorded outcome. An aborted preparation cannot reopen its pointer. Process death, lease expiry, drain, missing evidence and timeout never imply abort. Missing/corrupt capsules fail closed, without falling back to the destination's live state. A new source holder may explicitly abort; destination authority is unnecessary because no ownership has moved.

Keep both predecessor histories and source-side capsule objects, including after abort. The current backup copies all immutable namespace objects and the shared database snapshot; no GC or pruning is authorized. This does not qualify cellular history cloning/restore beyond the existing supported fixtures.

Schema 48/ADR-0148 now adds destination staging and atomic release of both pending pointers on source abort. Atomic two-head publication, commit/abort races and activation remain subsequent work. This segment adds no automatic migration, atlas, cross-edge movement, environmental coupling or census/extinction rule.