-
Missing area: the lightbox-specific state graph is not actually scoped as a migration surface, even though the plan’s motivating bug lives there.
Repo evidence: the plan anchors the problem in ImageLightbox and the split image-edit contexts, but M1a only scopes settings internals and makes M2 conditional (state_management_refactor_plan.md, state_management_refactor_plan.md, state_management_refactor_plan.md); meanwhile useImageLightboxEnvironment still composes useProject, usePanes, useUserUIState, useEditSettingsPersistence, useLoraManager, and other stateful hooks into one return object (useImageLightboxEnvironment.ts), and ImageEditProvider still fans one large value back out into three context slices as a re-render mitigation (ImageEditContext.tsx).
Why it matters: if M1a fixes only edit-settings persistence, the root bug can easily survive through pane state, user UI state, LoRA state, or orchestrator state; that turns M2 from “conditional” into emergency cleanup and expands scope mid-run.
Suggested correction: add an explicit preflight for the ImageLightbox tree before M1a exits: inventory every state source feeding ImageLightbox/EditModePanel, decide what stays local vs store-backed, and add a dedicated lightbox-surface sub-milestone or exit criteria before declaring the bug fixed.
-
Missing area: the settings migration under-scopes side-channel persistence and inheritance contracts outside useAutoSaveSettings.
Repo evidence: the canonical settings doc says the real system includes settingsWriteQueue, useToolSettings, shotSettingsInheritance, usePersistentToolState, and useUserUIState, plus localStorage/sessionStorage contracts (settings_system.md, settings_system.md, settings_system.md, settings_system.md); new-shot defaults are seeded through sessionStorage keys like apply-project-defaults-${shotId} in shotSettingsInheritance.ts; useLastUsedEditSettings also reads/writes both DB and localStorage (useLastUsedEditSettings.ts); usePersistentToolState is a legacy adapter with its own interaction guard (usePersistentToolState.ts).
Why it matters: these are not implementation details. If the store rewrite preserves only hook signatures but not these storage/write semantics, you get silent regressions in new-shot inheritance, “last used” defaults, cross-device sync, or write coalescing.
Suggested correction: expand M1/M1a to include a persistence-contract inventory: required storage keys, write-queue invariants, inheritance flow, adapter hooks, and which docs/tests must be updated before helpers are deleted.
-
Missing area: M1c does not account for timeline-adjacent bridge state living outside the timeline contexts it plans to migrate.
Repo evidence: M1c scopes useTimelineState and three timeline contexts (state_management_refactor_plan.md), but VideoEditorProvider contains additional store-sensitive bridges: Agent Chat registration reads editor ops and selected clips through refs (VideoEditorProvider.tsx); the “add to video editor” query-param/pending-add flow depends on editorRef.current and timeline mutation timing (VideoEditorProvider.tsx); lightbox navigation also derives from editor data outside the named timeline contexts (VideoEditorProvider.tsx).
Why it matters: those bridges will break even if TimelineCanvas and drag/resize seem fine. Regressions show up as “add to editor” failures, Agent Chat selection replacement bugs, or timeline lightbox navigation drift, which the current M1c smoke test does not cover.
Suggested correction: extend M1c preflight to inventory provider-local bridges and add smoke checks for Agent Chat clip replacement, pending-add/query-param import, and timeline lightbox next/prev behavior.
-
Missing area: the selection rollout inventory is too narrow and will miss direct context consumers, bridge hooks, and route-reset behavior.
Repo evidence: the M1b grep only targets a few hook names/import patterns (state_management_refactor_plan.md, state_management_refactor_plan.md); but useGallerySelectionBridge uses useGallerySelectionOptional() plus registerPeerClear to synchronize another selection surface (useGallerySelectionBridge.ts); useResetCurrentShotOnRouteChange mutates selection on route transitions (useResetCurrentShotOnRouteChange.ts); and some consumers read LastAffectedShotContext directly via useContext instead of useLastAffectedShot, for example useGalleryPageState.ts and App.tsx.
Why it matters: this is classic silent scope expansion. The plan will think it migrated “the selection system,” but peer-clear semantics, direct-context consumers, and route lifecycles can still be hanging off the old contract.
Suggested correction: broaden M1b preflight to include use*Optional, direct useContext(...) consumers, and route-reset hooks; require a migration map for peer-clear and route-clear semantics before implementation starts.
-
Missing area: M3 under-scopes the task/realtime surface to three consumer hooks, but the actual graph includes incoming placeholders, generation-task mapping, and task-count/status surfaces.
Repo evidence: M3 only names useTaskStatus, usePendingGenerationTasks, and useGenerationTaskDetails (state_management_refactor_plan.md); however the app also mounts GenerationTaskProvider globally (AppProviders.tsx), keeps separate incoming placeholder state in IncomingTasksContext.tsx, uses useTaskPlaceholder broadly across generation flows (see search hits in image/video/lightbox/task creation paths), and maintains a generation-task cache in generationTaskCache.ts. useTaskStatusCounts is also part of the visible tasks pane state surface (useTasksPaneController.ts).
Why it matters: you can move realtime events into a store and still keep flicker, duplicate renders, or stale task UI if placeholders, mapping cache, and counts are left on parallel state paths.
Suggested correction: rewrite M3 as a full task-state inventory milestone first: realtime connection state, incoming placeholders, generation-task mapping cache, per-task selectors, and aggregate counts. Then define which of those become store-backed and which remain React Query/cache-only, with telemetry on both task rows and gallery/lightbox consumers.