houserules/packages/chess
Joey Yakimowich-Payne fb6170127e
test(e2e): custom modifier DSL vertical slice + integration fixes
T3 Wave 5 (T29). New Playwright suite at e2e/custom-modifiers.spec.ts
covering 16 scenarios across the user-facing flows:

- Editor opens from the Modifier Profile editor header
- Palette click adds primitive to tree
- Save button reflects validator state (disabled when name empty)
- Custom modifier appears in PerType kind dropdown
- Selecting a custom kind shows the summary card
- Library survives page reload
- Solo game with custom-kind profile renders modifier indicators
- Multi-profile stack: stack two profiles, remove an entry, reorder
- Aura primitive: page survives onAfterMove recompute
- Library cap holds at 20 entries

Plus 4 trigger primitive scenarios (formerly fixme, unblocked by the
trigger evaluator wiring committed alongside):
  - on-turn-start nested primitives fire at turn boundary
  - on-capture nested primitives fire on capture
  - conditional evaluates and runs matching branch
  - absorb-damage-with-attribute integrates with damage pipeline

2 fixmes remain — both blocked on the editor-side multiplayer send UI
(server + client wire-side is fully implemented in this commit).

Integration fixes uncovered while writing the suite:

1. ModifierKindIdSchema widened from z.enum([built-ins]) to z.string().min(1).
   The pre-T3 enum silently rejected every profile that referenced a
   custom modifier id (e.g. 'custom:my-shield'), causing library load
   to drop the entry and the picker to have no option. Validity is
   now enforced at apply time via the registry-dispatch fallback
   (MODIFIER_REGISTRY → engine.customModifiers → warn-and-skip).

2. Lobby.resetToFreshGame now passes loadCustomModifierLibrary()
   results to ChessEngine.opts.customModifiers so a profile that
   references a custom kind can resolve at apply time. Without this
   the apply silently no-opped the custom-kind entries and indicators
   never rendered.

Schema tests updated: the 'rejects unknown modifier kind' test flipped
to 'accepts arbitrary kind strings (T3 widening)' with explanatory
JSDoc; an empty-string-rejection test added to preserve the min(1)
guard.

77 e2e + 1386 unit tests green; 2 honest fixmes documented.
2026-04-19 21:37:23 -06:00
..
docs feat(chess): preset-flexibility architecture — decouple HP, damage, piece-types, state, effects 2026-04-18 16:26:17 -06:00
e2e test(e2e): custom modifier DSL vertical slice + integration fixes 2026-04-19 21:37:23 -06:00
src test(e2e): custom modifier DSL vertical slice + integration fixes 2026-04-19 21:37:23 -06:00
tests/fide-games test(chess): replay 5 classic FIDE games; Phase 2 acceptance gate (P2.23) 2026-04-16 15:18:57 -06:00
index.html feat(branding): rename product to Houserules 2026-04-17 15:27:48 -06:00
package.json feat(engine): modifier profile types 2026-04-18 22:05:58 -06:00
README.md chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
RULES.md chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00
tsconfig.json test(chess): e2e full-flow scenario; tag Phase 3 (P3.15) 2026-04-16 16:55:28 -06:00
vite.config.ts feat(chess): scaffold Vite + React app (P3.9) 2026-04-16 15:54:32 -06:00
vitest.config.ts chore(root): scaffold monorepo — Phase 0 complete 2026-04-16 13:32:21 -06:00

@paratype/chess — custom-rules chess demo