Files
aevolution/docs/engineering/M12_EXACT_BIOLOGICAL_TRANSFER.md
T
dingo 0515702964
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 2m25s
Foundation / checks (network) (push) Successful in 20m44s
Foundation / checks (client) (push) Successful in 21m57s
Foundation / checks (tsan) (push) Successful in 22m46s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (checks) (push) Canceled after 30m2s
Foundation / checks (postgres) (push) Canceled after 29m56s
M12.4: retain read-only destination migration stages
2026-10-18 09:32:50 -04:00

10 KiB
Raw Blame History

M12.4c exact biological transfer candidates

ADR-0144 resolves the closed-owner/accounting conflict before implementing biological ownership transfer. The portable lifecycle layer now prepares a detached source/destination pair at an exact compatible cut. This segment adds owner format 7 and population envelope 2, without a live migration flag, database schema, durable manifest bundle, dependency or deployment.

The pair transfers actual zero-account wildlife, including every member of the selected genome group. Opening stocks remain immutable; explicit cumulative incoming/outgoing flows explain each owner's current stock. Bodies, reserves, age, growth/damage, ancestry, identity, coordinates and cohort tags are exact. Departures retain nonresident archive facts instead of recording death. Complete genome ancestry and organism revisions merge without erasing destination history, rewinding revisions or resurrecting dead organisms. Archive known-alive counts include nonresidents and must never be used as an owned census/extinction proof.

The primitive refuses incompatible cuts/worlds/frames/geometry, vulnerable controlled cells, identity conflicts, missing groups, placement conflicts, capacity exhaustion, archive conflicts and counter overflow. Both detached candidates must validate before success; failures leave the two originals exact. Local offspring use the destination's identity namespace, with sorted insertion even below imported IDs. Existing regional twin randomness retains its meaning; the migration cut does not promise identical future environments or outcomes.

The tests use real funded founders and real budding, not fabricated wildlife or the non-biological probe. They exercise repeated no-tick return trips, exact per-member equality and per-channel combined closure, canonical restore, imported death/decay, lower-namespace local reproduction among imported residents, whole-group capacity refusal, body conflicts, malformed/truncated ledgers, overflowing cumulative counters and cohort tag/policy/sequence preservation. Lineage tests include revision conflicts and a maximum-depth 4,096-genome ancestry using an iterative traversal.

The first reproduction fixture exposed an existing rules-8 limitation: a bud is created below full realization, growth is retained, and fund_bud requires full realization. Additional food does not mature that bud under the current kernel. This transfer segment does not invent growth or alter reproduction rules. Its ordering regression uses a real fully grown local founder reproducing alongside imported higher-namespace residents. Self-sustaining wildlife generations still need an explicit versioned maturation contract and ecological qualification.

This is not the durable escrow gate. No prepared candidate may become an active destination owner before a future fenced transaction commits both heads and immutable transfer evidence. The source remains the sole owner until that commit; a staged ghost owns nothing. Durable preparation/freeze, two-owner fencing, ambiguous outcomes, abort/restart, partition/duplicate delivery, process kills and stock-in-transit audits remain required. Existing profile-4/5 publishers do not admit this new owner tuple, and retained trace 1 explicitly refuses envelope 2.

Numeric coordinates are region/frame-local and current movement is clamped, without wrap. No atlas, route, edge crossing, cross-region contact or linked habitat field is inferred. Those need separately versioned contracts and fidelity tests. M12.4 as a whole remains open, as do dependent M12.5–M12.9 gates.

Executed qualification is recorded in VALIDATION.

M12.4d recorded paired replay

Migration trace 1 retains a bounded canonical request/cut/member/flow record for both individual and cohort owners. The portable replay API takes the separately trusted request and both predecessor states, verifies all bindings and derives the exact pair again. A new process restores both representations and reproduces all four source/destination output snapshots byte-for-byte. Corruption, malformed bounds, semantic member/material tampering, wrong predecessor/result IDs and representation confusion are refused.

This record provides reproducible evidence for the future paired publisher. It has no freeze, fence, durable retry outcome or activation rights. Independently establishing manifest/payload SHA-256 bindings and journal authority remains an I/O obligation; neither a checksum nor a UUID grants ownership. The durable escrow and linked-geometry limits above remain unchanged.

M12.4e portable population continuation

