fix: Match ccusage 20.0.9 cost calc; persist parse cache
ccusage moved 18.0.11 -> native-binary 20.0.9, changing three things we now mirror: - 1-hour cache writes bill at 2x base input (was a flat 5m rate). This is the dominant cost component for Claude Code (~90-99% of cache is 1h TTL), so the old calc undercounted "today's cost" by ~9%. - Row dedup switched first-wins -> max-output-wins: a message is written twice (partial stream snapshot + final), same msgid:requestId with identical input/cache but growing output_tokens; keep the complete copy. - ccusage became multi-provider (Codex/Kimi/...); we stay Claude-only. Verified: Tools/recalc_cost.swift matches ccusage 20.0.9 to the cent across 30 days; verify_cost.sh excludes the in-progress day and filters Claude-only. Also fixes a pre-existing SAVE failure: a .infinity timestamp sentinel made JSONEncoder reject the whole envelope, so the parse cache never persisted and every refresh did a full ~8s re-parse. Now finite; cache schema V2->V3.
X
XueshiQiao committed
42feb317fbf5bab7730195b0f2161ce541675fd5
Parent: 80da465