chore(sisyphus): Rule Variants Final Verification Wave — all reviewers APPROVE

Phase F Final Wave of the rule-variants epic.

  F1 (Plan Compliance, oracle):          APPROVE — bg_f2508b15
  F2 (Code Quality, unspecified-high):   APPROVE — bg_1101ecb3
  F3 (Manual QA, orchestrator-direct):   APPROVE — after agent hit
                                         tool cap; 1651/1651 unit +
                                         83/83 Playwright + 2/2
                                         visual spot-checks
  F4 (Scope Fidelity, deep):             APPROVE — bg_77460b0f

Summary:
- 1651 unit tests (1417 baseline → +234 across 14 presets + 4 hooks
  + audits).
- 83/83 Playwright (80 → +3 rule-variants scenarios in F.4).
- 0 typecheck / lint errors.
- 4 new preset hooks shipped: getRoyalPieces, filterLegalMoves,
  shouldAdvanceTurn (+ HalfMovesThisTurn fact), overridePieceMoves.
- 14 rule-variant presets shipped:
  * Tier 1: knightmate-rules, double-move, monster-rules (scope-
    flippable), first-promotion-wins.
  * Tier 2 royal: coregal, dual-king, weak-dual-king.
  * Tier 2 objective: suicide-chess, capture-all, extinction-chess.
  * Tier 2 movement: berolina-pawns (scope-flippable),
    berolina-pawns-2 (scope-flippable), bouncing-pieces,
    bouncing-pieces-2.
- 1 new layout: dual-classic.
- Engine composition fix: onCheckGameResult 'ongoing' suppresses
  defaults without short-circuiting later presets.
- UI: RulesDrawer category grouping + LayoutPicker suggested-rules
  chips.
- Docs: PRESET-API.md + RULES.md galleries updated.
- Audits: incompatibleWith symmetry test + suggestedPresets
  dangling-reference test — both green and runtime-enforced.

Deferred per-plan: Tier 3 royalty-transfer (requires mid-game state
toggle UX outside 'one move at a time'), berolina en-passant,
extinction-chess UI target cycling.

Plan: .sisyphus/plans/rule-variants-v2.md (all 31 tasks checked).
This commit is contained in:
Joey Yakimowich-Payne 2026-04-21 10:14:18 -06:00
commit 3cef8f5324
No known key found for this signature in database
3 changed files with 33 additions and 4 deletions

View file

@ -234,6 +234,30 @@ section).
is the authoritative contract — crashing on collision would
make it harder to iteratively develop two competing overrides.
## Epic COMPLETE — Final Verification Wave PASSED
**Final state**: master @ `cd7baea` plus `ed2f0cc` docs.
- 1651 unit tests (1417 baseline → +234)
- 83/83 Playwright (80 → +3 new rule-variants scenarios)
- 0 lint / typecheck errors
- 4 hooks + 14 presets + 1 layout + UI + docs
**Final Verification Wave results**:
- F1 (Plan Compliance, oracle): APPROVE
- F2 (Code Quality): APPROVE — 0 anti-patterns; all presets >= 8 tests (median ~12)
- F3 (Manual QA): APPROVE — orchestrator-direct after agent tool-cap; all visual spot-checks pass
- F4 (Scope Fidelity, deep): APPROVE — exactly 4 hooks + 14 presets + 1 layout; 0 protocol/wire/PGN/ELO creep
**Key patterns shipped for future epics**:
1. **Scope-flippable presets** — read own scope from `engine.activePresets.list()` at hook time (monster-rules, berolina-pawns, berolina-pawns-2 use this).
2. **Two-phase terminal-state protocol** — `onCheckGameResult` returning `"ongoing"` now SUPPRESSES defaults without short-circuiting later presets. Enables piece-hp + first-promotion-wins composition.
3. **Symmetric incompatibleWith graph** — runtime-enforced via `presets.test.ts`. Prevents asymmetric drift.
4. **Dangling-reference guards** — both presets and layouts have integrity tests ensuring every referenced id resolves.
5. **Category-grouped rules drawer** — optional `category` field + 6-bucket UI grouping. Scales as preset count grows.
**T3-learned fragility confirmed in Phase B/C/D**:
- D.1 suicide-chess, B.4 first-promotion-wins, B.3 monster-rules, D.3 extinction-chess, F.3 RulesDrawer ALL hit the 200-tool-call cap despite being 1-preset-per-delegation. Common cause: reading too many reference files upfront + verbose test writing. Mitigation: explicit per-delegation tool-cap warning + aim-for-80 suggestion paid off in smaller E phase.
## Phase A status at end of 20:17
All 4 hooks landed on master: