- Zustand 5 vanilla createStore composes 4 slices (garden / memory /
narrative / session); useAppStore React hook re-renders on selector
change; getState() works without React (Phaser ↔ React bridge per D-32)
- simAdapter exposes drainCommands / applyTilesAndUnlocks /
applyHarvestedFragments / applyLuraProgress / applyTickCount; sim
never imports the store (CORE-10)
- V1Payload extended in place per D-34: tickCount (BLOCKER 3 monotonic
counter), unlockedPlantTypes, luraBeatProgress, offlineEvents,
settings.persistenceToastShown — CURRENT_SCHEMA_VERSION stays 1, no
migrations[2] sneaked in (regression-defense test pins this)
- migrations[1] populates all new field defaults; tickCount: 0 means
fresh sims always start at sim-tick 0
- registerSaveLifecycleHooks (UX-10): visibilitychange→hidden,
beforeunload, plus saveOnSeasonTransition() — Vitest covers all three
- Phaser EventBus singleton seeded per the Phaser 4 React-template pattern
- Install @testing-library/react as devDep so the React-hook test can
exercise the real renderHook surface
- 27 new tests across store / migrations / lifecycle all green; full
npm run ci is 126/126