fix: module 10 review round 1 (module-local SpellGrid cards, cast target check, CLI without panic hook)

- SpellGrid cards move to course/10-spellgrid/cards; start-module and
  verify-references stage course/cards plus module-local cards up to the module,
  so M5-M9 workspaces get exactly the pre-M10 card set.
- cast() rejects a chosen-target spell without a target (checkCast/checkPlay);
  new test_10_targeted_spell_needs_target.
- Rust CLI pre-validates instead of swapping the global panic hook.
- Catalog: CRIER noun; DEATHRATTLE/BATTLECRY note on lexicon vs catalog role.
- Lesson: design note on mid-movement reparse.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
This commit is contained in:
Lucas Winther
2026-10-29 05:11:09 +01:00
co-authored by Claude Opus 5.5
parent a0cf9be214
commit 6f576940b7
34 changed files with 295 additions and 79 deletions
+5 -5
View File
@@ -1,12 +1,13 @@
#!/usr/bin/env node
// For each module <= N with a reference/: copy reference + tests of modules 01..module into a temp dir, run tests.
// course/cards (the card data, loaded by the references from Module 5) is staged as <dir>/cards,
// and each tested module's levels/ (the puzzle levels its tests load, from Module 10) as <dir>/levels.
// The card data (loaded by the references from Module 5) is staged as <dir>/cards: course/cards
// plus the cards/ of each module up to the one verified. Each tested module's levels/ (the
// puzzle levels its tests load, from Module 10) is staged as <dir>/levels.
import { cpSync, existsSync, mkdirSync, mkdtempSync, rmSync } from "node:fs";
import { spawnSync } from "node:child_process";
import { tmpdir } from "node:os";
import { basename, join } from "node:path";
import { courseRoot, moduleDirs, testFiles, fail } from "./lib.mjs";
import { cardDirs, moduleDirs, testFiles, fail } from "./lib.mjs";
// A staged reference has no node_modules, so TS installs the reference's own
// pinned devDependencies first (a bare `npx vitest` would fetch an unrelated version).
@@ -38,8 +39,7 @@ export function stage(plan, lang) {
for (const f of testFiles(t.path, lang)) cpSync(f, join(dir, "tests", basename(f)));
if (existsSync(join(t.path, "levels"))) cpSync(join(t.path, "levels"), join(dir, "levels"), { recursive: true });
}
const cards = join(courseRoot(), "cards");
if (existsSync(cards)) cpSync(cards, join(dir, "cards"), { recursive: true });
for (const cards of cardDirs(plan.num)) cpSync(cards, join(dir, "cards"), { recursive: true });
return dir;
}