[Story-1044] Add generated query invalidation helper

Story 1044Epic 9252 files · +112/−0

PR #239 · pramaan-io/pramaan-app · merged 2026-06-05

How it flows

sequenceDiagram
  autonumber
  participant dev as developer call
  participant helper as invalidation helper
  participant cache as query cache
  dev->>helper: call exact or collection
  helper->>helper: match generated key
  helper->>cache: remove entry or all variants

Out of scope by design

Stale cache ka common risk kam hua
Typed API — typo pe compile error
Tests real generated factory pe
Generated factory ke bina custom key doge toh match nahi karega
Tier 2 abhi bhi spike pe parked
Visual aur walkthrough exempt — non-visual infra

Files changed (2)

File±
src/lib/query/invalidation.test.ts ★+62
src/lib/query/invalidation.ts ★+50