feat(lifecycle): rules 13 behaviour-weighted mutation offers in the owner
Foundation / checks (checks) (push) Successful in 5s
Foundation / checks (client) (push) Successful in 4s
Foundation / checks (ecs) (push) Successful in 4s
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 4m34s
Foundation / postgres-tools (push) Successful in 22s
Foundation / server-image (push) Successful in 4m16s
Foundation / image (push) Successful in 4m47s

Phase 3 of the cellular revamp build plan (ADR-0179), server half.

- Every owned, active rules-13 life gathers its activity each tick from every
  phase (thrust and drift, brake presses, feeding and the collection limits,
  matter burned by channel, energy by use, contact with larger cells, engulf
  outcomes, growth blocked by a channel, buds made, refused or lost young, the
  reserve against the body) and advances its 98 triggers and 49 affinity scores.
- Active play earns an offer every interval: eligible catalog mutations of the
  life's plan, weighted by affinity, drawn with the floored and capped chances
  and a seeded systematic draw (a retry draws the same offer). Wildlife,
  newborns and frozen cells earn nothing; a plan without schema-7 traits has no
  catalog.
- A choice must name the life's own pending offer. It edits the offspring plan
  (phase 4 turns this into the split), pays the mutation's tuned cost from the
  reserve (matter may stand in for its energy, excluded channels excepted) and
  reclaims it as seeded random bubbles, merging into the farthest deposit at the
  deposit limit. Unaffordable choices keep the offer; declines clear it.
- Offspring inherit affinity scores and lineage progress. Growth speed scales
  the growth step with a carried fraction.
- Format 11 persists the offer tunables and each life's mutation state; the
  revamp tuning file gains the offer keys and optional per-mutation overrides
  (mutation.<key>.<field>), defaulting to the catalog with zero costs.

Tests cover per-mutation overrides and refusals, the collection-limit flags,
offers from active play, founder-5 plans never offered, exact restore of a
pending offer, a choice editing only the plan and reclaiming its cost with
closure, unaffordable choices, declines, foreign choices, and thrust moving
affinity. 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:58:32 -04:00
co-authored by Claude Opus 5.5
parent 732d008aa1
commit 7e5775b6f7
14 changed files with 1137 additions and 38 deletions
@@ -12,7 +12,7 @@ spec:
env:
- {name: REGION_SESSION, value: "dev"}
- {name: REGION_SESSION_LISTEN, value: "0.0.0.0:7400"}
- {name: REGION_SESSION_WINDOW, value: "dev-20261022T224609-01218f90:1792723569"}
- {name: REGION_SESSION_WINDOW, value: "dev-20261022T225821-fb28cb29:1792724301"}
- {name: REGION_M10_MAX_GRANT_LIFETIME, value: "14400"}
ports:
# QUIC (ADR-0090): UDP only; nothing listens on TCP 7400.
@@ -7,6 +7,7 @@ tuning.version = 1
# Body (body and maintenance plan).
body.essential_upkeep_per_mille = 250 # share of upkeep no upkeep-efficiency trait reduces
body.reserve_load_per_mille = 1_000 # reserve matter carried as load (slower, costlier thrust)
body.growth_per_tick_centi_mille = 500 # 5 per mille of full size per tick at growth speed 100
# Energy (feeding and energy plan): what 1,000 fg of reserve matter stands in for when the
# reserve's energy runs out. Bubbles carry ~17 pJ of energy per fg of matter, so 2 pJ per fg
@@ -29,3 +30,26 @@ predation.kill_bubble_per_mille = 500 # a kill's remainder left as bubbles; th
spent.drip_interval_ticks = 20 # once a second
spent.drip_bubble_pj = 20_000_000 # largest energy bubble per drip
spent.drip_bubble_fg = 1_000_000 # largest matter bubble per drip and channel
# Mutation offers (mutation plan section 3). Chances in parts per million.
mutation.options = 3
mutation.floor_ppm = 10 # 0.001%: anomalies always happen
mutation.cap_ppm = 700_000 # 70%
mutation.score_min = -1_000
mutation.score_max = 1_000
mutation.max_multiplier_per_mille = 10_000 # weight x10 at the top score
mutation.min_multiplier_per_mille = 0 # weight x0 at the bottom (the floor still applies)
mutation.offer_interval_ticks = 500 # an offer every 25 s of active play
mutation.min_points = 25 # trait bounds in reference points (founder 100)
mutation.max_points = 1_000
mutation.recipe_min_share = 20 # per thousand of the body per channel
mutation.max_offspring = 10 # per bud, so litter at most 900
mutation.carbon_for_light_fg = 20_000_000 # carbon burned before photosynthesis is offered
mutation.buds_for_adhesion = 5 # on-demand buds before Adhesion is offered
# Per-mutation overrides are optional: `mutation.<key>.<field> = value`, with fields enabled,
# base_weight, increase_points, decrease_points, primary_step, paired_step, spread_step,
# increase_ticks, decrease_ticks, cost_e_pj, cost_c_fg, cost_n_fg, cost_p_fg, cost_o_fg and
# cost_scale_percent. Unset fields keep the catalog's defaults (costs 0). For example:
# mutation.strong_propulsion.cost_e_pj = 1_000_000
# mutation.strong_propulsion.cost_scale_percent = 50