feat(biology): rules 13 mutation catalog, behaviour triggers and offer draw
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 5s
Foundation / checks (ecs) (push) Successful in 5s
Foundation / checks (network) (push) Successful in 4s
Foundation / checks (postgres) (push) Successful in 4s
Foundation / checks (tsan) (push) Successful in 4s
Foundation / checks (deploy) (push) Successful in 4m30s
Foundation / postgres-tools (push) Successful in 22s
Foundation / server-image (push) Successful in 4m10s
Foundation / image (push) Successful in 4m46s

Phase 3 of the cellular revamp build plan (ADR-0179), first part: the headless
pieces the owner will use.

- The named catalog: all 49 mutations of Cellular_mutation_plan.md as data
  (stable ids and tuning keys, name, pro, con, effect, availability, increase
  and decrease triggers, base weight). Applying one edits a schema-7 plan by
  fixed reference points (a point is a hundredth of the founder's value), with
  paired edits, spreads across a channel group, recipe shifts, photosynthesis
  acquire and shed, and Adhesion; bounds, gates (carbon burned, buds made) and
  the enabled switch close it. 43 mutations are open at birth, as planned.
- Triggers: per-tick activity signals and eight trigger kinds (accumulate,
  absence, count in a window, event, share over a window, regular recurrence,
  straight heading, sharp turns) move each mutation's affinity score within
  bounds; integer state only, so replay reproduces scores.
- Offers: weight = base x a score multiplier; chances clamp(k x weight, floor,
  cap) summing to the options, in parts per million (floor 0.001%, cap 70%),
  found exactly by water-filling over sorted weights; a systematic draw picks
  distinct mutations whose inclusion frequencies equal their chances exactly.

Tests cover the catalog's identities, the pool at birth, every kind of edit,
bounds and gates; every trigger kind; score bounds; weights; a 300-seed chance
ensemble; and an exhaustive draw over all million draws. Refreshes the DEV
session window.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
dingo
2026-10-22 18:46:21 -04:00
co-authored by Claude Opus 5.5
parent 76d21b4815
commit 732d008aa1
10 changed files with 1513 additions and 2 deletions
+10 -1
View File
@@ -77,7 +77,8 @@ add_library(evo_biology STATIC
src/biology/mutation.cpp src/biology/lineage.cpp src/biology/founder.cpp
src/biology/cellular_motion.cpp src/biology/cellular_kinematics.cpp
src/biology/cellular_tuning.cpp src/biology/cellular_revamp_tuning.cpp
src/biology/cellular_burn.cpp
src/biology/cellular_burn.cpp src/biology/cellular_catalog.cpp
src/biology/cellular_triggers.cpp src/biology/cellular_offers.cpp
src/biology/cellular_currents.cpp
src/biology/cellular_deposit_motion.cpp
src/biology/cellular_uptake.cpp
@@ -505,6 +506,14 @@ if(BUILD_TESTING)
target_link_libraries(evo-cellular-revamp-step-tests PRIVATE evo::biology)
evo_owned_target(evo-cellular-revamp-step-tests)
add_test(NAME cellular-revamp-step-contracts COMMAND evo-cellular-revamp-step-tests)
add_executable(evo-cellular-offers-tests tests/cellular_offers_tests.cpp)
target_link_libraries(evo-cellular-offers-tests PRIVATE evo::biology)
evo_owned_target(evo-cellular-offers-tests)
add_test(NAME cellular-offers-contracts COMMAND evo-cellular-offers-tests)
add_executable(evo-cellular-catalog-tests tests/cellular_catalog_tests.cpp)
target_link_libraries(evo-cellular-catalog-tests PRIVATE evo::biology)
evo_owned_target(evo-cellular-catalog-tests)
add_test(NAME cellular-catalog-contracts COMMAND evo-cellular-catalog-tests)
add_executable(evo-cellular-burn-tests tests/cellular_burn_tests.cpp)
target_link_libraries(evo-cellular-burn-tests PRIVATE evo::biology)
evo_owned_target(evo-cellular-burn-tests)