Skip to content

refactor(minesweeper): use FakePersistence in preview composition (#261) - #279

Merged
wei18 merged 1 commit into
mainfrom
refactor/ms-preview-fakepersistence-261
Jun 3, 2026
Merged

wei18 merged 1 commit into
mainfrom
refactor/ms-preview-fakepersistence-261

Conversation

@wei18

@wei18 wei18 commented Jun 3, 2026

Copy link
Copy Markdown
Owner

Closes #261.

MinesweeperAppComposition.preview() used LivePersistence(ckConfig:.minesweeper), safe only via lazy IO. Swapped to a zero-IO FakePersistence so any future Preview path that calls bootstrap()/latestInProgress() can't trap on a real CloudKit gateway. .live() unchanged.

Deviation (improves on the brief): FakePersistence did NOT already live in PersistenceTesting — Sudoku's is in SudokuKitTesting and is Sudoku-test-coupled (scripted op tracking). Rather than couple MS to Sudoku's test target, the agent added a new minimal generic FakePersistence to the shared PersistenceTesting target (zero-IO, empty defaults) — the correct shared home both apps consume. Sudoku's richer SudokuKitTesting.FakePersistence is untouched (no collision; consolidating the two is a deferred follow-up, out of scope here).

Verified: MinesweeperAppCompositionTests → 7/7 pass (incl. previewFactoryConstructs); PersistenceTesting builds.

🤖 Generated with Claude Code

MinesweeperAppComposition.preview() used LivePersistence(ckConfig:.minesweeper),
safe only via lazy IO. Swapped to FakePersistence (PersistenceTesting) so any
future Preview path that calls bootstrap()/latestInProgress() stays zero-IO,
mirroring Sudoku's AppComposition Preview. .live() unchanged.

FakePersistence did not previously exist in PersistenceTesting (Sudoku's lives
in SudokuKitTesting and is Sudoku-test-coupled). Added a minimal shared zero-IO
PersistenceProtocol conformer to PersistenceTesting so MS consumes it without
depending on Sudoku's test target. SudokuKitTesting.FakePersistence untouched.

Co-Authored-By: Claude Opus 4.8 <[email protected]>
@wei18
wei18 merged commit 7e0e3ae into main Jun 3, 2026
@wei18
wei18 deleted the refactor/ms-preview-fakepersistence-261 branch June 3, 2026 08:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

refactor(persistence): add FakePersistence target for zero-IO previews + tests

1 participant