Pinky W: cheap poll cycles — response cache, delta memo, visibility pause (v1.27.0) #53
Loading…
Reference in a new issue
No description provided.
Delete branch "oss-oo/pinky-w-cpu"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Owner top blocker: one open dashboard pegged a core (~170 % CPU, station 90–95 °C). Three layers, semantics untouched.
R1 — response cache: both poll endpoints serve cached bodies behind a change key over EVERY source (DB stat incl. -wal/-shm + data_version probe, tasks index, ledgers, contract, questions side-channel, state file, provider config, live /proc digests). Any source mutation rebuilds on the NEXT poll; TTL 8 s refreshes time-derived fields; ONE fetch per cycle shared by both endpoints; ZDO_CACHE=0 opts out.
R2 — hot-path memo: per-session facts keyed on session.time_updated (flushes with parts/turns — verified live 2026-09-26), re-derived only for changed/new/hot sessions; doorbell scan rowid-incremental. Measured on the station snapshot (340 sessions, 164k parts): idle rebuild 45 ms vs 2189 ms before; old-vs-new payloads IDENTICAL (normalized diff).
R3 — visibility governor: hidden tab pauses main/drawer/modal/dock timers; visible re-arms + immediate refresh. Default cadence unchanged (3000 ms).
Evidence: 67/67 unittests (15 new, one per source class incl. second-writer inserts, running→terminal + webhook-once, tasks flip, ledger rewrites, TTL, dedupe, busy-raises-not-stale, doorbell memo pickup); Super-Linter green (BASH/BASH_EXEC/MARKDOWN/PYTHON_PYLINT/PYTHON_RUFF/YAML); fixture rig E2E PASS: new session + running→terminal each visible in ~1.03 s (≤ 2 cycles budget 8 s), cache-hit bytes identical, CDP probes green (table, usage SVG, drawer + steer console, R3 pause/resume in the live page). Live G1/G2 measurements run after merge+install (dossier follows).