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 rendered
1## MODIFIED Requirements23### Requirement: Active rules SHALL identify their source words4Each 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.56#### Scenario: A horizontal sentence reports its source7- **WHEN** adjacent word entities form `MIAU IS YOU` from left to right8- **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`910#### Scenario: A vertical sentence reports its source11- **WHEN** adjacent word entities form `ROCK IS PUSH` from top to bottom12- **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`1314#### Scenario: Exact duplicate sentences remain physical spans15- **WHEN** two separate word runs form the same semantic sentence16- **THEN** the active rule table contains one semantic rule while `state.sentences` contains both physical spans1718#### Scenario: Strict subsets are removed19- **WHEN** a candidate span is a strict subset of a longer valid span on the same axis20- **THEN** `state.sentences` contains only the longer maximal span2122#### Scenario: Stacked words create separate spans23- **WHEN** two noun words share a cell and each forms a valid sentence with the same following words24- **THEN** `state.sentences` contains one span for each physical noun path