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-refresh-rules-after-contact-destruction / specs / rule-engine / spec.md
spec.md 2.5K source

MODIFIED Requirements

Requirement: The engine SHALL derive the MVP rule vocabulary from movable words

The engine SHALL scan horizontal and vertical straight lines for NOUN IS VALUE sentences, with adjacent AND terms expanding the noun side or value side. The initial semantic properties SHALL be exactly YOU, PUSH, STOP, WIN, SINK, and DEFEAT; a noun-to-noun value SHALL be treated as a transformation. Rules SHALL be recomputed from the current word positions after a turn that changes board state, including after contact effects remove word entities. The settled active rules, physical sentence spans, derived properties, and rule deltas SHALL describe only surviving words before the next player intent.

Scenario: An AND sentence expands to multiple properties

  • WHEN the board contains BABA IS YOU AND PUSH in one straight line
  • THEN the active rule table contains BABA IS YOU and BABA IS PUSH

Scenario: A moved word changes the active rules

  • WHEN a legal move changes the position of a word entity
  • THEN the engine replaces the active rule table with rules parsed from the new word positions before the next player intent

Scenario: A malformed line is ignored

  • WHEN a word line lacks IS or has no noun and value on both sides
  • THEN the line produces no active rule and does not make the turn fail

Scenario: SINK removes a rule word

  • WHEN a turn causes SINK to destroy the STOP word in ROCK IS STOP
  • THEN the settled state has no ROCK IS STOP rule or sentence span, the event reports that rule removed, and the next move onto ROCK is not blocked by STOP

Scenario: Contact removal updates derived control and automata

  • WHEN contact destruction removes a word granting YOU or a declared automaton property
  • THEN the settled state's control and automata carriers reflect the surviving words, and Undo restores the previous derivations

Scenario: A destroyed WIN word cannot grant a final victory

  • WHEN a contact destroys the word that supplied a surviving entity's WIN property
  • THEN the final victory check uses the surviving rule table and does not mark the level won from the destroyed word

Scenario: Restore a state after rule-word destruction

  • WHEN a settled snapshot lacking a destroyed rule word is restored or the level is reset
  • THEN the restored state derives rules from its present words, while reset restores the initial words and their rules