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-24-scale-solver-state-search / state-inventory.md
state-inventory.md 2.0K rendered
1# Settled state inventory for W323The authoritative shape is `game.getState()` from `src/engine.js` after a turn or restore. The compact solver stores only values that can change the next transition. `game.restore()` reconstructs rule and automata projections from the decoded values.45| Field | Role | Codec treatment |6| --- | --- | --- |7| `width`, `height`, `title`, `hint` | Static level definition | Check board identity; restore from the authored level. |8| `objects[].id`, `kind`, word `text` | Static authored identity | Fixed slot and metadata; presence bit distinguishes destruction. |9| `objects[].x`, `y` | Dynamic positions | Encode a cell for each surviving object. |10| Object `noun` | Dynamic transformation result | Encode a noun index for each surviving non-word object. |11| `automata[].id`, `subject`, `property`, `pattern` | Static definitions | Stable system-ID slots and authored metadata. |12| `automata[].phase` | Dynamic beat position | Encode for every system, including inactive systems. |13| `automata[].active`, `carriers`, `instanceIds`, `next` | Derived from rules, objects, and phase | Recompute after restore. |14| `rules`, `sentences` | Derived from surviving word positions and texts | Recompute after restore. |15| `moves` | Display/history count; no current mechanic reads it | Exclude from search identity; BFS depth is the shortest count. |16| `won` | Terminal result | Check before enqueue; nonterminal encoded states use `false`. |17| `mechanics` | Future persistent gate/switch/crumble state | Require explicit codec registration for each dynamic field. |1819The current engine has no `mechanics` envelope. Future changes must add state there and prove that two identical boards with different mechanic values produce different solver identities. A new unrecognized state field must fail encoding until this inventory and codec are updated.2021The `8ecc483` restore correction is required by this model: restoring a settled noun must not run another transformation link. The codec's decode/restore tests guard that invariant in addition to the engine fixture.