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
+45
View File
@@ -643,3 +643,48 @@ mutation and recombination remain open and are not settled here. Golden
`d61ad5bf0c928c76`, ecosystem fingerprint `2cd4a15f9fbe9949` and the frozen genome
fixture are unchanged. No deployment manifest or image pin changed. Linux
validation is pending; no Gitea result is claimed since `b01a824`.
## M3.5 lineage retention (2026-09-23)
Native Release, analysis and MSVC ASan each passed 21/21 CTests; formatting
passed. Commands: `tools/windows-check.ps1 -Preset <release|asan|analysis>
-Action check` and debug `-Action format`. `lineage-contracts` is the one new
CTest case, in the existing `evo::biology` library. No existing suite changed.
Retention is asserted as a property of the type, not only of its behaviour: four
concepts check that the archive offers no `erase`, `remove`, `clear` or `prune`,
with a std::map positive control so the checks are known to be live rather than
vacuously true. An earlier attempt used bare requires-expressions, which MSVC
diagnoses eagerly for a non-dependent type, and a std::vector control, which was
wrong because `vector::erase` takes an iterator rather than a key; the concept
correctly reported false and the control was corrected rather than the assertion
weakened.
A branching fixture of five genomes over three generations is used throughout.
Tests cover a genome outliving both organisms that carried it with its record,
ancestry, children and organism terminal ticks intact; ancestry and descendants
resolving through a genome whose only carrier died; common ancestors for
siblings, cousins, a genome against itself and two separate founders; refusal of
a duplicate identity, a child admitted before its parent and a full archive;
death being terminal against repeat, reversal and rebirth; and absence being
reported for every lineage that has no living carrier, including one that gains a
carrier again afterwards. The capacity case admits the full 4,096 genomes as one
chain, checks that the refusal leaves every earlier record intact, and walks the
4,096-deep ancestry.
The implementation was changed twice under clang-tidy rather than suppressed.
`std::map` members made the archive's move potentially throwing, because MSVC's
map move constructor allocates a sentinel node; sorted vectors replaced them,
which also matches the rest of the codebase. A wrapper struct holding a `Genome`
by value then had the same problem, because ADR-0030 made `Genome` copy-only, so
genomes are now stored directly and identified by their own `id()`. The redundant
per-genome carrier tally was dropped in the same change: carriers are counted from
the organism records, so there is no second tally that could drift.
Nothing is serialized, so no history survives a process, and no fixture calls any
of this. Terminal extinction is not claimed anywhere, durable retention and
migration are M7 and M8, and NPC mutation remains undecided. Golden
`d61ad5bf0c928c76`, ecosystem fingerprint `2cd4a15f9fbe9949` and the frozen genome
fixture are unchanged. No deployment manifest or image pin changed. Linux
validation is pending; no Gitea result is claimed since `b01a824`.