Skip to content

Codex/monthly cost token flow mode - #1

Merged
skuznetsov-clickhouse merged 8 commits into
mainfrom
codex/monthly-cost-token-flow-mode
Jul 20, 2026
Merged

Codex/monthly cost token flow mode#1
skuznetsov-clickhouse merged 8 commits into
mainfrom
codex/monthly-cost-token-flow-mode

Conversation

@skuznetsov

Copy link
Copy Markdown
Collaborator

No description provided.

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
skuznetsov-clickhouse merged commit 9b58aa6 into main Jul 20, 2026
@skuznetsov-clickhouse
skuznetsov-clickhouse deleted the codex/monthly-cost-token-flow-mode branch July 30, 2026 16:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants