Files
aevolution/schemas/lineage-archive-v2.md
T
dingo a479ce2d95
Foundation / checks (deploy) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 1m59s
Foundation / checks (checks) (push) Failing after 2m10s
Foundation / checks (postgres) (push) Failing after 10m34s
Foundation / checks (network) (push) Failing after 12m19s
Foundation / checks (tsan) (push) Failing after 2m14s
Foundation / checks (client) (push) Successful in 15m7s
Foundation / postgres-tools (push) Skipped
Foundation / server-image (push) Skipped
Foundation / image (push) Skipped
Add cellular genome revision profile migration
2026-10-11 06:13:17 -04:00

37 lines
1.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# Lineage archive v2 (M11.4c)
Authority: ADR-0122. The encoder and decoder are
`LineageArchive::encode/decode` in `src/biology/lineage.cpp`. All integers are
little-endian; no native struct serialization is used. V1 bytes and decoding
remain unchanged. V2 is used by cellular-v3 checkpoints.
| Offset | Size | Field |
|---|---|---|
| 0 | 8 | magic `AEVOLAR1` |
| 8 | 4 | archive format = 2 |
| 12 | 4 | highest genome schema present |
| 16 | 4 | genome count G (≤ 4096) |
| 20 | 4 | birth-record organism count O (≤ 65536) |
| 24 | 4 | genome-revision count R (≤ 4096) |
| 28 | 4 | reserved = 0 |
| 32 | 8 | total bytes, including checksum |
| 40 | … | G × (u16 length 1..256, canonical genome record), ordered by (ancestry depth, genome id) |
| … | 33·O | birth records ordered by organism id: organism, birth genome, born tick, died tick, alive flag |
| … | 40·R | revisions ordered by (effective tick, organism): organism, previous genome, successor genome, origin event, effective tick (all u64) |
| end−8 | 8 | FNV-1a64 of all preceding bytes |
The maximum size is 3,383,344 bytes. Counts and total size are checked before
allocation. A revision's successor is already in the genome table, has exactly
the previous genome as its parent, and carries the same nonzero value as its
genome ID and origin event. The organism must be alive at that tick, the tick
must be after birth and before death, and at most one revision per organism per
tick is permitted. Revisions form a continuous chain from the immutable birth
genome. `OrganismRecord.genome` always remains the birth genome; the current
genome is resolved by replaying the revisions.
Format 2 is append-only. Decoding admits genomes and birth/death records, then
replays revisions against the organism's current genome. The result must
re-encode to identical bytes. A format-2 archive with no revisions is used by
the explicit cellular-v2-to-v3 migration. Other profiles retain their v1
payload caps and bytes.