Files
systemic-game-design-course/course/07-rule-resolution/reference/rust
Lucas WintherandClaude Opus 5.5 85959ba5a0
CI / Tool tests and sync-check (push) Successful in 16s
CI / Verify references (all modules, Rust and TS) (push) Successful in 2m4s
CI / Verify Expansion Drop solutions (all modules, Rust and TS) (push) Successful in 2m1s
CI / Coupling audit on references (push) Successful in 5s
CI / Differential fuzzing of the Rust and TS references (300 seeds) (push) Successful in 53s
CI / Mutation check (tools/mutants.json against the highest TS reference) (push) Successful in 34s
CI / Verify the SpellGrid level proofs (solver) (push) Successful in 5m25s
CI / Site build (push) Successful in 15s
CI / Naive engine tests (Module 0) (push) Successful in 20s
fix: final review (engine errors end a Sequence cleanly; nesting guard labelled as the course's; Node 22.15; minor lesson and tool fixes)
I1: run-scenario and both SpellGrid CLIs check moves first and treat any other engine
error as fatal (same text in both tracks); trigger blocks close on error (try/finally,
catch_unwind in Rust); unknown summons rejected. I2, I3, M1-M7, T3, T9a-c, T10a-b.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-11 14:58:27 +01:00
..
2026-10-29 03:47:48 +01:00
2026-10-29 03:47:48 +01:00
2026-10-29 03:47:48 +01:00
2026-10-29 03:47:48 +01:00

Module 7 reference engine (Rust)

The course's own engine as of the end of Module 7. Part I's card engine is unchanged, and all of its tests still pass. The Part II engine in src/engine/puzzle/ now reads IS NOT and resolves the parsed rules into the rules in force. Module 6's reference was the starting point, so a diff between the two shows what this module adds.

  • cards/ (at the crate root; not in this directory): Part I's card data, a copy of course/cards/ staged by tools/verify-references.mjs. Part II doesn't read it.
  • src/engine/puzzle/: the Part II engine. It names no noun: the engine's own words are the operators IS, AND, NOT, the meta-noun TEXT and the property PUSH of the base rule TEXT IS PUSH.
    • grid.rs: the level format, object kinds and the board. Module 7 adds Board::get.
    • word.rs: the lexicon and the lexer. Module 7 adds Selects: which objects a noun names as a subject (its own things by default, every text object for TEXT, or every non-text object), read from the word list's optional "selects" field, and Lexicon::names.
    • parse.rs: the parser. Module 7 adds NOT: before a complement it negates that complement (Rule::negated); before a subject it ends the run of subjects without that subject. Each rule also records its complement's role, so a conversion (X IS <noun>) can be told apart.
    • resolve.rs (new): the resolution pass. Negation first (X IS NOT Y cancels every X IS Y and stays in force), then the identity lock (a surviving X IS X cancels X IS Y for nouns Y).
    • level.rs: a level in play. Every change to the board parses, then resolves. has_property answers for one object from the rules in force.
    • mod.rs: the module's exports.
  • The rest of src/engine/: Part I, unchanged.
  • src/content/words.json: unchanged from Module 6.
  • src/harness.rs: the adapter the course tests call. Module 7 adds Baba::active_rules and Baba::has_property; rules() now lists negated rules too ("BABA IS NOT YOU").

Run it with the module's tests: node tools/verify-references.mjs 07 from the course repository.