Engine events carry the nesting depth they were recorded at; the harness prints the log as an indented tree. New tests test_02_log_tree_shows_nesting and test_03_log_tree_death_phase; both SpellGrid CLIs print the tree of the last command's Sequences under a Log: line. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Module 7 reference engine (TypeScript)
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 package root; not in this directory): Part I's card data, a copy ofcourse/cards/staged bytools/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 operatorsIS,AND,NOT, the meta-nounTEXTand the propertyPUSHof the base ruleTEXT IS PUSH.grid.ts: the level format, object kinds and the board. Module 7 addsBoard.get.word.ts: the lexicon and the lexer. Module 7 addsSelects: which objects a noun names as a subject (its own things by default, every text object forTEXT, or every non-text object), read from the word list's optional"selects"field, andLexicon.names.parse.ts: the parser. Module 7 addsNOT: 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.ts(new): the resolution pass. Negation first (X IS NOT Ycancels everyX IS Yand stays in force), then the identity lock (a survivingX IS XcancelsX IS Yfor nounsY).level.ts: a level in play. Every change to the board parses, then resolves.hasPropertyanswers for one object from the rules in force.index.ts: the module's exports.
- The rest of
src/engine/: Part I, unchanged. src/content/words.json: unchanged from Module 6.src/harness.ts: the adapter the course tests call. Module 7 addsactiveRulesandhasPropertyonBaba;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.