feat(FN-4027): memoize startup slim list reads to avoid redundant fresh fet

Added memoization for startup slim task list reads (`store.ts`), with dashboard server routing startup reads through the memo window and tests covering the store watcher consumers in scheduler and worktree-pool, plus performance documentation.

Fusion-Task-Id: FN-4027
This commit is contained in:
Fusion
2026-05-11 18:36:53 -07:00
committed by gsxdsm
parent a22a665ec3
commit 5c3a1df977
9 changed files with 112 additions and 4 deletions

View File

@@ -206,6 +206,15 @@ const { stats: diffStats } = useTaskDiffStats(
## Cache Implementation Details
## Startup slim `listTasks` memoization (FN-4027)
A short-lived startup memo now collapses duplicate `listTasks({ slim: true })` reads that happen during boot choreography (watch cache warmup, scheduler PR hydration, worktree pool scan, and dashboard badge priming).
- Scope: startup-only slim reads keyed by `includeArchived` + `column`
- Safety: memo entries expire quickly (2.5s TTL) and are explicitly cleared when `watch()` handoff completes
- Freshness: steady-state polling/watch reads bypass the memo, so normal runtime updates are not served from stale startup data
- Mutation safety: memoized responses are cloned before return so callers cannot poison shared cached objects
### useTaskDiffStats Cache
```typescript