(Adaptive Loop) Initial Plan

This commit is contained in:
AlexKucera committed 2026-08-12 17:15:18 +02:00
1 parent 2316e4ac39
commit 6c2eef0019
7 files changed
+1096

No files matched your search

@@ -0,0 +1,40 @@
---
name: deterministic-game-core
description: Build and verify deterministic turn-based game simulations with pure transitions, exact previews, replayable state, and vertical behavior tests.
---
# Deterministic Game Core
## When to Use
Use when implementing or changing Adaptive Loop's simulation, scenario rules, previews, saves, replays, or win/lose logic.
## Procedure
1. Keep the domain model serializable and independent of rendering.
2. Route every committed action through one pure transition: `nextState(state, action)`.
3. Generate previews by calling the same transition on cloned state. Never maintain separate forecast rules.
4. Resolve each turn in a fixed documented order: chamber rotation → channel reconnection/flow → consumption and growth → biological interactions → migration → adaptation → environmental advance → objective/collapse evaluation.
5. Test vertical behavior through public seams. Use worked states and literal expected outcomes, not assertions that reimplement the production algorithm.
6. Cover at least: clockwise/counterclockwise loop rotation, overlapping-loop movement, flow direction, capped populations/resources, adaptation threshold, local trait activation, trait cost, species spillover, pressure-driven environment mutation, win, collapse, exact save/restore, preview/commit equality, and deterministic replay.
7. When a defect appears, search sibling actions and scenarios for the same failure class; fix the shared transition once.
8. Compare canonical domain state only: stable-key serialization or normalized deep equality must exclude timestamps, animation, focus, hover, and other transient UI state.
9. Scenario verification must replay one known winning and one known losing route per scenario and all reachable campaign inheritance combinations.
## Pitfalls
- No randomness unless seeded and serialized; prefer no randomness.
- No floating-point simulation where small capped integers suffice.
- No mutation of input state.
- No UI-owned game rules.
- No private-method or implementation-coupled tests.
- No snapshots whose expected value is generated by the same logic under test.
## Verification
- Identical canonical state plus action produces structurally identical canonical output and deterministic event attribution.
- Preview canonical output equals committed canonical output for every legal action in representative states.
- Saving and restoring preserves canonical state and the exact next transition.
- Replaying an action log from a scenario baseline plus inheritance snapshot reproduces final state and outcome.
- Each scenario has verified winning/losing routes; all reachable campaign inheritance combinations remain solvable.
@@ -0,0 +1,45 @@
---
name: game-ui-proof
description: Design and validate a distinctive, accessible browser-game interface whose mechanics read clearly in an uncut judging video.
---
# Game UI Proof
## When to Use
Use when designing, implementing, polishing, or validating Adaptive Loop's browser interface and gameplay recording path.
## Procedure
1. Treat the surface as an operational instrument: the board, legal actions, immediate consequences, objective, current pressure, and outcome must scan instantly.
2. Establish a specific visual world: dark laboratory glass, luminous culture chambers, crisp microfluidic channels, restrained biological motion, and four consistently encoded pressures. Avoid generic dashboard/card styling.
3. Render the interactive board as SVG with real buttons or keyboard-operable controls around it. Keep hit targets separate from decorative geometry.
4. Preview both chamber relocation and channel flow before commitment. Show exact population/resource deltas with symbols and text, not color alone.
5. Animate only to explain causality. Respect `prefers-reduced-motion` and provide immediate-state rendering when reduced motion is active.
6. Support keyboard navigation, visible focus, accessible names, semantic status/outcome announcements, sufficient contrast, and 200% zoom without loss of function.
7. Teach through scenario objectives and contextual labels, not a long modal tutorial.
8. Run one bounded visual QA pass at desktop and narrow viewport, fix defects in one batch, then confirm once and stop polishing.
## Pitfalls
- No downloaded or ripped commercial assets.
- No tiny unreadable labels, color-only species/pressure encoding, hidden hover-only rules, or canvas-only controls.
- No ornamental animation that obscures turn resolution.
- No claiming a mechanic in text unless it is visibly exercisable.
- No polishing before the full game floor works.
## Verification
Interact with the production build through public browser controls and capture evidence that one continuous take can show:
1. Start a campaign scenario.
2. Preview and commit a loop rotation.
3. Show movement and channel flow interacting.
4. Trigger an adaptation and expose its benefit, cost, and spillover.
5. Trigger a pressure-driven environmental change.
6. Lose by collapse and retry.
7. Win a scenario and preserve a lineage.
8. Save & Quit, close/reopen the page, and Continue exact state.
9. Show visible access to multiple scenarios.
Automated tests must prove all five scenarios and campaign victory. The recording does not need to play every scenario. Generate its short deterministic route from solver/browser-verified actions; never inject game state or localStorage.
@@ -0,0 +1,40 @@
---
name: pi-game-factory
description: Orchestrate a hands-off, one-prompt game build in Pi using vertical gates, one writer, independent review, and durable evidence.
---
# Pi Game Factory
## When to Use
Use for the Agentic Labs one-prompt challenge run. The parent owns scope, decisions, gates, and final acceptance. Subagents provide bounded implementation, review, and validation.
## Procedure
1. Create a todo list and keep exactly one task in progress.
2. Preflight legality: record the initial tree, reject unexpected code/history/generated artifacts, record effective provider/model, and create `CONTEXT-MANIFEST.md` covering all steering context, installed extension/package versions, and relevant configuration.
3. Record the current `PI_SESSION_FILE` path immediately. Verify it exists and begins with the initial Goal kickoff representing the sole human command. Never copy it live. At the end, report the canonical path plus a post-exit copy/parse/marker/hash command that distinguishes disclosed Goal continuations from human follow-ups.
4. Build vertically: runnable shell → complete scenario 1 → simulation truth tests → interacting adaptation systems → exact persistence → scenarios 2–5 → bounded polish → final audit.
5. Keep one writer for the active checkout. Parallelize only read-only review and validation.
6. Use Pi subagents through `workflowScript`. Give each task a concrete outcome, authority boundary, acceptance criteria, validation, and stop rule.
7. After each implementation milestone, run targeted checks. Launch fresh-context reviewers with distinct angles: correctness/determinism, user flow/accessibility, and simplicity/scope.
8. Synthesize findings. Send accepted fixes to one writer. Repeat broad review only while concrete defects remain, maximum three rounds. If a floor blocker remains, drop optional polish and allow one final focused repair/verification cycle.
9. Exercise the production browser game through public controls, not only tests. Verify start, rotation preview, committed resolution, adaptation benefit/cost/spillover, environmental response, win, collapse, retry, save, page close/reopen, exact Continue, scenario selection, and campaign completion. Never inject game state or localStorage to fake gameplay.
10. Finish only when every floor requirement and repository deliverable passes after the last code edit. Report commands, evidence, paths, final manifest/hash, and residual risks.
## Pitfalls
- Never ask the human a follow-up. Resolve routine implementation choices autonomously from the brief.
- Never let multiple writers edit the same checkout.
- Never trade a complete game floor for optional polish.
- Never trust a worker summary without inspecting the resulting files and running checks.
- Never claim browser validation from HTTP success or screenshots alone; interact with the game.
- Never add code after the final run ends.
## Verification
- Build, typecheck, tests, lint, solver/replay checks, and black-box browser tests pass if configured.
- The browser user flow demonstrates the required challenge mechanics without crashes or state injection.
- `CONTEXT-MANIFEST.md` closes the disclosure boundary for prompt, local skills/context, installed extensions, hooks, subagent definitions, and effective configuration.
- `PI_SESSION_FILE` is known; final instructions copy it only after exit, parse every line, prove no parent session, reconstruct the initial prompt from `goal-state.text`, verify every later user entry is a marked Goal-owned continuation rather than a human follow-up, and hash the result.
- README, ASSETS, RECORDING, SPEC, context manifest, and every steering file are present before freeze.