Seal the 12-slot piece-placement layout #121
Labels
No labels
bug
documentation
duplicate
enhancement
good first issue
help wanted
invalid
question
spec
wayfinder:grilling
wayfinder:map
wayfinder:prototype
wayfinder:research
wayfinder:task
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
amaurycoudr/chess-project#121
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Parent
#117
What to build
Seal the 12-slot piece-placement layout now that no consumer reaches it directly. With every reader on the
PieceReaderport andSearchBoardonMutablePlacement, the raw record types and the aliasing constructors have no remaining external callers — make the layout a private implementation detail.Un-export
PieceSets,PieceSetKey, andpieceSetKeyOf; collapseBoard's three aliasing-distinguished constructors (wrapSets,fromSets,toSets) into the single copy-onlyBoard.fromReaderbuilder, so silent copy-vs-alias mistakes become unrepresentable. RecordPieceReaderas the seam between rule logic and placement representation in the ADR lineage.Acceptance criteria
PieceSets,PieceSetKey,pieceSetKeyOfno longer exported; module-private to the placement moduleBoard.wrapSets/Board.fromSets/Board.toSetsremoved;Board.fromReaderis the single snapshot-from-anything builder (always copies)PieceReaderas the rule-logic/representation seampnpm lint,pnpm typecheck,pnpm test,pnpm buildall green; perft node counts unchangedBlocked by
Implemented by Sandcastle on branch
sandcastle/sequential-reviewer/1779455557939— awaiting review. 12-slot layout (PieceSets,PieceSetKey,pieceSetKeyOf,PIECE_SET_KEYS,PIECE_FOR_KEY) is now confined to a privatepiece-sets.tsshared only byBoardandMutablePlacement; the three aliasing-distinguished constructors (wrapSets/fromSets/toSets) are gone —Board.fromReaderis the single copy-only snapshot builder. ADR 0007 carries a lineage note recordingPieceReaderas the rule-logic/representation seam. All four gates green; perft node counts byte-identical.Promoted to branch
refactor/introduce-the-piecereader-read-port-118(PR #122), not yet merged to main. A dependent slice shouldgit fetch origin refactor/introduce-the-piecereader-read-port-118and branch off it.mentioned in commit
ad1f9e4a14mentioned in commit
2d77134432