Commit graph

2 commits

Author SHA1 Message Date
d5abaf13bc
feat(thressgame-coverage): Wave 19 (close 6 production gaps, lift all fixmes)
T85: Wired Wave 12 move-gen attrs into engine.ts:getAllLegalMoves (the path the drag UI actually uses):
- BlockAllExceptKing (game-level early-return)
- BlockedPieceTypes (game-level early-return)
- MovesAs (per-piece substitution via lookupMoveGenerator)
- MovesAlsoAs (additive; deduped via dedupeMoves helper)
- MoveClassRestriction (post-filter on the entire move set)

Previously these attrs only filtered rules/turn.ts:getLegalMovesForPiece, but the production drag path goes through engine.ts. Now both paths apply identical filters.

T86: engine.ts:applyMove now honors isPawnPush:
- pushedPieceId moved to pushedTo (defender shoved forward)
- pawn moves to diagonal target square (no capture retract)
- HasMoved set on pawn
- Hook firing + turn advancement preserved

5 fixmes lifted in move-gen-attrs.spec.ts (MovesAs, MovesAlsoAs, BlockedPieceTypes, MoveClassRestriction, PawnPushesPiecesEnabled).
1 fixme lifted in orphan-primitives.spec.ts (must-class consumer now active).

E2E status: 30/30 thressgame-coverage tests PASS. 0 fixmes. 0 skips.
Unit tests: 2866 -> 2868 (+2 from new applyMove unit tests). bun run check exit 0.
2026-04-26 21:39:13 -06:00
f762b6d207
feat(thressgame-coverage): Waves 16-18 (Playwright e2e for choice-kinds + move-gen attrs + orphan primitives)
Wave 16 — 3/3 untested choice-kinds covered (choice-kinds.spec.ts):
- square: 8x8 grid → click e4 → treasure marker spawns
- row: row picker → click row 3 → 8 treasure markers along row 3
- coin-flip: heads/tails buttons → click heads → CoinFlipResult set on GAME_ENTITY

Wave 17 — 1 active + 5 fixme (move-gen-attrs.spec.ts):
- KingExtraReach=2 PASSES (king steps 2 squares)
- MovesAs/MovesAlsoAs/BlockedPieceTypes/MoveClassRestriction/PawnPushesPiecesEnabled fixme'd: drag library doesn't reject illegal moves at UI layer (move-gen filter is engine-side; UI is permissive). Documented limitation; engine behavior verified at unit level (Wave 12 tests).

Wave 18 — 11 active + 1 fixme (orphan-primitives.spec.ts):
- place-piece, move-piece, swap-pieces, convert-piece-type
- for-each-piece, for-each-square, for-each-adjacent, for-each-marker
- block-by-piece-type primitive (consumer attr Wave 12)
- on-rule-expire (descriptor detach fires arm)
- on-marker-expire (lifetime sweep fires hook)
- spawn-marker-pair (mutual MarkerLinks)
- must-class fixme: consumer deferred (descriptor seeds attr; rules/turn filter not yet wired for must-class specifically)

E2E total: 27 active passing + 7 fixme. Unit tests: 2866 passing. bun run check exit 0.
2026-04-26 18:43:01 -06:00