Files
systemic-game-design-course/course/05-assemble/reference/rust
Lucas WintherandClaude Opus 5.5 638549161f
CI / Tool tests and sync-check (push) Successful in 13s
CI / Verify references (all modules, Rust and TS) (push) Successful in 1m32s
CI / Verify Expansion Drop solutions (all modules, Rust and TS) (push) Successful in 1m35s
CI / Coupling audit on references (push) Successful in 13s
CI / Site build (push) Successful in 25s
CI / Naive engine tests (Module 0) (push) Successful in 32s
feat(ci): verify Expansion Drop solutions; README quick start, disclaimer link; Rust reference lockfiles
- verify-references --expansion overlays expansion/solution on each reference and runs the
  cumulative tests plus the drop test; refuses a solution that touches src/engine/
- CI job verify-expansions
- README: workspace-template + git init step, tool list, repo disclaimer link
- Cargo.lock for every Rust reference (staged with the reference, pins serde for rustc 1.85.1)

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-29 19:13:11 +01:00
..
2026-10-29 03:17:21 +01:00
2026-10-29 03:17:21 +01:00
2026-10-29 03:17:21 +01:00
2026-10-29 03:17:21 +01:00
2026-10-29 03:17:21 +01:00

Module 5 reference engine (Rust)

The course's own engine as of the end of Module 5. Every card is now data: a JSON file in the course's card format (course/schema/card.schema.json), and the Rust functions that were card effects in Modules 2–4 are gone. One interpreter turns effects into actions. Assemble builds a new card by replacing half of one card's text with the same half of another's. Module 4'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): the card data. It is a copy of course/cards/, the single source: tools/verify-references.mjs stages it next to the crate, and tools/start-module.mjs copies it into a learner's workspace.
  • src/engine/: generic machinery. Names no cards.
    • card.rs: the card format as Rust types (CardDef, Clause, Effect, Target, Aura, read with serde), and the library. Registering a definition compiles its clauses into triggers, auras and a spell's effects, and marks whether Assemble may offer it (minions with text that were not themselves assembled). TriggerOn gains EndOfTurn, which card data may name (Drakkari Enchanter's aura does); the course has no turns, so nothing fires it.
    • effect.rs: the interpreter: one effect plus its context in, actions out. The only code that knows what dealDamage, draw, summon, assemble, buffHand, ... mean.
    • assemble.rs: assemble(base, donor, half) (list surgery on text at split; fails with AssembleError if the text is unchanged), and the assemble effect, which asks the chooser for a base from the filtered pool, a donor and a half.
    • queue.rs: as in Module 4, plus two actions (Assemble, Buff). An ability's effects are interpreted and performed one at a time, in printed order.
    • world.rs: as in Module 4, plus card registration, cost, the chooser, and buff.
    • aura.rs, death.rs, event.rs: unchanged from Module 4.
  • src/content/mod.rs: reads every .json file in cards/. No card is named in Rust any more.
  • src/harness.rs: the adapter the course tests call. Module 5 adds register_cards, assemble, cost and set_chooser.

Run it with the module's tests: node tools/verify-references.mjs 05 from the course repository. cargo test in this directory alone fails: there is no cards/ here.