Population batch 2 records ordinary biological intervals and whole-group no-tick conversions for envelope 2/owner 7. Batch 1 retains its old meaning and bytes; cross-version replay and mismatched magic/version are refused. Continued biology retains boundary flows/nonresident history while conserving actual current stock. The restart fixture now also records and independently replays a 64-tick interval after cohort transfer, comparing the complete continued destination snapshot.

This closes the portable continuation format boundary needed by a future durable adapter. It does not add a durable bundle or SQL admission: both the current C++ prepared validator and SQL checker continue to admit only population batch 1.

M12.4f portable checkpoint upgrade boundary

ADR-0145 declares bundle 10 for owner 7 and supplies an explicit bundle-9 no-tick upgrade candidate for both existing profiles. The manifest advances its commit sequence and retains the exact source digest while preserving profile, history and biological tick. Complete payload restoration/upgrade retains biology, opening stock and cohort policy/membership/sequence. There is no bundle-10 genesis or repeated upgrade. Ordinary continuation and profile changes preserve the tuple; new/old payload confusion is refused in both directions. Portable reader support does not imply database admission: schema 45 and the population prepared validator still reject the tuple. Dedicated upgrade publication/evidence/recovery is the next segment; paired escrow, geometry and remaining biological gates stay open.

M12.4g durable accounting upgrade admission

ADR-0146/schema 46 extends the existing immutable version-upgrade journal to an explicit same-profile bundle-9 to 10 publication. Both profiles retain complete source/result manifests, payload digests and exact version tuples under the current lease and head fence. An unsettled population interval blocks a new upgrade. The adapter restores the verified source, derives the exact candidate, uploads/reads back its object and retains the same prepared bytes after ambiguity. No worker upgrades automatically.

Recovery selects the recorded no-tick operation: a version upgrade is rederived from its full retained source; a representation change uses its separate journal. Both require full byte equality. Matching aggregate inventory cannot admit a different cohort policy or membership. Bundle 10 requires envelope/batch 2; bundle 9 retains envelope/batch 1. Raw biological trace 3 and rules 8 are unchanged. Representation changes preserve either tuple and interval/player-operation guards remain in place.

This admits the accounting format and its ordinary continuation. Paired migration trace 1 still has no SQL publisher, source freeze, staged ghost or activation rights. Durable two-head escrow, abort/partition/duplicate settlement, linked geometry and ecology remain open. No deployment, live upgrade or golden changed.

M12.4h durable source preparation and abort

ADR-0147/schema 47 retains canonical paired preparation under the source's current lease and exact head. A verified destination predecessor capsule in the source namespace supports complete recovery replay. The source keeps all stock at its unchanged head; the destination is neither staged nor activated. New source checkpoints/profile changes and interval/player reservations are refused while pending. A replacement owner recovers the same freeze, without a timeout-based release. Explicit current-source abort appends its immutable outcome and removes the pending pointer with both biological heads unchanged. Retrying an aborted preparation never reopens it.

The owning host withholds readiness and advancement while frozen or uncertain, retains exact requests, renews authority and polls paused work once per second. A fixed migration-freeze gauge identifies known pauses. Missing/corrupt capsules and canonically encoded false member/material declarations fail complete replay. See the contract. Destination staging, atomic paired head publication, commit/abort races and activation remain the next segment; no route or automatic migration is enabled.

M12.4i durable read-only destination staging

ADR-0148/schema 48 freezes the destination at its exact captured head under current destination authority and ordered endpoint locks. The adapter restores both cuts, replays the retained trace, copies the source capsule into the destination namespace and uploads/reads back the derived destination ghost. Its exact digest/length is immutable retry evidence, not an ownership receipt. Recovery uses those local objects and compares the complete rederived ghost. Neither biological head moves, and the source still owns all outgoing stock.

Both local migration roles are exclusive and block new publication, profile changes, intervals and player reservations. Unknown staging retains exact bytes; the owning destination pauses readiness/advancement through worker replacement. Source abort serializes with staging and releases both pointers atomically. Aborted-stage retries return their old outcome and never reopen a pause. Missing/corrupt evidence and real but semantically false objects fail closed. See the staging contract.

Atomic paired publication/common receipt, commit/abort races, recovery/activation and linked ecology remain subsequent work. The ghost cannot run biology or contribute owned census/extinction stock. No biological format, rule, route, automatic movement, live region or deployment changes.