@alpaca-software/40kdc-data 0.3.2 → 0.4.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (102) hide show
  1. package/README.md +12 -6
  2. package/dist/bundle-schemas.d.ts.map +1 -1
  3. package/dist/bundle-schemas.js +17 -0
  4. package/dist/bundle-schemas.js.map +1 -1
  5. package/dist/cli.js +5 -0
  6. package/dist/cli.js.map +1 -1
  7. package/dist/codegen-data.js +1 -0
  8. package/dist/codegen-data.js.map +1 -1
  9. package/dist/commands/populate-base-sizes.d.ts +2 -0
  10. package/dist/commands/populate-base-sizes.d.ts.map +1 -0
  11. package/dist/commands/populate-base-sizes.js +158 -0
  12. package/dist/commands/populate-base-sizes.js.map +1 -0
  13. package/dist/convert-faction.d.ts +3 -1
  14. package/dist/convert-faction.d.ts.map +1 -1
  15. package/dist/convert-faction.js +49 -16
  16. package/dist/convert-faction.js.map +1 -1
  17. package/dist/converters/base-size-bridge.d.ts +122 -0
  18. package/dist/converters/base-size-bridge.d.ts.map +1 -0
  19. package/dist/converters/base-size-bridge.js +198 -0
  20. package/dist/converters/base-size-bridge.js.map +1 -0
  21. package/dist/converters/base-size-guide-extract.d.ts +11 -0
  22. package/dist/converters/base-size-guide-extract.d.ts.map +1 -0
  23. package/dist/converters/base-size-guide-extract.js +59 -0
  24. package/dist/converters/base-size-guide-extract.js.map +1 -0
  25. package/dist/converters/option-bridge.d.ts +36 -0
  26. package/dist/converters/option-bridge.d.ts.map +1 -0
  27. package/dist/converters/option-bridge.js +72 -0
  28. package/dist/converters/option-bridge.js.map +1 -0
  29. package/dist/converters/option-parser.d.ts +56 -0
  30. package/dist/converters/option-parser.d.ts.map +1 -0
  31. package/dist/converters/option-parser.js +209 -0
  32. package/dist/converters/option-parser.js.map +1 -0
  33. package/dist/converters/wargear-options.d.ts +55 -0
  34. package/dist/converters/wargear-options.d.ts.map +1 -0
  35. package/dist/converters/wargear-options.js +187 -0
  36. package/dist/converters/wargear-options.js.map +1 -0
  37. package/dist/data/bundle.generated.js +1 -1
  38. package/dist/data/bundle.generated.js.map +1 -1
  39. package/dist/data/dataset.d.ts +9 -1
  40. package/dist/data/dataset.d.ts.map +1 -1
  41. package/dist/data/dataset.js +14 -0
  42. package/dist/data/dataset.js.map +1 -1
  43. package/dist/data/entities.d.ts +3 -1
  44. package/dist/data/entities.d.ts.map +1 -1
  45. package/dist/data/entities.js +4 -0
  46. package/dist/data/entities.js.map +1 -1
  47. package/dist/data/index.d.ts +4 -0
  48. package/dist/data/index.d.ts.map +1 -1
  49. package/dist/data/index.js +4 -0
  50. package/dist/data/index.js.map +1 -1
  51. package/dist/data/loadout.d.ts +60 -0
  52. package/dist/data/loadout.d.ts.map +1 -0
  53. package/dist/data/loadout.js +135 -0
  54. package/dist/data/loadout.js.map +1 -0
  55. package/dist/data/types.d.ts +3 -1
  56. package/dist/data/types.d.ts.map +1 -1
  57. package/dist/data/types.js +1 -0
  58. package/dist/data/types.js.map +1 -1
  59. package/dist/export/rosterizer.js +1 -1
  60. package/dist/export/rosterizer.js.map +1 -1
  61. package/dist/gen-conformance.js +171 -0
  62. package/dist/gen-conformance.js.map +1 -1
  63. package/dist/generated.d.ts +135 -55
  64. package/dist/generated.d.ts.map +1 -1
  65. package/dist/generated.js.map +1 -1
  66. package/dist/import/rosterizer.d.ts +1 -1
  67. package/dist/import/rosterizer.js.map +1 -1
  68. package/dist/index.d.ts +3 -2
  69. package/dist/index.d.ts.map +1 -1
  70. package/dist/index.js +3 -3
  71. package/dist/index.js.map +1 -1
  72. package/dist/runner.d.ts +16 -0
  73. package/dist/runner.d.ts.map +1 -1
  74. package/dist/runner.js +216 -0
  75. package/dist/runner.js.map +1 -1
  76. package/dist/scoring/index.d.ts +28 -6
  77. package/dist/scoring/index.d.ts.map +1 -1
  78. package/dist/scoring/index.js +31 -7
  79. package/dist/scoring/index.js.map +1 -1
  80. package/dist/terrain/index.d.ts +2 -2
  81. package/dist/terrain/index.d.ts.map +1 -1
  82. package/dist/terrain/index.js +1 -1
  83. package/dist/terrain/index.js.map +1 -1
  84. package/dist/terrain/solve.d.ts +41 -0
  85. package/dist/terrain/solve.d.ts.map +1 -1
  86. package/dist/terrain/solve.js +100 -0
  87. package/dist/terrain/solve.js.map +1 -1
  88. package/dist/translate/condition.d.ts.map +1 -1
  89. package/dist/translate/condition.js +4 -0
  90. package/dist/translate/condition.js.map +1 -1
  91. package/dist/validate.d.ts.map +1 -1
  92. package/dist/validate.js +13 -5
  93. package/dist/validate.js.map +1 -1
  94. package/package.json +5 -5
  95. package/schemas/$defs/common.schema.json +14 -0
  96. package/schemas/core/secondary-card.schema.json +10 -0
  97. package/schemas/core/terrain-layout.schema.json +18 -0
  98. package/schemas/core/unit-composition.schema.json +5 -1
  99. package/schemas/core/unit.schema.json +2 -10
  100. package/schemas/core/wargear-option.schema.json +32 -6
  101. package/schemas/core/wargear.schema.json +24 -0
  102. package/schemas/enrichment/ability-dsl/condition.schema.json +3 -2
