Keep every lineage, and never call absence extinction

M3.5 retains the genomes M3.4 produces and the organisms that carried
them. The named risk is deleting extinct genomes, so the answer is
structural: LineageArchive has no removal operation at all, not a guarded
one and not a private one. Retention is a property of the interface
rather than a rule someone has to remember, which is the only form of
"keep extinct genomes indefinitely" that a later change cannot quietly
undo. Four concepts assert that, with a positive control so the check is
known to be live rather than vacuous.

Admission requires the parent to be present, so ancestry never dangles
and the parent graph is acyclic by construction: a cycle would need one
of its members admitted before itself. A duplicate identity is refused
rather than overwritten, because overwriting is deletion renamed.

Organism identity and genome identity stay separate. A death is terminal
for the organism and touches nothing about the genome it carried;
ancestry, descendants and divergence all resolve afterwards.

The quieter risk is calling something extinct that is merely unobserved.
The archive reports living or absent and has no third answer: terminal
extinction is a policy judgement over a reconciled watermark covering
suspended members, eggs, spores and in-flight transfers, none of which
this type can see, so the word does not appear in the API. Absence is
also reversible, and a test shows a lineage regaining a carrier.

Capacity is bounded and admission fails loudly at the limit, since
refusing to record is not deleting but a silent drop would be.

The roadmap lists an NPC-mutation decision as a dependency, and
OPEN_QUESTIONS leaves it open until M12. It stays open: the archive
records an origin event and never an actor, so whether an NPC may
diverge changes nothing here.

Two clang-tidy findings were fixed rather than suppressed. std::map
members made the archive's move potentially throwing, because MSVC's map
move constructor allocates; sorted vectors replaced them. A wrapper
struct holding a Genome by value had the same problem, since ADR-0030
made Genome copy-only, so genomes are stored directly under their own
id(). The redundant carrier tally went with it: carriers are counted from
the organism records, so no second tally can drift.

Native Release, clang-tidy analysis, ASan and format checks pass 21/21.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-09-23 16:55:36 -04:00
co-authored by Claude Opus 5
parent badd28fe9b
commit 8020347f9b
11 changed files with 696 additions and 7 deletions
+99
View File
@@ -0,0 +1,99 @@
# ADR-0034: Permanent lineage archive and provisional absence
## Status
Adopted for M3.5. It does not settle NPC mutation, which the roadmap lists as a
dependency and OPEN_QUESTIONS leaves open until M12: the archive records an origin
event and never an actor, so whether an NPC may diverge changes nothing here.
Durable storage, retention tiers and cross-version migration remain M7 and M8.
## Context
M3.4 can produce a successor genome, but nothing keeps it. Three documents agree
on what keeping must mean. GENOME_MODEL: keep extinct genomes and ancestry
indefinitely. REPRODUCTION_MODEL: death is terminal for the organism ID, and
genome, ancestry, origin and extinction evidence are preserved permanently.
ECOLOGY_MODEL is the sharpest: distinguish no active observation from ecological
absence from terminal extinction, require a globally reconciled watermark before
claiming the last, and never let a density rounded to zero declare irreversible
extinction.
The named risk is deleting extinct genomes. The quieter one is calling something
extinct that is merely unobserved.
## Decision
Add `LineageArchive`, which retains genomes and the organisms that carried them.
It has no removal operation at all. Not a guarded one, not a private one: the
type offers no way to forget, so no caller and no later change can delete a record
by choosing to. Retention is a property of the interface rather than a rule
someone has to remember.
A genome is admitted only if its parent is already present, so ancestry is always
walkable and no link dangles. That ordering also makes the parent graph acyclic by
construction: admitting a cycle would require one of its members to be admitted
before itself. Duplicate genome IDs are refused rather than overwriting, because
overwriting is deletion wearing another name.
Organism identity and genome identity stay separate, as REPRODUCTION_MODEL
requires. Many organisms may carry one genome; a birth names both, a death names
only the organism. Death is terminal: a dead organism cannot act, die twice or be
reborn. Nothing about a death touches the genome it carried.
The archive therefore reports a lineage as living or absent, and has no third
answer. Absent means no organism now carries it, which is a fact the archive can
establish about itself. Terminal extinction is a policy judgement over a
reconciled world watermark covering suspended members, eggs, spores and in-flight
transfers, none of which exist yet and none of which this type can see. Calling
absence extinction would be exactly the failure ECOLOGY_MODEL names, so the word
does not appear in the API.
Divergence is answered by a most recent common ancestor over the retained parent
links, which is meaningful precisely because nothing was ever removed.
Capacity is bounded and admission fails loudly when it is reached. Refusing to
record is not deleting, and a silent drop would be. Real retention, tiering and
durability are M7 and M8 work, and this bound is a fixture limit, not a policy.
## Alternatives Considered
Pruning lineages with no living carrier is the named risk, and is wrong even as an
optimisation: an absent lineage is the evidence that something happened. A
`extinct` status would claim a conclusion the archive cannot support. Allowing a
genome to be re-admitted under an existing ID would silently destroy the earlier
record. Letting a child be admitted before its parent would leave ancestry walks
dangling and would permit a cycle. Storing a mutating actor alongside the origin
event would settle NPC mutation by implication. An unbounded archive would fail by
exhaustion rather than by saying so.
## Benefits
Ancestry survives every death by construction rather than by discipline. A
lineage can be walked to its founder, its descendants enumerated and two lineages
compared, all from records nothing can remove. Absence is reported honestly and
separately from a conclusion nobody is yet entitled to draw.
## Costs
The archive only grows, so a long run holds every genome it ever made. Ancestry
walks are linear in depth and descendant queries linear in the archive, which is
fine at fixture scale and is not an index. Organism records are in memory only:
nothing is serialized, so nothing survives a process.
## Risks
Do not read absence as extinction, in code or in a report. Do not read the
capacity bound as a retention policy. The archive says nothing about who caused a
mutation, whether NPCs may mutate, what an organism was doing, or whether a
lineage was viable; a lineage with no living carrier may have been perfectly
viable and merely unlucky. Nothing here is durable, and nothing replays.
## Consequences
Test that a genome outlives every organism that carried it, that ancestry and
descendants still resolve after all carriers die, that branching lineages resolve
their common ancestor, that admission refuses a duplicate ID, an unknown parent
and a full archive, that death is terminal and cannot be repeated or undone, that
a lineage with no living carrier reports absent rather than extinct, and that the
type exposes no operation that removes anything. No genome schema, mutation
catalog, ledger, fixture, renderer or deployment changes.