Problem
PERSISTENT_STALE_CEILING_MS in src/utils/circuit-breaker.ts:34 is a global 24h constant. Even after reducing risk scores localStorage staleness to 1h (PR #1320), the IndexedDB persistent cache can still serve 24h-old data as a last resort. For a conflict monitoring app, day-old CII risk scores are unacceptable.
Solution
Add an optional persistentStaleCeilingMs parameter to CircuitBreakerOptions. When provided, override the global PERSISTENT_STALE_CEILING_MS for that breaker. Risk scores would use 1h while other breakers keep the 24h default.
Files
src/utils/circuit-breaker.ts (line 34, options interface, persistent cache hydration)
src/services/cached-risk-scores.ts (line 171, breaker creation)
Context
Discovered during cache TTL audit (PR #1320). Plan explicitly deferred this as a separate task to avoid modifying a global constant.
Problem
PERSISTENT_STALE_CEILING_MSinsrc/utils/circuit-breaker.ts:34is a global 24h constant. Even after reducing risk scores localStorage staleness to 1h (PR #1320), the IndexedDB persistent cache can still serve 24h-old data as a last resort. For a conflict monitoring app, day-old CII risk scores are unacceptable.Solution
Add an optional
persistentStaleCeilingMsparameter toCircuitBreakerOptions. When provided, override the globalPERSISTENT_STALE_CEILING_MSfor that breaker. Risk scores would use 1h while other breakers keep the 24h default.Files
src/utils/circuit-breaker.ts(line 34, options interface, persistent cache hydration)src/services/cached-risk-scores.ts(line 171, breaker creation)Context
Discovered during cache TTL audit (PR #1320). Plan explicitly deferred this as a separate task to avoid modifying a global constant.