(Adaptive Loop) Prepare for Pass 2

This commit is contained in:
AlexKucera committed 2026-08-12 22:29:35 +02:00
1 parent bd7203fc9e
commit f262da55e5
32 files changed
+93 -7113

No files matched your search

+93
View File
@@ -0,0 +1,93 @@
# Board Layout — three interlocking hexagonal rings
This document is the rendering reference for the Adaptive Loop board (SPEC §4
"Board layout (rendering)"). The topology (12 slots, 3 loops, 6 shared slots) is
authoritative and unchanged; this file prescribes **how to draw it as three
interlocking hexagonal rings**, not as a network of connected spheres or a
numbered wiring diagram.
## Why the obvious drawings fail
The three loops pairwise share *edges* (A∩B = slots {2,3}; A∩C = {4,5};
B∩C = {8,9}). In a flat hexagonal *tiling*, three mutually edge-adjacent hexagons
meet at a single triple vertex and yield only 4 shared vertices — not the 6 this
topology requires. So the board **cannot** be drawn as three regular hexagons
that geometrically share edges in the plane. It must be drawn as three
**interlocking rings** (like chain links): hexagonal outlines that overlap, with
the six shared chambers sitting at the six overlap/crossing points.
## Requirements (binding)
1. Each loop is a **regular six-sided hexagon** (pointy-top), drawn as a stroked
`<polygon>` with a distinct per-loop color (A, B, C).
2. The three rings are arranged in a **symmetric trefoil** (centers at the
corners of an equilateral triangle) so each pair overlaps and the rings read
as interlocked.
3. At each of the six ring crossings use a consistent **over/under weave**
(break one ring's stroke where the other passes over it) so no ring outline is
visually broken and the "interlocking" reads clearly.
4. Chambers are circular nodes placed **on the rings at the hexagon vertices**,
in each loop's clockwise cyclic order:
- Loop A: `0 → 1 → 2 → 3 → 4 → 5 → 0`
- Loop B: `2 → 3 → 6 → 7 → 8 → 9 → 2`
- Loop C: `4 → 5 → 10 → 11 → 8 → 9 → 4`
5. A shared chamber belongs to two rings; render it **once** and route **both**
ring outlines through that single node (it is the visible overlap point).
6. Label each chamber with its slot index; mark shared chambers with the loops
that own them (e.g. `2 ⓪ⓑ`). Rotation moves payloads along the chosen loop's
cyclic order above; channel-flow arrows are drawn along the owner loop's edges
in its current direction.
## Construction (recommended)
Define the 12 chamber coordinates, then draw each loop as the polygon through its
6 chambers in cyclic order. Because a shared chamber is one coordinate used by two
loops' polygons, shared vertices **coincide by construction** and each loop is a
genuine 6-gon. Place the chambers so the three resulting 6-gons form a clean
trefoil (tune spacing/rotation until each ring reads as a distinct hexagon and
the six shared nodes sit at clear crossings).
A pointy-top hexagon of radius `R` centered at `C` has vertex offsets (clockwise
from top): `(0,-R)`, `(R·√3/2,-R/2)`, `(R·√3/2,R/2)`, `(0,R)`, `(-R·√3/2,R/2)`,
`(-R·√3/2,-R/2)`.
### Reference starting coordinates (viewBox 440×400, tune for legibility)
Three pointy-top hexagons, `R = 68`, trefoil centers `A=(220,114)`,
`B=(145,243)`, `C=(295,243)`. Generate each loop's six vertex positions from its
center, assign chambers in the cyclic order above, then for the six **shared**
chambers use a single coordinate at the overlap of the two loops that own them
(the midpoint of the two loops' nearest vertices is a fine starting point; nudge
so it lands on a clean crossing). Unique chambers keep their own vertex
coordinates. The implementer **must** visually/DOM-verify the result is three
distinct interlocking hexagons and adjust spacing if any ring collapses into a
tangle.
## ASCII schematic (topology only — not to scale)
`` Loop A
0─────1
/ \
5 2 ──┐ shared A∩B
│ C │ │
4─────────3 │ Loop B
\ │ / │
11 10 6────7
\ │ / │
\ │ / │
9─8 ──────┘ shared B∩C
↑ ↑
shared A∩C (4,5) and B∩C (8,9) and A∩B (2,3)
```
Each loop is a hexagon; shared slots (2,3 / 4,5 / 8,9) are the chambers where two
rings cross. Draw rings as stroked hexagons with an over/under weave at these six
crossings.
## Interaction note (see SPEC §13)
Selecting a rotation (focus/hover/tap) shows the preview and **enables Commit**;
the selection **persists** until the player commits, picks a different rotation,
or cancels (Escape). Do **not** clear the selection — and therefore do not grey
out Commit — when the pointer leaves the rotation control or focus moves to the
Commit button.
-99
View File
@@ -1,99 +0,0 @@
# Scenario Tuning Log (SPEC §9)
SPEC §9 permits the autonomous agent to adjust **starting populations/resources,
fixture locations, or numeric objective thresholds by at most 1 per tuning pass**
when a scenario is impossible or trivial, provided it documents every adjustment,
preserves all invariants (topology, turn order, caps, trait semantics, objective
type), and reruns all solver tests.
Two baseline scenarios were proven **unwinnable as originally specified** by an
exhaustive state-space search (`src/domain/solver.ts → exhaust`, iterative DFS
over canonical states). Each was minimally retuned and re-proven solvable. No
other scenarios were changed. Board topology, the 8-phase turn pipeline, caps,
trait semantics, and objective *types* are unchanged.
## Method
`exhaust(scenarioId, inheritance, opts)` visits every reachable canonical state
once (memory-light: stores only state hashes). `complete === true` with `win ===
null` is a proof of unwinnability within the turn limit. All proofs below ran to
`complete === true`.
## Scenario 3 — Toxin: Cleansing
**Original:** toxin inlets at slots 3 and 9 (+2 each/turn = +4), drains at 5 and
11 (−2 each/turn = −4), start toxin 2@3 and 2@9, win = total toxin ≤ 2 with
total producer+grazer ≥ 8 during turns 6–9.
**Proof of unwinnability:** exhaust explored **1,932,332** reachable states,
`complete === true`, no winning state. Root cause: the inlet/drain balance is
exactly net-zero (+4/−4), and toxin is otherwise conserved (flow only moves it;
overflow cannot bring the total below the steady floor). The reachable toxin
floor is **5**, never ≤ 2. The Efflux-spillover detox path cannot overcome the
+4/turn inlet pressure because adapted producers exhaust nutrient to the carrier
cost and cannot sustain enough spillover.
**Tuning (1 fixture change):** removed the toxin inlet at slot 9. With one inlet
(+2) against two drains (−4), toxin becomes purgable. Starting toxin kept at the
original 2@3 and 2@9.
**Re-proof:** exhaust (510,156 states, `complete === true`) finds an 8-turn win;
`tests/fixtures/solver-results.json` records a verified winning route (replayed
to `outcome === "won"` in `tests/solver.test.ts`).
## Scenario 4 — Immunity: Escort
**Original:** immune nodes at 2, 4, 6 (2 damage/turn each to the largest eligible
lineage), win = grazer ≥ 3 **and** phage ≥ 1 at the sanctuary slot 11, with total
producer ≥ 6.
**Proof of unwinnability:** exhaust explored **307,008** states, `complete ===
true`, no winning state. Root cause (confirmed by frontier probes): grazers can
reach slot 11 (up to 6 stack there) and producers can survive (total 6), but
**phage can never co-locate with ≥ 2 grazers at slot 11** — a phage arriving
consumes the grazers it must cohabit with, and the rotations that bring a phage
to slot 11 disperse the grazers. `max phage@11 === 1` and `max grazer@11 === 6`
are individually reachable but never simultaneously with grazer@11 ≥ 2. Every
variant win condition involving phage@11 ≥ 1 (with grazer@11 ≥ 2, ≥ 3, or any
producer floor) is infeasible.
**Tuning (1 objective-threshold change):** dropped the phage@11 requirement
(`phageMin: 1 → 0`). The win is now grazer ≥ 3 at slot 11 with total producer ≥ 6
(the original producer floor, which is achievable). This preserves the scenario's
teaching — immune targeting, escort through immune nodes to the sanctuary, and
predator vulnerability (phages still exist and prey on grazers during play) —
while removing a mechanically impossible co-location constraint.
**Re-proof:** exhaust (6,108 states, `complete === true`) finds an 8-turn win;
verified route in the fixtures.
## Counterfactual — shared-slot ownership (SPEC §4)
SPEC §4 requires at least one scenario solver-proven unwinnable when
`sharedOwner` is frozen at the scenario baseline (payload permutation and loop
direction still update). Scenarios 1–4 remain winnable under frozen ownership
(proven `complete === true`). **Scenario 5 (Convergence)** is winnable normally
(beam search finds a 9-turn win) but **no winning route exists under frozen
ownership** within bounded search: greedy beam search to width 20,000 and
exhaustive DFS to 8,000,000 states both find no win (the frozen state space
exceeds 8 M states, so the exhaustive pass is `complete === false`; the
concordance of two independent bounded searches is the recorded evidence). This
establishes that shared-slot ownership materially changes Scenario 5's
solvability.
## Adaptation evidence (SPEC §8)
- **Exploit:** Scenario 2 (Hunger) winning route unlocks Dormancy
(`producer:hunger`, `grazer:hunger`).
- **Avoid:** Scenario 1 (Heat) winning route wins while Heat Shield stays locked
(`producer:hunger` unlocks, but `heat` never reaches an evolution phase at 3).
Both recorded in `tests/fixtures/solver-results.json → adaptationEvidence` and
asserted in `tests/solver.test.ts`.
## Invariants preserved
Board topology (loops A/B/C, shared slots), the fixed 8-phase turn order, the
0–6 caps, the 0–3 pressure tracks, trait benefit/cost/spillover semantics, and
each scenario's objective *type* (producerAt / endurance / cleanse / escort /
sustained) are all unchanged. Only the two adjustments above were made.