@alpaca-software/40kdc-data 0.4.16 → 0.5.0
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.
- package/dist/author-batch.d.ts.map +1 -1
- package/dist/author-batch.js +3 -2
- package/dist/author-batch.js.map +1 -1
- package/dist/commands/translate.d.ts +3 -2
- package/dist/commands/translate.d.ts.map +1 -1
- package/dist/commands/translate.js +6 -154
- package/dist/commands/translate.js.map +1 -1
- package/dist/data/bundle.generated.js +1 -1
- package/dist/data/bundle.generated.js.map +1 -1
- package/dist/data/entities.d.ts +7 -0
- package/dist/data/entities.d.ts.map +1 -1
- package/dist/data/entities.js +10 -0
- package/dist/data/entities.js.map +1 -1
- package/dist/gen-conformance.js +57 -1
- package/dist/gen-conformance.js.map +1 -1
- package/dist/generated.d.ts +1 -1
- package/dist/generated.d.ts.map +1 -1
- package/dist/generated.js.map +1 -1
- package/dist/index.d.ts +1 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js.map +1 -1
- package/dist/runner.d.ts.map +1 -1
- package/dist/runner.js +16 -1
- package/dist/runner.js.map +1 -1
- package/dist/translate/condition.d.ts.map +1 -1
- package/dist/translate/condition.js +11 -0
- package/dist/translate/condition.js.map +1 -1
- package/dist/translate/effect.d.ts +72 -0
- package/dist/translate/effect.d.ts.map +1 -0
- package/dist/translate/effect.js +241 -0
- package/dist/translate/effect.js.map +1 -0
- package/dist/translate/index.d.ts +7 -4
- package/dist/translate/index.d.ts.map +1 -1
- package/dist/translate/index.js +7 -4
- package/dist/translate/index.js.map +1 -1
- package/package.json +2 -2
- package/schemas/enrichment/ability-dsl/condition.schema.json +2 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"author-batch.d.ts","sourceRoot":"","sources":["../src/author-batch.ts"],"names":[],"mappings":"AA8CA,KAAK,IAAI,GAAG,GAAG,CAAC;AAMhB,MAAM,WAAW,QAAQ;IACvB,UAAU,EAAE,MAAM,CAAC;IACnB,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", dice:"D6"|..., threshold:int, comparison?:"greater-or-equal"|..., on_success:effect, on_fail?:effect}\n` +
|
|
134
134
|
` • dice-pool-allocation: {type:"dice-pool-allocation", pool:{count,die}, max_activations:int, options:[{name, requirement, effect}, ...]}\n\n` +
|
|
135
135
|
`A condition is ONE of:\n` +
|
|
136
|
-
` • simple: {type, parameters:{...}} — ALL params go UNDER "parameters", never as top-level keys (e.g. {"type":"unit-has-keyword","parameters":{"keyword":"VEHICLE"}}, NOT {"type":"unit-has-keyword","keyword":"VEHICLE"}). type ∈ [phase-is{phase}, timing-is{timing}, player-turn-is{turn}, unit-below-starting-strength, unit-below-half-strength, unit-has-keyword{keyword}, unit-within-range-of{target_type}, model-is-leader, target-has-keyword{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{attack_type}, has-fought-this-phase, destroyed-by-attack-type{attack_type}, controls-objective, is-attached, terrain-area-control, engagement-state, territory-control, fights-first, disposition-matches, units-destroyed{side,window,count_min}, units-destroyed-comparison, objective-majority]\n` +
|
|
136
|
+
` • simple: {type, parameters:{...}} — ALL params go UNDER "parameters", never as top-level keys (e.g. {"type":"unit-has-keyword","parameters":{"keyword":"VEHICLE"}}, NOT {"type":"unit-has-keyword","keyword":"VEHICLE"}). type ∈ [phase-is{phase}, timing-is{timing}, player-turn-is{turn}, unit-below-starting-strength, unit-below-half-strength, unit-has-keyword{keyword}, unit-within-range-of{target_type}, model-is-leader, target-has-keyword{keyword}, charged-this-turn, advanced-this-turn, remained-stationary, is-battle-shocked, has-lost-wounds, was-hit-by-attack{subject?:"self"|"target",attack_type?,weapon_name?,count_min?}, opponent-unit-within-range, within-range-of-objective, attack-is-type{attack_type}, has-fought-this-phase, destroyed-by-attack-type{attack_type}, controls-objective, is-attached, terrain-area-control, engagement-state, territory-control, fights-first, disposition-matches, units-destroyed{side,window,count_min}, units-destroyed-comparison, objective-majority]\n` +
|
|
137
137
|
` • compound: {operator:"and"|"or"|"not", operands:[condition, ...]} — use "not" with ONE operand to negate (e.g. "while not Battle-shocked" → {operator:"not", operands:[{type:"is-battle-shocked"}]}). Nest compounds freely.\n\n` +
|
|
138
138
|
`Encode reactive/event triggers as a conditional whose condition is the trigger (e.g. an enemy destroyed a model nearby → destroyed-by-attack-type / opponent-unit-within-range). Encode "first time per turn"/"once per game" by choosing the correct timing condition; do not invent fields.\n` +
|
|
139
139
|
`scope = {range, duration}: range ∈ [self, unit, attached-unit, aura-6, aura-9, aura-12, ...]; duration ∈ [phase, turn, battle-round, battle, permanent]. Credit the aura in scope.range, NOT as a condition.\n` +
|
|
@@ -150,7 +150,8 @@ export const REPAIR_SYSTEM = `You repair Warhammer 40k ability DSL. You are give
|
|
|
150
150
|
` • "re-roll Battle-shock/Leadership tests" → leadership-modifier {test:"battle-shock", operation:"re-roll"} (NOT a combat re-roll).\n` +
|
|
151
151
|
` • deployment/redeploy ("set up in Strategic Reserves", "set up anywhere >9\\"", "redeploy after deployment") → deep-strike, or ability-grant {grant_type:"<descriptive-kebab>"} for a named deployment rule.\n` +
|
|
152
152
|
` • "move through terrain" → movement-modifier {move_type:"through-terrain"}.\n` +
|
|
153
|
-
` • "characteristic of N" → the matching stat/OC modifier with operation:"set".\n
|
|
153
|
+
` • "characteristic of N" → the matching stat/OC modifier with operation:"set".\n` +
|
|
154
|
+
` • "when/if this unit WAS HIT by one or more attacks" → was-hit-by-attack {subject:"self"} (NOT has-lost-wounds — a hit that is saved still counts). "if an enemy unit was hit by [the bearer's] attacks" (offensive follow-up like grav-pinning) → was-hit-by-attack {subject:"target"}; narrow with attack_type/weapon_name when the rule names the weapon.\n\n` +
|
|
154
155
|
`Set unencodable:true ONLY when the rule is NOT an in-battle ability effect at all — army-construction ("you can include one X per Y", "cannot include A with B"), roster selection ("cannot be your Warlord"), model geometry/transport-capacity declarations, or roll-off/meta procedures. For those, return your best partial effect and explain. Everything that IS an in-battle effect must be encoded with the grammar above. Give confidence + one-sentence reasoning.`;
|
|
155
156
|
export const REPAIR_SCHEMA = {
|
|
156
157
|
type: "object", additionalProperties: false,
|
package/dist/author-batch.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"author-batch.js","sourceRoot":"","sources":["../src/author-batch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,YAAY,EAAE,aAAa,EAAE,SAAS,EAAE,UAAU,EAAE,WAAW,EAAE,MAAM,SAAS,CAAC;AAC1F,OAAO,EAAE,OAAO,EAAE,MAAM,WAAW,CAAC;AACpC,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,aAAa,EAAE,MAAM,UAAU,CAAC;AACzC,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,gBAAgB,EAAE,MAAM,qBAAqB,CAAC;AAEvD,MAAM,SAAS,GAAG,aAAa,CAAC,IAAI,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC;AAC/D,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACnD,MAAM,SAAS,GAAG,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;AAC/D,MAAM,eAAe,GAAG,OAAO,CAAC,SAAS,EAAE,YAAY,CAAC,CAAC;AACzD,MAAM,OAAO,GAAG,OAAO,CAAC,SAAS,EAAE,QAAQ,EAAE,UAAU,CAAC,CAAC;AACzD,MAAM,iBAAiB,GAAG,sEAAsE,CAAC;AAIjG,MAAM,QAAQ,GAAG,CAAC,CAAS,EAAQ,EAAE,CAAC,IAAI,CAAC,KAAK,CAAC,YAAY,CAAC,CAAC,EAAE,OAAO,CAAC,CAAC,CAAC;AAC3E,MAAM,SAAS,GAAG,CAAC,CAAS,EAAE,CAAO,EAAQ,EAAE,C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EAAE,IAAI,CAAC,CAAC,CAAC;IAC/E,OAAO,CAAC,GAAG,CAAC,IAAI,CAAC,SAAS,CAAC,OAAO,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAC;IAC9C,MAAM,KAAK,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,OAAO,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,IAAI,KAAK,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;AACrH,CAAC;AAED,MAAM,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC1G,IAAI,MAAM;IAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/**\n * DSL stub authoring engine (#21) — batched, subscription-billed, two-phase.\n *\n * Empty-modifier ability stubs (`{type:\"stat-modifier\", modifier:{}}` and kin)\n * are authored into real DSL from their 10e-archive source rule. The work is a\n * pile of discrete, stateless, structured LLM calls, so we run them as batched\n * `claude -p --json-schema` invocations on the Claude subscription rather than\n * spawning a full agent per ability (the agent fan-out's per-call system-prompt\n * + tool-loop overhead is ~50-100x the useful work). Assembly and schema\n * validation are pure TS — the model only classifies and judges.\n *\n * author-input/<faction>.json (datasheet-resolved rules, from author-input.ts)\n * ── classify ──▶ flat slot-forms (batched claude -p)\n * ── assemble ──▶ full ability entries (TS: effect + scope, no LLM)\n * ── validate ──▶ AJV against the schema (TS — rejects invented enums)\n * ── verify ──▶ fidelity verdict (batched claude -p, scope-aware)\n * ─────────────▶ data/_audit/proposed/<faction>.json\n *\n * Two modes:\n * propose (default) — write proposals; never touch live data.\n * apply — splice gated proposals into live abilities.json. Only\n * rewrites entries that are STILL empty-modifier stubs,\n * so re-running is safe and authored work is never\n * clobbered. Gate defaults: schema-valid + verifier-\n * faithful + confidence≠low + not complex-flagged.\n *\n * Usage:\n * npx tsx tools/src/author-batch.ts propose <faction|--all> [--batch N] [--model M]\n * npx tsx tools/src/author-batch.ts apply <faction|--all> [--min-confidence high|medium]\n * [--include-complex] [--dry-run]\n */\nimport { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { execFile } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\nimport { createValidator } from \"./schema-loader.js\";\nimport { hasEmptyModifier } from \"./audit-coverage.js\";\n\nconst __dirname = fileURLToPath(new URL(\".\", import.meta.url));\nconst DATA_ROOT = resolve(__dirname, \"../../data\");\nconst INPUT_DIR = resolve(DATA_ROOT, \"_audit\", \"author-input\");\nconst ENRICHMENT_ROOT = resolve(DATA_ROOT, \"enrichment\");\nconst OUT_DIR = resolve(DATA_ROOT, \"_audit\", \"proposed\");\nconst ABILITY_SCHEMA_ID = \"https://40kdc.dev/schemas/enrichment/ability-dsl/ability.schema.json\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Json = any;\nconst readJSON = (p: string): Json => JSON.parse(readFileSync(p, \"utf-8\"));\nconst writeJSON = (p: string, v: Json): void => writeFileSync(p, JSON.stringify(v, null, 2) + \"\\n\");\n\nconst PARAMETERLESS = new Set([\"deep-strike\", \"fallback-and-act\", \"fight-first\", \"fight-last\", \"shoot-on-death\", \"fight-on-death\"]);\n\nexport interface Proposal {\n ability_id: string;\n name: string;\n faction: string;\n effect_type?: string;\n complex?: boolean;\n confidence?: \"high\" | \"medium\" | \"low\";\n schema_valid: boolean;\n proposed_effect?: Json;\n proposed_scope?: Json;\n /** Ability-level behavior the repair pass inferred (passive/activated/reactive/aura). */\n proposed_behavior?: string;\n verdict?: { severity: string; faithful: boolean; issue: string } | null;\n final_faithful: boolean;\n error?: string;\n /** Set by the full-tree repair pass — the effect is a nested tree, not flat-form. */\n repaired?: boolean;\n /** Repair pass flagged this rule as genuinely unencodable (needs hand-authoring). */\n unencodable?: boolean;\n /** Canonical-key lint result (repair pass only). false = invented/out-of-vocab modifier keys. */\n canonical?: boolean;\n}\n\n// ─── claude CLI bridge (subscription, structured output) ─────────────\n\n/** One batched, structured `claude -p` call. Resolves to the validated object. */\nexport function callClaude(system: string, user: string, schema: Json, model: string): Promise<Json> {\n return new Promise((res, rej) => {\n execFile(\n \"claude\",\n [\"-p\", user, \"--system-prompt\", system, \"--exclude-dynamic-system-prompt-sections\",\n \"--json-schema\", JSON.stringify(schema), \"--output-format\", \"json\", \"--model\", model],\n { maxBuffer: 64 * 1024 * 1024, timeout: 300_000 },\n (err, stdout) => {\n if (err && !stdout) return rej(err);\n try {\n const env = JSON.parse(stdout);\n if (env.is_error) return rej(new Error(env.result ?? \"claude error\"));\n if (!env.structured_output) return rej(new Error(\"no structured_output in response\"));\n res(env.structured_output);\n } catch (e) {\n rej(new Error(`parse failed: ${(e as Error).message}; head=${String(stdout).slice(0, 200)}`));\n }\n },\n );\n });\n}\n\n// ─── prompts + schemas ───────────────────────────────────────────────\n\nconst CLASSIFY_SYSTEM =\n `You translate Warhammer 40k ability rules into a structured DSL. For each ability return one slot-form.\\n\\n` +\n `effect_type — pick the SINGLE best of:\\n` +\n ` stat-modifier {operation:\"add\"|\"subtract\"|\"set\", stat:\"A\"|\"S\"|\"T\"|\"Sv\"|\"AP\"|\"OC\"|\"Ld\", value:int}\\n` +\n ` roll-modifier {operation:\"add\"|\"subtract\", roll:\"hit\"|\"wound\"|\"save\"|\"charge\", value:int}\\n` +\n ` re-roll {roll:\"hit\"|\"wound\"|\"save\"|\"damage\"|\"charge\", subset:\"ones\"|\"all-failures\"} — ONLY combat dice, NOT Battle-shock/Leadership\\n` +\n ` leadership-modifier {test:\"battle-shock\", operation:\"re-roll\"} or {operation:\"add\"|\"subtract\", value:int} — USE for Battle-shock/Leadership rerolls or Ld changes\\n` +\n ` mortal-wounds {count:int|\"D3\"|\"D6\"} ; feel-no-pain {threshold:int} ; invulnerable-save {invuln_sv:int}\\n` +\n ` keyword-grant {keywords:[ \"lethal-hits\"|\"sustained-hits\"|\"devastating-wounds\"|\"twin-linked\"|... ]} (ARRAY)\\n` +\n ` damage-reduction {reduction:int} ; objective-control-modifier {operation,value}|{sticky:true}\\n` +\n ` ability-grant {ability_id:\"kebab\"}|{grant_type:\"...\"} ; attack-restriction {restriction:\"...\"}\\n` +\n ` cp-gain|cp-refund {amount:int} ; resurrection {count:int|\"D3\"} ; model-destruction {count:int}\\n` +\n ` resource-gain|resource-spend {pool_id:\"...\", amount:int|\"D3\"} — faction resources: Miracle Dice→\"miracle-dice-pool\", Khorne Blessings→\"blessings-of-khorne-pool\", Pain tokens→\"pain-token-pool\"\\n` +\n ` movement-modifier {move_type,value} ; deep-strike/fallback-and-act/fight-first/fight-last/shoot-on-death/fight-on-death → modifier {}\\n\\n` +\n `attack_type — \"melee\"|\"ranged\" if the rule limits to that attack kind, else \"any\". (Do NOT encode this as a condition.)\\n` +\n `condition_kind — DEFAULT \"none\". Only set if the rule EXPLICITLY restricts: \"phase\" (+condition_param = phase name), \"vs-keyword\" (+param=keyword), ` +\n `\"charged\", \"stationary\", \"below-half\", \"below-starting\", \"attached\", \"leading\". Do NOT add a phase condition just because the ability operates in a phase. ` +\n `If the rule needs a compound/event trigger (e.g. a dice roll, an either/or choice, or \"when a friendly VEHICLE is destroyed within 12\\\\\"\") set complex=true.\\n` +\n `scope_range — \"self\"|\"unit\"|\"attached-unit\"|\"aura-6\"|\"aura-9\"|\"aura-12\"|... . scope_duration — \"phase\"|\"turn\"|\"battle-round\"|\"battle\"|\"permanent\".\\n` +\n `target — \"self\"|\"unit\"|\"friendly-within-aura\"|\"enemy-within-aura\"|\"attacker\"|\"defender\"|... (only values from the schema enum).\\n` +\n `Never copy rule text into any field. Give confidence and a one-sentence reasoning.`;\n\nexport const VERIFY_SYSTEM =\n `You judge whether authored DSL faithfully captures a 40k rule. The DSL includes scope {range,duration} — credit the aura/range/duration when it is in scope (do NOT flag \"missing 6\\\\\" aura\" if scope.range is \"aura-6\"). ` +\n `Be strict about the core mechanic: wrong effect type, wrong stat/roll, wrong value, a condition the rule does NOT state (phantom), a stated condition that is missing, or modeling a Leadership/Battle-shock re-roll as a combat re-roll. ` +\n `severity \"ok\" = core mechanic + conditions + scope correct; \"minor\" = core correct but a secondary detail imperfect; \"wrong\" = core mechanic wrong. Return one verdict per ability, echoing its ability_id.`;\n\nconst CLASSIFY_SCHEMA = {\n type: \"object\", additionalProperties: false,\n properties: { results: { type: \"array\", items: {\n type: \"object\", additionalProperties: false,\n properties: {\n ability_id: { type: \"string\" }, effect_type: { type: \"string\" }, target: { type: \"string\" },\n modifier: { type: \"object\", additionalProperties: true }, attack_type: { enum: [\"any\", \"melee\", \"ranged\"] },\n condition_kind: { enum: [\"none\", \"phase\", \"vs-keyword\", \"charged\", \"stationary\", \"below-half\", \"below-starting\", \"attached\", \"leading\"] },\n condition_param: { type: [\"string\", \"null\"] }, scope_range: { type: \"string\" }, scope_duration: { type: \"string\" },\n complex: { type: \"boolean\" }, confidence: { enum: [\"high\", \"medium\", \"low\"] }, reasoning: { type: \"string\" },\n },\n required: [\"ability_id\", \"effect_type\", \"target\", \"modifier\", \"attack_type\", \"condition_kind\", \"scope_range\", \"scope_duration\", \"complex\", \"confidence\", \"reasoning\"],\n } } },\n required: [\"results\"],\n};\n\nexport const VERIFY_SCHEMA = {\n type: \"object\", additionalProperties: false,\n properties: { results: { type: \"array\", items: {\n type: \"object\", additionalProperties: false,\n properties: { ability_id: { type: \"string\" }, severity: { enum: [\"ok\", \"minor\", \"wrong\"] }, faithful: { type: \"boolean\" }, issue: { type: \"string\" } },\n required: [\"ability_id\", \"severity\", \"faithful\", \"issue\"],\n } } },\n required: [\"results\"],\n};\n\n// ─── full-tree repair prompts + schema ───────────────────────────────\n//\n// The flat-form classifier (above) emits a single condition + flat leaf, so it\n// structurally CANNOT express compound conditions, event triggers, or nested\n// effect kinds — every such rule lands in the proposed/ residue with a verifier\n// `issue` naming the gap. The repair pass hands the model the FULL DSL grammar\n// and asks it to emit the complete nested effect tree, seeded with the existing\n// draft + that exact gap. The envelope schema below is intentionally loose (just\n// `effect`/`scope` objects); the real gate is AJV against ability.schema, exactly\n// as the flat-form path validates `buildEntry` output.\n\nexport const REPAIR_SYSTEM =\n `You repair Warhammer 40k ability DSL. You are given a rule, a DRAFT effect that an earlier flat-form pass produced, and the EXACT gap a verifier found (usually a missing trigger or compound condition). Emit the COMPLETE nested effect tree that fixes the gap. Never copy rule text into any field.\\n\\n` +\n `An effect node is ONE of:\\n` +\n ` • a leaf: {type, target, modifier} — 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, bs-modifier, engagement-passthrough]; target ∈ [self, bearer, unit, attached-unit, attacker, defender, friendly-within-aura, enemy-within-aura, all-friendly, all-enemy]\\n` +\n ` • conditional: {type:\"conditional\", condition, effect}\\n` +\n ` • sequence: {type:\"sequence\", steps:[effect, ...]} — multiple effects that all apply\\n` +\n ` • choice: {type:\"choice\", options:[effect, ...], choice_label?} — pick exactly one\\n` +\n ` • dice-gated: {type:\"dice-gated\", dice:\"D6\"|..., threshold:int, comparison?:\"greater-or-equal\"|..., on_success:effect, on_fail?:effect}\\n` +\n ` • dice-pool-allocation: {type:\"dice-pool-allocation\", pool:{count,die}, max_activations:int, options:[{name, requirement, effect}, ...]}\\n\\n` +\n `A condition is ONE of:\\n` +\n ` • simple: {type, parameters:{...}} — ALL params go UNDER \"parameters\", never as top-level keys (e.g. {\"type\":\"unit-has-keyword\",\"parameters\":{\"keyword\":\"VEHICLE\"}}, NOT {\"type\":\"unit-has-keyword\",\"keyword\":\"VEHICLE\"}). type ∈ [phase-is{phase}, timing-is{timing}, player-turn-is{turn}, unit-below-starting-strength, unit-below-half-strength, unit-has-keyword{keyword}, unit-within-range-of{target_type}, model-is-leader, target-has-keyword{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{attack_type}, has-fought-this-phase, destroyed-by-attack-type{attack_type}, controls-objective, is-attached, terrain-area-control, engagement-state, territory-control, fights-first, disposition-matches, units-destroyed{side,window,count_min}, units-destroyed-comparison, objective-majority]\\n` +\n ` • compound: {operator:\"and\"|\"or\"|\"not\", operands:[condition, ...]} — use \"not\" with ONE operand to negate (e.g. \"while not Battle-shocked\" → {operator:\"not\", operands:[{type:\"is-battle-shocked\"}]}). Nest compounds freely.\\n\\n` +\n `Encode reactive/event triggers as a conditional whose condition is the trigger (e.g. an enemy destroyed a model nearby → destroyed-by-attack-type / opponent-unit-within-range). Encode \"first time per turn\"/\"once per game\" by choosing the correct timing condition; do not invent fields.\\n` +\n `scope = {range, duration}: range ∈ [self, unit, attached-unit, aura-6, aura-9, aura-12, ...]; duration ∈ [phase, turn, battle-round, battle, permanent]. Credit the aura in scope.range, NOT as a condition.\\n` +\n `behavior ∈ [passive, activated, reactive, aura].\\n\\n` +\n `CANONICAL MODIFIER KEYS — use ONLY the keys listed per type; never invent a key (an unknown key is silently ignored by consumers and corrupts the data):\\n` +\n ` stat-modifier.modifier: {stat, operation:\"add\"|\"subtract\"|\"set\", value:int}. stat ∈ [A,S,T,Sv,AP,OC,Ld,M,W,D] ONLY (use \"M\" for Move, never \"Move\"/\"range\"; weapon range is NOT a unit stat). operation:\"set\" IS allowed for \"characteristic of N\" rules (e.g. OC of 9). Optional narrowing: attack_type:\"melee\"|\"ranged\", weapon_type:\"melee\"|\"ranged\", or weapon_name:\"<weapon>\" for a single named weapon. Do NOT use weapon_keyword/weapon_filter/model_filter.\\n` +\n ` roll-modifier.modifier: {roll:\"hit\"|\"wound\"|\"save\"|\"charge\"|\"damage\", operation, value}. re-roll.modifier: {roll, subset:\"ones\"|\"all-failures\"}. Optional attack_type/weapon_type/weapon_name as above.\\n` +\n ` keyword-grant.modifier: {keywords:[...]} (array) — combat keywords as written (\"Lethal Hits\",\"Sustained Hits 1\",\"Twin-linked\"). Optional weapon_type:\"melee\"|\"ranged\", weapon_name.\\n` +\n ` feel-no-pain.modifier:{threshold:int}; damage-reduction.modifier:{reduction:int}; bs-modifier.modifier:{operation,value}; ability-grant.modifier:{grant_type:\"kebab-label\"}; objective-control-modifier.modifier:{operation:\"add\"|\"set\",value} or {sticky:true}; movement-modifier.modifier:{move_type:\"kebab\",value}; deep-strike.modifier:{} (parameterless).\\n\\n` +\n `dice-gated.comparison ∈ [\"gte\",\"lte\",\"gt\",\"lt\",\"eq\"] (use \"gte\" for \"on a 2+\"). dice e.g. \"D6\",\"2D6\"; threshold int. on_success/on_fail are effect nodes.\\n` +\n `ENCODING THE RESIDUE — these ARE expressible, do not punt on them:\\n` +\n ` • \"roll a D6, on 2+ <effect>\" → dice-gated {dice:\"D6\", threshold:2, comparison:\"gte\", on_success:<effect>}.\\n` +\n ` • \"select one of N abilities/effects\" → choice {options:[<effect>,...]}.\\n` +\n ` • \"re-roll Battle-shock/Leadership tests\" → leadership-modifier {test:\"battle-shock\", operation:\"re-roll\"} (NOT a combat re-roll).\\n` +\n ` • deployment/redeploy (\"set up in Strategic Reserves\", \"set up anywhere >9\\\\\"\", \"redeploy after deployment\") → deep-strike, or ability-grant {grant_type:\"<descriptive-kebab>\"} for a named deployment rule.\\n` +\n ` • \"move through terrain\" → movement-modifier {move_type:\"through-terrain\"}.\\n` +\n ` • \"characteristic of N\" → the matching stat/OC modifier with operation:\"set\".\\n\\n` +\n `Set unencodable:true ONLY when the rule is NOT an in-battle ability effect at all — army-construction (\"you can include one X per Y\", \"cannot include A with B\"), roster selection (\"cannot be your Warlord\"), model geometry/transport-capacity declarations, or roll-off/meta procedures. For those, return your best partial effect and explain. Everything that IS an in-battle effect must be encoded with the grammar above. Give confidence + one-sentence reasoning.`;\n\nexport const REPAIR_SCHEMA = {\n type: \"object\", additionalProperties: false,\n properties: { results: { type: \"array\", items: {\n type: \"object\", additionalProperties: false,\n properties: {\n ability_id: { type: \"string\" },\n effect: { type: \"object\", additionalProperties: true },\n scope: { type: \"object\", additionalProperties: true },\n behavior: { type: \"string\" },\n unencodable: { type: \"boolean\" },\n confidence: { enum: [\"high\", \"medium\", \"low\"] },\n reasoning: { type: \"string\" },\n },\n required: [\"ability_id\", \"effect\", \"scope\", \"behavior\", \"unencodable\", \"confidence\", \"reasoning\"],\n } } },\n required: [\"results\"],\n};\n\n// ─── assembly (pure TS, no LLM) ──────────────────────────────────────\n\nexport function conditionNode(kind: string, param: string | null | undefined): Json | null {\n switch (kind) {\n case \"phase\": return { type: \"phase-is\", parameters: { phase: param } };\n case \"vs-keyword\": return { type: \"target-has-keyword\", parameters: { keyword: param } };\n case \"charged\": return { type: \"charged-this-turn\" };\n case \"stationary\": return { type: \"remained-stationary\" };\n case \"below-half\": return { type: \"unit-below-half-strength\" };\n case \"below-starting\": return { type: \"unit-below-starting-strength\" };\n case \"attached\": return { type: \"is-attached\" };\n case \"leading\": return { type: \"model-is-leader\" };\n default: return null;\n }\n}\n\n/** Build the effect node + scope from a flat-form. */\nexport function assembleEffect(form: Json): { effect: Json; scope: Json } {\n const modifier = PARAMETERLESS.has(form.effect_type) ? {} : { ...(form.modifier ?? {}) };\n if (form.attack_type && form.attack_type !== \"any\" && [\"stat-modifier\", \"roll-modifier\", \"re-roll\"].includes(form.effect_type)) {\n modifier.attack_type = form.attack_type;\n }\n let effect: Json = { type: form.effect_type, target: form.target, modifier };\n const cond = conditionNode(form.condition_kind, form.condition_param);\n if (cond) effect = { type: \"conditional\", condition: cond, effect };\n return { effect, scope: { range: form.scope_range, duration: form.scope_duration } };\n}\n\n/** Splice the authored effect+scope onto the original entry, preserving metadata. */\nexport function buildEntry(original: Json, form: Json): Json {\n const { effect, scope } = assembleEffect(form);\n return { ...original, effect, scope, community_notes: \"community-authored from 10e source (provisional 11e); see #21\" };\n}\n\nconst BEHAVIOR_VALUES = new Set([\"passive\", \"activated\", \"reactive\", \"aura\"]);\n\n// ─── canonical-key lint ──────────────────────────────────────────────\n//\n// The full-tree repair model emits the whole effect node, including the open\n// `modifier` object. AJV permits any modifier key (additionalProperties:true),\n// so an invented key (`weapon_keyword`, `model_filter`, `critical_threshold`)\n// passes schema validation — but the cruncher reads ONLY the canonical keys, so\n// an ignored filter on an `add` operation silently OVER-APPLIES the buff. The\n// verifier can't catch this: it judges the JSON against the rule as a reader,\n// not against what the engine honors. This lint is the deterministic gate.\n//\n// Vocabulary is calibrated to what EXISTING enrichment data actually uses (not\n// world-eaters alone): `keywords` array is the dominant keyword-grant form,\n// `damage-reduction` uses `reduction`, and `stat` spans the full statline. The\n// lint only runs on NEW repair proposals, so strictness can't regress shipped\n// data — a rejected proposal just stays residue for hand-authoring.\n\n/** Modifier keys the cruncher / canonical conventions recognise, per leaf type. */\nconst CANONICAL_MODIFIER_KEYS: Record<string, Set<string>> = {\n // weapon_type/weapon_name are valid narrowing keys (gold uses weapon_name): the\n // cruncher honors weapon_type as a phase gate and fail-safes (unsupported) on\n // weapon_name, so the data can carry them without risking a silent over-apply.\n \"stat-modifier\": new Set([\"stat\", \"operation\", \"value\", \"attack_type\", \"weapon_type\", \"weapon_name\"]),\n \"roll-modifier\": new Set([\"roll\", \"operation\", \"value\", \"attack_type\", \"weapon_type\", \"weapon_name\", \"critical_on\", \"uses\", \"context\"]),\n \"re-roll\": new Set([\"roll\", \"subset\", \"attack_type\", \"weapon_type\", \"weapon_name\", \"max_rerolls\", \"uses\", \"context\"]),\n \"keyword-grant\": new Set([\"keyword\", \"keywords\", \"weapon_type\", \"weapon_name\"]),\n \"bs-modifier\": new Set([\"operation\", \"value\", \"attack_type\"]),\n \"feel-no-pain\": new Set([\"threshold\"]),\n \"damage-reduction\": new Set([\"reduction\", \"amount\"]),\n};\nconst CANONICAL_STATS = new Set([\"A\", \"S\", \"T\", \"Sv\", \"AP\", \"OC\", \"Ld\", \"M\", \"W\", \"D\", \"Damage\", \"BS\", \"WS\"]);\nconst CANONICAL_ROLLS = new Set([\"hit\", \"wound\", \"save\", \"charge\", \"damage\", \"advance\", \"any\", \"all\"]);\nconst CANONICAL_SUBSETS = new Set([\"ones\", \"all-failures\"]);\nconst CANONICAL_ATTACK_TYPES = new Set([\"melee\", \"ranged\"]);\n\n/**\n * Walk an effect tree and flag any cruncher-interpreted leaf whose modifier\n * carries an unknown key or an out-of-vocabulary stat/roll/subset/attack_type.\n * Non-interpreted leaf types (ability-grant, movement-modifier, …) are left\n * permissive — they don't reach the damage path, so an unknown key there is a\n * consistency nit, not a silent-corruption risk.\n */\nexport function lintCanonical(effect: Json): { canonical: boolean; issues: string[] } {\n const issues: string[] = [];\n // A simple condition is {type, parameters?, negated?}; every param lives UNDER\n // `parameters`. The cruncher reads condition.parameters.* only, and AJV doesn't\n // forbid stray top-level keys, so a param placed top-level (e.g.\n // {type:\"unit-has-keyword\", keyword:\"X\"}) silently makes the condition\n // unevaluatable — the buff never fires. Existing data is 680 nested / 0 top-level.\n const visitCondition = (c: Json): void => {\n if (!c || typeof c !== \"object\") return;\n if (Array.isArray(c.operands)) return c.operands.forEach(visitCondition); // compound {operator, operands}\n if (typeof c.type === \"string\") {\n for (const k of Object.keys(c)) if (k !== \"type\" && k !== \"parameters\" && k !== \"negated\") issues.push(`condition ${c.type}: param \"${k}\" must live under \"parameters\"`);\n }\n };\n const visit = (node: Json): void => {\n if (Array.isArray(node)) return node.forEach(visit);\n if (!node || typeof node !== \"object\") return;\n const type = node.type as string | undefined;\n const allow = type ? CANONICAL_MODIFIER_KEYS[type] : undefined;\n if (allow && node.modifier && typeof node.modifier === \"object\") {\n const m = node.modifier as Record<string, unknown>;\n for (const k of Object.keys(m)) if (!allow.has(k)) issues.push(`${type}: non-canonical modifier key \"${k}\"`);\n if (type === \"stat-modifier\" && m.stat != null && !CANONICAL_STATS.has(String(m.stat))) issues.push(`stat-modifier: unknown stat \"${String(m.stat)}\"`);\n if ((type === \"roll-modifier\" || type === \"re-roll\") && m.roll != null && !CANONICAL_ROLLS.has(String(m.roll))) issues.push(`${type}: unknown roll \"${String(m.roll)}\"`);\n if (m.subset != null && !CANONICAL_SUBSETS.has(String(m.subset))) issues.push(`${type}: unknown subset \"${String(m.subset)}\"`);\n if (m.attack_type != null && !CANONICAL_ATTACK_TYPES.has(String(m.attack_type))) issues.push(`${type}: unknown attack_type \"${String(m.attack_type)}\"`);\n }\n if (node.condition) visitCondition(node.condition);\n // Recurse through the wrapper kinds (conditional/sequence/choice/dice-*).\n for (const key of [\"effect\", \"steps\", \"options\", \"on_success\", \"on_fail\"]) if (node[key]) visit(node[key]);\n };\n visit(effect);\n return { canonical: issues.length === 0, issues };\n}\n\n/**\n * Splice a pre-formed nested effect tree (from the repair pass) onto the original\n * entry. Unlike {@link buildEntry} the LLM owns the whole tree, so we only graft\n * `effect`/`scope`/`behavior` and the citation — never the flat-form assembly.\n * `behavior` is an ability-level field; only set it when the model returned a\n * valid enum value (an invalid one would just fail AJV and lose the whole entry).\n */\nexport function buildRepairedEntry(original: Json, effect: Json, scope: Json, behavior?: string): Json {\n const entry: Json = { ...original, effect, scope, community_notes: \"community-authored from 10e source (provisional 11e); see #21\" };\n if (behavior && BEHAVIOR_VALUES.has(behavior)) entry.behavior = behavior;\n return entry;\n}\n\n// ─── apply gate ──────────────────────────────────────────────────────\n\nexport interface GateOpts { minConfidence: \"high\" | \"medium\"; includeComplex: boolean }\n\n/** Whether a proposal is safe to apply automatically. */\nexport function passesGate(p: Proposal, opts: GateOpts): boolean {\n if (!p.schema_valid || !p.final_faithful) return false;\n if (p.confidence === \"low\") return false;\n if (opts.minConfidence === \"high\" && p.confidence !== \"high\") return false;\n // A repaired proposal IS the full nested tree, so `complex` no longer means\n // \"couldn't express it\" — the AJV + verifier gate already proved it expresses\n // the rule faithfully. It must also clear the canonical-key lint so an invented\n // modifier key can't silently over-apply. The complex-exclusion only applies to\n // flat-form output.\n if (p.repaired) return p.canonical !== false;\n if (p.complex && !opts.includeComplex) return false;\n return true;\n}\n\n// ─── batching helpers ────────────────────────────────────────────────\n\nconst chunk = <T>(arr: T[], n: number): T[][] => {\n const out: T[][] = [];\n for (let i = 0; i < arr.length; i += n) out.push(arr.slice(i, i + n));\n return out;\n};\n\nconst classifyUserPrompt = (items: Json[]): string =>\n `Classify each ability below. Return results[] (one per ability, echo its ability_id):\\n\\n` +\n items.map((it) => `- ability_id: ${it.ability_id}\\n name: ${it.name}\\n rule: ${it.src?.description ?? \"(none)\"}`).join(\"\\n\");\n\nexport const verifyUserPrompt = (entries: { ability_id: string; rule: string; effect: Json; scope: Json }[]): string =>\n `Judge each authored DSL against its rule. Return results[] (one per ability, echo its ability_id):\\n\\n` +\n entries.map((e) => `- ability_id: ${e.ability_id}\\n rule: ${e.rule}\\n authored: ${JSON.stringify({ effect: e.effect, scope: e.scope })}`).join(\"\\n\");\n\nexport const repairUserPrompt = (items: { ability_id: string; rule: string; draft: Json; issue: string }[]): string =>\n `Repair each ability's DSL. Emit the full nested effect tree + scope + behavior that fixes the stated gap. Return results[] (one per ability, echo its ability_id):\\n\\n` +\n items.map((it) =>\n `- ability_id: ${it.ability_id}\\n rule: ${it.rule || \"(none)\"}\\n draft_effect: ${JSON.stringify(it.draft ?? null)}\\n gap_to_fix: ${it.issue || \"(verifier produced no issue — re-author faithfully from the rule)\"}`,\n ).join(\"\\n\\n\");\n\n// ─── propose ─────────────────────────────────────────────────────────\n\ninterface ProposeOpts { batch: number; model: string }\n\nasync function proposeFaction(faction: string, opts: ProposeOpts, validate: (x: unknown) => boolean): Promise<Json> {\n const inputPath = resolve(INPUT_DIR, `${faction}.json`);\n if (!existsSync(inputPath)) return { faction, skipped: \"no author-input\" };\n const input: Json[] = readJSON(inputPath).filter((e: Json) => e.resolved);\n if (input.length === 0) return { faction, skipped: \"no resolved stubs\" };\n\n const original = new Map<string, Json>();\n for (const a of readJSON(resolve(ENRICHMENT_ROOT, faction, \"abilities.json\")) as Json[]) original.set(a.ability_id, a);\n\n const proposals: Proposal[] = [];\n for (const batch of chunk(input, opts.batch)) {\n let forms: Json[];\n try {\n ({ results: forms } = await callClaude(CLASSIFY_SYSTEM, classifyUserPrompt(batch), CLASSIFY_SCHEMA, opts.model));\n } catch (e) {\n // One flaky call shouldn't sink the run — record the batch as errored and move on.\n process.stderr.write(` ${faction}: classify batch failed (${(e as Error).message.slice(0, 80)}) — skipping ${batch.length}\\n`);\n for (const it of batch) proposals.push({ ability_id: it.ability_id, name: it.name, faction, schema_valid: false, final_faithful: false, error: \"classify call failed\" });\n continue;\n }\n const byId = new Map<string, Json>(forms.map((f: Json) => [f.ability_id, f]));\n\n const built: { it: Json; form: Json; entry: Json; schemaValid: boolean }[] = [];\n for (const it of batch) {\n const form = byId.get(it.ability_id);\n const orig = original.get(it.ability_id);\n if (!form || !orig) {\n proposals.push({ ability_id: it.ability_id, name: it.name, faction, schema_valid: false, final_faithful: false, error: !form ? \"no classification\" : \"no original entry\" });\n continue;\n }\n const entry = buildEntry(orig, form);\n built.push({ it, form, entry, schemaValid: validate(entry) });\n }\n\n const toVerify = built.filter((b) => b.schemaValid);\n const verdicts = new Map<string, Json>();\n if (toVerify.length > 0) {\n try {\n const { results } = await callClaude(VERIFY_SYSTEM,\n verifyUserPrompt(toVerify.map((b) => ({ ability_id: b.it.ability_id, rule: b.it.src?.description ?? \"\", effect: b.entry.effect, scope: b.entry.scope }))),\n VERIFY_SCHEMA, opts.model);\n for (const v of results) verdicts.set(v.ability_id, v);\n } catch (e) {\n // Verify failure → leave verdicts null (proposal kept, just not auto-gateable).\n process.stderr.write(` ${faction}: verify batch failed (${(e as Error).message.slice(0, 80)})\\n`);\n }\n }\n\n for (const b of built) {\n const verdict = verdicts.get(b.it.ability_id) ?? null;\n proposals.push({\n ability_id: b.it.ability_id, name: b.it.name, faction,\n effect_type: b.form.effect_type, complex: b.form.complex, confidence: b.form.confidence,\n schema_valid: b.schemaValid, proposed_effect: b.entry.effect, proposed_scope: b.entry.scope,\n verdict, final_faithful: !!verdict?.faithful && b.schemaValid,\n });\n }\n process.stderr.write(` ${faction}: ${proposals.length}/${input.length}\\n`);\n }\n\n mkdirSync(OUT_DIR, { recursive: true });\n writeJSON(resolve(OUT_DIR, `${faction}.json`), proposals);\n return {\n faction, total: proposals.length,\n schema_valid: proposals.filter((p) => p.schema_valid).length,\n faithful: proposals.filter((p) => p.final_faithful).length,\n gateable: proposals.filter((p) => passesGate(p, { minConfidence: \"medium\", includeComplex: false })).length,\n };\n}\n\n// ─── repair (full-tree pass over the residue) ────────────────────────\n\ninterface RepairOpts { batch: number; model: string; types?: Set<string> }\n\n/**\n * Re-author the complex residue in proposed/<faction>.json as full nested DSL.\n * Reuses the propose pipeline shape — classify(→repair)/assemble/AJV/verify —\n * but the model emits the whole effect tree and we seed it with the existing\n * draft + the verifier's gap. Updates the proposals in place (matched by\n * ability_id), tagging each `repaired:true`; the already-gateable and the errored\n * entries are left untouched.\n */\nasync function repairFaction(faction: string, opts: RepairOpts, validate: (x: unknown) => boolean): Promise<Json> {\n const proposalsPath = resolve(OUT_DIR, `${faction}.json`);\n if (!existsSync(proposalsPath)) return { faction, skipped: \"no proposals — run propose first\" };\n const proposals: Proposal[] = readJSON(proposalsPath);\n const gate = { minConfidence: \"medium\" as const, includeComplex: false };\n\n // Residue = not already auto-appliable, not a hard error. Phase A narrows to\n // the cruncher-relevant leaf types via --types.\n const targets = proposals\n .map((p, idx) => ({ p, idx }))\n .filter(({ p }) => !passesGate(p, gate) && !p.error)\n .filter(({ p }) => !opts.types || (p.effect_type != null && opts.types.has(p.effect_type)));\n if (targets.length === 0) return { faction, skipped: \"no matching residue\" };\n\n // Source rules (the gap the draft must close) + originals (metadata + AJV).\n const inputPath = resolve(INPUT_DIR, `${faction}.json`);\n const srcById = new Map<string, string>();\n if (existsSync(inputPath)) for (const e of readJSON(inputPath) as Json[]) if (e.src?.description) srcById.set(e.ability_id, e.src.description);\n const original = new Map<string, Json>();\n for (const a of readJSON(resolve(ENRICHMENT_ROOT, faction, \"abilities.json\")) as Json[]) original.set(a.ability_id, a);\n\n let done = 0;\n for (const batch of chunk(targets, opts.batch)) {\n let results: Json[];\n try {\n ({ results } = await callClaude(REPAIR_SYSTEM,\n repairUserPrompt(batch.map(({ p }) => ({ ability_id: p.ability_id, rule: srcById.get(p.ability_id) ?? \"\", draft: p.proposed_effect, issue: p.verdict?.issue ?? \"\" }))),\n REPAIR_SCHEMA, opts.model));\n } catch (e) {\n process.stderr.write(` ${faction}: repair batch failed (${(e as Error).message.slice(0, 80)}) — skipping ${batch.length}\\n`);\n continue;\n }\n const byId = new Map<string, Json>(results.map((r: Json) => [r.ability_id, r]));\n\n const built: { idx: number; p: Proposal; r: Json; entry: Json; schemaValid: boolean; canonical: boolean }[] = [];\n for (const { p, idx } of batch) {\n const r = byId.get(p.ability_id);\n const orig = original.get(p.ability_id);\n if (!r || !orig) continue; // model dropped it / live entry gone — leave the proposal as-is\n const entry = buildRepairedEntry(orig, r.effect, r.scope, r.behavior);\n built.push({ idx, p, r, entry, schemaValid: validate(entry), canonical: lintCanonical(r.effect).canonical });\n }\n\n // Verify only what can still pass the gate — a non-canonical entry can't, so\n // don't spend a verify call on it.\n const toVerify = built.filter((b) => b.schemaValid && b.canonical);\n const verdicts = new Map<string, Json>();\n if (toVerify.length > 0) {\n try {\n const { results: vs } = await callClaude(VERIFY_SYSTEM,\n verifyUserPrompt(toVerify.map((b) => ({ ability_id: b.p.ability_id, rule: srcById.get(b.p.ability_id) ?? \"\", effect: b.entry.effect, scope: b.entry.scope }))),\n VERIFY_SCHEMA, opts.model);\n for (const v of vs) verdicts.set(v.ability_id, v);\n } catch (e) {\n process.stderr.write(` ${faction}: repair-verify batch failed (${(e as Error).message.slice(0, 80)})\\n`);\n }\n }\n\n for (const b of built) {\n const verdict = verdicts.get(b.p.ability_id) ?? null;\n const behavior = b.r.behavior && BEHAVIOR_VALUES.has(b.r.behavior) ? b.r.behavior : undefined;\n proposals[b.idx] = {\n ...b.p,\n confidence: b.r.confidence ?? b.p.confidence,\n schema_valid: b.schemaValid,\n canonical: b.canonical,\n proposed_effect: b.entry.effect,\n proposed_scope: b.entry.scope,\n proposed_behavior: behavior,\n verdict,\n final_faithful: !!verdict?.faithful && b.schemaValid && b.canonical,\n repaired: true,\n unencodable: !!b.r.unencodable,\n };\n }\n done += batch.length;\n process.stderr.write(` ${faction}: repaired ${done}/${targets.length}\\n`);\n }\n\n writeJSON(proposalsPath, proposals);\n const repaired = proposals.filter((p) => p.repaired);\n return {\n faction, attempted: targets.length,\n now_faithful: repaired.filter((p) => p.final_faithful).length,\n non_canonical: repaired.filter((p) => p.canonical === false).length,\n unencodable: repaired.filter((p) => p.unencodable).length,\n gateable: proposals.filter((p) => passesGate(p, gate)).length,\n };\n}\n\n// ─── apply ───────────────────────────────────────────────────────────\n\ninterface ApplyOpts extends GateOpts { dryRun: boolean }\n\n/** Splice gated proposals into the live abilities.json — only over surviving stubs. */\nfunction applyFaction(faction: string, opts: ApplyOpts): Json {\n const proposalsPath = resolve(OUT_DIR, `${faction}.json`);\n if (!existsSync(proposalsPath)) return { faction, skipped: \"no proposals — run propose first\" };\n const proposals: Proposal[] = readJSON(proposalsPath);\n const abilitiesPath = resolve(ENRICHMENT_ROOT, faction, \"abilities.json\");\n if (!existsSync(abilitiesPath)) return { faction, skipped: \"no live abilities.json\" };\n const abilities: Json[] = readJSON(abilitiesPath);\n const byId = new Map<string, Json>(abilities.map((a) => [a.ability_id, a]));\n\n let applied = 0;\n const skipped: { id: string; why: string }[] = [];\n for (const p of proposals) {\n if (!passesGate(p, opts)) { skipped.push({ id: p.ability_id, why: \"gate\" }); continue; }\n const entry = byId.get(p.ability_id);\n if (!entry) { skipped.push({ id: p.ability_id, why: \"gone\" }); continue; }\n // Never clobber work that's no longer a stub (idempotent + safe to re-run).\n if (!hasEmptyModifier(entry.effect)) { skipped.push({ id: p.ability_id, why: \"not-a-stub\" }); continue; }\n entry.effect = p.proposed_effect;\n entry.scope = p.proposed_scope;\n if (p.proposed_behavior && BEHAVIOR_VALUES.has(p.proposed_behavior)) entry.behavior = p.proposed_behavior;\n entry.community_notes = \"community-authored from 10e source (provisional 11e); see #21\";\n applied++;\n }\n if (!opts.dryRun && applied > 0) writeJSON(abilitiesPath, abilities);\n return { faction, applied, skipped_gate: skipped.filter((s) => s.why === \"gate\").length, skipped_other: skipped.filter((s) => s.why !== \"gate\").length, dry_run: opts.dryRun };\n}\n\n// ─── review (cluster proposals into shape-families) ──────────────────\n\n/** Load every faction's proposals (skips the ad-hoc damage-batch scratch file). */\nfunction loadAllProposals(): Proposal[] {\n if (!existsSync(OUT_DIR)) return [];\n return readdirSync(OUT_DIR)\n .filter((f) => f.endsWith(\".json\") && f !== \"damage-batch.json\")\n .flatMap((f) => readJSON(resolve(OUT_DIR, f)) as Proposal[]);\n}\n\n/** Write a shape-family clustered REVIEW.md — gateable vs the complex residue, grouped for templating. */\nfunction review(): Json {\n const all = loadAllProposals();\n const gate = { minConfidence: \"medium\" as const, includeComplex: false };\n const gateable = all.filter((p) => passesGate(p, gate));\n const residue = all.filter((p) => !passesGate(p, gate) && !p.error);\n\n const byType = (ps: Proposal[]): [string, number][] =>\n Object.entries(ps.reduce<Record<string, number>>((m, p) => ((m[p.effect_type ?? \"?\"] = (m[p.effect_type ?? \"?\"] ?? 0) + 1), m), {})).sort((a, b) => b[1] - a[1]);\n\n // Cross-faction name dupes among the residue — author once, fan to all members.\n const byName = new Map<string, Proposal[]>();\n for (const p of residue) (byName.get(p.name) ?? byName.set(p.name, []).get(p.name)!).push(p);\n const shared = [...byName.entries()].filter(([, ps]) => new Set(ps.map((p) => p.faction)).size > 1)\n .map(([name, ps]) => ({ name, type: ps[0].effect_type, factions: [...new Set(ps.map((p) => p.faction))] }))\n .sort((a, b) => b.factions.length - a.factions.length);\n\n const L: string[] = [\n \"# DSL stub authoring — review\",\n \"\",\n `Generated by \\`author-batch review\\`. ${all.length} proposals across ${new Set(all.map((p) => p.faction)).size} factions.`,\n \"\",\n `- **schema-valid:** ${all.filter((p) => p.schema_valid).length}`,\n `- **verifier-faithful:** ${all.filter((p) => p.final_faithful).length}`,\n `- **complex-flagged:** ${all.filter((p) => p.complex).length}`,\n `- **auto-appliable (gate: valid+faithful+conf≠low+not-complex):** ${gateable.length}`,\n \"\",\n \"## Auto-appliable now — by faction\",\n \"\",\n ...Object.entries(gateable.reduce<Record<string, number>>((m, p) => ((m[p.faction] = (m[p.faction] ?? 0) + 1), m), {})).sort().map(([f, n]) => `- \\`${f}\\`: ${n}`),\n \"\",\n \"Apply with: `npm run author:apply -- <faction|--all> --dry-run` then drop `--dry-run`.\",\n \"\",\n \"## Complex residue — by shape family (author a template per family)\",\n \"\",\n ...byType(residue).map(([t, n]) => `- **${t}** — ${n}`),\n \"\",\n \"## Cross-faction shared shapes (author once, fan to all members)\",\n \"\",\n ...(shared.length ? shared.map((s) => `- **${s.name}** (\\`${s.type}\\`) → ${s.factions.join(\", \")}`) : [\"_(none found)_\"]),\n \"\",\n ];\n writeFileSync(resolve(OUT_DIR, \"REVIEW.md\"), L.join(\"\\n\") + \"\\n\");\n return { total: all.length, gateable: gateable.length, residue: residue.length, shared_shapes: shared.length };\n}\n\n// ─── main ────────────────────────────────────────────────────────────\n\nfunction factionList(arg: string, dir: string): string[] {\n return arg === \"--all\"\n ? readdirSync(dir).filter((f) => f.endsWith(\".json\") && f !== \"damage-batch.json\").map((f) => f.replace(/\\.json$/, \"\")).sort()\n : [arg];\n}\nconst flag = (argv: string[], name: string): string | undefined => (argv.includes(name) ? argv[argv.indexOf(name) + 1] : undefined);\n\nasync function main(): Promise<void> {\n const argv = process.argv.slice(2);\n const mode = argv[0];\n const target = argv[1];\n if (mode === \"review\") {\n console.log(JSON.stringify(review(), null, 2));\n console.error(`\\nWrote ${resolve(OUT_DIR, \"REVIEW.md\")}`);\n return;\n }\n if (![\"propose\", \"repair\", \"apply\"].includes(mode) || !target) {\n console.error(\"Usage:\\n author-batch propose <faction|--all> [--batch N] [--model M]\\n author-batch repair <faction|--all> [--types t1,t2] [--batch N] [--model M]\\n author-batch apply <faction|--all> [--min-confidence high|medium] [--include-complex] [--dry-run]\\n author-batch review\");\n process.exit(1);\n }\n\n if (mode === \"propose\") {\n const ajv = createValidator();\n const validateFn = ajv.getSchema(ABILITY_SCHEMA_ID);\n if (!validateFn) throw new Error(`ability schema not loaded: ${ABILITY_SCHEMA_ID}`);\n const validate = (x: unknown): boolean => !!validateFn(x);\n const opts: ProposeOpts = { batch: Number(flag(argv, \"--batch\")) || 15, model: flag(argv, \"--model\") ?? \"claude-haiku-4-5\" };\n const summary: Json[] = [];\n for (const f of factionList(target, INPUT_DIR)) {\n try {\n summary.push(await proposeFaction(f, opts, validate));\n } catch (e) {\n process.stderr.write(` ${f}: FAILED (${(e as Error).message.slice(0, 100)})\\n`);\n summary.push({ faction: f, error: (e as Error).message });\n }\n }\n console.log(JSON.stringify(summary, null, 2));\n return;\n }\n\n if (mode === \"repair\") {\n const ajv = createValidator();\n const validateFn = ajv.getSchema(ABILITY_SCHEMA_ID);\n if (!validateFn) throw new Error(`ability schema not loaded: ${ABILITY_SCHEMA_ID}`);\n const validate = (x: unknown): boolean => !!validateFn(x);\n const typesArg = flag(argv, \"--types\");\n const opts: RepairOpts = {\n batch: Number(flag(argv, \"--batch\")) || 8,\n model: flag(argv, \"--model\") ?? \"claude-sonnet-4-6\",\n types: typesArg ? new Set(typesArg.split(\",\").map((t) => t.trim()).filter(Boolean)) : undefined,\n };\n const summary: Json[] = [];\n for (const f of factionList(target, OUT_DIR)) {\n try {\n summary.push(await repairFaction(f, opts, validate));\n } catch (e) {\n process.stderr.write(` ${f}: FAILED (${(e as Error).message.slice(0, 100)})\\n`);\n summary.push({ faction: f, error: (e as Error).message });\n }\n }\n console.log(JSON.stringify(summary, null, 2));\n const unenc = summary.reduce((n, s) => n + (s.unencodable ?? 0), 0);\n const faithful = summary.reduce((n, s) => n + (s.now_faithful ?? 0), 0);\n const noncanon = summary.reduce((n, s) => n + (s.non_canonical ?? 0), 0);\n console.error(`\\nrepair: ${faithful} now faithful, ${noncanon} non-canonical (gate-blocked), ${unenc} flagged unencodable (need hand-authoring).`);\n return;\n }\n\n // apply\n const opts: ApplyOpts = {\n minConfidence: flag(argv, \"--min-confidence\") === \"high\" ? \"high\" : \"medium\",\n includeComplex: argv.includes(\"--include-complex\"),\n dryRun: argv.includes(\"--dry-run\"),\n };\n const summary = factionList(target, OUT_DIR).map((f) => applyFaction(f, opts));\n console.log(JSON.stringify(summary, null, 2));\n const total = summary.reduce((n, s) => n + (s.applied ?? 0), 0);\n console.error(`\\n${opts.dryRun ? \"[dry-run] would apply\" : \"applied\"} ${total} entr${total === 1 ? \"y\" : \"ies\"}.`);\n}\n\nconst isMain =\n process.argv[1] &&\n resolve(process.argv[1]).replace(/\\.\\w+$/, \"\") === fileURLToPath(import.meta.url).replace(/\\.\\w+$/, \"\");\nif (isMain) main().catch((e) => { console.error(e); process.exit(1); });\n"]}
|
|
1
|
+
{"version":3,"file":"author-batch.js","sourceRoot":"","sources":["../src/author-batch.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA8BG;AACH,OAAO,EAAE,YAAY,EAAE,a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AAO,IAAI,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;IAChE,OAAO,CAAC,KAAK,CAAC,KAAK,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,uBAAuB,CAAC,CAAC,CAAC,SAAS,IAAI,KAAK,QAAQ,KAAK,KAAK,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,GAAG,CAAC,CAAC;AACrH,CAAC;AAED,MAAM,MAAM,GACV,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC;IACf,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,KAAK,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;AAC1G,IAAI,MAAM;IAAE,IAAI,EAAE,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,GAAG,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC","sourcesContent":["/**\n * DSL stub authoring engine (#21) — batched, subscription-billed, two-phase.\n *\n * Empty-modifier ability stubs (`{type:\"stat-modifier\", modifier:{}}` and kin)\n * are authored into real DSL from their 10e-archive source rule. The work is a\n * pile of discrete, stateless, structured LLM calls, so we run them as batched\n * `claude -p --json-schema` invocations on the Claude subscription rather than\n * spawning a full agent per ability (the agent fan-out's per-call system-prompt\n * + tool-loop overhead is ~50-100x the useful work). Assembly and schema\n * validation are pure TS — the model only classifies and judges.\n *\n * author-input/<faction>.json (datasheet-resolved rules, from author-input.ts)\n * ── classify ──▶ flat slot-forms (batched claude -p)\n * ── assemble ──▶ full ability entries (TS: effect + scope, no LLM)\n * ── validate ──▶ AJV against the schema (TS — rejects invented enums)\n * ── verify ──▶ fidelity verdict (batched claude -p, scope-aware)\n * ─────────────▶ data/_audit/proposed/<faction>.json\n *\n * Two modes:\n * propose (default) — write proposals; never touch live data.\n * apply — splice gated proposals into live abilities.json. Only\n * rewrites entries that are STILL empty-modifier stubs,\n * so re-running is safe and authored work is never\n * clobbered. Gate defaults: schema-valid + verifier-\n * faithful + confidence≠low + not complex-flagged.\n *\n * Usage:\n * npx tsx tools/src/author-batch.ts propose <faction|--all> [--batch N] [--model M]\n * npx tsx tools/src/author-batch.ts apply <faction|--all> [--min-confidence high|medium]\n * [--include-complex] [--dry-run]\n */\nimport { readFileSync, writeFileSync, mkdirSync, existsSync, readdirSync } from \"node:fs\";\nimport { resolve } from \"node:path\";\nimport { execFile } from \"node:child_process\";\nimport { fileURLToPath } from \"node:url\";\nimport { createValidator } from \"./schema-loader.js\";\nimport { hasEmptyModifier } from \"./audit-coverage.js\";\n\nconst __dirname = fileURLToPath(new URL(\".\", import.meta.url));\nconst DATA_ROOT = resolve(__dirname, \"../../data\");\nconst INPUT_DIR = resolve(DATA_ROOT, \"_audit\", \"author-input\");\nconst ENRICHMENT_ROOT = resolve(DATA_ROOT, \"enrichment\");\nconst OUT_DIR = resolve(DATA_ROOT, \"_audit\", \"proposed\");\nconst ABILITY_SCHEMA_ID = \"https://40kdc.dev/schemas/enrichment/ability-dsl/ability.schema.json\";\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\ntype Json = any;\nconst readJSON = (p: string): Json => JSON.parse(readFileSync(p, \"utf-8\"));\nconst writeJSON = (p: string, v: Json): void => writeFileSync(p, JSON.stringify(v, null, 2) + \"\\n\");\n\nconst PARAMETERLESS = new Set([\"deep-strike\", \"fallback-and-act\", \"fight-first\", \"fight-last\", \"shoot-on-death\", \"fight-on-death\"]);\n\nexport interface Proposal {\n ability_id: string;\n name: string;\n faction: string;\n effect_type?: string;\n complex?: boolean;\n confidence?: \"high\" | \"medium\" | \"low\";\n schema_valid: boolean;\n proposed_effect?: Json;\n proposed_scope?: Json;\n /** Ability-level behavior the repair pass inferred (passive/activated/reactive/aura). */\n proposed_behavior?: string;\n verdict?: { severity: string; faithful: boolean; issue: string } | null;\n final_faithful: boolean;\n error?: string;\n /** Set by the full-tree repair pass — the effect is a nested tree, not flat-form. */\n repaired?: boolean;\n /** Repair pass flagged this rule as genuinely unencodable (needs hand-authoring). */\n unencodable?: boolean;\n /** Canonical-key lint result (repair pass only). false = invented/out-of-vocab modifier keys. */\n canonical?: boolean;\n}\n\n// ─── claude CLI bridge (subscription, structured output) ─────────────\n\n/** One batched, structured `claude -p` call. Resolves to the validated object. */\nexport function callClaude(system: string, user: string, schema: Json, model: string): Promise<Json> {\n return new Promise((res, rej) => {\n execFile(\n \"claude\",\n [\"-p\", user, \"--system-prompt\", system, \"--exclude-dynamic-system-prompt-sections\",\n \"--json-schema\", JSON.stringify(schema), \"--output-format\", \"json\", \"--model\", model],\n { maxBuffer: 64 * 1024 * 1024, timeout: 300_000 },\n (err, stdout) => {\n if (err && !stdout) return rej(err);\n try {\n const env = JSON.parse(stdout);\n if (env.is_error) return rej(new Error(env.result ?? \"claude error\"));\n if (!env.structured_output) return rej(new Error(\"no structured_output in response\"));\n res(env.structured_output);\n } catch (e) {\n rej(new Error(`parse failed: ${(e as Error).message}; head=${String(stdout).slice(0, 200)}`));\n }\n },\n );\n });\n}\n\n// ─── prompts + schemas ───────────────────────────────────────────────\n\nconst CLASSIFY_SYSTEM =\n `You translate Warhammer 40k ability rules into a structured DSL. For each ability return one slot-form.\\n\\n` +\n `effect_type — pick the SINGLE best of:\\n` +\n ` stat-modifier {operation:\"add\"|\"subtract\"|\"set\", stat:\"A\"|\"S\"|\"T\"|\"Sv\"|\"AP\"|\"OC\"|\"Ld\", value:int}\\n` +\n ` roll-modifier {operation:\"add\"|\"subtract\", roll:\"hit\"|\"wound\"|\"save\"|\"charge\", value:int}\\n` +\n ` re-roll {roll:\"hit\"|\"wound\"|\"save\"|\"damage\"|\"charge\", subset:\"ones\"|\"all-failures\"} — ONLY combat dice, NOT Battle-shock/Leadership\\n` +\n ` leadership-modifier {test:\"battle-shock\", operation:\"re-roll\"} or {operation:\"add\"|\"subtract\", value:int} — USE for Battle-shock/Leadership rerolls or Ld changes\\n` +\n ` mortal-wounds {count:int|\"D3\"|\"D6\"} ; feel-no-pain {threshold:int} ; invulnerable-save {invuln_sv:int}\\n` +\n ` keyword-grant {keywords:[ \"lethal-hits\"|\"sustained-hits\"|\"devastating-wounds\"|\"twin-linked\"|... ]} (ARRAY)\\n` +\n ` damage-reduction {reduction:int} ; objective-control-modifier {operation,value}|{sticky:true}\\n` +\n ` ability-grant {ability_id:\"kebab\"}|{grant_type:\"...\"} ; attack-restriction {restriction:\"...\"}\\n` +\n ` cp-gain|cp-refund {amount:int} ; resurrection {count:int|\"D3\"} ; model-destruction {count:int}\\n` +\n ` resource-gain|resource-spend {pool_id:\"...\", amount:int|\"D3\"} — faction resources: Miracle Dice→\"miracle-dice-pool\", Khorne Blessings→\"blessings-of-khorne-pool\", Pain tokens→\"pain-token-pool\"\\n` +\n ` movement-modifier {move_type,value} ; deep-strike/fallback-and-act/fight-first/fight-last/shoot-on-death/fight-on-death → modifier {}\\n\\n` +\n `attack_type — \"melee\"|\"ranged\" if the rule limits to that attack kind, else \"any\". (Do NOT encode this as a condition.)\\n` +\n `condition_kind — DEFAULT \"none\". Only set if the rule EXPLICITLY restricts: \"phase\" (+condition_param = phase name), \"vs-keyword\" (+param=keyword), ` +\n `\"charged\", \"stationary\", \"below-half\", \"below-starting\", \"attached\", \"leading\". Do NOT add a phase condition just because the ability operates in a phase. ` +\n `If the rule needs a compound/event trigger (e.g. a dice roll, an either/or choice, or \"when a friendly VEHICLE is destroyed within 12\\\\\"\") set complex=true.\\n` +\n `scope_range — \"self\"|\"unit\"|\"attached-unit\"|\"aura-6\"|\"aura-9\"|\"aura-12\"|... . scope_duration — \"phase\"|\"turn\"|\"battle-round\"|\"battle\"|\"permanent\".\\n` +\n `target — \"self\"|\"unit\"|\"friendly-within-aura\"|\"enemy-within-aura\"|\"attacker\"|\"defender\"|... (only values from the schema enum).\\n` +\n `Never copy rule text into any field. Give confidence and a one-sentence reasoning.`;\n\nexport const VERIFY_SYSTEM =\n `You judge whether authored DSL faithfully captures a 40k rule. The DSL includes scope {range,duration} — credit the aura/range/duration when it is in scope (do NOT flag \"missing 6\\\\\" aura\" if scope.range is \"aura-6\"). ` +\n `Be strict about the core mechanic: wrong effect type, wrong stat/roll, wrong value, a condition the rule does NOT state (phantom), a stated condition that is missing, or modeling a Leadership/Battle-shock re-roll as a combat re-roll. ` +\n `severity \"ok\" = core mechanic + conditions + scope correct; \"minor\" = core correct but a secondary detail imperfect; \"wrong\" = core mechanic wrong. Return one verdict per ability, echoing its ability_id.`;\n\nconst CLASSIFY_SCHEMA = {\n type: \"object\", additionalProperties: false,\n properties: { results: { type: \"array\", items: {\n type: \"object\", additionalProperties: false,\n properties: {\n ability_id: { type: \"string\" }, effect_type: { type: \"string\" }, target: { type: \"string\" },\n modifier: { type: \"object\", additionalProperties: true }, attack_type: { enum: [\"any\", \"melee\", \"ranged\"] },\n condition_kind: { enum: [\"none\", \"phase\", \"vs-keyword\", \"charged\", \"stationary\", \"below-half\", \"below-starting\", \"attached\", \"leading\"] },\n condition_param: { type: [\"string\", \"null\"] }, scope_range: { type: \"string\" }, scope_duration: { type: \"string\" },\n complex: { type: \"boolean\" }, confidence: { enum: [\"high\", \"medium\", \"low\"] }, reasoning: { type: \"string\" },\n },\n required: [\"ability_id\", \"effect_type\", \"target\", \"modifier\", \"attack_type\", \"condition_kind\", \"scope_range\", \"scope_duration\", \"complex\", \"confidence\", \"reasoning\"],\n } } },\n required: [\"results\"],\n};\n\nexport const VERIFY_SCHEMA = {\n type: \"object\", additionalProperties: false,\n properties: { results: { type: \"array\", items: {\n type: \"object\", additionalProperties: false,\n properties: { ability_id: { type: \"string\" }, severity: { enum: [\"ok\", \"minor\", \"wrong\"] }, faithful: { type: \"boolean\" }, issue: { type: \"string\" } },\n required: [\"ability_id\", \"severity\", \"faithful\", \"issue\"],\n } } },\n required: [\"results\"],\n};\n\n// ─── full-tree repair prompts + schema ───────────────────────────────\n//\n// The flat-form classifier (above) emits a single condition + flat leaf, so it\n// structurally CANNOT express compound conditions, event triggers, or nested\n// effect kinds — every such rule lands in the proposed/ residue with a verifier\n// `issue` naming the gap. The repair pass hands the model the FULL DSL grammar\n// and asks it to emit the complete nested effect tree, seeded with the existing\n// draft + that exact gap. The envelope schema below is intentionally loose (just\n// `effect`/`scope` objects); the real gate is AJV against ability.schema, exactly\n// as the flat-form path validates `buildEntry` output.\n\nexport const REPAIR_SYSTEM =\n `You repair Warhammer 40k ability DSL. You are given a rule, a DRAFT effect that an earlier flat-form pass produced, and the EXACT gap a verifier found (usually a missing trigger or compound condition). Emit the COMPLETE nested effect tree that fixes the gap. Never copy rule text into any field.\\n\\n` +\n `An effect node is ONE of:\\n` +\n ` • a leaf: {type, target, modifier} — 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, bs-modifier, engagement-passthrough]; target ∈ [self, bearer, unit, attached-unit, attacker, defender, friendly-within-aura, enemy-within-aura, all-friendly, all-enemy]\\n` +\n ` • conditional: {type:\"conditional\", condition, effect}\\n` +\n ` • sequence: {type:\"sequence\", steps:[effect, ...]} — multiple effects that all apply\\n` +\n ` • choice: {type:\"choice\", options:[effect, ...], choice_label?} — pick exactly one\\n` +\n ` • dice-gated: {type:\"dice-gated\", dice:\"D6\"|..., threshold:int, comparison?:\"greater-or-equal\"|..., on_success:effect, on_fail?:effect}\\n` +\n ` • dice-pool-allocation: {type:\"dice-pool-allocation\", pool:{count,die}, max_activations:int, options:[{name, requirement, effect}, ...]}\\n\\n` +\n `A condition is ONE of:\\n` +\n ` • simple: {type, parameters:{...}} — ALL params go UNDER \"parameters\", never as top-level keys (e.g. {\"type\":\"unit-has-keyword\",\"parameters\":{\"keyword\":\"VEHICLE\"}}, NOT {\"type\":\"unit-has-keyword\",\"keyword\":\"VEHICLE\"}). type ∈ [phase-is{phase}, timing-is{timing}, player-turn-is{turn}, unit-below-starting-strength, unit-below-half-strength, unit-has-keyword{keyword}, unit-within-range-of{target_type}, model-is-leader, target-has-keyword{keyword}, charged-this-turn, advanced-this-turn, remained-stationary, is-battle-shocked, has-lost-wounds, was-hit-by-attack{subject?:\"self\"|\"target\",attack_type?,weapon_name?,count_min?}, opponent-unit-within-range, within-range-of-objective, attack-is-type{attack_type}, has-fought-this-phase, destroyed-by-attack-type{attack_type}, controls-objective, is-attached, terrain-area-control, engagement-state, territory-control, fights-first, disposition-matches, units-destroyed{side,window,count_min}, units-destroyed-comparison, objective-majority]\\n` +\n ` • compound: {operator:\"and\"|\"or\"|\"not\", operands:[condition, ...]} — use \"not\" with ONE operand to negate (e.g. \"while not Battle-shocked\" → {operator:\"not\", operands:[{type:\"is-battle-shocked\"}]}). Nest compounds freely.\\n\\n` +\n `Encode reactive/event triggers as a conditional whose condition is the trigger (e.g. an enemy destroyed a model nearby → destroyed-by-attack-type / opponent-unit-within-range). Encode \"first time per turn\"/\"once per game\" by choosing the correct timing condition; do not invent fields.\\n` +\n `scope = {range, duration}: range ∈ [self, unit, attached-unit, aura-6, aura-9, aura-12, ...]; duration ∈ [phase, turn, battle-round, battle, permanent]. Credit the aura in scope.range, NOT as a condition.\\n` +\n `behavior ∈ [passive, activated, reactive, aura].\\n\\n` +\n `CANONICAL MODIFIER KEYS — use ONLY the keys listed per type; never invent a key (an unknown key is silently ignored by consumers and corrupts the data):\\n` +\n ` stat-modifier.modifier: {stat, operation:\"add\"|\"subtract\"|\"set\", value:int}. stat ∈ [A,S,T,Sv,AP,OC,Ld,M,W,D] ONLY (use \"M\" for Move, never \"Move\"/\"range\"; weapon range is NOT a unit stat). operation:\"set\" IS allowed for \"characteristic of N\" rules (e.g. OC of 9). Optional narrowing: attack_type:\"melee\"|\"ranged\", weapon_type:\"melee\"|\"ranged\", or weapon_name:\"<weapon>\" for a single named weapon. Do NOT use weapon_keyword/weapon_filter/model_filter.\\n` +\n ` roll-modifier.modifier: {roll:\"hit\"|\"wound\"|\"save\"|\"charge\"|\"damage\", operation, value}. re-roll.modifier: {roll, subset:\"ones\"|\"all-failures\"}. Optional attack_type/weapon_type/weapon_name as above.\\n` +\n ` keyword-grant.modifier: {keywords:[...]} (array) — combat keywords as written (\"Lethal Hits\",\"Sustained Hits 1\",\"Twin-linked\"). Optional weapon_type:\"melee\"|\"ranged\", weapon_name.\\n` +\n ` feel-no-pain.modifier:{threshold:int}; damage-reduction.modifier:{reduction:int}; bs-modifier.modifier:{operation,value}; ability-grant.modifier:{grant_type:\"kebab-label\"}; objective-control-modifier.modifier:{operation:\"add\"|\"set\",value} or {sticky:true}; movement-modifier.modifier:{move_type:\"kebab\",value}; deep-strike.modifier:{} (parameterless).\\n\\n` +\n `dice-gated.comparison ∈ [\"gte\",\"lte\",\"gt\",\"lt\",\"eq\"] (use \"gte\" for \"on a 2+\"). dice e.g. \"D6\",\"2D6\"; threshold int. on_success/on_fail are effect nodes.\\n` +\n `ENCODING THE RESIDUE — these ARE expressible, do not punt on them:\\n` +\n ` • \"roll a D6, on 2+ <effect>\" → dice-gated {dice:\"D6\", threshold:2, comparison:\"gte\", on_success:<effect>}.\\n` +\n ` • \"select one of N abilities/effects\" → choice {options:[<effect>,...]}.\\n` +\n ` • \"re-roll Battle-shock/Leadership tests\" → leadership-modifier {test:\"battle-shock\", operation:\"re-roll\"} (NOT a combat re-roll).\\n` +\n ` • deployment/redeploy (\"set up in Strategic Reserves\", \"set up anywhere >9\\\\\"\", \"redeploy after deployment\") → deep-strike, or ability-grant {grant_type:\"<descriptive-kebab>\"} for a named deployment rule.\\n` +\n ` • \"move through terrain\" → movement-modifier {move_type:\"through-terrain\"}.\\n` +\n ` • \"characteristic of N\" → the matching stat/OC modifier with operation:\"set\".\\n` +\n ` • \"when/if this unit WAS HIT by one or more attacks\" → was-hit-by-attack {subject:\"self\"} (NOT has-lost-wounds — a hit that is saved still counts). \"if an enemy unit was hit by [the bearer's] attacks\" (offensive follow-up like grav-pinning) → was-hit-by-attack {subject:\"target\"}; narrow with attack_type/weapon_name when the rule names the weapon.\\n\\n` +\n `Set unencodable:true ONLY when the rule is NOT an in-battle ability effect at all — army-construction (\"you can include one X per Y\", \"cannot include A with B\"), roster selection (\"cannot be your Warlord\"), model geometry/transport-capacity declarations, or roll-off/meta procedures. For those, return your best partial effect and explain. Everything that IS an in-battle effect must be encoded with the grammar above. Give confidence + one-sentence reasoning.`;\n\nexport const REPAIR_SCHEMA = {\n type: \"object\", additionalProperties: false,\n properties: { results: { type: \"array\", items: {\n type: \"object\", additionalProperties: false,\n properties: {\n ability_id: { type: \"string\" },\n effect: { type: \"object\", additionalProperties: true },\n scope: { type: \"object\", additionalProperties: true },\n behavior: { type: \"string\" },\n unencodable: { type: \"boolean\" },\n confidence: { enum: [\"high\", \"medium\", \"low\"] },\n reasoning: { type: \"string\" },\n },\n required: [\"ability_id\", \"effect\", \"scope\", \"behavior\", \"unencodable\", \"confidence\", \"reasoning\"],\n } } },\n required: [\"results\"],\n};\n\n// ─── assembly (pure TS, no LLM) ──────────────────────────────────────\n\nexport function conditionNode(kind: string, param: string | null | undefined): Json | null {\n switch (kind) {\n case \"phase\": return { type: \"phase-is\", parameters: { phase: param } };\n case \"vs-keyword\": return { type: \"target-has-keyword\", parameters: { keyword: param } };\n case \"charged\": return { type: \"charged-this-turn\" };\n case \"stationary\": return { type: \"remained-stationary\" };\n case \"below-half\": return { type: \"unit-below-half-strength\" };\n case \"below-starting\": return { type: \"unit-below-starting-strength\" };\n case \"attached\": return { type: \"is-attached\" };\n case \"leading\": return { type: \"model-is-leader\" };\n default: return null;\n }\n}\n\n/** Build the effect node + scope from a flat-form. */\nexport function assembleEffect(form: Json): { effect: Json; scope: Json } {\n const modifier = PARAMETERLESS.has(form.effect_type) ? {} : { ...(form.modifier ?? {}) };\n if (form.attack_type && form.attack_type !== \"any\" && [\"stat-modifier\", \"roll-modifier\", \"re-roll\"].includes(form.effect_type)) {\n modifier.attack_type = form.attack_type;\n }\n let effect: Json = { type: form.effect_type, target: form.target, modifier };\n const cond = conditionNode(form.condition_kind, form.condition_param);\n if (cond) effect = { type: \"conditional\", condition: cond, effect };\n return { effect, scope: { range: form.scope_range, duration: form.scope_duration } };\n}\n\n/** Splice the authored effect+scope onto the original entry, preserving metadata. */\nexport function buildEntry(original: Json, form: Json): Json {\n const { effect, scope } = assembleEffect(form);\n return { ...original, effect, scope, community_notes: \"community-authored from 10e source (provisional 11e); see #21\" };\n}\n\nconst BEHAVIOR_VALUES = new Set([\"passive\", \"activated\", \"reactive\", \"aura\"]);\n\n// ─── canonical-key lint ──────────────────────────────────────────────\n//\n// The full-tree repair model emits the whole effect node, including the open\n// `modifier` object. AJV permits any modifier key (additionalProperties:true),\n// so an invented key (`weapon_keyword`, `model_filter`, `critical_threshold`)\n// passes schema validation — but the cruncher reads ONLY the canonical keys, so\n// an ignored filter on an `add` operation silently OVER-APPLIES the buff. The\n// verifier can't catch this: it judges the JSON against the rule as a reader,\n// not against what the engine honors. This lint is the deterministic gate.\n//\n// Vocabulary is calibrated to what EXISTING enrichment data actually uses (not\n// world-eaters alone): `keywords` array is the dominant keyword-grant form,\n// `damage-reduction` uses `reduction`, and `stat` spans the full statline. The\n// lint only runs on NEW repair proposals, so strictness can't regress shipped\n// data — a rejected proposal just stays residue for hand-authoring.\n\n/** Modifier keys the cruncher / canonical conventions recognise, per leaf type. */\nconst CANONICAL_MODIFIER_KEYS: Record<string, Set<string>> = {\n // weapon_type/weapon_name are valid narrowing keys (gold uses weapon_name): the\n // cruncher honors weapon_type as a phase gate and fail-safes (unsupported) on\n // weapon_name, so the data can carry them without risking a silent over-apply.\n \"stat-modifier\": new Set([\"stat\", \"operation\", \"value\", \"attack_type\", \"weapon_type\", \"weapon_name\"]),\n \"roll-modifier\": new Set([\"roll\", \"operation\", \"value\", \"attack_type\", \"weapon_type\", \"weapon_name\", \"critical_on\", \"uses\", \"context\"]),\n \"re-roll\": new Set([\"roll\", \"subset\", \"attack_type\", \"weapon_type\", \"weapon_name\", \"max_rerolls\", \"uses\", \"context\"]),\n \"keyword-grant\": new Set([\"keyword\", \"keywords\", \"weapon_type\", \"weapon_name\"]),\n \"bs-modifier\": new Set([\"operation\", \"value\", \"attack_type\"]),\n \"feel-no-pain\": new Set([\"threshold\"]),\n \"damage-reduction\": new Set([\"reduction\", \"amount\"]),\n};\nconst CANONICAL_STATS = new Set([\"A\", \"S\", \"T\", \"Sv\", \"AP\", \"OC\", \"Ld\", \"M\", \"W\", \"D\", \"Damage\", \"BS\", \"WS\"]);\nconst CANONICAL_ROLLS = new Set([\"hit\", \"wound\", \"save\", \"charge\", \"damage\", \"advance\", \"any\", \"all\"]);\nconst CANONICAL_SUBSETS = new Set([\"ones\", \"all-failures\"]);\nconst CANONICAL_ATTACK_TYPES = new Set([\"melee\", \"ranged\"]);\n\n/**\n * Walk an effect tree and flag any cruncher-interpreted leaf whose modifier\n * carries an unknown key or an out-of-vocabulary stat/roll/subset/attack_type.\n * Non-interpreted leaf types (ability-grant, movement-modifier, …) are left\n * permissive — they don't reach the damage path, so an unknown key there is a\n * consistency nit, not a silent-corruption risk.\n */\nexport function lintCanonical(effect: Json): { canonical: boolean; issues: string[] } {\n const issues: string[] = [];\n // A simple condition is {type, parameters?, negated?}; every param lives UNDER\n // `parameters`. The cruncher reads condition.parameters.* only, and AJV doesn't\n // forbid stray top-level keys, so a param placed top-level (e.g.\n // {type:\"unit-has-keyword\", keyword:\"X\"}) silently makes the condition\n // unevaluatable — the buff never fires. Existing data is 680 nested / 0 top-level.\n const visitCondition = (c: Json): void => {\n if (!c || typeof c !== \"object\") return;\n if (Array.isArray(c.operands)) return c.operands.forEach(visitCondition); // compound {operator, operands}\n if (typeof c.type === \"string\") {\n for (const k of Object.keys(c)) if (k !== \"type\" && k !== \"parameters\" && k !== \"negated\") issues.push(`condition ${c.type}: param \"${k}\" must live under \"parameters\"`);\n }\n };\n const visit = (node: Json): void => {\n if (Array.isArray(node)) return node.forEach(visit);\n if (!node || typeof node !== \"object\") return;\n const type = node.type as string | undefined;\n const allow = type ? CANONICAL_MODIFIER_KEYS[type] : undefined;\n if (allow && node.modifier && typeof node.modifier === \"object\") {\n const m = node.modifier as Record<string, unknown>;\n for (const k of Object.keys(m)) if (!allow.has(k)) issues.push(`${type}: non-canonical modifier key \"${k}\"`);\n if (type === \"stat-modifier\" && m.stat != null && !CANONICAL_STATS.has(String(m.stat))) issues.push(`stat-modifier: unknown stat \"${String(m.stat)}\"`);\n if ((type === \"roll-modifier\" || type === \"re-roll\") && m.roll != null && !CANONICAL_ROLLS.has(String(m.roll))) issues.push(`${type}: unknown roll \"${String(m.roll)}\"`);\n if (m.subset != null && !CANONICAL_SUBSETS.has(String(m.subset))) issues.push(`${type}: unknown subset \"${String(m.subset)}\"`);\n if (m.attack_type != null && !CANONICAL_ATTACK_TYPES.has(String(m.attack_type))) issues.push(`${type}: unknown attack_type \"${String(m.attack_type)}\"`);\n }\n if (node.condition) visitCondition(node.condition);\n // Recurse through the wrapper kinds (conditional/sequence/choice/dice-*).\n for (const key of [\"effect\", \"steps\", \"options\", \"on_success\", \"on_fail\"]) if (node[key]) visit(node[key]);\n };\n visit(effect);\n return { canonical: issues.length === 0, issues };\n}\n\n/**\n * Splice a pre-formed nested effect tree (from the repair pass) onto the original\n * entry. Unlike {@link buildEntry} the LLM owns the whole tree, so we only graft\n * `effect`/`scope`/`behavior` and the citation — never the flat-form assembly.\n * `behavior` is an ability-level field; only set it when the model returned a\n * valid enum value (an invalid one would just fail AJV and lose the whole entry).\n */\nexport function buildRepairedEntry(original: Json, effect: Json, scope: Json, behavior?: string): Json {\n const entry: Json = { ...original, effect, scope, community_notes: \"community-authored from 10e source (provisional 11e); see #21\" };\n if (behavior && BEHAVIOR_VALUES.has(behavior)) entry.behavior = behavior;\n return entry;\n}\n\n// ─── apply gate ──────────────────────────────────────────────────────\n\nexport interface GateOpts { minConfidence: \"high\" | \"medium\"; includeComplex: boolean }\n\n/** Whether a proposal is safe to apply automatically. */\nexport function passesGate(p: Proposal, opts: GateOpts): boolean {\n if (!p.schema_valid || !p.final_faithful) return false;\n if (p.confidence === \"low\") return false;\n if (opts.minConfidence === \"high\" && p.confidence !== \"high\") return false;\n // A repaired proposal IS the full nested tree, so `complex` no longer means\n // \"couldn't express it\" — the AJV + verifier gate already proved it expresses\n // the rule faithfully. It must also clear the canonical-key lint so an invented\n // modifier key can't silently over-apply. The complex-exclusion only applies to\n // flat-form output.\n if (p.repaired) return p.canonical !== false;\n if (p.complex && !opts.includeComplex) return false;\n return true;\n}\n\n// ─── batching helpers ────────────────────────────────────────────────\n\nconst chunk = <T>(arr: T[], n: number): T[][] => {\n const out: T[][] = [];\n for (let i = 0; i < arr.length; i += n) out.push(arr.slice(i, i + n));\n return out;\n};\n\nconst classifyUserPrompt = (items: Json[]): string =>\n `Classify each ability below. Return results[] (one per ability, echo its ability_id):\\n\\n` +\n items.map((it) => `- ability_id: ${it.ability_id}\\n name: ${it.name}\\n rule: ${it.src?.description ?? \"(none)\"}`).join(\"\\n\");\n\nexport const verifyUserPrompt = (entries: { ability_id: string; rule: string; effect: Json; scope: Json }[]): string =>\n `Judge each authored DSL against its rule. Return results[] (one per ability, echo its ability_id):\\n\\n` +\n entries.map((e) => `- ability_id: ${e.ability_id}\\n rule: ${e.rule}\\n authored: ${JSON.stringify({ effect: e.effect, scope: e.scope })}`).join(\"\\n\");\n\nexport const repairUserPrompt = (items: { ability_id: string; rule: string; draft: Json; issue: string }[]): string =>\n `Repair each ability's DSL. Emit the full nested effect tree + scope + behavior that fixes the stated gap. Return results[] (one per ability, echo its ability_id):\\n\\n` +\n items.map((it) =>\n `- ability_id: ${it.ability_id}\\n rule: ${it.rule || \"(none)\"}\\n draft_effect: ${JSON.stringify(it.draft ?? null)}\\n gap_to_fix: ${it.issue || \"(verifier produced no issue — re-author faithfully from the rule)\"}`,\n ).join(\"\\n\\n\");\n\n// ─── propose ─────────────────────────────────────────────────────────\n\ninterface ProposeOpts { batch: number; model: string }\n\nasync function proposeFaction(faction: string, opts: ProposeOpts, validate: (x: unknown) => boolean): Promise<Json> {\n const inputPath = resolve(INPUT_DIR, `${faction}.json`);\n if (!existsSync(inputPath)) return { faction, skipped: \"no author-input\" };\n const input: Json[] = readJSON(inputPath).filter((e: Json) => e.resolved);\n if (input.length === 0) return { faction, skipped: \"no resolved stubs\" };\n\n const original = new Map<string, Json>();\n for (const a of readJSON(resolve(ENRICHMENT_ROOT, faction, \"abilities.json\")) as Json[]) original.set(a.ability_id, a);\n\n const proposals: Proposal[] = [];\n for (const batch of chunk(input, opts.batch)) {\n let forms: Json[];\n try {\n ({ results: forms } = await callClaude(CLASSIFY_SYSTEM, classifyUserPrompt(batch), CLASSIFY_SCHEMA, opts.model));\n } catch (e) {\n // One flaky call shouldn't sink the run — record the batch as errored and move on.\n process.stderr.write(` ${faction}: classify batch failed (${(e as Error).message.slice(0, 80)}) — skipping ${batch.length}\\n`);\n for (const it of batch) proposals.push({ ability_id: it.ability_id, name: it.name, faction, schema_valid: false, final_faithful: false, error: \"classify call failed\" });\n continue;\n }\n const byId = new Map<string, Json>(forms.map((f: Json) => [f.ability_id, f]));\n\n const built: { it: Json; form: Json; entry: Json; schemaValid: boolean }[] = [];\n for (const it of batch) {\n const form = byId.get(it.ability_id);\n const orig = original.get(it.ability_id);\n if (!form || !orig) {\n proposals.push({ ability_id: it.ability_id, name: it.name, faction, schema_valid: false, final_faithful: false, error: !form ? \"no classification\" : \"no original entry\" });\n continue;\n }\n const entry = buildEntry(orig, form);\n built.push({ it, form, entry, schemaValid: validate(entry) });\n }\n\n const toVerify = built.filter((b) => b.schemaValid);\n const verdicts = new Map<string, Json>();\n if (toVerify.length > 0) {\n try {\n const { results } = await callClaude(VERIFY_SYSTEM,\n verifyUserPrompt(toVerify.map((b) => ({ ability_id: b.it.ability_id, rule: b.it.src?.description ?? \"\", effect: b.entry.effect, scope: b.entry.scope }))),\n VERIFY_SCHEMA, opts.model);\n for (const v of results) verdicts.set(v.ability_id, v);\n } catch (e) {\n // Verify failure → leave verdicts null (proposal kept, just not auto-gateable).\n process.stderr.write(` ${faction}: verify batch failed (${(e as Error).message.slice(0, 80)})\\n`);\n }\n }\n\n for (const b of built) {\n const verdict = verdicts.get(b.it.ability_id) ?? null;\n proposals.push({\n ability_id: b.it.ability_id, name: b.it.name, faction,\n effect_type: b.form.effect_type, complex: b.form.complex, confidence: b.form.confidence,\n schema_valid: b.schemaValid, proposed_effect: b.entry.effect, proposed_scope: b.entry.scope,\n verdict, final_faithful: !!verdict?.faithful && b.schemaValid,\n });\n }\n process.stderr.write(` ${faction}: ${proposals.length}/${input.length}\\n`);\n }\n\n mkdirSync(OUT_DIR, { recursive: true });\n writeJSON(resolve(OUT_DIR, `${faction}.json`), proposals);\n return {\n faction, total: proposals.length,\n schema_valid: proposals.filter((p) => p.schema_valid).length,\n faithful: proposals.filter((p) => p.final_faithful).length,\n gateable: proposals.filter((p) => passesGate(p, { minConfidence: \"medium\", includeComplex: false })).length,\n };\n}\n\n// ─── repair (full-tree pass over the residue) ────────────────────────\n\ninterface RepairOpts { batch: number; model: string; types?: Set<string> }\n\n/**\n * Re-author the complex residue in proposed/<faction>.json as full nested DSL.\n * Reuses the propose pipeline shape — classify(→repair)/assemble/AJV/verify —\n * but the model emits the whole effect tree and we seed it with the existing\n * draft + the verifier's gap. Updates the proposals in place (matched by\n * ability_id), tagging each `repaired:true`; the already-gateable and the errored\n * entries are left untouched.\n */\nasync function repairFaction(faction: string, opts: RepairOpts, validate: (x: unknown) => boolean): Promise<Json> {\n const proposalsPath = resolve(OUT_DIR, `${faction}.json`);\n if (!existsSync(proposalsPath)) return { faction, skipped: \"no proposals — run propose first\" };\n const proposals: Proposal[] = readJSON(proposalsPath);\n const gate = { minConfidence: \"medium\" as const, includeComplex: false };\n\n // Residue = not already auto-appliable, not a hard error. Phase A narrows to\n // the cruncher-relevant leaf types via --types.\n const targets = proposals\n .map((p, idx) => ({ p, idx }))\n .filter(({ p }) => !passesGate(p, gate) && !p.error)\n .filter(({ p }) => !opts.types || (p.effect_type != null && opts.types.has(p.effect_type)));\n if (targets.length === 0) return { faction, skipped: \"no matching residue\" };\n\n // Source rules (the gap the draft must close) + originals (metadata + AJV).\n const inputPath = resolve(INPUT_DIR, `${faction}.json`);\n const srcById = new Map<string, string>();\n if (existsSync(inputPath)) for (const e of readJSON(inputPath) as Json[]) if (e.src?.description) srcById.set(e.ability_id, e.src.description);\n const original = new Map<string, Json>();\n for (const a of readJSON(resolve(ENRICHMENT_ROOT, faction, \"abilities.json\")) as Json[]) original.set(a.ability_id, a);\n\n let done = 0;\n for (const batch of chunk(targets, opts.batch)) {\n let results: Json[];\n try {\n ({ results } = await callClaude(REPAIR_SYSTEM,\n repairUserPrompt(batch.map(({ p }) => ({ ability_id: p.ability_id, rule: srcById.get(p.ability_id) ?? \"\", draft: p.proposed_effect, issue: p.verdict?.issue ?? \"\" }))),\n REPAIR_SCHEMA, opts.model));\n } catch (e) {\n process.stderr.write(` ${faction}: repair batch failed (${(e as Error).message.slice(0, 80)}) — skipping ${batch.length}\\n`);\n continue;\n }\n const byId = new Map<string, Json>(results.map((r: Json) => [r.ability_id, r]));\n\n const built: { idx: number; p: Proposal; r: Json; entry: Json; schemaValid: boolean; canonical: boolean }[] = [];\n for (const { p, idx } of batch) {\n const r = byId.get(p.ability_id);\n const orig = original.get(p.ability_id);\n if (!r || !orig) continue; // model dropped it / live entry gone — leave the proposal as-is\n const entry = buildRepairedEntry(orig, r.effect, r.scope, r.behavior);\n built.push({ idx, p, r, entry, schemaValid: validate(entry), canonical: lintCanonical(r.effect).canonical });\n }\n\n // Verify only what can still pass the gate — a non-canonical entry can't, so\n // don't spend a verify call on it.\n const toVerify = built.filter((b) => b.schemaValid && b.canonical);\n const verdicts = new Map<string, Json>();\n if (toVerify.length > 0) {\n try {\n const { results: vs } = await callClaude(VERIFY_SYSTEM,\n verifyUserPrompt(toVerify.map((b) => ({ ability_id: b.p.ability_id, rule: srcById.get(b.p.ability_id) ?? \"\", effect: b.entry.effect, scope: b.entry.scope }))),\n VERIFY_SCHEMA, opts.model);\n for (const v of vs) verdicts.set(v.ability_id, v);\n } catch (e) {\n process.stderr.write(` ${faction}: repair-verify batch failed (${(e as Error).message.slice(0, 80)})\\n`);\n }\n }\n\n for (const b of built) {\n const verdict = verdicts.get(b.p.ability_id) ?? null;\n const behavior = b.r.behavior && BEHAVIOR_VALUES.has(b.r.behavior) ? b.r.behavior : undefined;\n proposals[b.idx] = {\n ...b.p,\n confidence: b.r.confidence ?? b.p.confidence,\n schema_valid: b.schemaValid,\n canonical: b.canonical,\n proposed_effect: b.entry.effect,\n proposed_scope: b.entry.scope,\n proposed_behavior: behavior,\n verdict,\n final_faithful: !!verdict?.faithful && b.schemaValid && b.canonical,\n repaired: true,\n unencodable: !!b.r.unencodable,\n };\n }\n done += batch.length;\n process.stderr.write(` ${faction}: repaired ${done}/${targets.length}\\n`);\n }\n\n writeJSON(proposalsPath, proposals);\n const repaired = proposals.filter((p) => p.repaired);\n return {\n faction, attempted: targets.length,\n now_faithful: repaired.filter((p) => p.final_faithful).length,\n non_canonical: repaired.filter((p) => p.canonical === false).length,\n unencodable: repaired.filter((p) => p.unencodable).length,\n gateable: proposals.filter((p) => passesGate(p, gate)).length,\n };\n}\n\n// ─── apply ───────────────────────────────────────────────────────────\n\ninterface ApplyOpts extends GateOpts { dryRun: boolean }\n\n/** Splice gated proposals into the live abilities.json — only over surviving stubs. */\nfunction applyFaction(faction: string, opts: ApplyOpts): Json {\n const proposalsPath = resolve(OUT_DIR, `${faction}.json`);\n if (!existsSync(proposalsPath)) return { faction, skipped: \"no proposals — run propose first\" };\n const proposals: Proposal[] = readJSON(proposalsPath);\n const abilitiesPath = resolve(ENRICHMENT_ROOT, faction, \"abilities.json\");\n if (!existsSync(abilitiesPath)) return { faction, skipped: \"no live abilities.json\" };\n const abilities: Json[] = readJSON(abilitiesPath);\n const byId = new Map<string, Json>(abilities.map((a) => [a.ability_id, a]));\n\n let applied = 0;\n const skipped: { id: string; why: string }[] = [];\n for (const p of proposals) {\n if (!passesGate(p, opts)) { skipped.push({ id: p.ability_id, why: \"gate\" }); continue; }\n const entry = byId.get(p.ability_id);\n if (!entry) { skipped.push({ id: p.ability_id, why: \"gone\" }); continue; }\n // Never clobber work that's no longer a stub (idempotent + safe to re-run).\n if (!hasEmptyModifier(entry.effect)) { skipped.push({ id: p.ability_id, why: \"not-a-stub\" }); continue; }\n entry.effect = p.proposed_effect;\n entry.scope = p.proposed_scope;\n if (p.proposed_behavior && BEHAVIOR_VALUES.has(p.proposed_behavior)) entry.behavior = p.proposed_behavior;\n entry.community_notes = \"community-authored from 10e source (provisional 11e); see #21\";\n applied++;\n }\n if (!opts.dryRun && applied > 0) writeJSON(abilitiesPath, abilities);\n return { faction, applied, skipped_gate: skipped.filter((s) => s.why === \"gate\").length, skipped_other: skipped.filter((s) => s.why !== \"gate\").length, dry_run: opts.dryRun };\n}\n\n// ─── review (cluster proposals into shape-families) ──────────────────\n\n/** Load every faction's proposals (skips the ad-hoc damage-batch scratch file). */\nfunction loadAllProposals(): Proposal[] {\n if (!existsSync(OUT_DIR)) return [];\n return readdirSync(OUT_DIR)\n .filter((f) => f.endsWith(\".json\") && f !== \"damage-batch.json\")\n .flatMap((f) => readJSON(resolve(OUT_DIR, f)) as Proposal[]);\n}\n\n/** Write a shape-family clustered REVIEW.md — gateable vs the complex residue, grouped for templating. */\nfunction review(): Json {\n const all = loadAllProposals();\n const gate = { minConfidence: \"medium\" as const, includeComplex: false };\n const gateable = all.filter((p) => passesGate(p, gate));\n const residue = all.filter((p) => !passesGate(p, gate) && !p.error);\n\n const byType = (ps: Proposal[]): [string, number][] =>\n Object.entries(ps.reduce<Record<string, number>>((m, p) => ((m[p.effect_type ?? \"?\"] = (m[p.effect_type ?? \"?\"] ?? 0) + 1), m), {})).sort((a, b) => b[1] - a[1]);\n\n // Cross-faction name dupes among the residue — author once, fan to all members.\n const byName = new Map<string, Proposal[]>();\n for (const p of residue) (byName.get(p.name) ?? byName.set(p.name, []).get(p.name)!).push(p);\n const shared = [...byName.entries()].filter(([, ps]) => new Set(ps.map((p) => p.faction)).size > 1)\n .map(([name, ps]) => ({ name, type: ps[0].effect_type, factions: [...new Set(ps.map((p) => p.faction))] }))\n .sort((a, b) => b.factions.length - a.factions.length);\n\n const L: string[] = [\n \"# DSL stub authoring — review\",\n \"\",\n `Generated by \\`author-batch review\\`. ${all.length} proposals across ${new Set(all.map((p) => p.faction)).size} factions.`,\n \"\",\n `- **schema-valid:** ${all.filter((p) => p.schema_valid).length}`,\n `- **verifier-faithful:** ${all.filter((p) => p.final_faithful).length}`,\n `- **complex-flagged:** ${all.filter((p) => p.complex).length}`,\n `- **auto-appliable (gate: valid+faithful+conf≠low+not-complex):** ${gateable.length}`,\n \"\",\n \"## Auto-appliable now — by faction\",\n \"\",\n ...Object.entries(gateable.reduce<Record<string, number>>((m, p) => ((m[p.faction] = (m[p.faction] ?? 0) + 1), m), {})).sort().map(([f, n]) => `- \\`${f}\\`: ${n}`),\n \"\",\n \"Apply with: `npm run author:apply -- <faction|--all> --dry-run` then drop `--dry-run`.\",\n \"\",\n \"## Complex residue — by shape family (author a template per family)\",\n \"\",\n ...byType(residue).map(([t, n]) => `- **${t}** — ${n}`),\n \"\",\n \"## Cross-faction shared shapes (author once, fan to all members)\",\n \"\",\n ...(shared.length ? shared.map((s) => `- **${s.name}** (\\`${s.type}\\`) → ${s.factions.join(\", \")}`) : [\"_(none found)_\"]),\n \"\",\n ];\n writeFileSync(resolve(OUT_DIR, \"REVIEW.md\"), L.join(\"\\n\") + \"\\n\");\n return { total: all.length, gateable: gateable.length, residue: residue.length, shared_shapes: shared.length };\n}\n\n// ─── main ────────────────────────────────────────────────────────────\n\nfunction factionList(arg: string, dir: string): string[] {\n return arg === \"--all\"\n ? readdirSync(dir).filter((f) => f.endsWith(\".json\") && f !== \"damage-batch.json\").map((f) => f.replace(/\\.json$/, \"\")).sort()\n : [arg];\n}\nconst flag = (argv: string[], name: string): string | undefined => (argv.includes(name) ? argv[argv.indexOf(name) + 1] : undefined);\n\nasync function main(): Promise<void> {\n const argv = process.argv.slice(2);\n const mode = argv[0];\n const target = argv[1];\n if (mode === \"review\") {\n console.log(JSON.stringify(review(), null, 2));\n console.error(`\\nWrote ${resolve(OUT_DIR, \"REVIEW.md\")}`);\n return;\n }\n if (![\"propose\", \"repair\", \"apply\"].includes(mode) || !target) {\n console.error(\"Usage:\\n author-batch propose <faction|--all> [--batch N] [--model M]\\n author-batch repair <faction|--all> [--types t1,t2] [--batch N] [--model M]\\n author-batch apply <faction|--all> [--min-confidence high|medium] [--include-complex] [--dry-run]\\n author-batch review\");\n process.exit(1);\n }\n\n if (mode === \"propose\") {\n const ajv = createValidator();\n const validateFn = ajv.getSchema(ABILITY_SCHEMA_ID);\n if (!validateFn) throw new Error(`ability schema not loaded: ${ABILITY_SCHEMA_ID}`);\n const validate = (x: unknown): boolean => !!validateFn(x);\n const opts: ProposeOpts = { batch: Number(flag(argv, \"--batch\")) || 15, model: flag(argv, \"--model\") ?? \"claude-haiku-4-5\" };\n const summary: Json[] = [];\n for (const f of factionList(target, INPUT_DIR)) {\n try {\n summary.push(await proposeFaction(f, opts, validate));\n } catch (e) {\n process.stderr.write(` ${f}: FAILED (${(e as Error).message.slice(0, 100)})\\n`);\n summary.push({ faction: f, error: (e as Error).message });\n }\n }\n console.log(JSON.stringify(summary, null, 2));\n return;\n }\n\n if (mode === \"repair\") {\n const ajv = createValidator();\n const validateFn = ajv.getSchema(ABILITY_SCHEMA_ID);\n if (!validateFn) throw new Error(`ability schema not loaded: ${ABILITY_SCHEMA_ID}`);\n const validate = (x: unknown): boolean => !!validateFn(x);\n const typesArg = flag(argv, \"--types\");\n const opts: RepairOpts = {\n batch: Number(flag(argv, \"--batch\")) || 8,\n model: flag(argv, \"--model\") ?? \"claude-sonnet-4-6\",\n types: typesArg ? new Set(typesArg.split(\",\").map((t) => t.trim()).filter(Boolean)) : undefined,\n };\n const summary: Json[] = [];\n for (const f of factionList(target, OUT_DIR)) {\n try {\n summary.push(await repairFaction(f, opts, validate));\n } catch (e) {\n process.stderr.write(` ${f}: FAILED (${(e as Error).message.slice(0, 100)})\\n`);\n summary.push({ faction: f, error: (e as Error).message });\n }\n }\n console.log(JSON.stringify(summary, null, 2));\n const unenc = summary.reduce((n, s) => n + (s.unencodable ?? 0), 0);\n const faithful = summary.reduce((n, s) => n + (s.now_faithful ?? 0), 0);\n const noncanon = summary.reduce((n, s) => n + (s.non_canonical ?? 0), 0);\n console.error(`\\nrepair: ${faithful} now faithful, ${noncanon} non-canonical (gate-blocked), ${unenc} flagged unencodable (need hand-authoring).`);\n return;\n }\n\n // apply\n const opts: ApplyOpts = {\n minConfidence: flag(argv, \"--min-confidence\") === \"high\" ? \"high\" : \"medium\",\n includeComplex: argv.includes(\"--include-complex\"),\n dryRun: argv.includes(\"--dry-run\"),\n };\n const summary = factionList(target, OUT_DIR).map((f) => applyFaction(f, opts));\n console.log(JSON.stringify(summary, null, 2));\n const total = summary.reduce((n, s) => n + (s.applied ?? 0), 0);\n console.error(`\\n${opts.dryRun ? \"[dry-run] would apply\" : \"applied\"} ${total} entr${total === 1 ? \"y\" : \"ies\"}.`);\n}\n\nconst isMain =\n process.argv[1] &&\n resolve(process.argv[1]).replace(/\\.\\w+$/, \"\") === fileURLToPath(import.meta.url).replace(/\\.\\w+$/, \"\");\nif (isMain) main().catch((e) => { console.error(e); process.exit(1); });\n"]}
|
|
@@ -1,8 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Translates ability DSL entries into plain English descriptions.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
4
|
+
* Thin CLI shell over the shared `translate/effect.ts` describer (the
|
|
5
|
+
* conformance-pinned `ability.print()`); this file only handles file loading
|
|
6
|
+
* and per-ability presentation.
|
|
6
7
|
*/
|
|
7
8
|
export declare function translateCommand(path?: string): Promise<void>;
|
|
8
9
|
//# sourceMappingURL=translate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/commands/translate.ts"],"names":[],"mappings":"AAAA
|
|
1
|
+
{"version":3,"file":"translate.d.ts","sourceRoot":"","sources":["../../src/commands/translate.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAmBH,wBAAsB,gBAAgB,CACpC,IAAI,CAAC,EAAE,MAAM,GACZ,OAAO,CAAC,IAAI,CAAC,CAsBf"}
|