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:
+6
-1
@@ -40,7 +40,7 @@ target_include_directories(evo_accounting PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/in
|
||||
target_compile_features(evo_accounting PUBLIC cxx_std_23)
|
||||
evo_owned_target(evo_accounting)
|
||||
|
||||
add_library(evo_biology STATIC src/biology/genome.cpp src/biology/development.cpp src/biology/metabolism.cpp src/biology/mutation.cpp)
|
||||
add_library(evo_biology STATIC src/biology/genome.cpp src/biology/development.cpp src/biology/metabolism.cpp src/biology/mutation.cpp src/biology/lineage.cpp)
|
||||
add_library(evo::biology ALIAS evo_biology)
|
||||
target_include_directories(evo_biology PUBLIC "${CMAKE_CURRENT_SOURCE_DIR}/include")
|
||||
target_link_libraries(evo_biology PUBLIC evo::accounting)
|
||||
@@ -88,6 +88,11 @@ if(BUILD_TESTING)
|
||||
evo_owned_target(evo-mutation-tests)
|
||||
add_test(NAME mutation-contracts COMMAND evo-mutation-tests)
|
||||
set_tests_properties(mutation-contracts PROPERTIES TIMEOUT 120)
|
||||
add_executable(evo-lineage-tests tests/lineage_tests.cpp)
|
||||
target_link_libraries(evo-lineage-tests PRIVATE evo::biology)
|
||||
evo_owned_target(evo-lineage-tests)
|
||||
add_test(NAME lineage-contracts COMMAND evo-lineage-tests)
|
||||
set_tests_properties(lineage-contracts PROPERTIES TIMEOUT 120)
|
||||
add_executable(evo-producer-tests tests/producer_tests.cpp)
|
||||
target_link_libraries(evo-producer-tests PRIVATE evo::processes)
|
||||
evo_owned_target(evo-producer-tests)
|
||||
|
||||
Reference in New Issue
Block a user