fix(savings): show only ledger-resident models with actual costs; consistent TTY styling#111
Closed
ztkent wants to merge 3 commits into
Closed
fix(savings): show only ledger-resident models with actual costs; consistent TTY styling#111ztkent wants to merge 3 commits into
ztkent wants to merge 3 commits into
Conversation
Remove the counterfactual per-model table (CostAvoidedAll over the full pricing table) and replace it with actual attribution from ModelTotals. Only models present in the ledger are shown; each model's cost is derived from its real token usage scaled to its own tokenizer. Apply consistent TTY styling (Heading, Stat/StatGood/StatNeutral, StatStrip) to all dashboard sections: cost avoided per model, savings by client, per-repo totals, and per-language totals. Each row now shows a green price alongside the bold counts. Remove the top-level "$ cost avoided" headline (a counterfactual guess); actual cost is authoritative in the per-model section.
Contributor
Author
|
Reopening from a dedicated feature branch ( |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Replaces the counterfactual per-model cost table with actual attribution from
ModelTotals, applies consistent TTY styling across all dashboard sections, and removes the top-level$ cost avoidedheadline.Before — 26 models shown regardless of usage, all priced against the same token count:
After — only models present in the ledger, costs from real usage:
Why this shape
CostAvoidedAlliterates the full pricing table and applies one shared token count to every entry — it answers "what would these tokens have cost on each model?" rather than "what did this model actually cost?". That counterfactual table is useful in the JSON output (consumers can pick any model for their own calculations) but wrong for the human-facing dashboard, where every row looked like a real figure.ModelTotalsalready provides the correct data: per-model token counts from the ledger, each rescaled through its own tokenizer. The two sections were shown in the wrong order under confusing labels.The TTY-path styling now mirrors the existing headline throughout:
progress.Headingfor section titles,StatGood(green) for dollar amounts,StatNeutral(bold) for counts.Tests
TestEmitSavingsDashboard_RendersThreeBuckets— assertion changed from"Cost avoided:"(removed headline) to"Cost avoided per model (all time):".go test ./internal/savings/... ./cmd/gortex/...passes.Notes
CostAvoidedAllis retained for the JSON output path (cost_avoided_usdon bucket entries) where it remains useful for downstream consumers.--modelflag still controls the model used for per-bucket bar-chart costs.(none — no model hint captured yet)fallback renders when no session has written a model hint yet.