fix(tools): stage course cards from M5, audit noun words without flagging identifiers, Node<24.2 main guard, rename-proof expansion-check, safe check-links

- cardDirs: course/cards only from Module 5 (spec 6.2a); fixture modules 04/05 and tests
- coupling-audit: noun words match as UPPERCASE, PascalCase or a whole string literal;
  lowercase identifiers like key/flag pass; card names keep every variant
- isMain() argv guard replaces import.meta.main in coupling-audit and verify-references;
  engines.node >=22
- expansion-check: git diff --no-renames so moving engine code into content fails
- start-module and other tools: clear error when .course.json is missing
- check-links: malformed URLs reported as invalid URL instead of throwing

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
Lucas WintherandClaude Opus 5.5 committed 2026-10-29 19:06:56 +01:00
1 parent 0700cac492
commit ad0701395d
26 files changed
+213 -47

No files matched your search

+7 -5
View File
@@ -46,14 +46,17 @@ test("verify_stage_copies_all_earlier_module_tests", async () => {
assert.ok(existsSync(join(dir, "Cargo.toml")));
});
test("verify_stage_copies_course_cards", async () => {
// From Module 5 the references load card data from <crate or package root>/cards.
test("verify_stage_copies_course_cards_from_module_5", async () => {
// From Module 5 the references load card data from <crate or package root>/cards;
// Modules 1-4 keep their cards in code and get no course/cards (spec §6.2a).
process.env.COURSE_ROOT = root;
const { planVerification, stage } = await import("../verify-references.mjs");
const { existsSync } = await import("node:fs");
const plans = planVerification(moduleDirs(), 5);
for (const lang of ["rust", "ts"]) {
const dir = stage(planVerification(moduleDirs(), 1)[0], lang);
assert.ok(existsSync(join(dir, "cards", "test-fixture.json")), lang);
assert.ok(!existsSync(join(stage(plans[0], lang), "cards", "test-fixture.json")), `01 ${lang}`);
assert.ok(!existsSync(join(stage(plans[3], lang), "cards", "test-fixture.json")), `04 ${lang}`);
assert.ok(existsSync(join(stage(plans[4], lang), "cards", "test-fixture.json")), `05 ${lang}`);
}
});
@@ -88,6 +91,5 @@ test("verify_stage_copies_module_cards_up_to_the_module", async () => {
assert.ok(existsSync(join(stage(plans[1], lang), "cards", "module-fixture.json")), lang);
const later = stage(plans[2], lang);
assert.ok(existsSync(join(later, "cards", "module-fixture.json")), lang);
assert.ok(existsSync(join(later, "cards", "test-fixture.json")), lang);
}
});