@@ -1 +1 @@
1
- {"version":3,"file":"gen-conformance.js","sourceRoot":"","sources":["../src/gen-conformance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,EAAE,YAAY,EAAqB,MAAM,mBAAmB,CAAC;AACpE,OAAO,EAAE,YAAY,EAAE,mBAAmB,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,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,IAAI,EAAE,CAAC,CAAC,IAAI;QACZ,SAAS,EAAE,CAAC,CAAC,SAAS;QACtB,MAAM,EAAE,CAAC,CAAC,MAAM;QAChB,QAAQ,EAAE,EAAE,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,MAAM,EAAE,CAAC,CAAC,SAAS,CAAC,EAAE;KAC3D,CAAC,CAAC,CAAC;IACJ,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,gCAAgC,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC;AACpE,CAAC;AAED,YAAY,EAAE,CAAC;AACf,UAAU,EAAE,CAAC;AACb,YAAY,EAAE,CAAC;AACf,cAAc,EAAE,CAAC;AACjB,qBAAqB,EAAE,CAAC;AACxB,kBAAkB,EAAE,CAAC","sourcesContent":["/**\n * Generate the cross-implementation conformance corpus under repo-root\n * `conformance/`. The TypeScript package is the reference implementation, so\n * the goldens it emits are what the Rust crate must reproduce byte-for-byte\n * (structurally). Run via `npm run gen:conformance`; CI regenerates and asserts\n * `git diff --exit-code conformance/` is clean.\n *\n * Outputs:\n * - `conformance/normalize.json` — `[{ input, expected }]` for normalizeName.\n * - `conformance/roster/<case>/expected.roster.json` — the resolved Roster.\n * - `conformance/roster/<case>/expected.<fmt>.{txt,json}` — every export\n * target's golden output. The TS exporter is the oracle; the Rust mirror\n * asserts byte-equal output for the same Roster.\n * - `conformance/roster/<case>/input.newrecruit-{wtc-compact,wtc-full,simple}.txt`\n * — text inputs derived from the seed by the exporter, so a re-import\n * regression in either implementation surfaces immediately.\n *\n * Seeding: each `<case>/` carries one canonical input — either the legacy\n * `input.json` (ListForge) or `input.newrecruit-json.json` (NewRecruit). Other\n * inputs are derived.\n */\nimport { readdirSync, readFileSync, writeFileSync, existsSync, mkdirSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { Dataset } from \"./data/dataset.js\";\nimport { normalizeName } from \"./data/normalize.js\";\nimport { describeScoringCard } from \"./translate/index.js\";\nimport { exportRoster, type ExportFormat } from \"./export/index.js\";\nimport { importRoster, REGISTERED_ADAPTERS } from \"./import/import-roster.js\";\nimport { selectAdapter } from \"./import/adapter.js\";\nimport type { ParsedRoster, Roster } from \"./import/types.js\";\nimport { attributeStages } from \"./cruncher/attribution.js\";\nimport type { EngineInput } from \"./cruncher/index.js\";\nimport {\n resolveLayout,\n type TerrainTemplate as ResolverTemplate,\n type TerrainLayout as ResolverLayout,\n} from \"./terrain/resolve.js\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst REPO_ROOT = join(__dirname, \"../..\");\nconst CONFORMANCE = join(REPO_ROOT, \"conformance\");\n\nconst NORMALIZE_INPUTS = [\n // NFD diacritic strip\n \"Khârn the Betrayer\",\n \"Brôkhyr\",\n \"Ûthar\",\n \"Magnús\",\n // apostrophe / quote variants\n \"T'au\",\n \"Be’lakor\",\n \"Kor’sarro Khan\",\n \"Aetaos'rau'keres\",\n \"‘quoted’\",\n // whitespace / hyphen collapse + trim\n \"Brôkhyr Iron-master\",\n \" the betrayer \",\n \"space--marines\",\n // casefold\n \"KHÂRN THE BETRAYER\",\n // already-normalized (idempotence)\n \"kharn the betrayer\",\n // distinctness anchors (must NOT collapse together)\n \"Khorne\",\n \"Khârn\",\n // Unicode whitespace beyond ASCII — every Unicode whitespace must collapse\n // identically across implementations or `find(\"Khorne Lord\")` and\n // `find(\"Khorne Lord\")` will silently disagree across ports.\n \"Khorne Lord\",\n \"Khorne Lord\",\n // Turkish dotted-I: NFD decomposes to `I` + combining dot above; the dot is\n // stripped, then locale-independent lowercase yields `i`. The case pins that\n // no implementation introduces locale-aware casefolding (which would map\n // `I` → `ı` under Turkish locale and break ASCII-text search).\n \"İmperial Fists\",\n // Zero-width joiner: passes through every step today. Pinned so behavior\n // does not silently change — if a future commit strips Cf-category chars,\n // this golden updates in the same PR.\n \"Khorne‍Lord\",\n];\n\nfunction writeJson(path: string, value: unknown): void {\n writeFileSync(path, `${JSON.stringify(value, null, 2)}\\n`);\n}\n\nfunction writeText(path: string, value: string): void {\n writeFileSync(path, value);\n}\n\nfunction genNormalize(): void {\n const table = NORMALIZE_INPUTS.map((input) => ({ input, expected: normalizeName(input) }));\n writeJson(join(CONFORMANCE, \"normalize.json\"), table);\n console.log(`normalize.json: ${table.length} cases`);\n}\n\n/** Locate the canonical input for a fixture dir: prefer `input.json` (legacy\n * ListForge), then `input.newrecruit-json.json` (NewRecruit), then the\n * text-only `input.gw.txt` (GW app export — import-only, like ListForge). */\nfunction seedRoster(caseDir: string, ds: Dataset): Roster {\n const decoded = decodeCanonicalSeed(caseDir);\n return importRoster(decoded, { dataset: ds });\n}\n\n/** Return the decoded payload for the canonical seed — the same value the\n * import pipeline would dispatch on. JSON seeds come back parsed; text seeds\n * come back as the raw string. */\nfunction decodeCanonicalSeed(caseDir: string): unknown {\n const jsonSeed = join(caseDir, \"input.json\");\n if (existsSync(jsonSeed)) {\n return JSON.parse(readFileSync(jsonSeed, \"utf8\"));\n }\n const nrSeed = join(caseDir, \"input.newrecruit-json.json\");\n if (existsSync(nrSeed)) {\n return JSON.parse(readFileSync(nrSeed, \"utf8\"));\n }\n const gwSeed = join(caseDir, \"input.gw.txt\");\n if (existsSync(gwSeed)) {\n return readFileSync(gwSeed, \"utf8\");\n }\n throw new Error(`no canonical input found in ${caseDir}`);\n}\n\n/** Run a decoded payload through the adapter pipeline up to (but not past)\n * resolution. The result is the format-agnostic ParsedRoster — the same\n * intermediate the resolver consumes. Pinning this layer surfaces parser\n * regressions even when resolution masks them. */\nfunction parsedFromCanonicalSeed(caseDir: string): ParsedRoster {\n const decoded = decodeCanonicalSeed(caseDir);\n const adapter = selectAdapter(decoded, [...REGISTERED_ADAPTERS]);\n return adapter.parse(decoded);\n}\n\nconst TEXT_FORMATS: { format: ExportFormat; inputName: string; goldenName: string }[] = [\n {\n format: \"newrecruit-wtc-compact\",\n inputName: \"input.newrecruit-wtc-compact.txt\",\n goldenName: \"expected.newrecruit-wtc-compact.txt\",\n },\n {\n format: \"newrecruit-wtc-full\",\n inputName: \"input.newrecruit-wtc-full.txt\",\n goldenName: \"expected.newrecruit-wtc-full.txt\",\n },\n {\n format: \"newrecruit-simple\",\n inputName: \"input.newrecruit-simple.txt\",\n goldenName: \"expected.newrecruit-simple.txt\",\n },\n];\n\nfunction genRosters(): void {\n const ds = Dataset.embedded();\n const rosterDir = join(CONFORMANCE, \"roster\");\n for (const entry of readdirSync(rosterDir, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n const caseDir = join(rosterDir, entry.name);\n\n const seed = seedRoster(caseDir, ds);\n writeJson(join(caseDir, \"expected.roster.json\"), seed);\n\n // Parsed-stage golden — the intermediate ParsedRoster produced by the\n // adapter for the canonical seed, before resolution. Catches parser bugs\n // that resolution would otherwise mask (e.g. wrong unit count from a\n // duplicate cost line that resolves to the same unit twice).\n writeJson(join(caseDir, \"expected.parsed.json\"), parsedFromCanonicalSeed(caseDir));\n\n // JSON export golden — NewRecruit-shaped skeleton.\n const jsonOut = exportRoster(seed, \"newrecruit-json\");\n writeJson(join(caseDir, \"expected.newrecruit-json.json\"), JSON.parse(jsonOut));\n\n // Canonical Roster JSON export — should equal the resolved roster.\n writeJson(join(caseDir, \"expected.roster-json.json\"), JSON.parse(exportRoster(seed, \"roster-json\")));\n\n // Text exports: always write the export golden so every fixture exercises\n // the cross-implementation byte-equality check. Only write the\n // `input.*.txt` round-trip seed when the fixture was authored for the\n // NewRecruit pipeline — legacy ListForge fixtures carry decoration\n // (multi-force warnings, leader-attachment inference) that the simple/wtc\n // exporters can't fully preserve, so the round-trip would fail\n // structurally rather than uncover a parser bug.\n const isNewRecruitSeed = existsSync(join(caseDir, \"input.newrecruit-json.json\"));\n for (const { format, inputName, goldenName } of TEXT_FORMATS) {\n const out = exportRoster(seed, format);\n writeText(join(caseDir, goldenName), out);\n if (isNewRecruitSeed) {\n writeText(join(caseDir, inputName), out);\n }\n }\n\n // Rosterizer JSON export + a derived round-trip input. The exporter is\n // deterministic and round-trips through the adapter, so emitting it as\n // both `expected.rosterizer.json` and `input.rosterizer.json` pins the\n // cross-implementation goldens and the importer regression at the same\n // time. Same NewRecruit-seed gate as the text formats — multi-force\n // ListForge fixtures lose their provisional leader-attachment under\n // round-trip, so they only get the export golden, not the derived input.\n const rosterizerOut = exportRoster(seed, \"rosterizer\");\n writeJson(join(caseDir, \"expected.rosterizer.json\"), JSON.parse(rosterizerOut));\n if (isNewRecruitSeed) {\n writeJson(join(caseDir, \"input.rosterizer.json\"), JSON.parse(rosterizerOut));\n }\n\n console.log(\n `roster/${entry.name}: ${seed.units.length} units, ${seed.diagnostics.warnings.length} warnings`,\n );\n }\n}\n\n/**\n * Linked-API query cases. Each descriptor names a query method on Dataset, the\n * args to call it with, and how the result should be compared.\n *\n * `comparison: \"ordered\"` pins the result order — used for queries that iterate\n * a data-driven array (`unit.ability_ids`, `unit.weapon_ids`) where order is\n * encoded in the data and both implementations iterate it the same way.\n *\n * `comparison: \"set\"` pins only the set of ids — used for queries that walk an\n * index (faction → abilities, ability → phases) where iteration order depends\n * on dataset bundler internals and is incidental. Ids are sorted before\n * comparison.\n *\n * `comparison: \"scalar\"` pins a single id-or-null result (find_* and\n * faction_of(unit)).\n */\ntype LinkedApiQuery =\n | { name: string; query: \"find_unit\"; args: { query: string }; comparison: \"scalar\" }\n | { name: string; query: \"find_weapon\"; args: { query: string }; comparison: \"scalar\" }\n | { name: string; query: \"find_faction\"; args: { query: string }; comparison: \"scalar\" }\n | { name: string; query: \"find_ability\"; args: { query: string }; comparison: \"scalar\" }\n | { name: string; query: \"abilities_of\"; args: { unitId: string }; comparison: \"ordered\" }\n | { name: string; query: \"weapons_of\"; args: { unitId: string }; comparison: \"ordered\" }\n | { name: string; query: \"phases_of\"; args: { abilityId: string }; comparison: \"set\" }\n | { name: string; query: \"faction_of\"; args: { unitId: string }; comparison: \"scalar\" }\n | { name: string; query: \"abilities_of_faction\"; args: { factionId: string }; comparison: \"set\" }\n | { name: string; query: \"weapons_of_faction\"; args: { factionId: string }; comparison: \"set\" };\n\nconst LINKED_API_QUERIES: LinkedApiQuery[] = [\n // find_unit: diacritic-insensitive lookup, miss returns null.\n { name: \"find_unit by diacritic name\", query: \"find_unit\", args: { query: \"Kharn\" }, comparison: \"scalar\" },\n { name: \"find_unit miss returns null\", query: \"find_unit\", args: { query: \"not-a-real-unit-xyz\" }, comparison: \"scalar\" },\n // find_weapon: hyphen + space tolerance.\n { name: \"find_weapon by name\", query: \"find_weapon\", args: { query: \"bolt rifle\" }, comparison: \"scalar\" },\n // find_faction: punctuation/diacritic tolerance.\n { name: \"find_faction by display name\", query: \"find_faction\", args: { query: \"World Eaters\" }, comparison: \"scalar\" },\n // find_ability: ability name lookup.\n { name: \"find_ability by name\", query: \"find_ability\", args: { query: \"Berzerker Frenzy\" }, comparison: \"scalar\" },\n // abilities_of(unit): ordered, iterates unit.ability_ids array.\n { name: \"abilities_of intercessor-squad\", query: \"abilities_of\", args: { unitId: \"intercessor-squad\" }, comparison: \"ordered\" },\n { name: \"abilities_of kharn-the-betrayer\", query: \"abilities_of\", args: { unitId: \"kharn-the-betrayer\" }, comparison: \"ordered\" },\n // weapons_of(unit): ordered, iterates unit.weapon_ids array.\n { name: \"weapons_of intercessor-squad\", query: \"weapons_of\", args: { unitId: \"intercessor-squad\" }, comparison: \"ordered\" },\n { name: \"weapons_of kharn-the-betrayer\", query: \"weapons_of\", args: { unitId: \"kharn-the-betrayer\" }, comparison: \"ordered\" },\n // phases_of(ability): compared as set (phase index iteration order is incidental).\n { name: \"phases_of berzerker-frenzy\", query: \"phases_of\", args: { abilityId: \"berzerker-frenzy\" }, comparison: \"set\" },\n // faction_of(unit): scalar id or null.\n { name: \"faction_of intercessor-squad\", query: \"faction_of\", args: { unitId: \"intercessor-squad\" }, comparison: \"scalar\" },\n // abilities_of_faction: compared as set (collection-index order is incidental).\n { name: \"abilities_of_faction world-eaters\", query: \"abilities_of_faction\", args: { factionId: \"world-eaters\" }, comparison: \"set\" },\n // weapons_of_faction: compared as set.\n { name: \"weapons_of_faction world-eaters\", query: \"weapons_of_faction\", args: { factionId: \"world-eaters\" }, comparison: \"set\" },\n];\n\nfunction genLinkedApi(): void {\n const ds = Dataset.embedded();\n const cases = LINKED_API_QUERIES.map((q) => {\n const expected = runLinkedQuery(ds, q);\n return { ...q, expected };\n });\n writeJson(join(CONFORMANCE, \"linked-api\", \"cases.json\"), cases);\n console.log(`linked-api/cases.json: ${cases.length} cases`);\n}\n\nfunction runLinkedQuery(ds: Dataset, q: LinkedApiQuery): string | null | string[] {\n switch (q.query) {\n case \"find_unit\":\n return ds.units.find(q.args.query)?.id ?? null;\n case \"find_weapon\":\n return ds.weapons.find(q.args.query)?.id ?? null;\n case \"find_faction\":\n return ds.factions.find(q.args.query)?.id ?? null;\n case \"find_ability\":\n return ds.abilities.find(q.args.query)?.id ?? null;\n case \"abilities_of\": {\n const u = ds.units.get(q.args.unitId);\n if (!u) throw new Error(`abilities_of: unknown unit ${q.args.unitId}`);\n return u.abilities.map((a) => a.id);\n }\n case \"weapons_of\": {\n const u = ds.units.get(q.args.unitId);\n if (!u) throw new Error(`weapons_of: unknown unit ${q.args.unitId}`);\n return u.weapons.map((w) => w.id);\n }\n case \"phases_of\": {\n const a = ds.abilities.get(q.args.abilityId);\n if (!a) throw new Error(`phases_of: unknown ability ${q.args.abilityId}`);\n return [...a.phases].sort();\n }\n case \"faction_of\": {\n const u = ds.units.get(q.args.unitId);\n if (!u) throw new Error(`faction_of: unknown unit ${q.args.unitId}`);\n return u.faction?.id ?? null;\n }\n case \"abilities_of_faction\":\n return ds.abilities.byFaction(q.args.factionId).map((a) => a.id).sort();\n case \"weapons_of_faction\": {\n // Mirrors Rust `weapons_of_faction`: aggregate weapons across the\n // faction's units and dedupe by id. The collection-level\n // `weapons.byFaction()` is a different operation (it looks up weapons\n // whose own `faction_id` is set, which is empty for most factions).\n const f = ds.factions.get(q.args.factionId);\n if (!f) throw new Error(`weapons_of_faction: unknown faction ${q.args.factionId}`);\n return f.weapons.map((w) => w.id).sort();\n }\n }\n}\n\n/**\n * Attribution corpus: reuses the existing cruncher inputs from the cases that\n * carry at least one groupable buff (ability or manual). The expected shape\n * is the AttributedStage array produced by attributeStages; both\n * implementations of the leave-one-out decomposition must reproduce it\n * within the per-stage float tolerance.\n */\nconst ATTRIBUTION_CASE_FILES = [\n \"05-anti-infantry-vs-cultist.json\",\n \"07-twin-linked-heavy-stationary-vs-knight.json\",\n];\n\ninterface CruncherCaseInput {\n name: string;\n attacker: { weaponId: string; profileIndex: number };\n modelsFiring: number;\n target: { unitId: string; profileIndex: number; modelCount?: number };\n context: EngineInput[\"context\"];\n buffs: EngineInput[\"buffs\"];\n}\n\nfunction loadAttributionInput(ds: Dataset, filename: string): {\n name: string;\n input: EngineInput;\n} {\n const path = join(CONFORMANCE, \"cruncher\", filename);\n const c = JSON.parse(readFileSync(path, \"utf8\")) as CruncherCaseInput;\n const weapon = ds.weapons.get(c.attacker.weaponId);\n const unit = ds.units.get(c.target.unitId);\n if (!weapon) throw new Error(`attribution: unknown weapon ${c.attacker.weaponId}`);\n if (!unit) throw new Error(`attribution: unknown unit ${c.target.unitId}`);\n return {\n name: c.name,\n input: {\n attacker: { weapon: weapon.raw, profileIndex: c.attacker.profileIndex },\n target: {\n unit: unit.raw,\n profileIndex: c.target.profileIndex,\n ...(c.target.modelCount !== undefined ? { modelCount: c.target.modelCount } : {}),\n },\n modelsFiring: c.modelsFiring,\n buffs: c.buffs,\n context: c.context,\n },\n };\n}\n\nfunction genAttribution(): void {\n const ds = Dataset.embedded();\n const cases = ATTRIBUTION_CASE_FILES.map((filename, idx) => {\n const { name, input } = loadAttributionInput(ds, filename);\n const stages = attributeStages(input, ds);\n return {\n // Persist the input by file reference so the corpus stays a single\n // source of truth — the cruncher case file already pins the EngineInput.\n name,\n cruncher_case: filename,\n expected: stages.map((s) => ({\n name: s.name,\n expected: s.expected,\n baseline: s.baseline,\n lifts: s.lifts.map((l) => ({ source: l.source, delta: l.delta })),\n residual: s.residual,\n intrinsics: s.intrinsics,\n })),\n // Stable ordering of cases in the corpus file.\n _order: idx,\n };\n });\n // Sort by _order and strip the helper before writing.\n cases.sort((a, b) => a._order - b._order);\n const serialised = cases.map(({ _order: _o, ...rest }) => rest);\n writeJson(join(CONFORMANCE, \"attribution\", \"cases.json\"), serialised);\n console.log(`attribution/cases.json: ${cases.length} cases`);\n}\n\n/**\n * Scoring-card translation corpus: humanize each primary mission card's\n * `awards` into plain English. The TS translator is the oracle; the Rust port\n * must reproduce every string byte-for-byte (the differ compares structurally,\n * no tolerance). Only `card_type: \"primary\"` cards are pinned — the 14-card\n * secondary deck isn't revealed yet. Cases are sorted by id for stability, and\n * the `awards` array order within each card is load-bearing.\n */\nfunction genScoringTranslation(): void {\n const ds = Dataset.embedded();\n mkdirSync(join(CONFORMANCE, \"scoring-translation\"), { recursive: true });\n // Pin the translation of every mission card's awards — primary and secondary\n // alike (the secondary deck has the same `awards` shape and deserves the same\n // cross-impl pinning).\n const cases = ds.missionCards.all\n .filter((c) => c.card_type === \"primary\" || c.card_type === \"secondary\")\n .slice()\n .sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))\n .map((card) => ({ cardId: card.id, expected: { awards: describeScoringCard(card) } }));\n writeJson(join(CONFORMANCE, \"scoring-translation\", \"cases.json\"), cases);\n console.log(`scoring-translation/cases.json: ${cases.length} cases`);\n}\n\n/**\n * Terrain-resolver corpus: resolve template-anchored layouts to absolute\n * board-space vertices (y-down inches). The TS resolver is the oracle; the Rust\n * port must reproduce every vertex within 5e-4 (per-area invariant in\n * CONFORMANCE.md). Cases are self-contained — each carries its own `templates`\n * and `layout` — so the corpus does not depend on the bundled catalog and the\n * runner op can pass both in `args`. Coverage: per-template centroid anchoring\n * (identity), cardinal + oblique rotations, both mirror axes on an asymmetric\n * shape, embedded-feature composition, explicit parenting, and the inline\n * footprint escape hatch.\n */\nfunction genTerrainResolver(): void {\n mkdirSync(join(CONFORMANCE, \"terrain-resolver\"), { recursive: true });\n\n const areaLarge: ResolverTemplate = {\n id: \"area-large\",\n name: \"Large Area\",\n kind: \"area\",\n footprint: { type: \"rectangle\", width: 11.5, height: 7 },\n };\n const areaMedium: ResolverTemplate = {\n id: \"area-medium\",\n name: \"Medium Area\",\n kind: \"area\",\n footprint: { type: \"rectangle\", width: 6, height: 4 },\n };\n const areaTrapezoid: ResolverTemplate = {\n id: \"area-trapezoid\",\n name: \"Trapezoid Area\",\n kind: \"area\",\n footprint: {\n type: \"polygon\",\n points: [\n { x: 0, y: 0 },\n { x: 8, y: 0 },\n { x: 2, y: 11.5 },\n { x: 0, y: 11.5 },\n ],\n },\n };\n const wedge: ResolverTemplate = {\n id: \"wedge\",\n name: \"Right Wedge\",\n kind: \"area\",\n footprint: { type: \"right-triangle\", width: 8, height: 11.5 },\n };\n const wallLong: ResolverTemplate = {\n id: \"wall-long\",\n name: \"Long Wall\",\n kind: \"feature\",\n footprint: { type: \"rectangle\", width: 7, height: 0.25 },\n };\n const ruinComposed: ResolverTemplate = {\n id: \"ruin-composed\",\n name: \"Composed Ruin\",\n kind: \"area\",\n footprint: { type: \"rectangle\", width: 11.5, height: 7 },\n features: [\n { id: \"back-wall\", template: \"wall-long\", position: { x: 0, y: -3 } },\n { id: \"side-wall\", template: \"wall-long\", position: { x: -5, y: 0 }, rotation_degrees: 90, mirror: \"horizontal\" },\n ],\n };\n\n const baseCatalog = [areaLarge, areaMedium, areaTrapezoid, wedge, wallLong];\n\n const layoutCases: { name: string; templates: ResolverTemplate[]; layout: ResolverLayout }[] = [\n {\n name: \"identity-large\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-large\", position: { x: 30, y: 22 } }] },\n },\n {\n name: \"identity-wedge\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"wedge\", position: { x: 12, y: 30 } }] },\n },\n {\n name: \"identity-trapezoid\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-trapezoid\", position: { x: 40, y: 18 } }] },\n },\n {\n name: \"rotate-medium-90\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-medium\", position: { x: 30, y: 22 }, rotation_degrees: 90 }] },\n },\n {\n name: \"rotate-medium-180\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-medium\", position: { x: 30, y: 22 }, rotation_degrees: 180 }] },\n },\n {\n name: \"rotate-medium-270\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-medium\", position: { x: 30, y: 22 }, rotation_degrees: 270 }] },\n },\n {\n name: \"rotate-large-oblique-55\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-large\", position: { x: 30, y: 22 }, rotation_degrees: 55 }] },\n },\n {\n name: \"rotate-trapezoid-oblique-235\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-trapezoid\", position: { x: 35.75, y: 27 }, rotation_degrees: 235 }] },\n },\n {\n name: \"mirror-trapezoid-horizontal\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-trapezoid\", position: { x: 40, y: 18 }, mirror: \"horizontal\" }] },\n },\n {\n name: \"mirror-trapezoid-vertical-rot90\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-trapezoid\", position: { x: 40, y: 18 }, rotation_degrees: 90, mirror: \"vertical\" }] },\n },\n {\n name: \"composition-ruin-rot90-mirror-h\",\n templates: [ruinComposed, wallLong],\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"a1\", template: \"ruin-composed\", position: { x: 30, y: 22 }, rotation_degrees: 90, mirror: \"horizontal\" }] },\n },\n {\n name: \"explicit-parent-feature\",\n templates: [areaLarge, wallLong],\n layout: {\n id: \"c\",\n name: \"c\",\n pieces: [\n { id: \"a1\", template: \"area-large\", position: { x: 30, y: 22 }, rotation_degrees: 90, mirror: \"horizontal\" },\n { id: \"back-wall\", template: \"wall-long\", parent_area_id: \"a1\", position: { x: 0, y: -3 } },\n ],\n },\n },\n {\n name: \"inline-footprint-polygon\",\n templates: [],\n layout: {\n id: \"c\",\n name: \"c\",\n pieces: [\n {\n id: \"p\",\n footprint: { type: \"polygon\", points: [{ x: 0, y: 0 }, { x: 4, y: 0 }, { x: 2, y: 5 }] },\n position: { x: 50, y: 40 },\n rotation_degrees: 30,\n },\n ],\n },\n },\n ];\n\n const cases = layoutCases.map((c) => ({\n name: c.name,\n templates: c.templates,\n layout: c.layout,\n expected: { pieces: resolveLayout(c.layout, c.templates) },\n }));\n writeJson(join(CONFORMANCE, \"terrain-resolver\", \"cases.json\"), cases);\n console.log(`terrain-resolver/cases.json: ${cases.length} cases`);\n}\n\ngenNormalize();\ngenRosters();\ngenLinkedApi();\ngenAttribution();\ngenScoringTranslation();\ngenTerrainResolver();\n"]}
1
+ {"version":3,"file":"gen-conformance.js","sourceRoot":"","sources":["../src/gen-conformance.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;GAoBG;AACH,OAAO,EAAE,WAAW,EAAE,YAAY,EAAE,aAAa,EAAE,UAAU,EAAE,SAAS,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,MAAM,WAAW,CAAC;AAC1C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AAEzC,OAAO,EAAE,OAAO,EAAE,MAAM,mBAAmB,CAAC;AAC5C,OAAO,EAAE,aAAa,EAAE,MAAM,qBAAqB,CAAC;AACpD,OAAO,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAC3D,OAAO,E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AC,EAAE;KAC3D,CAAC,CAAC,CAAC;IACJ,SAAS,CAAC,IAAI,CAAC,WAAW,EAAE,kBAAkB,EAAE,YAAY,CAAC,EAAE,KAAK,CAAC,CAAC;IACtE,OAAO,CAAC,GAAG,CAAC,gCAAgC,KAAK,CAAC,MAAM,QAAQ,CAAC,CAAC;AACpE,CAAC;AAED,YAAY,EAAE,CAAC;AACf,UAAU,EAAE,CAAC;AACb,YAAY,EAAE,CAAC;AACf,cAAc,EAAE,CAAC;AACjB,qBAAqB,EAAE,CAAC;AACxB,UAAU,EAAE,CAAC;AACb,kBAAkB,EAAE,CAAC","sourcesContent":["/**\n * Generate the cross-implementation conformance corpus under repo-root\n * `conformance/`. The TypeScript package is the reference implementation, so\n * the goldens it emits are what the Rust crate must reproduce byte-for-byte\n * (structurally). Run via `npm run gen:conformance`; CI regenerates and asserts\n * `git diff --exit-code conformance/` is clean.\n *\n * Outputs:\n * - `conformance/normalize.json` — `[{ input, expected }]` for normalizeName.\n * - `conformance/roster/<case>/expected.roster.json` — the resolved Roster.\n * - `conformance/roster/<case>/expected.<fmt>.{txt,json}` — every export\n * target's golden output. The TS exporter is the oracle; the Rust mirror\n * asserts byte-equal output for the same Roster.\n * - `conformance/roster/<case>/input.newrecruit-{wtc-compact,wtc-full,simple}.txt`\n * — text inputs derived from the seed by the exporter, so a re-import\n * regression in either implementation surfaces immediately.\n *\n * Seeding: each `<case>/` carries one canonical input — either the legacy\n * `input.json` (ListForge) or `input.newrecruit-json.json` (NewRecruit). Other\n * inputs are derived.\n */\nimport { readdirSync, readFileSync, writeFileSync, existsSync, mkdirSync } from \"node:fs\";\nimport { dirname, join } from \"node:path\";\nimport { fileURLToPath } from \"node:url\";\n\nimport { Dataset } from \"./data/dataset.js\";\nimport { normalizeName } from \"./data/normalize.js\";\nimport { describeScoringCard } from \"./translate/index.js\";\nimport { awardsOf } from \"./scoring/index.js\";\nimport { createRunnerState, dispatch } from \"./runner.js\";\nimport { exportRoster, type ExportFormat } from \"./export/index.js\";\nimport { importRoster, REGISTERED_ADAPTERS } from \"./import/import-roster.js\";\nimport { selectAdapter } from \"./import/adapter.js\";\nimport type { ParsedRoster, Roster } from \"./import/types.js\";\nimport { encodeBase } from \"./runner.js\";\nimport { attributeStages } from \"./cruncher/attribution.js\";\nimport type { EngineInput } from \"./cruncher/index.js\";\nimport {\n resolveLayout,\n type TerrainTemplate as ResolverTemplate,\n type TerrainLayout as ResolverLayout,\n} from \"./terrain/resolve.js\";\n\nconst __dirname = dirname(fileURLToPath(import.meta.url));\nconst REPO_ROOT = join(__dirname, \"../..\");\nconst CONFORMANCE = join(REPO_ROOT, \"conformance\");\n\nconst NORMALIZE_INPUTS = [\n // NFD diacritic strip\n \"Khârn the Betrayer\",\n \"Brôkhyr\",\n \"Ûthar\",\n \"Magnús\",\n // apostrophe / quote variants\n \"T'au\",\n \"Be’lakor\",\n \"Kor’sarro Khan\",\n \"Aetaos'rau'keres\",\n \"‘quoted’\",\n // whitespace / hyphen collapse + trim\n \"Brôkhyr Iron-master\",\n \" the betrayer \",\n \"space--marines\",\n // casefold\n \"KHÂRN THE BETRAYER\",\n // already-normalized (idempotence)\n \"kharn the betrayer\",\n // distinctness anchors (must NOT collapse together)\n \"Khorne\",\n \"Khârn\",\n // Unicode whitespace beyond ASCII — every Unicode whitespace must collapse\n // identically across implementations or `find(\"Khorne Lord\")` and\n // `find(\"Khorne Lord\")` will silently disagree across ports.\n \"Khorne Lord\",\n \"Khorne Lord\",\n // Turkish dotted-I: NFD decomposes to `I` + combining dot above; the dot is\n // stripped, then locale-independent lowercase yields `i`. The case pins that\n // no implementation introduces locale-aware casefolding (which would map\n // `I` → `ı` under Turkish locale and break ASCII-text search).\n \"İmperial Fists\",\n // Zero-width joiner: passes through every step today. Pinned so behavior\n // does not silently change — if a future commit strips Cf-category chars,\n // this golden updates in the same PR.\n \"Khorne‍Lord\",\n];\n\nfunction writeJson(path: string, value: unknown): void {\n writeFileSync(path, `${JSON.stringify(value, null, 2)}\\n`);\n}\n\nfunction writeText(path: string, value: string): void {\n writeFileSync(path, value);\n}\n\nfunction genNormalize(): void {\n const table = NORMALIZE_INPUTS.map((input) => ({ input, expected: normalizeName(input) }));\n writeJson(join(CONFORMANCE, \"normalize.json\"), table);\n console.log(`normalize.json: ${table.length} cases`);\n}\n\n/** Locate the canonical input for a fixture dir: prefer `input.json` (legacy\n * ListForge), then `input.newrecruit-json.json` (NewRecruit), then the\n * text-only `input.gw.txt` (GW app export — import-only, like ListForge). */\nfunction seedRoster(caseDir: string, ds: Dataset): Roster {\n const decoded = decodeCanonicalSeed(caseDir);\n return importRoster(decoded, { dataset: ds });\n}\n\n/** Return the decoded payload for the canonical seed — the same value the\n * import pipeline would dispatch on. JSON seeds come back parsed; text seeds\n * come back as the raw string. */\nfunction decodeCanonicalSeed(caseDir: string): unknown {\n const jsonSeed = join(caseDir, \"input.json\");\n if (existsSync(jsonSeed)) {\n return JSON.parse(readFileSync(jsonSeed, \"utf8\"));\n }\n const nrSeed = join(caseDir, \"input.newrecruit-json.json\");\n if (existsSync(nrSeed)) {\n return JSON.parse(readFileSync(nrSeed, \"utf8\"));\n }\n const gwSeed = join(caseDir, \"input.gw.txt\");\n if (existsSync(gwSeed)) {\n return readFileSync(gwSeed, \"utf8\");\n }\n throw new Error(`no canonical input found in ${caseDir}`);\n}\n\n/** Run a decoded payload through the adapter pipeline up to (but not past)\n * resolution. The result is the format-agnostic ParsedRoster — the same\n * intermediate the resolver consumes. Pinning this layer surfaces parser\n * regressions even when resolution masks them. */\nfunction parsedFromCanonicalSeed(caseDir: string): ParsedRoster {\n const decoded = decodeCanonicalSeed(caseDir);\n const adapter = selectAdapter(decoded, [...REGISTERED_ADAPTERS]);\n return adapter.parse(decoded);\n}\n\nconst TEXT_FORMATS: { format: ExportFormat; inputName: string; goldenName: string }[] = [\n {\n format: \"newrecruit-wtc-compact\",\n inputName: \"input.newrecruit-wtc-compact.txt\",\n goldenName: \"expected.newrecruit-wtc-compact.txt\",\n },\n {\n format: \"newrecruit-wtc-full\",\n inputName: \"input.newrecruit-wtc-full.txt\",\n goldenName: \"expected.newrecruit-wtc-full.txt\",\n },\n {\n format: \"newrecruit-simple\",\n inputName: \"input.newrecruit-simple.txt\",\n goldenName: \"expected.newrecruit-simple.txt\",\n },\n];\n\nfunction genRosters(): void {\n const ds = Dataset.embedded();\n const rosterDir = join(CONFORMANCE, \"roster\");\n for (const entry of readdirSync(rosterDir, { withFileTypes: true })) {\n if (!entry.isDirectory()) continue;\n const caseDir = join(rosterDir, entry.name);\n\n const seed = seedRoster(caseDir, ds);\n writeJson(join(caseDir, \"expected.roster.json\"), seed);\n\n // Parsed-stage golden — the intermediate ParsedRoster produced by the\n // adapter for the canonical seed, before resolution. Catches parser bugs\n // that resolution would otherwise mask (e.g. wrong unit count from a\n // duplicate cost line that resolves to the same unit twice).\n writeJson(join(caseDir, \"expected.parsed.json\"), parsedFromCanonicalSeed(caseDir));\n\n // JSON export golden — NewRecruit-shaped skeleton.\n const jsonOut = exportRoster(seed, \"newrecruit-json\");\n writeJson(join(caseDir, \"expected.newrecruit-json.json\"), JSON.parse(jsonOut));\n\n // Canonical Roster JSON export — should equal the resolved roster.\n writeJson(join(caseDir, \"expected.roster-json.json\"), JSON.parse(exportRoster(seed, \"roster-json\")));\n\n // Text exports: always write the export golden so every fixture exercises\n // the cross-implementation byte-equality check. Only write the\n // `input.*.txt` round-trip seed when the fixture was authored for the\n // NewRecruit pipeline — legacy ListForge fixtures carry decoration\n // (multi-force warnings, leader-attachment inference) that the simple/wtc\n // exporters can't fully preserve, so the round-trip would fail\n // structurally rather than uncover a parser bug.\n const isNewRecruitSeed = existsSync(join(caseDir, \"input.newrecruit-json.json\"));\n for (const { format, inputName, goldenName } of TEXT_FORMATS) {\n const out = exportRoster(seed, format);\n writeText(join(caseDir, goldenName), out);\n if (isNewRecruitSeed) {\n writeText(join(caseDir, inputName), out);\n }\n }\n\n // Rosterizer JSON export + a derived round-trip input. The exporter is\n // deterministic and round-trips through the adapter, so emitting it as\n // both `expected.rosterizer.json` and `input.rosterizer.json` pins the\n // cross-implementation goldens and the importer regression at the same\n // time. Same NewRecruit-seed gate as the text formats — multi-force\n // ListForge fixtures lose their provisional leader-attachment under\n // round-trip, so they only get the export golden, not the derived input.\n const rosterizerOut = exportRoster(seed, \"rosterizer\");\n writeJson(join(caseDir, \"expected.rosterizer.json\"), JSON.parse(rosterizerOut));\n if (isNewRecruitSeed) {\n writeJson(join(caseDir, \"input.rosterizer.json\"), JSON.parse(rosterizerOut));\n }\n\n console.log(\n `roster/${entry.name}: ${seed.units.length} units, ${seed.diagnostics.warnings.length} warnings`,\n );\n }\n}\n\n/**\n * Linked-API query cases. Each descriptor names a query method on Dataset, the\n * args to call it with, and how the result should be compared.\n *\n * `comparison: \"ordered\"` pins the result order — used for queries that iterate\n * a data-driven array (`unit.ability_ids`, `unit.weapon_ids`) where order is\n * encoded in the data and both implementations iterate it the same way.\n *\n * `comparison: \"set\"` pins only the set of ids — used for queries that walk an\n * index (faction → abilities, ability → phases) where iteration order depends\n * on dataset bundler internals and is incidental. Ids are sorted before\n * comparison.\n *\n * `comparison: \"scalar\"` pins a single id-or-null result (find_* and\n * faction_of(unit)).\n */\ntype LinkedApiQuery =\n | { name: string; query: \"find_unit\"; args: { query: string }; comparison: \"scalar\" }\n | { name: string; query: \"find_weapon\"; args: { query: string }; comparison: \"scalar\" }\n | { name: string; query: \"find_faction\"; args: { query: string }; comparison: \"scalar\" }\n | { name: string; query: \"find_ability\"; args: { query: string }; comparison: \"scalar\" }\n | { name: string; query: \"abilities_of\"; args: { unitId: string }; comparison: \"ordered\" }\n | { name: string; query: \"weapons_of\"; args: { unitId: string }; comparison: \"ordered\" }\n | { name: string; query: \"phases_of\"; args: { abilityId: string }; comparison: \"set\" }\n | { name: string; query: \"faction_of\"; args: { unitId: string }; comparison: \"scalar\" }\n | { name: string; query: \"abilities_of_faction\"; args: { factionId: string }; comparison: \"set\" }\n | { name: string; query: \"weapons_of_faction\"; args: { factionId: string }; comparison: \"set\" }\n | { name: string; query: \"base_size_of\"; args: { unitId: string }; comparison: \"scalar\" }\n | { name: string; query: \"model_bases_of\"; args: { unitId: string }; comparison: \"ordered\" };\n\nconst LINKED_API_QUERIES: LinkedApiQuery[] = [\n // find_unit: diacritic-insensitive lookup, miss returns null.\n { name: \"find_unit by diacritic name\", query: \"find_unit\", args: { query: \"Kharn\" }, comparison: \"scalar\" },\n { name: \"find_unit miss returns null\", query: \"find_unit\", args: { query: \"not-a-real-unit-xyz\" }, comparison: \"scalar\" },\n // find_weapon: hyphen + space tolerance.\n { name: \"find_weapon by name\", query: \"find_weapon\", args: { query: \"bolt rifle\" }, comparison: \"scalar\" },\n // find_faction: punctuation/diacritic tolerance.\n { name: \"find_faction by display name\", query: \"find_faction\", args: { query: \"World Eaters\" }, comparison: \"scalar\" },\n // find_ability: ability name lookup.\n { name: \"find_ability by name\", query: \"find_ability\", args: { query: \"Berzerker Frenzy\" }, comparison: \"scalar\" },\n // abilities_of(unit): ordered, iterates unit.ability_ids array.\n { name: \"abilities_of intercessor-squad\", query: \"abilities_of\", args: { unitId: \"intercessor-squad\" }, comparison: \"ordered\" },\n { name: \"abilities_of kharn-the-betrayer\", query: \"abilities_of\", args: { unitId: \"kharn-the-betrayer\" }, comparison: \"ordered\" },\n // weapons_of(unit): ordered, iterates unit.weapon_ids array.\n { name: \"weapons_of intercessor-squad\", query: \"weapons_of\", args: { unitId: \"intercessor-squad\" }, comparison: \"ordered\" },\n { name: \"weapons_of kharn-the-betrayer\", query: \"weapons_of\", args: { unitId: \"kharn-the-betrayer\" }, comparison: \"ordered\" },\n // phases_of(ability): compared as set (phase index iteration order is incidental).\n { name: \"phases_of berzerker-frenzy\", query: \"phases_of\", args: { abilityId: \"berzerker-frenzy\" }, comparison: \"set\" },\n // faction_of(unit): scalar id or null.\n { name: \"faction_of intercessor-squad\", query: \"faction_of\", args: { unitId: \"intercessor-squad\" }, comparison: \"scalar\" },\n // abilities_of_faction: compared as set (collection-index order is incidental).\n { name: \"abilities_of_faction world-eaters\", query: \"abilities_of_faction\", args: { factionId: \"world-eaters\" }, comparison: \"set\" },\n // weapons_of_faction: compared as set.\n { name: \"weapons_of_faction world-eaters\", query: \"weapons_of_faction\", args: { factionId: \"world-eaters\" }, comparison: \"set\" },\n // base_size_of(unit): scalar encoded base — round, oval, and a draft flying-base.\n { name: \"base_size_of intercessor-squad\", query: \"base_size_of\", args: { unitId: \"intercessor-squad\" }, comparison: \"scalar\" },\n { name: \"base_size_of vertus-praetors\", query: \"base_size_of\", args: { unitId: \"vertus-praetors\" }, comparison: \"scalar\" },\n { name: \"base_size_of windriders (draft flying base)\", query: \"base_size_of\", args: { unitId: \"windriders\" }, comparison: \"scalar\" },\n // model_bases_of(unit): ordered per-model bases; jakhals mixes 28.5mm bodies with a 40mm Dishonoured.\n { name: \"model_bases_of jakhals (mixed)\", query: \"model_bases_of\", args: { unitId: \"jakhals\" }, comparison: \"ordered\" },\n];\n\nfunction genLinkedApi(): void {\n const ds = Dataset.embedded();\n const cases = LINKED_API_QUERIES.map((q) => {\n const expected = runLinkedQuery(ds, q);\n return { ...q, expected };\n });\n writeJson(join(CONFORMANCE, \"linked-api\", \"cases.json\"), cases);\n console.log(`linked-api/cases.json: ${cases.length} cases`);\n}\n\nfunction runLinkedQuery(ds: Dataset, q: LinkedApiQuery): string | null | string[] {\n switch (q.query) {\n case \"find_unit\":\n return ds.units.find(q.args.query)?.id ?? null;\n case \"find_weapon\":\n return ds.weapons.find(q.args.query)?.id ?? null;\n case \"find_faction\":\n return ds.factions.find(q.args.query)?.id ?? null;\n case \"find_ability\":\n return ds.abilities.find(q.args.query)?.id ?? null;\n case \"abilities_of\": {\n const u = ds.units.get(q.args.unitId);\n if (!u) throw new Error(`abilities_of: unknown unit ${q.args.unitId}`);\n return u.abilities.map((a) => a.id);\n }\n case \"weapons_of\": {\n const u = ds.units.get(q.args.unitId);\n if (!u) throw new Error(`weapons_of: unknown unit ${q.args.unitId}`);\n return u.weapons.map((w) => w.id);\n }\n case \"phases_of\": {\n const a = ds.abilities.get(q.args.abilityId);\n if (!a) throw new Error(`phases_of: unknown ability ${q.args.abilityId}`);\n return [...a.phases].sort();\n }\n case \"faction_of\": {\n const u = ds.units.get(q.args.unitId);\n if (!u) throw new Error(`faction_of: unknown unit ${q.args.unitId}`);\n return u.faction?.id ?? null;\n }\n case \"abilities_of_faction\":\n return ds.abilities.byFaction(q.args.factionId).map((a) => a.id).sort();\n case \"weapons_of_faction\": {\n // Mirrors Rust `weapons_of_faction`: aggregate weapons across the\n // faction's units and dedupe by id. The collection-level\n // `weapons.byFaction()` is a different operation (it looks up weapons\n // whose own `faction_id` is set, which is empty for most factions).\n const f = ds.factions.get(q.args.factionId);\n if (!f) throw new Error(`weapons_of_faction: unknown faction ${q.args.factionId}`);\n return f.weapons.map((w) => w.id).sort();\n }\n case \"base_size_of\": {\n const u = ds.units.get(q.args.unitId);\n if (!u) throw new Error(`base_size_of: unknown unit ${q.args.unitId}`);\n return encodeBase(u.raw.base_size_mm);\n }\n case \"model_bases_of\": {\n const u = ds.units.get(q.args.unitId);\n if (!u) throw new Error(`model_bases_of: unknown unit ${q.args.unitId}`);\n const comp = ds.unitCompositions.find((c) => c.unit_id === q.args.unitId);\n return (comp?.models ?? []).map((m) => `${m.name}=${encodeBase(m.base_size_mm) ?? \"none\"}`);\n }\n }\n}\n\n/**\n * Attribution corpus: reuses the existing cruncher inputs from the cases that\n * carry at least one groupable buff (ability or manual). The expected shape\n * is the AttributedStage array produced by attributeStages; both\n * implementations of the leave-one-out decomposition must reproduce it\n * within the per-stage float tolerance.\n */\nconst ATTRIBUTION_CASE_FILES = [\n \"05-anti-infantry-vs-cultist.json\",\n \"07-twin-linked-heavy-stationary-vs-knight.json\",\n];\n\ninterface CruncherCaseInput {\n name: string;\n attacker: { weaponId: string; profileIndex: number };\n modelsFiring: number;\n target: { unitId: string; profileIndex: number; modelCount?: number };\n context: EngineInput[\"context\"];\n buffs: EngineInput[\"buffs\"];\n}\n\nfunction loadAttributionInput(ds: Dataset, filename: string): {\n name: string;\n input: EngineInput;\n} {\n const path = join(CONFORMANCE, \"cruncher\", filename);\n const c = JSON.parse(readFileSync(path, \"utf8\")) as CruncherCaseInput;\n const weapon = ds.weapons.get(c.attacker.weaponId);\n const unit = ds.units.get(c.target.unitId);\n if (!weapon) throw new Error(`attribution: unknown weapon ${c.attacker.weaponId}`);\n if (!unit) throw new Error(`attribution: unknown unit ${c.target.unitId}`);\n return {\n name: c.name,\n input: {\n attacker: { weapon: weapon.raw, profileIndex: c.attacker.profileIndex },\n target: {\n unit: unit.raw,\n profileIndex: c.target.profileIndex,\n ...(c.target.modelCount !== undefined ? { modelCount: c.target.modelCount } : {}),\n },\n modelsFiring: c.modelsFiring,\n buffs: c.buffs,\n context: c.context,\n },\n };\n}\n\nfunction genAttribution(): void {\n const ds = Dataset.embedded();\n const cases = ATTRIBUTION_CASE_FILES.map((filename, idx) => {\n const { name, input } = loadAttributionInput(ds, filename);\n const stages = attributeStages(input, ds);\n return {\n // Persist the input by file reference so the corpus stays a single\n // source of truth — the cruncher case file already pins the EngineInput.\n name,\n cruncher_case: filename,\n expected: stages.map((s) => ({\n name: s.name,\n expected: s.expected,\n baseline: s.baseline,\n lifts: s.lifts.map((l) => ({ source: l.source, delta: l.delta })),\n residual: s.residual,\n intrinsics: s.intrinsics,\n })),\n // Stable ordering of cases in the corpus file.\n _order: idx,\n };\n });\n // Sort by _order and strip the helper before writing.\n cases.sort((a, b) => a._order - b._order);\n const serialised = cases.map(({ _order: _o, ...rest }) => rest);\n writeJson(join(CONFORMANCE, \"attribution\", \"cases.json\"), serialised);\n console.log(`attribution/cases.json: ${cases.length} cases`);\n}\n\n/**\n * Scoring-card translation corpus: humanize each primary mission card's\n * `awards` into plain English. The TS translator is the oracle; the Rust port\n * must reproduce every string byte-for-byte (the differ compares structurally,\n * no tolerance). Only `card_type: \"primary\"` cards are pinned — the 14-card\n * secondary deck isn't revealed yet. Cases are sorted by id for stability, and\n * the `awards` array order within each card is load-bearing.\n */\nfunction genScoringTranslation(): void {\n const ds = Dataset.embedded();\n mkdirSync(join(CONFORMANCE, \"scoring-translation\"), { recursive: true });\n // Pin the translation of every mission card's awards — primary and secondary\n // alike (the secondary deck has the same `awards` shape and deserves the same\n // cross-impl pinning).\n const cases = ds.missionCards.all\n .filter((c) => c.card_type === \"primary\" || c.card_type === \"secondary\")\n .slice()\n .sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0))\n .map((card) => ({ cardId: card.id, expected: { awards: describeScoringCard(card) } }));\n writeJson(join(CONFORMANCE, \"scoring-translation\", \"cases.json\"), cases);\n console.log(`scoring-translation/cases.json: ${cases.length} cases`);\n}\n\n/**\n * Scoring-engine corpus: pin the pure VP arithmetic of the scoring engine\n * (`tools/src/scoring/` — the oracle) so the Rust `wh40kdc::scoring` port\n * reproduces it. Three ops, each case `{ name, op, args, expected }`:\n *\n * - `score_event` — per card and approach, assert every award matching the\n * approach (by its full-`awards`-array index). Pins `scoreAward`, `scoreTurn`\n * (exclusive-group \"highest only\", `vp_per × count` clamped to `per_max`,\n * cumulative sums), `scoreCap` (tactical 5 vs fixed `vp_max`/uncapped), and\n * `scoreSecondaryEvent`; primary cards also carry a `roundCap` to pin\n * `scorePrimaryEvent`. `cap: null` means uncapped (Infinity has no JSON form).\n * - `score_state` — replay scenarios over a `PlayerGame`, pinning the per-round\n * cap (15), per-game primary cap (45), grand-total cap (100), score+discard,\n * and undo.\n * - `wtc_result` — the 20-point band mapping across its boundaries.\n *\n * Goldens are produced by driving the TS runner's own `dispatch`, so the corpus\n * and the runner agree by construction; the cross-impl contract is the Rust\n * runner reproducing them. Integers are compared exactly (no tolerance).\n */\nfunction genScoring(): void {\n const ds = Dataset.embedded();\n mkdirSync(join(CONFORMANCE, \"scoring\"), { recursive: true });\n\n // One initialized runner state, reused across cases (the ops don't mutate it).\n const specVersion = Number.parseInt(\n readFileSync(join(CONFORMANCE, \"SPEC_VERSION\"), \"utf8\").trim(),\n 10,\n );\n const state = createRunnerState();\n const init = dispatch(state, {\n op: \"init\",\n args: { spec_version: specVersion, locale: \"C\", tz: \"UTC\", seed: 0 },\n });\n if (!init.ok) throw new Error(`gen scoring: init failed: ${JSON.stringify(init)}`);\n const run = (op: string, args: unknown): unknown => {\n const r = dispatch(state, { op, args });\n if (!r.ok) throw new Error(`gen scoring: ${op} failed: ${JSON.stringify(r)} for ${JSON.stringify(args)}`);\n return r.value;\n };\n\n type Case = { name: string; op: string; args: unknown; expected: unknown };\n const cases: Case[] = [];\n\n // score_event: every mission card, both approaches. Assert the approach's\n // awards by their full-array index; count vp_per awards to their per_max\n // (else 2) so the cap logic actually bites.\n const cards = ds.missionCards.all\n .slice()\n .sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));\n for (const card of cards) {\n for (const approach of [\"fixed\", \"tactical\"] as const) {\n const asserted = awardsOf(card)\n .map((aw, index) => ({ aw, index }))\n .filter(({ aw }) => aw.mode == null || aw.mode === approach)\n .map(({ aw, index }) =>\n aw.vp_per != null ? { index, count: aw.per_max ?? 2 } : { index },\n );\n const args: Record<string, unknown> = { cardId: card.id, approach, asserted };\n if (card.card_type === \"primary\") args.roundCap = 15;\n cases.push({\n name: `score_event/${card.id}/${approach}`,\n op: \"score_event\",\n args,\n expected: run(\"score_event\", args),\n });\n }\n }\n\n // score_state: hand-authored replay scenarios. Card ids are real deck/mission\n // cards; expected state is whatever the engine produces.\n const stateScenarios: { name: string; args: unknown }[] = [\n {\n name: \"primary-round-and-game-caps\",\n args: {\n approach: \"tactical\",\n ops: [\n { kind: \"set-primary\", round: 1, vp: 30, roundCap: 15, gameCap: 45 },\n { kind: \"set-primary\", round: 2, vp: 30, roundCap: 15, gameCap: 45 },\n { kind: \"set-primary\", round: 3, vp: 30, roundCap: 15, gameCap: 45 },\n { kind: \"set-primary\", round: 4, vp: 30, roundCap: 15, gameCap: 45 },\n ],\n },\n },\n {\n // The full primary path: a card's raw round total, clamped to the round\n // cap on store, then cleared back to 0 by a set-primary 0.\n name: \"score-primary-then-clear\",\n args: {\n approach: \"tactical\",\n ops: [\n {\n kind: \"score-primary\",\n cardId: \"ground-control\",\n round: 2,\n asserted: awardsOf(ds.missionCards.get(\"ground-control\")!).map((aw, index) =>\n aw.vp_per != null ? { index, count: aw.per_max ?? 3 } : { index },\n ),\n roundCap: 15,\n gameCap: 45,\n },\n { kind: \"set-primary\", round: 3, vp: 99, roundCap: 15, gameCap: 45 },\n { kind: \"set-primary\", round: 2, vp: 0, roundCap: 15, gameCap: 45 },\n ],\n },\n },\n {\n name: \"secondary-score-and-undo\",\n args: {\n approach: \"tactical\",\n ops: [\n { kind: \"draw\", cardId: \"no-prisoners\" },\n { kind: \"score-secondary\", cardId: \"no-prisoners\", round: 2, asserted: [{ index: 0, count: 3 }] },\n { kind: \"remove-score\", index: 0 },\n ],\n },\n },\n {\n // Uncapped set-primary (no caps) overshoots so the 100 grand-total cap bites.\n name: \"grand-total-cap-at-100\",\n args: {\n approach: \"tactical\",\n ops: [\n { kind: \"set-primary\", round: 1, vp: 30 },\n { kind: \"set-primary\", round: 2, vp: 30 },\n { kind: \"set-primary\", round: 3, vp: 30 },\n { kind: \"set-primary\", round: 4, vp: 30 },\n { kind: \"set-primary\", round: 5, vp: 30 },\n { kind: \"draw\", cardId: \"no-prisoners\" },\n { kind: \"score-secondary\", cardId: \"no-prisoners\", round: 5, asserted: [{ index: 0, count: 99 }] },\n ],\n },\n },\n ];\n for (const s of stateScenarios) {\n cases.push({ name: `score_state/${s.name}`, op: \"score_state\", args: s.args, expected: run(\"score_state\", s.args) });\n }\n\n // wtc_result: band boundaries and symmetry.\n const wtcPairs: [number, number][] = [\n [50, 50],\n [48, 45],\n [45, 50],\n [56, 50],\n [50, 61],\n [100, 50],\n [100, 49],\n [0, 100],\n [60, 40],\n [55, 50],\n ];\n for (const [a, b] of wtcPairs) {\n const args = { a, b };\n cases.push({ name: `wtc_result/${a}-${b}`, op: \"wtc_result\", args, expected: run(\"wtc_result\", args) });\n }\n\n writeJson(join(CONFORMANCE, \"scoring\", \"cases.json\"), cases);\n console.log(`scoring/cases.json: ${cases.length} cases`);\n}\n\n/**\n * Terrain-resolver corpus: resolve template-anchored layouts to absolute\n * board-space vertices (y-down inches). The TS resolver is the oracle; the Rust\n * port must reproduce every vertex within 5e-4 (per-area invariant in\n * CONFORMANCE.md). Cases are self-contained — each carries its own `templates`\n * and `layout` — so the corpus does not depend on the bundled catalog and the\n * runner op can pass both in `args`. Coverage: per-template centroid anchoring\n * (identity), cardinal + oblique rotations, both mirror axes on an asymmetric\n * shape, embedded-feature composition, explicit parenting, and the inline\n * footprint escape hatch.\n */\nfunction genTerrainResolver(): void {\n mkdirSync(join(CONFORMANCE, \"terrain-resolver\"), { recursive: true });\n\n const areaLarge: ResolverTemplate = {\n id: \"area-large\",\n name: \"Large Area\",\n kind: \"area\",\n footprint: { type: \"rectangle\", width: 11.5, height: 7 },\n };\n const areaMedium: ResolverTemplate = {\n id: \"area-medium\",\n name: \"Medium Area\",\n kind: \"area\",\n footprint: { type: \"rectangle\", width: 6, height: 4 },\n };\n const areaTrapezoid: ResolverTemplate = {\n id: \"area-trapezoid\",\n name: \"Trapezoid Area\",\n kind: \"area\",\n footprint: {\n type: \"polygon\",\n points: [\n { x: 0, y: 0 },\n { x: 8, y: 0 },\n { x: 2, y: 11.5 },\n { x: 0, y: 11.5 },\n ],\n },\n };\n const wedge: ResolverTemplate = {\n id: \"wedge\",\n name: \"Right Wedge\",\n kind: \"area\",\n footprint: { type: \"right-triangle\", width: 8, height: 11.5 },\n };\n const wallLong: ResolverTemplate = {\n id: \"wall-long\",\n name: \"Long Wall\",\n kind: \"feature\",\n footprint: { type: \"rectangle\", width: 7, height: 0.25 },\n };\n const ruinComposed: ResolverTemplate = {\n id: \"ruin-composed\",\n name: \"Composed Ruin\",\n kind: \"area\",\n footprint: { type: \"rectangle\", width: 11.5, height: 7 },\n features: [\n { id: \"back-wall\", template: \"wall-long\", position: { x: 0, y: -3 } },\n { id: \"side-wall\", template: \"wall-long\", position: { x: -5, y: 0 }, rotation_degrees: 90, mirror: \"horizontal\" },\n ],\n };\n\n const baseCatalog = [areaLarge, areaMedium, areaTrapezoid, wedge, wallLong];\n\n const layoutCases: { name: string; templates: ResolverTemplate[]; layout: ResolverLayout }[] = [\n {\n name: \"identity-large\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-large\", position: { x: 30, y: 22 } }] },\n },\n {\n name: \"identity-wedge\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"wedge\", position: { x: 12, y: 30 } }] },\n },\n {\n name: \"identity-trapezoid\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-trapezoid\", position: { x: 40, y: 18 } }] },\n },\n {\n name: \"rotate-medium-90\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-medium\", position: { x: 30, y: 22 }, rotation_degrees: 90 }] },\n },\n {\n name: \"rotate-medium-180\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-medium\", position: { x: 30, y: 22 }, rotation_degrees: 180 }] },\n },\n {\n name: \"rotate-medium-270\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-medium\", position: { x: 30, y: 22 }, rotation_degrees: 270 }] },\n },\n {\n name: \"rotate-large-oblique-55\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-large\", position: { x: 30, y: 22 }, rotation_degrees: 55 }] },\n },\n {\n name: \"rotate-trapezoid-oblique-235\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-trapezoid\", position: { x: 35.75, y: 27 }, rotation_degrees: 235 }] },\n },\n {\n name: \"mirror-trapezoid-horizontal\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-trapezoid\", position: { x: 40, y: 18 }, mirror: \"horizontal\" }] },\n },\n {\n name: \"mirror-trapezoid-vertical-rot90\",\n templates: baseCatalog,\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"p\", template: \"area-trapezoid\", position: { x: 40, y: 18 }, rotation_degrees: 90, mirror: \"vertical\" }] },\n },\n {\n name: \"composition-ruin-rot90-mirror-h\",\n templates: [ruinComposed, wallLong],\n layout: { id: \"c\", name: \"c\", pieces: [{ id: \"a1\", template: \"ruin-composed\", position: { x: 30, y: 22 }, rotation_degrees: 90, mirror: \"horizontal\" }] },\n },\n {\n name: \"explicit-parent-feature\",\n templates: [areaLarge, wallLong],\n layout: {\n id: \"c\",\n name: \"c\",\n pieces: [\n { id: \"a1\", template: \"area-large\", position: { x: 30, y: 22 }, rotation_degrees: 90, mirror: \"horizontal\" },\n { id: \"back-wall\", template: \"wall-long\", parent_area_id: \"a1\", position: { x: 0, y: -3 } },\n ],\n },\n },\n {\n name: \"inline-footprint-polygon\",\n templates: [],\n layout: {\n id: \"c\",\n name: \"c\",\n pieces: [\n {\n id: \"p\",\n footprint: { type: \"polygon\", points: [{ x: 0, y: 0 }, { x: 4, y: 0 }, { x: 2, y: 5 }] },\n position: { x: 50, y: 40 },\n rotation_degrees: 30,\n },\n ],\n },\n },\n ];\n\n const cases = layoutCases.map((c) => ({\n name: c.name,\n templates: c.templates,\n layout: c.layout,\n expected: { pieces: resolveLayout(c.layout, c.templates) },\n }));\n writeJson(join(CONFORMANCE, \"terrain-resolver\", \"cases.json\"), cases);\n console.log(`terrain-resolver/cases.json: ${cases.length} cases`);\n}\n\ngenNormalize();\ngenRosters();\ngenLinkedApi();\ngenAttribution();\ngenScoringTranslation();\ngenScoring();\ngenTerrainResolver();\n"]}
@@ -154,53 +154,13 @@ export type AbilityCondition1 = SimpleCondition | CompoundCondition;
154
154
  * Effect applied when the action completes (e.g. terrain-area-tag, objective-tag, or unit-tag to mark transient state).
155
155
  */
156
156
  export type AbilityEffect = SingleEffect | ChoiceEffect | SequenceEffect | DiceGatedEffect | ConditionalEffect | DicePoolAllocationEffect;
157
- /**
158
- * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
159
- * via the `definition` "single-effect".
160
- */
161
- export type SingleEffect = unknown & {
162
- type: "stat-modifier" | "roll-modifier" | "re-roll" | "mortal-wounds" | "feel-no-pain" | "invulnerable-save" | "ward" | "keyword-grant" | "movement-modifier" | "deep-strike" | "fallback-and-act" | "fight-first" | "fight-last" | "shoot-on-death" | "fight-on-death" | "objective-control-modifier" | "leadership-modifier" | "damage-reduction" | "attack-restriction" | "ability-grant" | "cp-gain" | "cp-refund" | "model-destruction" | "resurrection" | "resource-gain" | "resource-spend" | "charge-roll-modifier" | "terrain-area-tag" | "objective-tag" | "unit-tag" | "bs-modifier" | "engagement-passthrough";
163
- target: "self" | "bearer" | "unit" | "attached-unit" | "attacker" | "defender" | "friendly-within-aura" | "enemy-within-aura" | "all-friendly" | "all-enemy";
164
- modifier?: {
165
- [k: string]: unknown;
166
- };
167
- [k: string]: unknown;
168
- } & {
169
- type: "stat-modifier" | "roll-modifier" | "re-roll" | "mortal-wounds" | "feel-no-pain" | "invulnerable-save" | "ward" | "keyword-grant" | "movement-modifier" | "deep-strike" | "fallback-and-act" | "fight-first" | "fight-last" | "shoot-on-death" | "fight-on-death" | "objective-control-modifier" | "leadership-modifier" | "damage-reduction" | "attack-restriction" | "ability-grant" | "cp-gain" | "cp-refund" | "model-destruction" | "resurrection" | "resource-gain" | "resource-spend" | "charge-roll-modifier" | "terrain-area-tag" | "objective-tag" | "unit-tag" | "bs-modifier" | "engagement-passthrough";
170
- target: "self" | "bearer" | "unit" | "attached-unit" | "attacker" | "defender" | "friendly-within-aura" | "enemy-within-aura" | "all-friendly" | "all-enemy";
171
- modifier?: {
172
- [k: string]: unknown;
173
- };
174
- [k: string]: unknown;
175
- } & {
176
- type: "stat-modifier" | "roll-modifier" | "re-roll" | "mortal-wounds" | "feel-no-pain" | "invulnerable-save" | "ward" | "keyword-grant" | "movement-modifier" | "deep-strike" | "fallback-and-act" | "fight-first" | "fight-last" | "shoot-on-death" | "fight-on-death" | "objective-control-modifier" | "leadership-modifier" | "damage-reduction" | "attack-restriction" | "ability-grant" | "cp-gain" | "cp-refund" | "model-destruction" | "resurrection" | "resource-gain" | "resource-spend" | "charge-roll-modifier" | "terrain-area-tag" | "objective-tag" | "unit-tag" | "bs-modifier" | "engagement-passthrough";
177
- target: "self" | "bearer" | "unit" | "attached-unit" | "attacker" | "defender" | "friendly-within-aura" | "enemy-within-aura" | "all-friendly" | "all-enemy";
178
- modifier?: {
179
- [k: string]: unknown;
180
- };
181
- [k: string]: unknown;
182
- } & {
183
- type: "stat-modifier" | "roll-modifier" | "re-roll" | "mortal-wounds" | "feel-no-pain" | "invulnerable-save" | "ward" | "keyword-grant" | "movement-modifier" | "deep-strike" | "fallback-and-act" | "fight-first" | "fight-last" | "shoot-on-death" | "fight-on-death" | "objective-control-modifier" | "leadership-modifier" | "damage-reduction" | "attack-restriction" | "ability-grant" | "cp-gain" | "cp-refund" | "model-destruction" | "resurrection" | "resource-gain" | "resource-spend" | "charge-roll-modifier" | "terrain-area-tag" | "objective-tag" | "unit-tag" | "bs-modifier" | "engagement-passthrough";
184
- target: "self" | "bearer" | "unit" | "attached-unit" | "attacker" | "defender" | "friendly-within-aura" | "enemy-within-aura" | "all-friendly" | "all-enemy";
185
- modifier?: {
186
- [k: string]: unknown;
187
- };
188
- [k: string]: unknown;
189
- } & {
190
- type: "stat-modifier" | "roll-modifier" | "re-roll" | "mortal-wounds" | "feel-no-pain" | "invulnerable-save" | "ward" | "keyword-grant" | "movement-modifier" | "deep-strike" | "fallback-and-act" | "fight-first" | "fight-last" | "shoot-on-death" | "fight-on-death" | "objective-control-modifier" | "leadership-modifier" | "damage-reduction" | "attack-restriction" | "ability-grant" | "cp-gain" | "cp-refund" | "model-destruction" | "resurrection" | "resource-gain" | "resource-spend" | "charge-roll-modifier" | "terrain-area-tag" | "objective-tag" | "unit-tag" | "bs-modifier" | "engagement-passthrough";
191
- target: "self" | "bearer" | "unit" | "attached-unit" | "attacker" | "defender" | "friendly-within-aura" | "enemy-within-aura" | "all-friendly" | "all-enemy";
192
- modifier?: {
193
- [k: string]: unknown;
194
- };
195
- [k: string]: unknown;
196
- };
197
157
  /**
198
158
  * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
199
159
  * via the `definition` "effect-node".
200
160
  */
201
161
  export type EffectNode = SingleEffect | ChoiceEffect | SequenceEffect | DiceGatedEffect | ConditionalEffect | DicePoolAllocationEffect;
202
162
  export type AbilityCondition2 = SimpleCondition | CompoundCondition;
203
- export type AbilityEffect1 = unknown | ChoiceEffect | SequenceEffect | DiceGatedEffect | ConditionalEffect | DicePoolAllocationEffect;
163
+ export type AbilityEffect1 = SingleEffect | ChoiceEffect | SequenceEffect | DiceGatedEffect | ConditionalEffect | DicePoolAllocationEffect;
204
164
  /**
205
165
  * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
206
166
  * via the `definition` "condition".
@@ -227,6 +187,26 @@ export interface Vec2 {
227
187
  x: number;
228
188
  y: number;
229
189
  }
190
+ /**
191
+ * A model's base. 'round' carries 'diameter'; 'oval' carries 'width'+'length'. 'flying-base' (with 'size': small/large), 'hull', and 'unique' are categories the GW base-size guide gives without standard millimetre dimensions; entries carrying such a category, or any millimetre value not taken from an authoritative source, set 'draft': true to mark them for later hand-authoring.
192
+ *
193
+ * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
194
+ * via the `definition` "base-size".
195
+ */
196
+ export interface BaseSize {
197
+ shape: "round" | "oval" | "flying-base" | "hull" | "unique";
198
+ diameter?: number;
199
+ width?: number;
200
+ length?: number;
201
+ /**
202
+ * Flying-base size class, when 'shape' is 'flying-base'.
203
+ */
204
+ size?: "small" | "large";
205
+ /**
206
+ * True when the entry is provisional/guessed (e.g. a category without authoritative dimensions) and should be revisited.
207
+ */
208
+ draft?: boolean;
209
+ }
230
210
  /**
231
211
  * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
232
212
  * via the `definition` "game-version-ref".
@@ -466,6 +446,30 @@ export interface Mission {
466
446
  deployment_pattern_ids?: EntityId[];
467
447
  game_version: GameVersionReference;
468
448
  }
449
+ /**
450
+ * When a VP award is evaluated. A bare `phase` is the legacy shorthand for 'during this phase'; richer triggers add `timing` (the moment within a phase/turn/game), `player_turn`, and a `battle_round` window. A card's section headers map onto these: 'ANY BATTLE ROUND' omits `battle_round`; 'SECOND BATTLE ROUND ONWARDS' is { min: 2 }; 'END OF THE BATTLE' is timing: end-of-battle.
451
+ *
452
+ * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
453
+ * via the `definition` "scoring-trigger".
454
+ */
455
+ export interface ScoringTrigger {
456
+ /**
457
+ * The five official game phases. Unchanged between 10th and 11th edition — 11e reorders Pile In timing within the Fight phase but adds no top-level phase.
458
+ */
459
+ phase?: "command" | "movement" | "shooting" | "charge" | "fight";
460
+ /**
461
+ * The moment the award is checked. 'End of your turn' = end-of-turn; 'End of your Command phase' = end-of-phase with phase: command; 'End of the battle' = end-of-battle.
462
+ */
463
+ timing?: "start-of-turn" | "end-of-turn" | "start-of-phase" | "end-of-phase" | "end-of-battle";
464
+ player_turn?: PlayerTurn;
465
+ /**
466
+ * Battle-round window in which the trigger is active. Absent means any battle round (1-5). 'Second battle round onwards' is { min: 2 }.
467
+ */
468
+ battle_round?: {
469
+ min?: number;
470
+ max?: number;
471
+ };
472
+ }
469
473
  /**
470
474
  * A draw-time predicate over an army list (not runtime board state, so deliberately NOT the Ability DSL condition). Used to gate when_drawn operations such as redraws. Example: a card that is void unless the opponent fields a large unit (10e 'Cull the Horde' redrew when the opponent had no unit of 14+ models) is { subject: 'opponent', quantifier: 'none', unit_filter: { model_count_min: 14 } } with operation 'redraw'.
471
475
  *
@@ -521,6 +525,13 @@ export interface SecondaryCard {
521
525
  */
522
526
  card_ids?: EntityId[];
523
527
  condition?: ArmyCompositionPredicate1;
528
+ /**
529
+ * Battle-round window in which the draw operation is eligible (e.g. { max: 1 } means 'only when drawn in the first battle round'). Absent means the operation fires regardless of round.
530
+ */
531
+ battle_round?: {
532
+ min?: number;
533
+ max?: number;
534
+ };
524
535
  };
525
536
  /**
526
537
  * Optional player actions the card enables. Most cards have a single action; a few (e.g. Observe Enemy, with separate Baited-removal and Spotted actions) have two distinct actions on the same card.
@@ -623,7 +634,7 @@ export interface ArmyCompositionPredicate1 {
623
634
  * via the `definition` "simple-condition".
624
635
  */
625
636
  export interface SimpleCondition {
626
- type: "phase-is" | "timing-is" | "player-turn-is" | "unit-below-starting-strength" | "unit-below-half-strength" | "unit-has-keyword" | "unit-within-range-of" | "model-is-leader" | "target-has-keyword" | "charged-this-turn" | "advanced-this-turn" | "remained-stationary" | "is-battle-shocked" | "has-lost-wounds" | "opponent-unit-within-range" | "within-range-of-objective" | "attack-is-type" | "has-fought-this-phase" | "destroyed-by-attack-type" | "controls-objective" | "is-attached" | "terrain-area-control" | "engagement-state" | "territory-control" | "fights-first" | "disposition-matches" | "units-destroyed" | "units-destroyed-comparison" | "objective-majority" | "action-completed" | "objective-has-tag" | "unit-has-tag" | "terrain-has-tag" | "new-objective-controlled" | "engagement-fronts" | "destroyed-while-on-objective";
637
+ type: "phase-is" | "timing-is" | "player-turn-is" | "unit-below-starting-strength" | "unit-below-half-strength" | "unit-has-keyword" | "unit-within-range-of" | "model-is-leader" | "target-has-keyword" | "charged-this-turn" | "advanced-this-turn" | "remained-stationary" | "is-battle-shocked" | "has-lost-wounds" | "opponent-unit-within-range" | "within-range-of-objective" | "attack-is-type" | "has-fought-this-phase" | "destroyed-by-attack-type" | "controls-objective" | "is-attached" | "terrain-area-control" | "engagement-state" | "territory-control" | "fights-first" | "disposition-matches" | "units-destroyed" | "units-destroyed-comparison" | "objective-majority" | "action-completed" | "objective-has-tag" | "unit-has-tag" | "terrain-has-tag" | "new-objective-controlled" | "engagement-fronts" | "destroyed-while-on-objective" | "destroyed-in-tagged-terrain";
627
638
  parameters?: {
628
639
  [k: string]: unknown;
629
640
  };
@@ -642,6 +653,18 @@ export interface CompoundCondition {
642
653
  operands: [ConditionNode, ...ConditionNode[]];
643
654
  [k: string]: unknown;
644
655
  }
656
+ /**
657
+ * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
658
+ * via the `definition` "single-effect".
659
+ */
660
+ export interface SingleEffect {
661
+ type: "stat-modifier" | "roll-modifier" | "re-roll" | "mortal-wounds" | "feel-no-pain" | "invulnerable-save" | "ward" | "keyword-grant" | "movement-modifier" | "deep-strike" | "fallback-and-act" | "fight-first" | "fight-last" | "shoot-on-death" | "fight-on-death" | "objective-control-modifier" | "leadership-modifier" | "damage-reduction" | "attack-restriction" | "ability-grant" | "cp-gain" | "cp-refund" | "model-destruction" | "resurrection" | "resource-gain" | "resource-spend" | "charge-roll-modifier" | "terrain-area-tag" | "objective-tag" | "unit-tag" | "bs-modifier" | "engagement-passthrough";
662
+ target: "self" | "bearer" | "unit" | "attached-unit" | "attacker" | "defender" | "friendly-within-aura" | "enemy-within-aura" | "all-friendly" | "all-enemy";
663
+ modifier?: {
664
+ [k: string]: unknown;
665
+ };
666
+ [k: string]: unknown;
667
+ }
645
668
  /**
646
669
  * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
647
670
  * via the `definition` "choice-effect".
@@ -835,6 +858,10 @@ export interface Piece {
835
858
  * Pieces sharing a `link_group` value are linked terrain — treated as a single terrain feature (and, where an objective sits among them, a single objective).
836
859
  */
837
860
  link_group?: string;
861
+ /**
862
+ * Designates this terrain area — or, when `link_group`'d, the union of linked areas (one objective for the set) — as carrying an objective of the given 11e role: `home` (inside a deployment zone), `center` (board middle), or `expansion` (no-man's-land). Implies `is_objective`.
863
+ */
864
+ objective_role?: "home" | "expansion" | "center";
838
865
  /**
839
866
  * Whether this piece carries an objective marker.
840
867
  */
@@ -878,6 +905,18 @@ export interface TerrainLayout {
878
905
  */
879
906
  source?: string;
880
907
  description?: string;
908
+ /**
909
+ * Kebab-case identifier
910
+ */
911
+ mission_matchup_id?: string;
912
+ /**
913
+ * The card's trailing variant number within its mission matchup (1–3 at launch, since three layouts share each pairing). No hard maximum, to avoid a breaking change if more variants ship.
914
+ */
915
+ variant?: number;
916
+ /**
917
+ * Kebab-case identifier
918
+ */
919
+ deployment_pattern_id?: string;
881
920
  /**
882
921
  * Terrain pieces composing the layout. May be empty while a layout is registered by name ahead of its confirmed geometry.
883
922
  */
@@ -986,6 +1025,7 @@ export interface UnitComposition {
986
1025
  max: number;
987
1026
  default_weapon_ids?: EntityId[];
988
1027
  is_leader_model?: boolean;
1028
+ base_size_mm?: BaseSize1;
989
1029
  },
990
1030
  ...{
991
1031
  name: string;
@@ -994,10 +1034,28 @@ export interface UnitComposition {
994
1034
  max: number;
995
1035
  default_weapon_ids?: EntityId[];
996
1036
  is_leader_model?: boolean;
1037
+ base_size_mm?: BaseSize1;
997
1038
  }[]
998
1039
  ];
999
1040
  game_version: GameVersionReference;
1000
1041
  }
1042
+ /**
1043
+ * This model's base. Absent when no base could be resolved for the model.
1044
+ */
1045
+ export interface BaseSize1 {
1046
+ shape: "round" | "oval" | "flying-base" | "hull" | "unique";
1047
+ diameter?: number;
1048
+ width?: number;
1049
+ length?: number;
1050
+ /**
1051
+ * Flying-base size class, when 'shape' is 'flying-base'.
1052
+ */
1053
+ size?: "small" | "large";
1054
+ /**
1055
+ * True when the entry is provisional/guessed (e.g. a category without authoritative dimensions) and should be revisited.
1056
+ */
1057
+ draft?: boolean;
1058
+ }
1001
1059
  /**
1002
1060
  * A unit datasheet entry with stat profiles and point costs.
1003
1061
  *
@@ -1060,13 +1118,10 @@ export interface Unit {
1060
1118
  points_provisional?: boolean;
1061
1119
  keywords?: KeywordList;
1062
1120
  faction_keywords?: KeywordList;
1063
- base_size_mm?: {
1064
- shape: "round" | "oval";
1065
- diameter?: number;
1066
- width?: number;
1067
- length?: number;
1068
- [k: string]: unknown;
1069
- } | null;
1121
+ /**
1122
+ * The unit's representative base (the most-numerous model's base). Mixed-model units carry the full per-model breakdown in unit-composition; this top-level value is a convenience for consumers that need a single base.
1123
+ */
1124
+ base_size_mm?: BaseSize | null;
1070
1125
  model_count?: {
1071
1126
  min: number;
1072
1127
  max: number;
@@ -1083,7 +1138,7 @@ export interface Unit {
1083
1138
  is_legend?: boolean;
1084
1139
  }
1085
1140
  /**
1086
- * A weapon substitution option available to models within a unit.
1141
+ * A wargear option available to models within a unit: a weapon/wargear swap, a pure add-on, or a choice between alternatives. Models start with the unit's base loadout; an option modifies that loadout for the number of models its `model_constraint` permits.
1087
1142
  *
1088
1143
  * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
1089
1144
  * via the `definition` "wargear-option".
@@ -1095,23 +1150,45 @@ export interface WargearOption {
1095
1150
  model_name?: string;
1096
1151
  per_n_models?: number;
1097
1152
  max_count?: number;
1153
+ /**
1154
+ * When true, every model in the unit may take the option ('Any number of models can each ...'). Mutually exclusive in spirit with `per_n_models`.
1155
+ */
1156
+ any_number?: boolean;
1098
1157
  } | null;
1099
1158
  /**
1100
- * Weapon IDs being removed
1159
+ * Weapon or wargear IDs removed from the model. Omit for a pure add-on (the option only equips new wargear).
1101
1160
  *
1102
1161
  * @minItems 1
1103
1162
  */
1104
- replaces: [EntityId, ...EntityId[]];
1163
+ replaces?: [EntityId, ...EntityId[]];
1105
1164
  /**
1106
- * Weapon IDs being added
1165
+ * Weapon or wargear IDs added to the model — all of them. Exactly one of `replacement` / `replacement_choice` is present.
1107
1166
  *
1108
1167
  * @minItems 1
1109
1168
  */
1110
- replacement: [EntityId, ...EntityId[]];
1169
+ replacement?: [EntityId, ...EntityId[]];
1170
+ /**
1171
+ * A choice of replacements ('one of the following'): pick exactly one inner group; each group's IDs are all added together. Exactly one of `replacement` / `replacement_choice` is present.
1172
+ *
1173
+ * @minItems 2
1174
+ */
1175
+ replacement_choice?: [[EntityId, ...EntityId[]], [EntityId, ...EntityId[]], ...[EntityId, ...EntityId[]][]];
1111
1176
  is_free?: boolean;
1112
1177
  additional_cost?: number | null;
1113
1178
  game_version: GameVersionReference;
1114
1179
  }
1180
+ /**
1181
+ * A non-weapon item a model may carry — an icon, attachment, or other piece of equipment with no weapon profile. Weapons live in weapon.schema.json; this entity exists so wargear-option swaps and add-ons can reference equipment that is not a weapon.
1182
+ *
1183
+ * This interface was referenced by `0KdcBundledSchemas`'s JSON-Schema
1184
+ * via the `definition` "wargear".
1185
+ */
1186
+ export interface Wargear {
1187
+ id: EntityId;
1188
+ name: string;
1189
+ category?: string | null;
1190
+ game_version: GameVersionReference;
1191
+ }
1115
1192
  /**
1116
1193
  * Catalog entry for a weapon keyword (Lethal Hits, Sustained Hits N, Anti-X N+, etc.). Each weapon profile references entries here via {keyword_id, parameters?} instead of carrying free-text strings. The optional `effect` describes the keyword's game mechanic in the Ability DSL; null when the behaviour is faction-specific flavour not yet modelled.
1117
1194
  *
@@ -1131,7 +1208,10 @@ export interface WeaponKeyword {
1131
1208
  "value" | "target_keyword" | "threshold",
1132
1209
  "value" | "target_keyword" | "threshold"
1133
1210
  ];
1134
- effect: unknown;
1211
+ /**
1212
+ * Mechanical effect of this keyword. Null when the behaviour is faction-specific flavour not yet expressible in the DSL — engines treat such references as no-op buffs and may surface them as 'cannot auto-apply'.
1213
+ */
1214
+ effect: AbilityEffect1 | null;
1135
1215
  game_version: GameVersionReference;
1136
1216
  }
1137
1217
  /**