feat(chess): starting-layout foundation (Phase A)
Introduces a pluggable StartingLayout abstraction so the engine can
open from positions other than FIDE without per-caller special casing.
- layouts/{types,registry,index}.ts: StartingLayout + LAYOUT_REGISTRY,
mirroring the PRESET_REGISTRY / PIECE_TYPE_REGISTRY pattern.
- starting-position.ts: CLASSIC_LAYOUT + applyLayout(session, layout)
as the parametrized spawn path. generateStartingPosition stays as
a thin back-compat wrapper so no existing call site changes.
- layouts/{classic,empty}.ts: first two premades registered via
side-effect imports from the barrel.
- engine.ts: ChessEngine constructor now accepts either legacy
(activePresets) positional or new options-bag form
({ activePresets?, layout? }). Detection uses a method-shape
probe rather than instanceof so both overload forms compose
cleanly under strict TS.
- Tests: 11 new tests in starting-position.test.ts + engine-presets
cover applyLayout ordering, hasMoved pre-revocation, empty
layout, classic equivalence, options-bag equivalence with legacy.
Also lands the full execution plans for starting-layouts and
rule-variants under .sisyphus/plans/ (both Momus-reviewed OKAY).
941 tests passing; bun run check clean.
This commit is contained in:
parent
653267daf0
commit
d93bcf6c81
12 changed files with 1319 additions and 26 deletions
|
|
@ -35,7 +35,10 @@
|
|||
"ses_262ddfb93ffeMGkZK2rspryFfX",
|
||||
"ses_262998e6fffeRY6BJVTKB7Jtwb",
|
||||
"ses_26299a749ffe3jnwQzrfJ9g1Wc",
|
||||
"ses_261e4ca30ffexBShmvjEhVSHRy"
|
||||
"ses_261e4ca30ffexBShmvjEhVSHRy",
|
||||
"ses_25d474e64ffeuPnRfi4X9al43a",
|
||||
"ses_25d39bf44ffeY9WOIQgNCijBt0",
|
||||
"ses_25d319ba5ffe37R9eKUEq95w7o"
|
||||
],
|
||||
"plan_name": "rete-rules-engine",
|
||||
"agent": "atlas"
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue