feat(summary): revision-gated cache with stale-while-revalidate (STATE-WP-0066)

Replace the fixed 15s TTL on GET /state/summary with per-table revision
watermarks, stale-while-revalidate background refresh, and a progress-tail
section split. SQLAlchemy write hooks invalidate core or progress sections
on mutation. Adds tests, benchmark script, and operator docs.
This commit is contained in:
2026-06-22 16:27:32 +02:00
parent f88e74288d
commit 94c7817339
10 changed files with 614 additions and 35 deletions

View File

@@ -52,10 +52,10 @@ def _truncate(_schema):
from api.models import Base
import api.routers.state as _state_router
import api.routers.workstreams as _ws_router
from api.services.summary_cache import reset_summary_cache_for_tests
# Reset in-process TTL caches so stale data from a previous test can't bleed through.
_state_router._SUMMARY_CACHE = None
_state_router._SUMMARY_CACHE_AT = 0.0
# Reset in-process caches so stale data from a previous test can't bleed through.
reset_summary_cache_for_tests()
_state_router._OVERVIEW_CACHE = None
_state_router._OVERVIEW_CACHE_AT = 0.0
_ws_router._INDEX_CACHE = None