Type generated WoW talent legality keys as strings (#4)

This commit is contained in:
warren committed 2026-10-09 18:41:57 -04:00
1 parent 8a7e44cc14
commit 1622f0893c
3 files changed
+243 -1

No files matched your search

+46
View File
@@ -0,0 +1,46 @@
# WoW talent-gate Set typing — 2026-10-09
This narrow source correction addresses shared-source issue [#4](https://git.whoagland.com/phenom/healer-man/issues/4), coordinated with native issue [#236](https://git.whoagland.com/Codex/healer-man-godot/issues/236). It changes only the inferred TypeScript type of the legal talent-node ID set in `src/game/wow335AbilityCatalog.ts`:
```ts
const SOURCE_WOW335_TALENT_NODE_IDS = new Set<string>(WOW335_TALENT_NODES.map((node) => node.id));
```
The runtime membership check and its inputs are unchanged. The explicit `string` type lets the imported talent-node ID pass strict `Set.has` checking without changing any legal node, exemption, ability rank, rotation, or gameplay value.
## Before and after
- Baseline catalog SHA-256: `6a7cf9b934026ec4b5beb0de3fe64eda4872efad561d63d25b2c911676d249a4`
- Corrected catalog SHA-256: `3ea007068d8a8b6cd0c49d2d4b780cf176dc567e23fe20537e40f49fded14314`
- The focused strict baseline emitted exactly one expected `TS2345` at `wow335AbilityCatalog.ts(2605,75)`, on `SOURCE_WOW335_TALENT_NODE_IDS.has(chain.talentNodeId)`.
- The corrected source passed strict TypeScript 5.8.3 checking with zero diagnostics.
- Three focused regressions passed: cold native import followed by talent preload, legal talent gates plus source-only-node exemptions, and equality with the full legal talent-node set. The targeted Vitest invocation selected these three tests; 41 other tests in that file were skipped.
The review run is recorded in `../diagnostics/strict-types/after-regression-tool-final2.json`. The sparse authoritative mirror strict check is recorded in `../diagnostics/strict-types/actual-mirror-types-final.json`; that run used TypeScript 5.8.3 with zero diagnostics and skipped runtime tests because the mirror does not contain the runtime fixture/dependencies. The baseline proof is `../diagnostics/strict-types/baseline-regression-tool.json`.
## Reproduction checker
`../scripts/check-wow-talent-gate-types.mjs` checks the catalog and its imported TypeScript dependency graph in strict mode. It can also run the three focused regressions when the project root has `vite.config.ts` and the cold-start fixture, and the toolchain root provides TypeScript, Vite, and Vitest.
From the source review checkout, run both type and runtime checks with:
```sh
node scripts/check-wow-talent-gate-types.mjs \
--project-root /path/to/source-review \
--toolchain-root /path/to/source-review
```
For a sparse source mirror with an external dependency tree, point the roots separately and omit only the runtime tests:
```sh
node /path/to/source-mirror/scripts/check-wow-talent-gate-types.mjs \
--project-root /path/to/source-mirror \
--toolchain-root /path/to/toolchain \
--skip-runtime
```
`--expect baseline` is available to verify the recorded pre-fix `TS2345`; the default `--expect fixed` requires a clean strict check. The checker is focused evidence, not a full project build, runtime gameplay validation, balance certification, or GPU validation.
## Scope record
Coordinator: `/root`, session `01a11cd3-fa7c-7510-ba8f-bc7a3d0310a6`. The Set typing correction was the source-owned change; independent strict-type and focused-regression validation was performed by the validation worker. All workers used GPT-6 Luna with xhigh reasoning for this scoped work.