Commit Graph

2 Commits

Author SHA1 Message Date
be6eaee6d0 fix(01-02): TS-strict narrowing for EvalResult discriminated union
Rule 1 deviation: TS strict mode (noImplicitAny + strict) couldn't narrow
the EvalResult union via 'r.ok' direct access because the {unknown:true,raw}
variant has no 'ok' property. Added explicit type-guard helpers (isUnknown,
isOk, isFail) for both production and spec narrowing. Runtime behavior
unchanged; tsc --noEmit now exits clean for the leveling lib.

Files:
- prereq-evaluator.ts: 3 type-guard functions, used in OR/AND walkers
- prereq-evaluator.spec.ts: isFail() in lieu of result.ok=== checks
2026-04-27 14:18:10 +02:00
66d9d5cc0a test(01-02): RED — prereq-evaluator spec (D-01..D-04)
Task 3 RED phase: 18 failing tests covering prereq DSL evaluation.
Coverage:
- empty/null inputs (always ok)
- skill rank: trained/expert/master/legendary in <skill>
- disjunctive (comma + or) and conjunctive (semicolon)
- bare feat name lookup
- heritage / class refs
- non-evaluable patterns: spellcasting, deity, age, vision, free-text → {unknown, raw}
- German failure reasons asserted

Verified failure: module './prereq-evaluator' not found.
2026-04-27 14:07:02 +02:00