fix(token-usage): profile-aware config tier, uniform speed_inferred, version guard
Three review findings on the extraction layer: - The config.toml fallback used ccusage's table-blind line scan, so a `service_tier = "fast"` inside an INACTIVE [profiles.*] table marked every rollout under the codex home fast, billing unmarked entries at the model's fast multiplier. It now parses the file properly (toml crate, like streams::model_extraction): the active profile's tier wins, else the top-level key — a documented deviation from ccusage's scan. - Unmarked Claude entries hardcoded speed_inferred=false while the identical condition on Codex reports true, making the wire flag uninterpretable across tools. The flag means "tier not recorded in the transcript" and Claude now reports it that way. - migrate() had no guard against a database written by a newer binary. Migrations are destructive from v3 on, so a downgraded daemon would open fine and then fail every pass at runtime on missing columns; it now fails closed at open with an actionable message. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
S
Sasha Varlamov committed
315014f51926485f2c099a779ca51f4f0b4aef5b
Parent: ae4190c