Adaptive Loop — a deterministic microfluidic strategy puzzle. Pure serializable nextState(state,action) owns every committed turn; previews call the same function on a clone. 5 handcrafted scenarios, bounded solver with verified win/lose routes + shared-ownership counterfactual, exact localStorage persistence/replay, accessible SVG interface, Vitest truth/solver/persistence tests, and Playwright black-box browser proof. Scenarios 3 and 4 retuned per SPEC §9 (provably unwinnable as originally specified); proofs and exact changes in docs/scenario-tuning.md. Invariants preserved. See CONTEXT-MANIFEST.md for the disclosure boundary and residual risks. Aggregate verified: tsc --noEmit, vitest (59), vite build, playwright (10).
3.1 KiB
3.1 KiB
Recording Route
This route is generated from verified solver/browser actions
(tests/fixtures/solver-results.json, replayed by tests/solver.test.ts and
exercised through the public UI in e2e/smoke.spec.ts), not invented prose. It
is short and deterministic — record it as one uncut take from the production
build (npm run preview → http://localhost:4173).
One-continuous-take route
- Title / campaign start. Click New Campaign → Scenario 1 (Heat: Cultivation Quota) board appears.
- Exact preview of a rotation. Focus the Loop C CW rotation button; the Preview panel shows the exact one-turn outcome (turn 0→1, producer+grazer total, predicted result) and the board shows flow arrows + chamber deltas.
- Rotation causes movement + flow. Commit it (Enter / Commit). Chambers along loop C shift and nutrient flows along the reclaimed outlets (flow arrows re-route).
- Pressure causes an adaptation (Scenario 2). From the title, Replay
Standalone → Scenario 2 (Endurance). Play the verified winning route:
A-ccw → C-ccw → B-ccw → C-cw → C-cw → C-ccw → A-ccw → A-ccw → C-cw → A-cw. The Pressures & Traits panel shows the producer/grazer hunger track climbing to 3 and Dormancy unlocking (✓); event log attributes the unlock. - Adaptation benefit / cost / spillover. During Scenario 2, once Dormancy is active, the event log attributes prevented hunger loss (benefit) and dormant prey is inedible, denying predator food (spillover); dormant population cannot migrate (cost).
- Global pressure response. In a heat-heavy line (Scenario 1 over several turns, or Scenario 5), heat sources add +3 instead of +2 once the global Heat Response activates — visible in the event log ("Global heat response active") and the strengthened fixture effect.
- Ecosystem collapse and retry. Repeat a single loop rotation in a campaign scenario to drive collapse/expiry; the live region announces it. Click Retry to restore the scenario-entry snapshot (turn resets to 0).
- Scenario win + preserved lineage choice. Finish the Scenario 1 verified
route
C-cw → B-cw → A-ccw → C-ccw → A-cw(5 turns) → Scenario 1 complete; choose to preserve nothing (or a newly adapted trait). - Save & Quit. Mid-scenario, click Save & Quit → returns to title; Continue now appears.
- Close/reopen + Continue. Reload the page; click Continue → exact state restored (same turn, same chambers).
- Visible access to multiple scenarios. Replay Standalone lists all five scenarios.
Notes
- Automated tests validate all five scenarios and campaign victory
(
tests/solver.test.ts); the recording need not play all five — the route above is concise and covers the required beats. - The S1 winning route
C-cw → B-cw → A-ccw → C-ccw → A-cwis verified to reachoutcome === "won"(producer at slot 11 ≥ 5 and total producer ≥ 12). - The S2 route unlocks Dormancy (exploit evidence); the S1 route wins while Heat
Shield stays locked (avoid evidence). Both are asserted in
tests/solver.test.ts.