Repository navigation
feat(shell): add BoardPreview value type + extend resume mappers to stop dropping payload - #1047
Conversation
…top dropping payload
Add a zero-dependency BoardPreview { columns, rows, cells: [CellMark] }
value type to GameShellKit (per design.md §3.6 ⚠️ 型別約束 — NOT GameAppKit,
see §12 error #11) and give GameAppKit's ResumeCandidate<Route> an optional
boardPreview field referencing it, so the CloudKit payload both apps already
fetch (Sudoku boardState, Minesweeper stateBlob) stops being discarded by the
resume mappers.
- GameShellKit: BoardPreview + game-agnostic CellMark (empty/given/filled/
marked); failable init degrades malformed shapes to nil, never traps.
- PersistenceKit: SavedGameSummary surfaces boardState (tolerant decode).
- SudokuKit: pure SudokuBoardPreviewMapper (boardState + givenMask from the
deterministic local puzzle regen — no new CK fetch); wired in Live.swift
fetchResume; any failure degrades to a text-only pill.
- MinesweeperKit: MinesweeperSavedGameSummary surfaces stateBlob; pure
MinesweeperBoardPreviewMapper decodes the session snapshot; wired in
Live.swift fetchResume with the same degrade contract.
- Tests in all four packages incl. malformed/truncated-payload → nil paths;
doc sync in docs/superpowers/specs/2026-06-10-resume-seam-design.md.
Data availability only — rendering is #1021's job.
Closes #1017
Part of #1014
Co-Authored-By: Claude Fable 5 <[email protected]>
|
T6 ACCEPT — PR #1047 (issue #1017), fresh-context acceptance in a throwaway detached worktree at head c28bdd0. Sanity check: A. BoardPreview zero-dependency in GameShellKit — ✅. BoardPreview.swift has zero B. End-to-end payload wiring — ✅. Traced both apps:
C. CellMark = D. Test suites (throwaway worktree,
E. Diff scope — ✅. F. swiftlint --strict on all 14 changed G. PR body: Forbidden-clause checks from #1017: Verdict: T6 ACCEPT. |
What
Adds the game-agnostic⚠️ 型別約束 / §12 error #11) and extends the resume pipeline so the CloudKit payload both apps already fetch stops being dropped by the mappers:
BoardPreview { columns, rows, cells: [CellMark] }value type to GameShellKit (zero-dependency, per design.md §3.6GameAppKit.ResumeCandidate<Route>gainsboardPreview: BoardPreview?(references the shell type — dependency direction keeps the shell clean).SavedGameSummarysurfacesboardState; pureSudokuBoardPreviewMappermaps it + the puzzle'sgivenMask(deterministic local regen viapuzzleProvider.puzzle(for:), no new CloudKit fetch) into.given/.filled/.emptymarks; wired inLive.swiftfetchResume.MinesweeperSavedGameSummarysurfacesstateBlob; pureMinesweeperBoardPreviewMapperdecodes the session snapshot into.empty/.filled/.marked; wired inLive.swiftfetchResume.boardPreview == nil, text-only resume pill; resume itself is never blocked (failableBoardPreview.init?+ tolerant decode +try?around the puzzle lookup).Verification
swift testgreen: GameShellKit 54, GameAppKit 85, PersistenceKit 81, SudokuKit 438 (full), MinesweeperKit 371 (full) — incl. new malformed-payload → nil degrade tests in all four packages.rg "import Persistence" Packages/GameShellKit/Sources→ zero hits (D2 mechanical proof; no new dependency edge in GameShellKit's Package.swift).swiftlint lint --strictclean on all touched files.puzzle(for:)traced to the local seed-based regen (PuzzleStore.swift:86), failure branch degrades preview only, never the candidate.docs/superpowers/specs/2026-06-10-resume-seam-design.mdstruct block updated; impl-notes atmeetings/2026-08-31_1017-board-preview.impl-notes.md.Closes #1017
Part of #1014
🤖 Generated with Claude Code