feat(lifecycle): retain inherited offspring plans separately from bodies
Foundation / checks (ecs) (push) Successful in 2m26s
Foundation / checks (deploy) (push) Successful in 4m6s
Foundation / postgres-tools (push) Canceled after 0s
Foundation / server-image (push) Canceled after 0s
Foundation / image (push) Canceled after 0s
Foundation / checks (client) (push) Canceled after 9m29s
Foundation / checks (tsan) (push) Canceled after 7m4s
Foundation / checks (network) (push) Canceled after 9m28s
Foundation / checks (postgres) (push) Canceled after 9m28s
Foundation / checks (checks) (push) Canceled after 9m34s

This commit is contained in:
dingo
2026-10-19 13:55:29 -04:00
parent 5d8aa4d2e3
commit 2c3a3c65a6
16 changed files with 887 additions and 71 deletions
@@ -0,0 +1,83 @@
# ADR-0165: Retained cellular offspring plans
## Status and scope
Accepted for the portable stored-plan segment of ADR-0163/0164, 2026-10-19.
No default/DEV upgrade, SQL admission, player succession or NPC behavior policy.
This is an explicit offspring-plan editing mode, not a final classification of
which future mutation operators may also be expressed during an existing life.
## Decision
Add cellular owner format 8/rules 10 through a detached no-tick upgrade from
format 7/rules 9. Preserve all biology, inventories, identities, offers, boundary
flows and archive history. Initialize each living/corpse offspring plan to its
currently expressed genome. Older formats retain zero in the new in-memory
fields and omit them from their unchanged canonical bytes.
`identity.genome` and archive `current_genome` keep their expressed-body meaning.
The separate `offspring_genome` names the inherited developmental plan. Every
newborn starts with both references naming the actual inherited plan. Existing
body derivation, maintenance, movement, feeding, growth, damage, predation and
spatial exclusion always use the expressed genome. Corpses retain the last
offspring plan as history, with no reproductive viability granted to dead tissue.
In this opt-in editing mode, the existing earned mutation choice edits the
offspring plan. Draw from the current plan using the existing recorded context
and eligibility credit. Revalidate selections exactly; admit the successor genome
without adding an expressed-genome revision or constructing parent tissue.
Consume the offer once. Record `(life,previous_plan,successor_plan,tick)` in an
append-only log, bounded by the existing genome archive capacity. Operator zero
still declines. NPCs still earn no mutation offers. No extra mutation fee is
invented: physical construction is funded when an actual offspring is made.
The live-expression path for nonstructural traits requires a later operator
catalog/transaction contract; this mode supplies only offspring-plan selections.
Use ADR-0164 mixed-genome funding for buds and their exact twin eligibility.
Retain existing phase order: surviving-parent plan selection precedes budding;
newborns do not grow or bud in their birth tick. Thus a selected plan can affect
that tick's offspring while the parent's expressed body remains unchanged. The
child's birth archive record names its actual inherited genome. Later selections
affect later offspring only. Wildlife reproduction uses the actual plan cost.
## State and restore invariants
Format 8 extends the format-7 header by a u32 plan-history count and zero u32
reserved field (316 bytes total). Each living/corpse row appends one u64 plan
reference (512/132 bytes). After habitat, archive and nonresident IDs, append
32-byte history rows in increasing `(tick,life)` order, then the existing FNV
trailer. Preserve the 16 MiB owner bound and existing archive limits. The magic is
`AEVCLV08`; only rules 10 uses this format. No native-layout serialization.
Validate counts/size before allocation, all plan references, compatible schema/
development versions, and each complete per-life chain from its expressed genome.
History successors have one genome parent matching the recorded previous plan
and their recorded origin matches the selected successor identity. Require unique
successors, live-at-selection timing, retained actor identity, and final references
matching the log. Selections must follow any legacy expressed-body revision used
as their initial plan. Regenerate outstanding offers from the retained current plan.
Missing, conflicting, forged, over-bound or noncanonical state refuses atomically.
## Alternatives, benefits, costs and risks
Overwriting the parent's expressed genome would rebuild it and misprice its body.
Treating an unexpressed plan as an archive living carrier invents an organism.
Keeping only a final reference loses which parent selected earlier sibling plans.
The distinct reference/log preserves body and ancestry meanings at bounded cost.
A plan without expressed carriers may still be reproductively available in a
living parent. Existing census, migration, population and persistence allowlists
must refuse this new owner until they have complete plan/viability semantics and
versioned replay; absence of expressed carriers cannot prove its extinction.
No old snapshot or golden is rewritten. This portable checkpoint is not durable
publication authority, and no existing SQL bundle admits it.
## Qualification
Require real earned plan selections, unchanged parent anatomy/biological charges,
different funded sibling plans, later choices leaving earlier children unchanged,
exact save/restore and separate-process continuation, death/history retention,
offline exclusion, all-channel closure, unsupported old paths and forged codecs.
Run Release/NDEBUG, analysis, formatting and relevant ASan/UBSan checks. Retained
plans do not implement the birth-time control choice, persistent NPC behavior,
new limb/plant traits, UI, environmental producers or M12 completion.
+2
View File
@@ -1,5 +1,7 @@
# Architecture decision records
- [ADR-0165: Retained cellular offspring plans](0165-retained-cellular-offspring-plans.md) - portable owner format 8/rules 10 keeps expressed bodies separate from earned inherited plans, repeated births and selection history; durable/control/UI integration pending.
- [ADR-0164: Distinct-genome offspring funding](0164-distinct-genome-offspring-funding.md) - pure funded reproduction separates the expressed parent's investment from the inherited child's anatomy and provision; old same-genome behavior retained, owner/control integration pending.
- [ADR-0163: Structural inheritance and one-way offspring succession](0163-structural-inheritance-and-offspring-succession.md) - maintainer-accepted target gameplay: offspring structural traits, irreversible birth-time control choice and NPC-parent behavior/reproductive continuity; implementation pending.