mirror of
https://github.com/teamchong/pxpipe.git
synced 2026-07-22 02:02:51 +02:00
cde21b2e73
The savings accounting priced the text baseline as cold whenever pxpipe's own image cache missed this turn (cr==0), fabricating a 1.25x create the text path would never have paid and inflating reported savings ~2x. Decouple them: the text prefix reads warm whenever a fresh same-session prior exists within the 300s TTL (wall-clock), unioned with an observed read (cr>0) for the post-restart case. Centralised in deriveBaselineWarmth; used by all three call sites (sessions, dashboard, fragments). Empirical replay over ~/.pxpipe/events.jsonl (13,402 message rows): honest headline 504.6M tokens saved vs the old cr-gated 1.05B; 1,409/12,305 fresh-prior rows (11.4%) read warm despite a busted image cache. Dashboard now narrates the busted-image case explicitly. Adds baseline/sessions/context-map regression tests. Measurement only — no change to proxy behavior. typecheck + 600 tests + build all green.