clone

a browser grid puzzle game where you push words around to rewrite the rules of each level

main
miau-is-true / openspec / changes / archive / 2026-09-23-build-dynamic-rule-engine / tasks.md
tasks.md 3.2K source

1. Engine contract and fixtures

  • [x] 1.1 Define the level, entity, rule, and snapshot data shapes used by the engine and tests.
  • [x] 1.2 Add fixtures for straight-line IS parsing, AND expansion, malformed lines, duplicate words, and shared cells.
  • [x] 1.3 Add fixtures for the six properties and noun-to-noun transformation, including re-scan after a word move.
  • [x] 1.4 Preserve source word IDs and sentence axis on active rule records, including stacked and duplicate sources.

2. Deterministic turn resolution

  • [x] 2.1 Implement cardinal YOU intent handling with stable ordering for multiple controlled entities.
  • [x] 2.2 Implement atomic push-chain planning, default pushability for word entities, bounds checks, and STOP blocking.
  • [x] 2.3 Implement post-move transformation and deterministic SINK, DEFEAT, and WIN contact effects.
  • [x] 2.4 Implement complete snapshot undo, reset, move counts, win lockout, and no-op behavior for invalid or blocked intents.
  • [x] 2.5 Verify engine fixtures cover every requirement scenario and run the engine test command.
  • [x] 2.6 Return settled step, undo, and reset events with kind, accepted state, ordered movement, full rule deltas, transformations, destruction details, controlLost, and win state.
  • [x] 2.7 Add event fixtures for blocked: { id, dir, blockerId, reason }, direct versus pushed movement via pushedBy, and ordered movement/transform/destroy/win phases.

3. Three built-in levels and input

  • [x] 3.1 Define and validate the three ordered MIAU teaching puzzles covering movement, pushing, rule editing, STOP, WIN, and AND subject expansion.
  • [x] 3.2 Add the app shell and level selection state for the three built-in levels.
  • [x] 3.3 Route keyboard arrows, touch direction controls, undo, reset, and continue through the common engine API.
  • [x] 3.4 Display move count, undo availability, level title/hint, victory, loss of control, and blocked-move feedback.

4. CommonJS mod boundary

  • [x] 4.1 Define the local CommonJS export shape for manifest, levels, vocabulary, and palette.
  • [x] 4.2 Implement manifest validation with duplicate, coordinate, vocabulary, and level diagnostics.
  • [x] 4.3 Register valid mod content atomically and isolate loading or import failures without removing built-in content.
  • [x] 4.4 Add fixtures for a valid noun/emoji/level mod and rejected or throwing modules.

5. Emoji and text presentation

  • [x] 5.1 Implement fixed-coordinate grid rendering with stable stack order and noun text fallback.
  • [x] 5.2 Render word tiles and the active rule table from settled engine state.
  • [x] 5.3 Add Pretext layout for hints and visual emphasis for rules and turn feedback without coupling to grid geometry.
  • [x] 5.4 Add accessible labels, readable text status, and reduced-motion-safe presentation for all controls and outcomes.

6. Integration verification

  • [x] 6.1 Run the full test suite and production build after wiring the browser shell.
  • [x] 6.2 Run browser smoke checks for built-in start, keyboard/touch movement, word push/rule update, undo/reset, win progression, and mod fallback.
  • [x] 6.3 Update implementation notes or the relevant OpenSpec artifacts for any behavior discovered during verification.