(Adaptive Loop) Prepare for Pass 3

This commit is contained in:
AlexKucera committed 2026-08-13 09:07:45 +02:00
1 parent 8249da7e9b
commit 72497dcdbe
40 files changed
+242 -6229

No files matched your search

+64 -67
View File
@@ -1,88 +1,85 @@
# Board Layout — three interlocking hexagonal rings
# Board Layout — three concentric 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.
"Board topology and legal actions"). It prescribes **how to draw the board as
three concentric hexagonal rings connected by six radial gates**, not as a
network of connected spheres or a numbered wiring diagram.
## Why the obvious drawings fail
## Topology (authoritative, from SPEC §4)
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.
- **Inner ring** (radius 1): 6 tiles `I0..I5` — `I0` at top, clockwise.
- **Middle ring** (radius 2): 12 tiles `M0..M11` — `M0` at top, clockwise.
- **Outer ring** (radius 3): 18 tiles `O0..O17` — `O0` at top, clockwise.
- 36 tiles total. The outer ring has more tiles than the middle, which has more
than the inner.
Six **gates** `g0..g5` sit at the six hex vertices (clockwise from the top). A
tile is **on a gate** when its current ring position is that vertex:
- Inner: `I_g` is on gate `g` (every inner tile is always on a gate).
- Middle: `M_{2g}` is on gate `g` (every second middle tile).
- Outer: `O_{3g}` is on gate `g` (every third outer tile).
The three on-gate tiles at the same gate (inner + middle + outer) form a radial
channel. Rotating a ring shifts payloads around the track, so **which payloads
sit on the gates changes** — this is what reconnects the rings each turn.
## 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.
1. Render the board as **three concentric hexagonal rings** of regular pointy-top
hex tiles, clearly nested around a common center.
2. Each ring has a **distinct color** (inner / middle / outer).
3. Draw the **six gates as luminous radial connectors** between the rings at the
six vertices, so the player can see which tiles are currently linked across
rings.
4. Keep the clockwise cyclic tile order per ring (`I0→I1→…`, `M0→M1→…`,
`O0→O1→…`) so rotation direction reads correctly.
5. Tiles are hexagonal nodes; label each with its ring index (`I0`, `M0`, `O0`).
On-gate tiles are visually emphasized (e.g., a gate-aligned glow).
## 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).
Place the three rings concentrically. For a pointy-top hex grid, the tiles of
ring radius `r` lie on a hexagonal perimeter at distance `r·tileSpacing` from the
center, with:
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)`.
- Inner `r=1`: 6 perimeter tiles at the 6 vertex directions.
- Middle `r=2`: 12 tiles — one at each vertex plus one midway along each edge.
- Outer `r=3`: 18 tiles — one at each vertex plus two along each edge.
### Reference starting coordinates (viewBox 440×400, tune for legibility)
Index each ring clockwise from the top vertex (`I0`, `M0`, `O0` at top). With this
construction the gate vertices line up exactly: the top vertex holds `I0`, `M0`,
`O0` (gate `g0`); the next vertex clockwise holds `I1`, `M2`, `O3` (gate `g1`);
and so on, matching the `M_{2g}` / `O_{3g}` gate rule.
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.
Tile size may decrease slightly for the inner ring (fewer, larger tiles) and
increase count for the outer ring — whatever keeps all 36 tiles legible. The
implementer **must** visually/DOM-verify the result is three distinct nested
hexagonal rings with six clear radial gates and adjust spacing if any ring
collapses or overlaps illegibly.
## 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)
`` g0 (top)
I0 M0 O0
I5 I1
O17 M11 M1 O1
g5 ┌─────┬─────┬─────┐ g1
│ │ I·· │ │
O16 │ M10 │ │ M2 │ O2
│ │ │ │
g5 └─────┴─────┴─────┘ g1
O15 M9 M3 O3
I4 I2
I3 M6 O9
g3 (bottom)
gates g0..g5 at the 6 vertices connect I·/M·/O· on the same spoke
```
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.
Each ring is a closed hexagon of tiles; the six gates are the radial spokes that
link the three rings. Rotation moves payloads around a ring; the gate spokes are
fixed in space, so rotation changes which tiles the spokes touch.
## Interaction note (see SPEC §13)
+10 -7
View File
@@ -6,13 +6,15 @@ Create a strong-contender browser game for the Agentic Labs one-prompt challenge
## Selected concept
**Adaptive Loop** is a deterministic microscopic strategy puzzle. The player rotates overlapping hexagonal loops in a microfluidic culture dish. Each rotation simultaneously moves culture chambers and reconnects channels, then a fixed simulation tick resolves flow, growth, biological interactions, migration, evolution, environmental pressure, and objectives.
**Adaptive Loop** is a deterministic microscopic strategy puzzle. The board is **three concentric hexagonal rings** — outer, middle, inner — each a closed loop of hex culture tiles. The player rotates a whole ring clockwise or counter-clockwise; the outer ring has more tiles than the inner. Six fixed **radial gates** at the hex vertices connect the three rings: rotating a ring moves its payloads around the loop and changes which tiles sit on the gates, reconnecting how nutrient and toxin flow inward and how organisms migrate between rings.
Each rotation is followed by a fixed simulation tick that resolves flow, growth, biological interactions, migration, evolution, environmental pressure, and objectives.
The ecosystem counter-adapts to repeated strategies. Players see adaptation thresholds, deliberately provoke them, then exploit each adaptation's cost and ecological spillover.
## Product decisions
- Browser game, desktop-first, SVG board.
- Browser game, desktop-first, SVG board of three concentric rings + six gates.
- Five handcrafted scenarios; no procedural boards.
- Science-inspired fiction with simplified microbial biology.
- Capped integer populations/resources rather than continuous simulation.
@@ -23,13 +25,14 @@ The ecosystem counter-adapts to repeated strategies. Players see adaptation thre
- Campaign lineages persist as both gifts and burdens; standalone scenario replay restores baseline species.
- Deterministic player-caused variation; no random season deck.
- Local save/load and deterministic action replay.
- Intricate procedural SVG entity art (not primitive shapes).
## Five-scenario arc
1. **Heat** — basic rotation, growth, and flow.
2. **Hunger** — competition and dormancy.
3. **Toxin** — resistance and metabolic costs.
4. **Immunity** — phage, immune cells, and spillover.
1. **Heat** — basic ring rotation, gate alignment, inward flow, and growth.
2. **Hunger** — competition, gate migration, and dormancy.
3. **Toxin** — routing contaminants inward to drains, resistance, and metabolic costs.
4. **Immunity** — phage, immune nodes, and spillover.
5. **Convergence** — all pressures plus inherited lineage consequences.
Each scenario uses a different objective style while ecosystem collapse remains the universal lose state.
@@ -40,7 +43,7 @@ All rules live in a serializable, rendering-independent state machine. A pure `n
## Autonomous execution decision
Use Pi 0.84.1 with `openai-codex/gpt-5.6-sol`, high thinking, installed extensions, and only the three disclosed local skills under `.agents/skills`. Disable ambient context files, global skills, and prompt templates. The single prompt explicitly reads these local skills before work begins.
Run the build with the default model — no specific model or reasoning level is required. Use installed extensions and only the three disclosed local skills under `.agents/skills`. Disable ambient context files, global skills, and prompt templates. The single prompt explicitly reads these local skills before work begins.
Build vertically: runnable shell → complete scenario 1 → truth tests → interacting adaptation systems → persistence → scenarios 2–5 → bounded polish → final audit. Keep one writer; parallelize only independent review and validation.
-46
View File
@@ -1,46 +0,0 @@
# Scenario Tuning — Adaptive Loop
`SPEC.md` (§9) is authoritative. Board topology, turn order, caps, trait
semantics, and objective types are unchanged. Where the bounded solver proved a
baseline scenario (or a reachable inheritance combination) impossible, the SPEC
explicitly permits adjusting only **starting populations/resources, fixture
locations, or numeric objective thresholds by at most 1 per tuning pass**. Every
adjustment is listed here; all solver tests were rerun after each.
## Tunings applied
| Scenario | Change (SPEC §9 knob) | Reason (solver-proven) |
|---|---|---|
| s3 Cleansing | Removed toxin inlet at slot 9 (fixture-location change) | With two toxin inlets (+4 toxin/turn) the win (total toxin ≤ 2 by turn 6–9) was unreachable within the search budget; a single inlet at slot 3 keeps the detox-routing puzzle intact. |
| s4 Escort | phage@11 objective threshold relaxed 1 → 0 (numeric objective threshold) | Escorting a phage to sanctuary alongside 3 grazers within 8 turns was unreachable; grazer escort + producer survival remains the taught objective. `winDescription` updated to match. |
| s5 Stable Equilibrium | Assay occupancy threshold relaxed 2 → 1 (numeric objective threshold) | Holding producer+grazer ≥ 2 in all three assay chambers for two consecutive turns while immune nodes culled populations was unreachable; ≥ 1 keeps the multi-chamber equilibrium objective. |
| s5 Stable Equilibrium | Removed toxin inlet at slot 3 (fixture-location change) | With a continuous toxin inlet and a single drain, total toxin stayed above the ≤ 6 sustained ceiling in every reachable state; the start toxin (3, 9) + drain @9 still teaches toxin routing. |
| s5 Stable Equilibrium | Removed both immune nodes (fixture-location change) | With immune nodes present, inheriting Cloak from s4 (a reachable campaign choice) made s5 unwinnable: the carrier cost destabilized the equilibrium. s4 already teaches immunity; s5 converges heat/hunger/toxin + inheritance without immune targeting. |
## Invariants preserved
Unchanged across all tunings: 12-slot / 3-loop topology, shared-slot ownership
rule, the fixed 8-phase turn order, integer caps (0–6 populations/resources,
0–3 pressure tracks), the four adaptation semantics (benefit + carrier cost +
spillover + global response), universal collapse (producer + grazer = 0), and
terminal precedence (collapse > win > expire).
## Reachability verification
`scripts/gen-solver-fixtures.ts` enumerates every cumulative inheritance set
reachable by preserving 0 or 1 newly-unlocked trait after each scenario and
confirms each is solvable. Result: **all reachable combinations are solvable
except a documented residual-risk class** (below).
## Documented residual risk
Eight reachable combinations inherit **producer Dormancy** (the hunger trait)
into the convergence scenario. Dormancy removes the natural starvation that
bounds producers, so they overgrow past the sustained 8–14 producer ceiling,
making the equilibrium bounded-search-unsolvable (verified unsolvable within
15 000 000 explored states). SPEC §9's ±1-per-pass tuning budget cannot bound
that runaway growth without distorting the scenario, so these combinations are
recorded as a residual risk in `tests/fixtures/solver-results.json`
(`reachability.residualRiskCombos`) rather than forced. Normal play is unaffected
— a player who inherits Dormancy into the finale can still decline/retry; all
other inheritance paths complete the campaign.