Codex/monthly cost token flow mode - #1
Merged
Conversation
Seal the local-first migration path, isolation boundaries, execution order, and falsifiers before Source Registry or hosted authentication work begins.
Show current-month spend beside the all-time Cost KPI, reuse Token Flow for token or cost analysis without resetting zoom, and add weekly/yearly aggregation at wider domains. Percentages follow the active measure.\n\nVerified with npm test (168 passing) and desktop/mobile Playwright smoke tests against local ClickHouse.
Detect inclusive input counters from the total-token invariant so adding cache_write_input_tokens does not turn the absolute cached counter into an input delta. Bump the analytics derivation to reimport affected sources and cover both transition and steady-state snapshots. Verified: npm test (170/170); ClickHouse generation comparison reduces 2026-07-17 from ,218.45 to .22.
Use semantic daily, weekly, monthly, and yearly resolution caps with exact calendar bucket centers. Add month-to-date ranges, a persistent range total, and a database-backed monthly USD limit with remaining/overage status.\n\nVerified with npm test (174/174) and Playwright against the ClickHouse dashboard; MTD chart and KPI both report .3K, 1Y renders monthly buckets, and the console is clean.
Separate API billed-cost estimates from subscription API-equivalent value, expose observed quota windows with coverage, and add profile-aware recommendations. Preserve pricing overlays and cached analytics for profile-only changes.\n\nTests: npm test (184/184)\nVerification: desktop/mobile Playwright; read-only local ClickHouse report build
Persist compressed provider telemetry, expose direct OpenAI plan history, and add guarded Claude session-limit inference with weekly 5h lower bounds. Verified with 202 tests, desktop/mobile browser checks, and a full ClickHouse derivation-v5 backfill. Claude tier inference remains explicitly low-confidence because local logs do not expose account identity or provider quota facts.
Return no x-axis ticks for an empty viewport so wheel zoom cannot dereference a missing point and leave a stale canvas frame. Verified with focused timeline/dashboard tests and the reproduced browser zoom sequence.
Use GROUPING SETS to compute all usage buckets from one pinned generation scan and share one ordered rate-limit pass between window totals and attribution. Preserve generation and pricing revision semantics; document the guarded frontier for future persistent rollups. Verified by 203 tests and a live 2,877,549-number report comparison.
skuznetsov-clickhouse
approved these changes
Jul 20, 2026
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.
No description provided.