No description
Phase B.2 of the rule-variants epic. Each side plays two consecutive half-moves before the turn flips; turn order is WW BB WW BB … Implementation is a two-line `shouldAdvanceTurn` hook on top of the Phase A.3 `HalfMovesThisTurn` fact — veto the flip while the post- increment count is < 2, let the engine default flip proceed otherwise. No engine, schema, or layout modifications. Check / checkmate composition is free: the self-check filter runs per half-move (so neither half-move may leave own king exposed), and `checkGameResult` runs after every applyMove regardless of flip, so mate on the mover's second half-move lands exactly where it should without any double-move-specific terminal logic. Documented composition with `piece-hp` (independent; damage pipeline doesn't read HalfMovesThisTurn) and `king-heals` (uses onAfterMove, not onTurnStart — fires on every half-move including vetoed ones; pinned by the test). Declared `incompatibleWith: ["monster-rules"]` because both redefine the flip hook in conflicting ways. Test count: 1461 previous → 1479 total (+18). The double-move.test.ts file contributes 18 behavioral tests covering preset definition sanity, WW BB WW counter semantics, onTurnStart cadence, mid-turn check delivery, Fool's-Mate-style and Scholar's-Mate-style checkmate detection, composition with piece-hp, composition with king-heals, and session-snapshot integrity mid-veto. Exceeds the 12-test floor. - packages/chess/src/presets/double-move.ts (new) - packages/chess/src/presets/double-move.test.ts (new, 18 tests) |
||
|---|---|---|
| .github/workflows | ||
| .sisyphus | ||
| docs | ||
| packages | ||
| scripts | ||
| .gitignore | ||
| eslint.config.js | ||
| lefthook.yml | ||
| LICENSE | ||
| package.json | ||
| playwright.config.ts | ||
| README.md | ||
| tsconfig.base.json | ||
| tsconfig.json | ||
| vitest.workspace.ts | ||
@paratype
A Doorenbos-style Rete II rules engine for TypeScript games, with an authoritative WebSocket chess demo.
Packages
packages/rete— Rete II engine corepackages/chess— Browser chess demo (React + Vite)packages/server— Authoritative Bun WebSocket server
Docs
- SPEC.md — Engine specification
- PHASES.md — Development phases & perf budgets
- RULES.md — Chess rule presets
- PROTOCOL.md — WebSocket message protocol
Getting Started
bun install && bun run check