clone

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

Inventory authoritative fields for solver state identity

Dami committed e34bf0f
commit
e34bf0fde4f4add1369890b248e4cc76c8556205
parent
fcc26c0f023261443351e6774b9a00fbef34535f
author
Dami <dami.etoile@gmail.com>
2 files changed, +22 -1
Aopenspec/changes/scale-solver-state-search/state-inventory.md21+++++++++++++++++++++
Mopenspec/changes/scale-solver-state-search/tasks.md2+-
A openspec/changes/scale-solver-state-search/state-inventory.md +21 -0
@@ -0,0 +1,21 @@
1+# Settled state inventory for W32+3+The 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.4+5+| 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. |18+19+The 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.20+21+The `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.
M openspec/changes/scale-solver-state-search/tasks.md +1 -1