clone

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

main
miau-is-true / openspec / changes / add-custom-property-presentation / specs / custom-property-presentation / spec.md
spec.md 5.1K source

ADDED Requirements

Requirement: Packs MAY declare a validated custom-property glossary

The loader SHALL validate and preserve an optional properties glossary. A pack MAY declare it as a map from uppercase custom property tokens to { accent, describe }, and the loader SHALL accept only the documented accent tokens and descriptions of 80 characters or fewer, reject unsupported fields and malformed values atomically, and preserve valid glossary data through normalization, catalog views, CommonJS export, and data-only sharing.

Scenario: A valid glossary survives loading and sharing

  • WHEN a pack declares TICK with accent tick and a 55-character description
  • THEN loading succeeds and the same normalized glossary is present in the catalog view, exported CommonJS data, and decoded shared payload

Scenario: A malformed glossary leaves the catalog unchanged

  • WHEN a pack declares an unsupported accent, an empty description, an overlong description, or an unknown glossary field
  • THEN loading or installation fails with a field-specific error and no pack or active-level catalog state is mutated

Requirement: A level's implemented custom properties SHALL be data-driven

The host SHALL derive the current level's implemented custom-property set from its normalized automaton property declarations. Glossary metadata SHALL affect presentation only; it SHALL not create parser predicates or engine behavior.

Scenario: A non-TICK automaton property is implemented locally

  • WHEN a level declares an automaton with property WIND and contains the word WIND
  • THEN WIND is exposed to presentation as a custom property for that level, while a glossary entry for an unrelated word does not change rules

Scenario: A legacy pack has no glossary

  • WHEN a valid pack omits properties
  • THEN loading succeeds with an empty glossary and existing core and automata behavior remains unchanged

Requirement: Declared custom properties SHALL render consistently

The board and rule ledger SHALL classify every current-level implemented custom property as a property tile, using its glossary accent when present and the documented TICK-lime fallback when absent. The same property classification and accent SHALL be used by accessible rule details.

Scenario: A custom property is visible as a property tile

  • WHEN the board contains MOUSE IS WIND and the level implements WIND with glossary accent push
  • THEN the WIND word and its ledger predicate use the chamfered property tile treatment and push accent, rather than noun styling

Scenario: D21 beat presentation remains independent

  • WHEN an active TICK automaton advances a beat
  • THEN its accepted current/next beat strip and cue behavior remain unchanged while the shared property metadata supplies only word styling and details

Requirement: The first custom-property encounter SHALL teach the word

The stage SHALL request an acknowledgement card before accepting proof input when a player enters a proof containing a glossary-described custom property. The card SHALL contain the pack ID, property word, tile accent, description, an example sentence using a visible level noun, and an accessible equivalent. Encounter state SHALL persist by pack ID and property word.

Scenario: The first encounter shows a teach card

  • WHEN the player enters the first proof in pack clockwork containing described property TICK
  • THEN the card appears before play with the TICK tile, its description, and an example such as MOUSE IS TICK, and ENTER acknowledges it

Scenario: Acknowledgement suppresses repeats within a pack

  • WHEN the player acknowledges TICK and enters another Clockwork proof containing TICK
  • THEN the card does not appear again for Clockwork while the description remains available through details

Scenario: The same word in another pack is independent

  • WHEN another pack introduces its own described TICK property
  • THEN that pack may show its own first-encounter card independently

Requirement: Inspect and ledger details SHALL expose custom descriptions

Inspect mode and the ledger's hover or keyboard-focus details affordance SHALL expose the property word and glossary description after or without the teach card, without changing simulation state or progress.

Scenario: Details remain available after acknowledgement

  • WHEN the player acknowledges the TICK card and opens details for TICK
  • THEN accessible text includes TICK and its glossary description, and the engine snapshot and move count are unchanged

Requirement: W12 SHALL defer pair mechanics

This change SHALL not implement or infer level.pairs, OPEN/SHUT contact effects, entry overrides, or pair-specific animation. Those behaviors SHALL remain subject to the separate W13 contract.

Scenario: Pair data is not silently executed by W12

  • WHEN a pack contains draft OPEN/SHUT pair data
  • THEN W12 does not execute a pair effect or alter contact resolution, and the pack is handled according to the separately versioned W13 capability