### Install 40kdc-data package Source: https://github.com/wn-mitch/40kdc-data/blob/main/README.md Install the dataset package via npm. ```bash npm install @alpaca-software/40kdc-data ``` -------------------------------- ### Install Python Package Source: https://github.com/wn-mitch/40kdc-data/blob/main/README.md Install the wh40kdc package via pip. ```bash pip install wh40kdc ``` -------------------------------- ### Setup Go development environment Source: https://github.com/wn-mitch/40kdc-data/blob/main/CONTRIBUTING.md Commands to run tests, linting, and build the Go runner. ```bash cd go go test ./... # unit + Go-native conformance tests (reads ../conformance) go vet ./... gofmt -l . # must print nothing go build -o wh40kdc-runner ./cmd/wh40kdc-runner ``` -------------------------------- ### Development Environment Setup Source: https://github.com/wn-mitch/40kdc-data/blob/main/python/README.md Commands to set up the development environment and run tests or linters. ```bash cd python uv venv && uv pip install -e ".[dev]" pytest # includes the conformance suite when run inside the repo ruff check . mypy src ``` -------------------------------- ### Install Go Module Source: https://github.com/wn-mitch/40kdc-data/blob/main/README.md Retrieve the latest version of the wh40kdc Go module. ```bash go get github.com/wn-mitch/40kdc-data/go@latest ``` -------------------------------- ### Setup Python development environment Source: https://github.com/wn-mitch/40kdc-data/blob/main/CONTRIBUTING.md Commands to initialize the Python virtual environment and run quality assurance tools. ```bash cd python uv venv && uv pip install -e ".[dev]" pytest # unit tests + the full conformance suite (reads ../conformance/) ruff check . mypy src ``` -------------------------------- ### Repository Structure Overview Source: https://github.com/wn-mitch/40kdc-data/blob/main/AGENTS.md Visual representation of the project directory layout, including schemas, data, tools, and example applications. ```text schemas/ $defs/ Shared definitions (entity-id, keyword, stat-value, phase, etc.) core/ Structural entity schemas: faction, unit, weapon, game-version, detachment, enhancement, stratagem, wargear-option, leader-attachment, unit-composition enrichment/ Community-authored intelligence: ability-dsl/ Ability DSL (ability, trigger, condition, effect, scope) *.schema.json Phase-mapping, interaction-flag data/ core/_example/ Fabricated example data (not real GW data) enrichment/ Community enrichment data by edition/dataslate tools/ TypeScript package @alpaca-software/40kdc-data: src/data/ Linked typed API (Dataset, collections, views) src/codegen-data.ts Bundles data/ into the embedded module src/generated.ts Entity types (codegen'd from schemas) schema-loader/cli AJV validator + 40kdc-validate CLI docs/api/ Auto-generated API reference (TypeDoc) src/mfm/ MFM contract and ingestion: dump-catalog.schema.json validation schema for dump.catalog.json mfm-source-map.schema.json validation schema for mappings/*.mapping.json dump.catalog.json hand-reviewed table/field/relation semantics dump.schema.json generated, committed public source-shape schema dump.generated.ts generated typed table/relation contract mappings/ one provenance map per schemas/core schema gen-dump-schema.ts contract generator/checker/report command loader.ts shared runtime table/relation access examples/ Demo web apps consuming the package (Svelte 5 + Vite + Cloudflare). See examples/AGENTS.md for their shared conventions before working in any of them. ``` -------------------------------- ### View Repository Structure Source: https://github.com/wn-mitch/40kdc-data/blob/main/CLAUDE.md Displays the directory layout of the 40kdc-data repository, including schemas, data, tools, and examples. ```text schemas/ $defs/ Shared definitions (entity-id, keyword, stat-value, phase, etc.) core/ Structural entity schemas: faction, unit, weapon, game-version, detachment, enhancement, stratagem, wargear-option, leader-attachment, unit-composition enrichment/ Community-authored intelligence: ability-dsl/ Ability DSL (ability, trigger, condition, effect, scope) *.schema.json Phase-mapping, interaction-flag data/ core/_example/ Fabricated example data (not real GW data) enrichment/ Community enrichment data by edition/dataslate tools/ TypeScript package @alpaca-software/40kdc-data: src/data/ Linked typed API (Dataset, collections, views) src/codegen-data.ts Bundles data/ into the embedded module src/generated.ts Entity types (codegen'd from schemas) schema-loader/cli AJV validator + 40kdc-validate CLI docs/api/ Auto-generated API reference (TypeDoc) examples/ Demo web apps consuming the package (Svelte 5 + Vite + Cloudflare). See examples/CLAUDE.md for their shared conventions before working in any of them. ``` -------------------------------- ### GET /health Source: https://github.com/wn-mitch/40kdc-data/blob/main/workers/sync/README.md Checks the liveness of the service. ```APIDOC ## GET /health ### Description Returns the liveness status of the service. ### Method GET ### Endpoint /health ``` -------------------------------- ### GET /docs Source: https://github.com/wn-mitch/40kdc-data/blob/main/workers/sync/README.md Retrieves metadata for the owner's documents. ```APIDOC ## GET /docs ### Description Retrieves metadata for the owner's documents, including a shared flag. ### Method GET ### Endpoint /docs ### Parameters #### Query Parameters - **kind** (string) - Optional - Filter by document kind. ``` -------------------------------- ### GET /links/:code Source: https://github.com/wn-mitch/40kdc-data/blob/main/workers/sync/README.md Resolves a shortlink to its associated kind and payload. ```APIDOC ## GET /links/:code ### Description Resolves a shortlink code to retrieve the associated document kind and payload. ### Method GET ### Endpoint /links/:code ### Parameters #### Path Parameters - **code** (string) - Required - The shortlink code. ``` -------------------------------- ### Development Commands Source: https://github.com/wn-mitch/40kdc-data/blob/main/workers/sync/README.md Commands for setting up the development environment and running tests for the sync worker. ```bash cd workers/sync npm install # own lockfile — NOT an npm workspace (the monorepo pins # vitest 2.x; the workers pool needs vitest 3 + current workerd) npm test npm run typecheck ``` -------------------------------- ### POST /session Source: https://github.com/wn-mitch/40kdc-data/blob/main/workers/sync/README.md Creates a live room seeded with a specific kind and payload. ```APIDOC ## POST /session ### Description Creates a live room seeded with the provided kind and payload. ### Method POST ### Endpoint /session ``` -------------------------------- ### Run Go cross-implementation parity tests Source: https://github.com/wn-mitch/40kdc-data/blob/main/CONTRIBUTING.md Commands to build the Go runner and verify parity against other implementations. ```bash ( cd go && go build -o wh40kdc-runner ./cmd/wh40kdc-runner ) python3 tooling/parity/differ.py --pair ts,go python3 tooling/parity/differ.py --pair rust,go python3 tooling/parity/differ.py --pair py,go ``` -------------------------------- ### Run Ability DSL Authoring Pipeline Source: https://github.com/wn-mitch/40kdc-data/blob/main/CONTRIBUTING.md Commands to execute the automated pipeline for classifying, proposing, and applying ability DSL changes. ```bash cd tools # 1. Join each empty-modifier stub to its correct source rule (disambiguated by # unit → faction, since ability names collide). → data/_audit/author-input/ ARMY_ASSIST_JSON=/path/to/your/json npm run author:input -- # 2. Batched `claude -p --json-schema`: classify → assemble → AJV-validate → # verify. Writes proposals only; live data is untouched. → data/_audit/proposed/ npm run author:propose -- [--model ] [--batch N] npm run author:review # 3. inspect proposals npm run author:repair -- # 3b. (optional) re-run failures # 4. Splice GATED proposals (schema-valid + verifier-faithful + confidence≠low + # not complex-flagged) into live abilities.json. Only rewrites entries that # are STILL empty stubs, so re-running never clobbers authored work. npm run author:apply -- [--min-confidence high|medium] [--dry-run] npm run validate # 5. schema-check npm run audit:coverage # 6. re-measure coverage ``` -------------------------------- ### recommendedTerrainLayouts() Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/classes/Dataset.md Retrieves recommended terrain layouts for a deployment pattern. ```APIDOC ## recommendedTerrainLayouts(pattern) ### Description The terrain layouts a deployment pattern recommends, in declared order, skipping any ids absent from the dataset. ### Parameters - **pattern** (DeploymentPattern) - Required ### Returns - **TerrainLayout[]** - Array of recommended terrain layouts. ``` -------------------------------- ### Handshake Source: https://github.com/wn-mitch/40kdc-data/blob/main/conformance/RUNNER_PROTOCOL.md Initializes the runner session and negotiates configuration settings. ```APIDOC ## Handshake ### Description The first request after launch to initialize the runner with specific locale, timezone, and seed settings. ### Request {"op":"init","spec_version":1,"locale":"C","tz":"UTC","seed":0} ### Response {"ok":true,"value":{"impl":"ts","spec_version":1,"impl_version":"0.4.2"}} ``` -------------------------------- ### Configure Rust Dependency Source: https://github.com/wn-mitch/40kdc-data/blob/main/README.md Add the wh40kdc crate to your Cargo.toml file using a git source. ```toml [dependencies] wh40kdc = { git = "https://github.com/wn-mitch/40kdc-data" } ``` -------------------------------- ### Accessing the Embedded Dataset Source: https://github.com/wn-mitch/40kdc-data/blob/main/crates/wh40kdc/README.md Demonstrates how to initialize the embedded dataset and perform entity lookups, including filtering abilities by phase. ```rust use wh40kdc::{Dataset, Phase}; let ds = Dataset::embedded(); let kharn = ds.find_unit("Kharn").unwrap(); let shooting: Vec<&str> = ds .abilities_of(kharn) .into_iter() .filter(|a| ds.phases_of(a).contains(&Phase::Shooting)) .map(|a| a.ability_id.as_str()) .collect(); assert_eq!(shooting, ["berzerker-frenzy"]); assert_eq!(ds.faction_of(kharn).unwrap().id.as_str(), "world-eaters"); ``` -------------------------------- ### Initialization Handshake Source: https://github.com/wn-mitch/40kdc-data/blob/main/conformance/RUNNER_PROTOCOL.md The initial request and response exchange to establish the runner's implementation details and environment constraints. ```json {"op":"init","spec_version":1,"locale":"C","tz":"UTC","seed":0} ``` ```json {"ok":true,"value":{"impl":"ts","spec_version":1,"impl_version":"0.4.2"}} ``` -------------------------------- ### POST /docs Source: https://github.com/wn-mitch/40kdc-data/blob/main/workers/sync/README.md Creates a new document. ```APIDOC ## POST /docs ### Description Creates a new document with the specified kind, name, and payload. ### Method POST ### Endpoint /docs ``` -------------------------------- ### Run Python cross-implementation parity tests Source: https://github.com/wn-mitch/40kdc-data/blob/main/CONTRIBUTING.md Commands to verify parity between Python and other language implementations. ```bash python3 tooling/parity/differ.py --pair ts,py python3 tooling/parity/differ.py --pair rust,py ``` -------------------------------- ### Run parity differ commands Source: https://github.com/wn-mitch/40kdc-data/blob/main/tooling/parity/README.md Commands to build the runners, execute corpus parity tests, and run property-style fuzzing. ```bash # 1. Build the runners (skipped automatically if pre-built artifacts exist). cd tools && npm ci && npm run build && cd .. cargo build --release --bin wh40kdc-runner # 2. Corpus parity — runs every case across normalize / roster / cruncher / # linked-api / attribution. Exits 0 iff every case agrees. python3 tooling/parity/differ.py # 3. Property-style fuzzing — deterministic random inputs both impls have to # agree on. Mismatches dump full reproducers into regressions/. python3 tooling/parity/differ.py --mode fuzz --fuzz-target normalize --fuzz-seed 42 python3 tooling/parity/differ.py --mode fuzz --fuzz-target crunch --fuzz-seed 42 ``` -------------------------------- ### POST /links Source: https://github.com/wn-mitch/40kdc-data/blob/main/workers/sync/README.md Mints a new 8-character shortlink. ```APIDOC ## POST /links ### Description Mints a new 8-character shortlink. ### Method POST ### Endpoint /links ``` -------------------------------- ### Bulk Port All Factions Source: https://github.com/wn-mitch/40kdc-data/blob/main/11e-migration.md Runs the migration script across all factions to perform a bulk sweep of the remaining data. ```bash npx tsx tools/src/port-10e-faction.ts --all ``` -------------------------------- ### Querying Unit Abilities with TypeScript Source: https://github.com/wn-mitch/40kdc-data/blob/main/README.md Demonstrates accessing unit data and filtering abilities by phase using the @alpaca-software/40kdc-data package. ```ts import { units } from "@alpaca-software/40kdc-data"; units.find("Kharn")!.abilities .filter(a => a.phases.includes("fight")) .map(a => a.id); // ["legendary-killer", "berzerker-frenzy"] ``` -------------------------------- ### Political Overwatch DSL Proposal Source: https://github.com/wn-mitch/40kdc-data/blob/main/data/_audit/proposed/REVIEW-DETAIL.md Proposed DSL for the Political Overwatch ability. ```json {type:leadership-modifier,target:unit,modifier:{test:battle-shock,operation:re-roll}} ``` -------------------------------- ### stackableBuffsFor(input, context) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/classes/Dataset.md Enumerate every attacker-side buff a unit could stack in a given context, including toggleable levers and activation groups. ```APIDOC ## stackableBuffsFor(input, context) ### Description Enumerate every attacker-side buff a unit could stack in `context` as a list of toggleable levers, plus the activation groups that limit them. This method surfaces player decisions like stratagems and activatable gates. ### Parameters - **input** (EligibilityInput & object) - Required - The input data for eligibility. - **context** (EngineContext) - Required - The engine context for the calculation. ### Returns - **buffs** (StackableBuff[]) - A list of stackable buffs. - **groups** (StackableBuffGroup[]) - A list of activation groups that limit the buffs. ### Usage Example ```ts const { buffs } = ds.stackableBuffsFor(input, ctx); const chosen = buffs.filter(b => b.enabled).flatMap(b => b.buffs); crunch({ ...profiles, buffs: chosen, context: ctx }, ds); ``` ``` -------------------------------- ### effectToBuffs(effect, source, context, perspective?) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/functions/effectToBuffs.md Walks an ability DSL effect tree and produces the buff stack it contributes against a context from a given perspective. ```APIDOC ## effectToBuffs(effect, source, context, perspective?) ### Description Walks an ability DSL `effect` tree and produces the buff stack it contributes against `context` from the given `perspective`, plus an `unsupported` list naming any branches the buff layer can't express today. ### Parameters - **effect** (unknown) - The ability DSL effect tree to process. - **source** (BuffSource) - The source of the buff. - **context** (EngineContext) - The engine context to evaluate against. - **perspective** (TranslationPerspective) - Optional. The perspective for the translation, defaults to "attacker". ### Returns - **EffectTranslation** - The resulting buff stack and list of unsupported branches. ``` -------------------------------- ### Run Validation Suite Source: https://github.com/wn-mitch/40kdc-data/blob/main/11e-migration.md Executes the test suite and validation scripts to ensure data integrity after migration. ```bash cd tools && npm test && npm run validate ``` -------------------------------- ### Run local validation and tests Source: https://github.com/wn-mitch/40kdc-data/blob/main/CLAUDE.md Execute unit tests and schema validation for data files within the tools directory. ```bash cd tools npm install npm test # unit tests (vitest) npm run validate # validate all data files against schemas ``` -------------------------------- ### Fight First DSL Proposal Source: https://github.com/wn-mitch/40kdc-data/blob/main/data/_audit/proposed/REVIEW-DETAIL.md Proposed JSON structure for fight-first unit abilities. ```json {type:fight-first,target:unit,modifier:{}} ``` -------------------------------- ### Regenerate project artifacts Source: https://github.com/wn-mitch/40kdc-data/blob/main/CLAUDE.md Manual commands to regenerate bundles and sync generated code across supported languages after modifying data or schemas. ```bash cd tools && npm run bundle:schemas cargo run -p xtask -- codegen # crates/.../generated.rs (only drifts if schemas/ changed) cargo run -p xtask -- bundle-data # crates/.../data/bundle.generated.json python3 python/codegen/sync_bundle.py # python/.../_bundle.json bash go/codegen/sync.sh # go/{bundle.json,share_registry.json,schemas/,spec.go} ``` -------------------------------- ### Find draft base size entries Source: https://github.com/wn-mitch/40kdc-data/blob/main/CONTRIBUTING.md Uses jq to identify units that currently have draft base size dimensions. ```bash jq -r '.[] | select(.base_size_mm.draft) | .id' data/core/*/units.json ``` -------------------------------- ### Re-derive and verify data Source: https://github.com/wn-mitch/40kdc-data/blob/main/WARGEAR_ORPHAN_FIXES.md Commands to update derived data, validate the build, and synchronize bundles across different language implementations. ```bash cd tools && npx tsx src/ingest-mfm.ts wargear --write # if the fix is dump-derivable npm run build && npm run validate # gate must stay green # then regen the other bundles IN ORDER (python copies the rust bundle!): cargo run -p xtask -- bundle-data && python3 ../python/codegen/sync_bundle.py && bash ../go/codegen/sync.sh ``` -------------------------------- ### Normalize display names to lookup keys Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/functions/normalizeName.md Demonstrates the transformation of various input strings into their canonical, lowercase, and stripped lookup key formats. ```ts normalizeName("Khârn the Betrayer"); // "kharn the betrayer" normalizeName("T'au"); // "tau" ``` -------------------------------- ### maximalLoadout(unit, modelCount, options) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/functions/maximalLoadout.md Calculates the maximal loadout by applying every base weapon on every model and maximizing each wargear option based on its cap. ```APIDOC ## maximalLoadout(unit, modelCount, options) ### Description Calculates the maximal loadout for a unit. This includes every base weapon on every model, with each option applied at its full `optionCap` (choices take their first branch). Swaps move count from the replaced ID to the added ID, while add-ons only add. ### Parameters - **unit** (Unit) - Required - The unit configuration object. - **modelCount** (number) - Required - The number of models in the unit. - **options** (WargearOption[]) - Required - A read-only array of wargear options to apply. ### Returns - **Loadout** - The calculated maximal loadout object. ``` -------------------------------- ### import Source: https://github.com/wn-mitch/40kdc-data/blob/main/conformance/RUNNER_PROTOCOL.md Imports roster data from a specified format. ```APIDOC ## import ### Description Imports roster data from a raw string or JSON-encoded string based on the provided format. ### Request {"op":"import","args":{"format":"newrecruit-wtc-compact","input":"..."}} ### Response {"ok":true,"value":{...Roster...}} ``` -------------------------------- ### Git Tag Format Source: https://github.com/wn-mitch/40kdc-data/blob/main/VERSIONING.md The naming convention used for repository releases. ```text 10th/2025-q3 11th/2025-q4 ``` -------------------------------- ### defensiveBuffsFor(input, context) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/classes/Dataset.md Calculates the defender-perspective buff stack for a unit. ```APIDOC ## defensiveBuffsFor(input, context) ### Description Calculates the defender-perspective buff stack for the chosen unit, translating DSL effects into defensive modifiers like FNP, save mods, and toughness mods. ### Parameters - **input** (EligibilityInput & object) - Required - The input context. - **context** (EngineContext) - Required - The engine context. ### Returns - **Buff[]** - A list of applicable defensive buffs. ``` -------------------------------- ### Check Candidate Affordability Source: https://github.com/wn-mitch/40kdc-data/blob/main/conformance/RUNNER_PROTOCOL.md Calculates the cost of adding specific units to an existing roster and determines if they are affordable within the remaining points limit. ```json {"op":"candidate_affordability","args":{"factionId":"world-eaters","battleSize":"strike-force","pointsLimitOverride":null,"units":[{"unitId":"chaos-terminators","modelCount":5}],"candidateUnitIds":["jakhals","chaos-terminators"]}} ``` -------------------------------- ### keywordsAt(i?) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/classes/WeaponView.md Retrieves the catalog views for keywords referenced by a specific profile. ```APIDOC ## keywordsAt(i?) ### Description Returns catalog views for each keyword referenced by profile `i`, paired with the reference-site parameters. Unresolved keyword IDs are skipped. ### Parameters - **i** (number) - Optional - The index of the profile. Defaults to 0. ### Returns - **keywords** (object[]) - A list of keyword objects. ``` -------------------------------- ### Refresh base size data from PDF Source: https://github.com/wn-mitch/40kdc-data/blob/main/CONTRIBUTING.md Extracts base size information from a tournament companion PDF and updates the project's base size data files. ```bash pdftotext -layout tournament-companion.pdf tc.txt cd tools tsx src/converters/base-size-guide-extract.ts tc.txt > src/converters/data/base-size-guide.json tsx src/cli.ts populate-base-sizes # patches data/core/*/{units,unit-compositions}.json ``` -------------------------------- ### buffsFor(input, context) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/classes/Dataset.md Calculates the attacker-perspective buff stack for a unit and phase combination. ```APIDOC ## buffsFor(input, context) ### Description Calculates the attacker-perspective buff stack, including intrinsic weapon-profile keywords and eligible abilities that translate to attacker-side buffs. ### Parameters - **input** (EligibilityInput & object) - Required - The input context. - **context** (EngineContext) - Required - The engine context. ### Returns - **Buff[]** - A list of applicable buffs. ``` -------------------------------- ### Warmaster Proposal Source: https://github.com/wn-mitch/40kdc-data/blob/main/data/_audit/proposed/REVIEW-DETAIL.md Proposed DSL for the Warmaster ability. ```json {type:ability-grant,target:self,modifier:{grant_type:warmaster-selection}} ``` -------------------------------- ### Proposed DSL for Aerial Deployment Source: https://github.com/wn-mitch/40kdc-data/blob/main/data/_audit/proposed/REVIEW-DETAIL.md Proposed DSL structure for the Aerial Deployment ability. ```json {type:conditional,condition:{type:phase-is,parameters:{phase:movement}},effect:{type:ability-grant,target:self,modifier: ``` -------------------------------- ### candidate_affordability Source: https://github.com/wn-mitch/40kdc-data/blob/main/conformance/RUNNER_PROTOCOL.md Calculates the affordability of candidate units based on remaining points. ```APIDOC ## candidate_affordability ### Description Determines if candidate units can be added to a roster based on current points limits and ordinal-aware pricing. ### Request Body - **op** (string) - Required - "candidate_affordability" - **args** (object) - Required - Contains factionId, battleSize, pointsLimitOverride, units, and candidateUnitIds. ### Response - **value** (array) - A list of objects containing unitId, nextCopyCost, and affordable boolean. ``` -------------------------------- ### Query Units and Weapons Source: https://github.com/wn-mitch/40kdc-data/blob/main/python/README.md Initialize the embedded dataset and retrieve weapon names for a specific unit. ```python from wh40kdc import Dataset ds = Dataset.embedded() unit = ds.units.find("Khârn the Betrayer") for weapon in unit.weapons: print(weapon.name) ``` -------------------------------- ### Resource Spend DSL Proposal Source: https://github.com/wn-mitch/40kdc-data/blob/main/data/_audit/proposed/REVIEW-DETAIL.md Proposed JSON structure for resource expenditure mechanics. ```json {type:resource-spend,target:self,modifier:{pool_id:cp,multiplier:3}} ``` -------------------------------- ### eligibleAbilities(input, phase) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/classes/Dataset.md Enumerates all abilities applicable to a unit within a specific phase. ```APIDOC ## eligibleAbilities(input, phase) ### Description Enumerates every ability that could apply to the given unit in the specified phase, grouped by source. ### Parameters - **input** (EligibilityInput) - Required - The input context for eligibility. - **phase** (Phase) - Required - The game phase to check. ### Returns - **EligibleAbility[]** - A list of eligible abilities. ``` -------------------------------- ### Game Version Object Format Source: https://github.com/wn-mitch/40kdc-data/blob/main/VERSIONING.md The standard structure for defining the edition and dataslate within entity and enrichment entries. ```json { "edition": "10th", "dataslate": "2025-q3" } ``` -------------------------------- ### POST /docs/:id/share Source: https://github.com/wn-mitch/40kdc-data/blob/main/workers/sync/README.md Mints durable share tokens for a document. ```APIDOC ## POST /docs/:id/share ### Description Mints durable share tokens for a document. This operation is idempotent; setting regenerate to true rotates the tokens. ### Method POST ### Endpoint /docs/:id/share ### Parameters #### Path Parameters - **id** (string) - Required - The document ID. ``` -------------------------------- ### buffsFromKeyword(args) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/functions/buffsFromKeyword.md Converts a single weapon-keyword reference into the buff contributions it makes against the provided engine context. ```APIDOC ## buffsFromKeyword(args) ### Description Converts a single weapon-keyword reference (catalog effect + reference-site parameters) into the buff contributions it makes against the provided engine context. ### Signature `buffsFromKeyword(args: { keywordId: string, weaponId: string, effect: unknown, parameters?: Record, context: EngineContext }): Buff[]` ### Parameters - **args** (object) - Required - **keywordId** (string) - The identifier for the keyword. - **weaponId** (string) - The identifier for the weapon. - **effect** (unknown) - The effect associated with the keyword. - **parameters** (Record) - Optional. Additional parameters for the keyword. - **context** (EngineContext) - The engine context to evaluate against. ### Returns - **Buff[]** - An array of buff contributions. ``` -------------------------------- ### resolveEligibleAbilities(dataset, input, phase) Source: https://github.com/wn-mitch/40kdc-data/blob/main/tools/docs/api/data/functions/resolveEligibleAbilities.md Computes the sorted-by-source eligible-ability list for a given unit and phase. ```APIDOC ## resolveEligibleAbilities(dataset, input, phase) ### Description Compute the sorted-by-source eligible-ability list for one (unit, phase). ### Parameters - **dataset** (Dataset) - The dataset to query. - **input** (EligibilityInput) - The input criteria for eligibility. - **phase** (Phase) - The specific phase to resolve abilities for. ### Returns - **EligibleAbility[]** - An array of eligible abilities. ``` -------------------------------- ### Proposed DSL for Mission Tactics Source: https://github.com/wn-mitch/40kdc-data/blob/main/data/_audit/proposed/REVIEW-DETAIL.md Proposed DSL structure for the Mission Tactics ability. ```json {type:ability-grant,target:self,modifier:{}} ``` -------------------------------- ### export Source: https://github.com/wn-mitch/40kdc-data/blob/main/conformance/RUNNER_PROTOCOL.md Exports a roster to a specific format. ```APIDOC ## export ### Description Exports a roster object into the requested format string. ### Request {"op":"export","args":{"format":"newrecruit-wtc-compact","roster":{...}}} ### Response {"ok":true,"value":"string"} ``` -------------------------------- ### match_applies_to Source: https://github.com/wn-mitch/40kdc-data/blob/main/conformance/RUNNER_PROTOCOL.md Resolves a keyword filter against a list of units. ```APIDOC ## match_applies_to ### Description Filters a list of units based on required and excluded keywords, returning the IDs of units that match the criteria. ### Request Body - **op** (string) - Required - Must be "match_applies_to" - **args** (object) - Required - Contains applies_to filter and a list of units. ``` -------------------------------- ### Regenerate Go artifacts Source: https://github.com/wn-mitch/40kdc-data/blob/main/CONTRIBUTING.md Commands to regenerate embedded assets after schema or data changes. ```bash cd tools && npm run bundle:schemas && cd .. cargo run -p xtask -- bundle-data bash go/codegen/sync.sh # go/{bundle.json,share_registry.json,schemas/,spec.go} ```