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-fix-same-entity-win / specs / rule-engine / spec.md
spec.md 2.2K source

MODIFIED Requirements

Requirement: The engine SHALL apply transformations and contact effects deterministically

After movement, the engine SHALL apply active noun-to-noun transformations, then resolve contact effects using the MVP properties. SINK SHALL remove all occupants of a contact cell, DEFEAT SHALL remove controlled entities sharing its cell, and WIN SHALL mark the level won when a surviving entity has both YOU and WIN or when a surviving YOU shares its cell with a distinct surviving WIN entity. The engine SHALL expose the settled state only after these effects complete.

Scenario: A noun transforms

  • WHEN the active rule BABA IS KEKE is present after a successful turn
  • THEN every object with noun BABA becomes noun KEKE before the next rule scan

Scenario: Sink removes contact occupants

  • WHEN an entity with SINK shares a cell with another entity after movement
  • THEN every entity in that cell is removed before the turn is committed

Scenario: Defeat removes YOU

  • WHEN a YOU entity shares a cell with an entity having DEFEAT
  • THEN the controlled entity is removed and the level is not marked won by that contact

Scenario: A surviving same-entity YOU and WIN wins

  • WHEN a surviving entity has both YOU and WIN after transformations and contact destruction settle
  • THEN the engine marks the level won and the settled event reports won: true

Scenario: Distinct YOU and WIN entities still win

  • WHEN a surviving YOU entity shares a cell with a distinct surviving entity having WIN
  • THEN the engine marks the level won and rejects later movement until reset or progression

Scenario: Destruction takes precedence over same-entity victory

  • WHEN an entity with both YOU and WIN is removed by SINK or DEFEAT during contact resolution
  • THEN the entity is listed in destruction details and the level is not marked won by that removed entity

Scenario: Proof 03 reaches the win state

  • WHEN the authored proof 03 rule MIAU IS YOU AND WIN is active and the controlled MIAU completes its winning move
  • THEN the settled state and event report won: true, and the browser opens the existing Win scene