# Usage retention runtime proof

Two isolated Linux development servers ran the base and head commits. The browser viewport was 1280 × 800, light theme. All uploaded usage data is synthetic. No model was called and no database rows were inserted.

1. Install dependencies in each checkout with `vp i`.
2. Run `python3 seed.py "$CHECKOUT"` before starting each app. It creates synthetic completed Claude-format transcripts with mtimes of 0, 100, 200, and 300 days and configures retention to 365.
3. Start each app from its checkout with `env -u CURSOR_API_KEY HOME="$EMPTY_FIXTURE_HOME" T3CODE_DEV_SEED=0 node scripts/dev-runner.ts dev`. Use an empty fixture HOME to keep default provider discovery isolated. Pair its real browser and open `/usage`, select Tokens and 90 days, and refresh.
4. The supplied UI-only reproduction has a setup gap: refreshing a chart limited to 90 days does not scan transcripts whose mtimes are 100–300 days old. To exercise retention, load `broad-scan.js` in the real client page and call `await scanRetention()`. This uses the existing client query and real server RPC for 2025-11-18 through 2026-11-18. The app implementation is unchanged. Inspect the server-created persisted cache with `python3 inspect-cache.py "$CHECKOUT" initial-broad-scan`.
5. Move the three aged transcript files outside `fixture-claude/projects`, keeping that provider directory and the current control transcript. Stop and restart each environment with the same command and HOME. Reload the real client, open Usage, and refresh. Inspect the persisted cache again.
6. Change `usageHistoryRetentionDays` in each disposable environment's userdata/settings.json to 92. Refresh Usage and inspect the cache.
7. Change it back to 365, leaving the aged sources unavailable. Refresh and inspect again.

Observed aged cache counts, base versus head: broad scan 0/3; after source removal, restart, and UI refresh 0/3; after lowering to 92 and refreshing 0/0; after widening to 365 and refreshing 0/0. Both real clients show the 1,100-token current control correctly. The charts remain capped at 90 days, as expected.

The cache PNGs are rendered summaries of the captured runtime inspection JSON, not screenshots of a product UI. The Usage PNGs are unmodified real browser screenshots; each was checked against an identical second screenshot more than 500 ms later. Videos show the same real-client refresh sequence after restart and during the 365 → 92 → 365 changes; the settings edits and cache inspections occur outside the browser and are recorded in the runtime JSON.
