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-expose-sentence-spans / specs / rule-engine / spec.md
spec.md 1.9K source

MODIFIED Requirements

Requirement: Active rules SHALL identify their source words

Each active semantic rule SHALL expose the word entity IDs that formed it in reading order and whether the sentence runs horizontally or vertically. Duplicate semantic rules at different physical locations SHALL remain deduplicated in the active rule table while retaining deterministic source information. The settled state SHALL additionally expose sentences, an ordered list of every physical maximal sentence span as { ids, axis }. A span that is a strict subset of a longer span on the same axis SHALL be omitted; exact duplicate sentences at different locations SHALL both remain.

Scenario: A horizontal sentence reports its source

  • WHEN adjacent word entities form MIAU IS YOU from left to right
  • THEN the resulting semantic rule identifies those word IDs in order, reports horizontal axis, and state.sentences contains the physical span with those ids and axis h

Scenario: A vertical sentence reports its source

  • WHEN adjacent word entities form ROCK IS PUSH from top to bottom
  • THEN the resulting semantic rule identifies those word IDs in order, reports vertical axis, and state.sentences contains the physical span with those ids and axis v

Scenario: Exact duplicate sentences remain physical spans

  • WHEN two separate word runs form the same semantic sentence
  • THEN the active rule table contains one semantic rule while state.sentences contains both physical spans

Scenario: Strict subsets are removed

  • WHEN a candidate span is a strict subset of a longer valid span on the same axis
  • THEN state.sentences contains only the longer maximal span

Scenario: Stacked words create separate spans

  • WHEN two noun words share a cell and each forms a valid sentence with the same following words
  • THEN state.sentences contains one span for each physical noun path