(Adaptive Loop) Prepare for final pass

This commit is contained in:
AlexKucera committed 2026-08-14 09:57:44 +02:00
1 parent 078ad55b83
commit bd9d5e59d2
1079 files changed
-1131878

No files matched your search

-62
View File
@@ -1,62 +0,0 @@
# Scenario Tuning Log (SPEC §9 budget)
SPEC §9 permits adjusting **starting populations/resources, fixture locations, or numeric
objective thresholds** when a scenario is impossible or trivial under the implemented model,
provided every change is documented and all invariants are preserved. The simulation rules
(SPEC §5–§8) were NOT changed; only declarative scenario data was tuned.
The root cause across the tuned scenarios is the same: SPEC §7 defines resources and organisms
to move at a fixed **1 unit per phase** (tangential + radial flow, and migration of a single unit
toward strictly-greater food). Under that deterministic, low-rate model, organisms cannot quickly
cross rings, and localized drains cannot out-clear widely-spread contamination. Several SPEC
scenario targets were therefore unreachable as written. Each change below is the smallest
adjustment that makes the scenario provably solvable (verified by the bounded solver in
`src/domain/solver.ts`, fixtures in `test/solver-fixtures.json`) while preserving the scenario's
teaching intent and all SPEC invariants.
## Scenario 3 — Toxin: Cleansing
- **Removed** both `toxinInlet` fixtures (O3 and O9). Contamination is now a **one-time
starting load** (`O3: 3 toxin`, `O9: 3 toxin`) routed to the drains.
- **Relaxed** the win threshold `total toxin ≤ 2` → `≤ 4`.
- **Reason:** two simultaneous inlets add +4 toxin/turn; the two localized drains (I1, I3) clear
at most −4/turn only when toxin is perfectly routed onto their tiles, but tangential flow spreads
toxin around each ring, so total toxin never reached ≤ 2 (solver-provable floor was 11 with two
inlets, 4 with one-time contamination). One-time contamination keeps the route-to-drain and
Efflux teaching intact.
- **Invariants preserved:** drain/toxin/flow rules unchanged; Efflux adaptation (pay nutrient,
spillover −toxin) still triggers on toxic tiles.
## Scenario 4 — Immunity: Escort
- **Repositioned starting organisms onto the gate-0 spoke:** added `M0: 2 nutrient / 3 producer /
1 grazer` and `I0: 2 producer / 1 grazer` (sanctuary seed), kept `M2`, `M8`, `O5`, `O11`.
- **Reason:** with all grazers starting off the gate-0 path, the 1-unit/phase migration model could
not move a grazer onto `I0` within the 8-turn limit (solver proved max reachable grazer at I0 = 0).
Seeding the spoke makes the escort objective reachable. Immune nodes (I1, I3), the phage predator,
and the Cloak/retarget teaching are all retained.
- **Invariants preserved:** immune algorithm, Cloak benefit/cost/spillover unchanged.
## Scenario 5 — Convergence: Stable Equilibrium
- **Seeded the gate-0 assay spoke AND its rotational neighbors** (`I0/I1/I5`, `M0/M1/M11`,
`O0/O1/O17`) so a single ring rotation keeps the spoke occupied (the cw/ccw neighbor rotates in).
- **Relaxed** the sustained predicate: assay condition from *all three* of I0/M0/O0 occupied →
**≥ 2 of 3**; population bands widened (producer 4–30, grazer 1–10, phage ≤ 5, toxin ≤ 8).
- **Removed** the `toxinInlet` at `O2` (one-time contamination only).
- **Reason:** (a) under 1-unit/phase migration the assay tiles were unreachable, so sustained was
never satisfiable; (b) a bare spoke empties on the first forced rotation, so sustained could not
hold for 2 consecutive turns; (c) the ecosystem is volatile under predation (producers crash) yet
overgrows when an inherited Dormancy makes them inedible, so the original tight bands (prod 8–16,
graz 3–7) could not hold for 2 turns. The verified solver route holds the equilibrium within 2
turns before either extreme is reached. All four pressures (heat sources, toxin, immune node,
phage) and every adaptation remain present and exercisable.
- **Invariants preserved:** sustained/consecutive mechanics, all pressure and adaptation rules
unchanged; every reachable (themed) campaign inheritance set can still complete this scenario
(verified in `test/solver-fixtures.json` → `reachOk: true`).
## Verification
Every tuned scenario has a solver-verified **winning and losing** route, and every reachable
campaign inheritance combination can complete its subsequent scenario. See
`test/solver-fixtures.json` and the `Gate 4` / `Gate 5` tests.