Files
aevolution/schemas/cellular-population.md
T
dingo a898a35e1b
Foundation / checks (ecs) (push) Successful in 2m26s
Foundation / checks (deploy) (push) Successful in 4m57s
Foundation / checks (network) (push) Successful in 20m53s
Foundation / checks (client) (push) Successful in 22m12s
Foundation / checks (tsan) (push) Successful in 39m45s
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 45m41s
Foundation / checks (checks) (push) Canceled after 45m43s
feat(lifecycle): preserve inherited plans in exact populations
2026-10-19 15:19:43 -04:00

101 lines
5.8 KiB
Markdown

# Exact cellular population envelope 1
Authority: ADR-0139/0140/0142. Little-endian integers, no padding. Size is bounded by
`max_cellular_population_bytes`. No changes to existing cellular owner envelopes.
| Offset | Bytes | Field |
|---:|---:|---|
| 0 | 8 | Magic `AEVOPOP1` |
| 8 | 4 | Version 1 |
| 12 | 4 | Automatic policy flag, exactly 0 or 1 |
| 16 | 4 | Materialization radius, micrometres, positive |
| 20 | 4 | Collapse radius, strictly larger, at most 1,000,000 micrometres |
| 24 | 8 | Conversion sequence |
| 32 | 8 | World |
| 40 | 8 | Region |
| 48 | 8 | Frame |
| 56 | 8 | Completed tick |
| 64 | 8 | Nested biological payload bytes |
| 72 | 8 | Cohort member count, at most 256 |
| 80 | 16 each | Sorted unique member life ID and exact genome ID |
| after members | declared length | Complete canonical rules-8 CellularLives snapshot |
| final | 8 | FNV-1a64 over all preceding bytes |
Require exact total length, matching trusted identity/tick, valid policy, canonical
nested restoration and complete byte-identical re-encoding. Every tagged member
must exist, have zero account, active presence and exactly the recorded genome.
The membership table contains no additional inventory. Untagged living cells are
individuals. New offspring may be individual until the next applicable group
conversion. No random seed or residual is missing: the representation is exact.
The checksum detects corruption, not malicious alteration. Production object
publication must also bind SHA-256, predecessor, current fence and immutable
manifest. Migration 44 admits this envelope as checkpoint profile 5, nested
cellular bundle 9 and history profile 5. It must never be labeled as the existing
raw cellular profile-4 payload. Entry wraps identical rules-8 biology with empty
membership and sequence zero; reverse entry unwraps the identical biology.
Conversion sequence is local to each profile-5 generation. The immutable region
commit sequence and transition evidence distinguish generations and never reset.
See [population batch format 1](cellular-population-batch.md).
## Portable envelope 2
ADR-0144 adds magic `AEVOPOP2`, version 2, with the identical header/member layout
and a nested [owner format 7](cellular-lives-v7.md), rules 8. Envelope 1 requires
owner format 6; magic, envelope version and nested tuple must agree. Explicit
no-tick upgrade retains every membership tag, conversion sequence and policy.
Paired population migration moves the exact existing tags with their cells,
retaining each region's policy and conversion sequence; it performs no collapse,
materialization or new automatic-policy evaluation. Untagged members stay untagged.
Envelope 2 is portable only in this segment. Existing durable trace 1 refuses it;
schema 45/profile 5 does not admit the new nested owner tuple. No live flag or
default entry enables migration or this new representation.
M12.4g/ADR-0146 subsequently admits envelope 2 as profile 5 with bundle 10 and
history 5 in schema 46. An explicit no-tick version upgrade retains membership,
policy and conversion sequence through the immutable version-upgrade journal.
Ordinary publication requires population batch 2; profile transitions preserve
bundle 10. No worker upgrades automatically and no paired migration is published.
ADR-0157 additionally permits **portable** envelope 2 to contain owner 7/rules 9.
The nested owner identifies the changed growth semantics; no membership, policy,
sequence or wire-layout change is needed. An explicit no-tick maturation candidate
preserves all tags and upgrades only the nested rules. Both representations use
the same funded-growth kernel. Envelope 1 remains rules 8. Durable bundle 10
remains rules 8 and does not admit this portable maturation upgrade.
ADR-0158/schema 53 subsequently admits nested rules 9 as bundle 11. Entry requires
the retained bundle-10 same-profile upgrade; ordinary intervals use batch 2 and
profile transitions preserve the exact tuple. See
[durable maturation](cellular-maturation-upgrade.md). Default entry is unchanged.
## Portable retained-plan envelope 3
[ADR-0171](../docs/adr/0171-retained-plan-exact-populations.md) adds `AEVOPOP3`,
version 3, with the same bounded header/member layout and a complete nested
[owner 8/rules 10](cellular-lives-v8.md). Exact nested plans and their revisions
remain per organism. Whole eligible groups are still tagged by expressed genome;
membership does not replace heterogeneous retained state or own inventory.
An explicit detached envelope-2/rules-9 inheritance candidate preserves policy,
conversion sequence and every membership tag. It invokes the exact nested
inheritance upgrade without advancing time. Direct portable wrapping of an
inherited raw owner is also possible. Old outer versions cannot label owner 8;
magic, version and nested owner/rules must agree and re-encode exactly. Earlier
envelopes retain their original bytes and meanings.
Population batch 3 uses `AEVOPBT3`, version 3 and nested raw trace 4; the existing
header, recorded tick intentions and exact representation-boundary layout are
unchanged. No-tick conversions carry no biological trace. Biological intervals
remain bounded by 64 ticks, require fully suspended controlled cells and retain
frozen-only controlled inputs, with no birth requests or mutation selections.
Wildlife executes the unchanged controller while recording and recorded inputs
while replaying. Paid births, development and inherited plans use the same kernel.
Old batch versions and raw trace 3 never replay an envelope-3 biological interval.
[Census projection 2](ecology/regional-cellular-census-v2.md) distinguishes
cohort/individual stock and plan references without changing biological totals.
No population checkpoint tuple mapping, SQL admission, profile transition,
cross-region transfer or production selector is added by this portable segment.