cli-consumption 0.5.0__tar.gz → 0.6.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (118) hide show
  1. cli_consumption-0.6.0/CHANGELOG.md +589 -0
  2. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/PKG-INFO +68 -6
  3. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/README.md +60 -5
  4. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/pyproject.toml +12 -2
  5. cli_consumption-0.5.0/src/cli_consumption/INTER_FONT_LICENSE.txt → cli_consumption-0.6.0/src/cli_consumption/MARTIAN_MONO_FONT_LICENSE.txt +1 -1
  6. cli_consumption-0.6.0/src/cli_consumption/PRICING_DATA_LICENSE.txt +26 -0
  7. cli_consumption-0.6.0/src/cli_consumption/__init__.py +22 -0
  8. cli_consumption-0.6.0/src/cli_consumption/__main__.py +4 -0
  9. cli_consumption-0.6.0/src/cli_consumption/adapters/__init__.py +97 -0
  10. cli_consumption-0.6.0/src/cli_consumption/adapters/_claude_usage.py +180 -0
  11. cli_consumption-0.6.0/src/cli_consumption/adapters/_codex_zstd.py +134 -0
  12. cli_consumption-0.6.0/src/cli_consumption/adapters/_copilot_retry.py +371 -0
  13. cli_consumption-0.6.0/src/cli_consumption/adapters/_copy_selection.py +120 -0
  14. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/_incremental.py +43 -13
  15. cli_consumption-0.6.0/src/cli_consumption/adapters/_kimi_code.py +522 -0
  16. cli_consumption-0.6.0/src/cli_consumption/adapters/_primitives.py +33 -0
  17. cli_consumption-0.6.0/src/cli_consumption/adapters/_session_files.py +117 -0
  18. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/_shared.py +208 -83
  19. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/aider.py +8 -2
  20. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/amazon_q.py +8 -2
  21. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/amp.py +10 -26
  22. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/base.py +5 -3
  23. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/claude.py +165 -152
  24. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/cline.py +16 -12
  25. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/codex.py +411 -50
  26. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/continue_cli.py +17 -31
  27. cli_consumption-0.6.0/src/cli_consumption/adapters/copilot.py +798 -0
  28. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/crush.py +42 -22
  29. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/cursor.py +40 -13
  30. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/gemini.py +33 -15
  31. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/goose.py +18 -4
  32. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/grok.py +123 -68
  33. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/kilo.py +43 -2
  34. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/kimi.py +106 -39
  35. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/mistral_vibe.py +357 -53
  36. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/opencode.py +415 -91
  37. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/openhands.py +265 -74
  38. cli_consumption-0.6.0/src/cli_consumption/adapters/otlp.py +188 -0
  39. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/pi.py +43 -37
  40. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/plandex.py +7 -1
  41. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/adapters/qwen.py +53 -34
  42. cli_consumption-0.6.0/src/cli_consumption/adapters/registry.py +924 -0
  43. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/api.py +212 -29
  44. cli_consumption-0.6.0/src/cli_consumption/block_report.py +409 -0
  45. cli_consumption-0.6.0/src/cli_consumption/budget.py +687 -0
  46. cli_consumption-0.6.0/src/cli_consumption/cli.py +3395 -0
  47. cli_consumption-0.6.0/src/cli_consumption/copy_rank.py +111 -0
  48. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/dashboard.py +502 -58
  49. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/dashboard_layouts.py +54 -18
  50. cli_consumption-0.6.0/src/cli_consumption/dashboard_react.css +2 -0
  51. cli_consumption-0.6.0/src/cli_consumption/dashboard_react.js +9 -0
  52. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/exporting.py +76 -6
  53. cli_consumption-0.6.0/src/cli_consumption/file_parse_cache.py +372 -0
  54. cli_consumption-0.6.0/src/cli_consumption/git_activity.py +795 -0
  55. cli_consumption-0.6.0/src/cli_consumption/git_report.py +308 -0
  56. cli_consumption-0.6.0/src/cli_consumption/insights_report.py +1096 -0
  57. cli_consumption-0.6.0/src/cli_consumption/insights_sql.py +766 -0
  58. cli_consumption-0.6.0/src/cli_consumption/launcher.py +23 -0
  59. cli_consumption-0.6.0/src/cli_consumption/mcp_server.py +470 -0
  60. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0009_replicated_call_keys.py +30 -0
  61. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0010_normalization_version.py +28 -0
  62. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0011_file_parse_cache.py +28 -0
  63. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0012_rate_limit_samples.py +72 -0
  64. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0013_git_commits.py +46 -0
  65. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0014_statusline_quota_observations.py +51 -0
  66. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0015_otlp_metrics.py +85 -0
  67. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0016_metric_client_budgets.py +79 -0
  68. cli_consumption-0.6.0/src/cli_consumption/migrations/versions/v0017_tool_outcomes.py +21 -0
  69. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/models.py +175 -10
  70. cli_consumption-0.6.0/src/cli_consumption/otlp.py +538 -0
  71. cli_consumption-0.6.0/src/cli_consumption/otlp_storage.py +380 -0
  72. cli_consumption-0.6.0/src/cli_consumption/pricing.json +746 -0
  73. cli_consumption-0.6.0/src/cli_consumption/pricing.py +618 -0
  74. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/reporting.py +268 -7
  75. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/reporting_api.py +106 -5
  76. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/retention.py +63 -1
  77. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/schema.py +235 -18
  78. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/snapshot_extraction.py +60 -4
  79. cli_consumption-0.6.0/src/cli_consumption/snapshot_files.py +543 -0
  80. cli_consumption-0.6.0/src/cli_consumption/snapshot_split.py +132 -0
  81. cli_consumption-0.6.0/src/cli_consumption/statusline.py +1181 -0
  82. cli_consumption-0.6.0/src/cli_consumption/statusline_quota.py +83 -0
  83. cli_consumption-0.6.0/src/cli_consumption/storage.py +1356 -0
  84. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/sync.py +38 -3
  85. cli_consumption-0.6.0/src/cli_consumption/terminal_report.py +510 -0
  86. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/timestamps.py +4 -1
  87. cli_consumption-0.6.0/src/cli_consumption/tool_outcomes.py +92 -0
  88. cli_consumption-0.6.0/src/cli_consumption/usage_report.py +950 -0
  89. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/web_runtime.zip +0 -0
  90. cli_consumption-0.5.0/CHANGELOG.md +0 -319
  91. cli_consumption-0.5.0/src/cli_consumption/__init__.py +0 -10
  92. cli_consumption-0.5.0/src/cli_consumption/__main__.py +0 -4
  93. cli_consumption-0.5.0/src/cli_consumption/adapters/__init__.py +0 -45
  94. cli_consumption-0.5.0/src/cli_consumption/adapters/_kimi_code.py +0 -399
  95. cli_consumption-0.5.0/src/cli_consumption/adapters/copilot.py +0 -454
  96. cli_consumption-0.5.0/src/cli_consumption/adapters/registry.py +0 -519
  97. cli_consumption-0.5.0/src/cli_consumption/cli.py +0 -1738
  98. cli_consumption-0.5.0/src/cli_consumption/dashboard_react.css +0 -2
  99. cli_consumption-0.5.0/src/cli_consumption/dashboard_react.js +0 -9
  100. cli_consumption-0.5.0/src/cli_consumption/snapshot_files.py +0 -255
  101. cli_consumption-0.5.0/src/cli_consumption/storage.py +0 -739
  102. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/.gitignore +0 -0
  103. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/LICENSE +0 -0
  104. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/NOTICE +0 -0
  105. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/frontend.py +0 -0
  106. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/__init__.py +0 -0
  107. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/env.py +0 -0
  108. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/__init__.py +0 -0
  109. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/v0001_baseline.py +0 -0
  110. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/v0002_minimize_subagents.py +0 -0
  111. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/v0003_canonical_timestamps.py +0 -0
  112. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/v0004_subagent_scope_freshness.py +0 -0
  113. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/v0005_sync_receipts.py +0 -0
  114. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/v0006_dashboard_layouts.py +0 -0
  115. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/v0007_dashboard_layout_revision.py +0 -0
  116. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/migrations/versions/v0008_cache_write_duration.py +0 -0
  117. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/py.typed +0 -0
  118. {cli_consumption-0.5.0 → cli_consumption-0.6.0}/src/cli_consumption/qualifications.py +0 -0
@@ -0,0 +1,589 @@
1
+ # Changelog
2
+
3
+ Notable user-visible changes to CLI Consumption are documented in this file. The
4
+ format follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/), and releases
5
+ use [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
+
7
+ ## [Unreleased]
8
+
9
+ ## [0.6.0] - 2026-12-05
10
+
11
+ ### Added
12
+
13
+ - Simulate routing a share of model calls in detailed dashboards and offline
14
+ HTML. Show pricing coverage and compare the current and simulated estimates.
15
+ - Show active quota windows and heuristic five-hour activity blocks in the live
16
+ and offline dashboards. Share-safe exports omit the quota snapshot.
17
+ - Show the collector's current calendar budget and observed quota statuses on the
18
+ persistent dashboard, independently of the selected date range or filters.
19
+
20
+ - Report terminal OpenCode 2.x tool outcomes in detailed CLI insights and through
21
+ the authorized reporting API. The failure rate uses calls with a known
22
+ terminal outcome and includes coverage by SQLite projection format.
23
+ - Show the technical tool failure rate and source coverage in the detailed
24
+ persistent dashboard.
25
+ - Add a local `retry-links` command for qualified Copilot CLI permission-recovery
26
+ episodes, with aggregate counts and coverage.
27
+
28
+ - Collect OpenHands Agent Canvas conversations from the local agent server
29
+ store (`~/.openhands/agent-canvas/conversations/` or `OH_CONVERSATIONS_PATH`).
30
+ Usage copied into a fork counts once in reports, even after the source is
31
+ deleted or collected in another batch. Fork usage without a per-call response
32
+ ID, and all usage in ACP forks, is excluded.
33
+ - Publish an authenticated calendar budget status from an explicit
34
+ `serve --budgets-config` file. The collector reports one aggregate status
35
+ for recorded tokens and estimated USD and omits it from share-safe reports
36
+ and exports.
37
+ - Publish an authenticated aggregate quota status for explicitly configured
38
+ Codex source windows and opted-in local Claude Code statusline windows.
39
+
40
+ - Declare which usage insight signals each adapter can report. The dashboard and
41
+ `report insights` can show zero measured events for a supported signal even
42
+ when it has never appeared in storage. Unsupported signals remain unavailable.
43
+
44
+ - Receive authenticated OTLP/HTTP metrics from Claude Code, Codex, and Gemini CLI
45
+ with the optional `otlp` extra. The collector stores bounded counters separately
46
+ from conversations and reports an all-time token total that prefers collected
47
+ files for matching sessions. OTLP activity counters stay separate from git
48
+ history counters. Identity storage defaults to off. The receiver limits new
49
+ rows per rolling minute and rejects stale intervals.
50
+
51
+ - Accept several OTLP metrics tokens, each with a non-secret label set by
52
+ `--metrics-client LABEL=ENV_VAR` or `CLI_CONSUMPTION_METRICS_CLIENTS`. Each
53
+ token has its own rolling write budget, so one client that reaches it gets 429
54
+ without blocking the others. The global storage caps still apply to all
55
+ clients. A token can be revoked by removing its label.
56
+ `CLI_CONSUMPTION_METRICS_TOKEN` keeps working as the `default` client. Database
57
+ revision `0016` adds the client label to the budget table.
58
+
59
+ - Collect content-free git commit counters (commits, added and deleted lines, files
60
+ changed) from repositories selected with `--git-repo` or `--git-activity` on
61
+ `collect`, `snapshot create`, and `sync`, and correlate them with token usage and
62
+ estimated cost per project and day in `report git`. Commit identifiers, messages,
63
+ file names, branches, and remote URLs are never stored; commits are filtered to the
64
+ local `user.email` by default, deduplicated across clones by a truncated
65
+ fingerprint, and authors are stored only with `--git-identity hmac|raw`. Snapshot
66
+ schema 7 and database revision `0013` carry the counters; upgrade collectors first.
67
+
68
+ - `report insights` and a dashboard **Usage insights** widget derive cache read rates
69
+ (by model and project, low-cache sessions), compactions per 100 turns with a weekly
70
+ trend, high context pressure, aborted turns, failed work items, repeated tool runs,
71
+ and subagent token share from stored metadata, with documented definitions. A
72
+ provider that never records a signal shows `n/a`, never zero. `--route-from`,
73
+ `--route-to`, and `--route-share` add a routing what-if at public list prices. The
74
+ indicators are correlations, not a measure of quality, productivity, or billing.
75
+
76
+ - `statusline` prints one Claude Code status line in well under 100 ms: session and
77
+ daily Claude Code tokens, cache rate, estimated cost, and the quota windows that
78
+ Claude Code passes on stdin. It reads the database read-only plus a bounded tail of
79
+ the current session transcript and never echoes text from stdin. Add
80
+ `--record-quotas` to save local five-hour, seven-day, and gateway spend observations
81
+ for `report blocks`. These expire after 90 days and stay out of snapshot and sync.
82
+
83
+ - Serve bounded usage and public list-price cost estimates over MCP stdio with
84
+ `cli-consumption[mcp]`. The server opens an existing SQLite database read-only
85
+ and supports `--share-safe` label pseudonyms.
86
+
87
+ - Check daily, weekly, or monthly token and estimated USD budgets with
88
+ `budget check`. Local JSON rules can target providers, projects, and models.
89
+ Stable exit codes support automation, and share-safe output shows the overall
90
+ status without per-rule details.
91
+
92
+ - Record Codex quota window observations without account identifiers, and show active
93
+ quota windows alongside clearly marked five-hour activity blocks in `report blocks`.
94
+ Snapshot schema 6 transfers the new observations.
95
+
96
+ - Reuse unchanged eligible provider-file parses during local SQLite collection.
97
+ `collect --full` forces a fresh parse.
98
+ - `report daily|weekly|monthly|session` prints token usage tables from the database
99
+ without collecting. It supports `--since`, `--until`, `--timezone`, repeated
100
+ `--provider`, `--project`, `--machine`, and `--model` filters, `--by
101
+ model|provider|project|machine` breakdowns, `--share-safe` pseudonyms, and a
102
+ versioned deterministic `--json` contract. Unavailable token counters display as
103
+ `n/a`, and conversation-aggregate or context-snapshot counters are flagged.
104
+ - `quick` collects every detected provider into the default database, then prints the
105
+ daily report, for a one-command first run.
106
+ - `report` and `report --json` show an estimated cost at public API list prices per
107
+ row and total, with the pricing currency and version. Calls are priced from a
108
+ versioned price table bundled with the package (uncached input, cache reads,
109
+ five-minute and one-hour cache writes, output, reasoning, and long-context tiers);
110
+ unknown models and non-additive token semantics display as `n/a`. Every output
111
+ states that the value is an estimate, not an invoice. `--pricing PATH` merges a
112
+ strictly validated local override file.
113
+ - The offline and online dashboards, the reporting API, and CSV exports show the same
114
+ estimated cost: a headline metric, a daily calendar metric, breakdowns by provider,
115
+ project, and model, and a per-conversation column, each labelled as an estimate at
116
+ public API list prices with its pricing version. The dashboard dataset adds optional
117
+ `meta.pricing`, per-call `estimatedCost`, and per-conversation `estimatedCost`,
118
+ `pricedCalls`, and `unpricedCalls` fields within contract version 1;
119
+ `model_calls.csv` adds `estimated_cost` and the pricing currency and versions.
120
+ `export --pricing PATH` applies a local override. Unpriced values show as `n/a`,
121
+ never zero, and partial sums are flagged.
122
+
123
+ ### Changed
124
+
125
+ - Redesign both dashboards (persistent and offline) around one headline band: total
126
+ tokens for the selected period beside a daily trend with its peak labelled, then
127
+ estimated cost, closed turns, active days and conversations with a neutral change
128
+ against the previous period of equal length, then a dense readout of secondary
129
+ measurements. The period and its comparison window are always named. Sections are
130
+ numbered, panel notes are shortened, charts gain exact-value tables, and the light
131
+ and dark palettes are revalidated for contrast and colour-vision deficiency. The
132
+ bundled font is now Martian Mono (SIL OFL 1.1, four subsets), which roughly halves
133
+ the offline stylesheet; dashboards still make no network requests. Both follow the
134
+ system light or dark preference until a theme is chosen, including the sign-in
135
+ page. Both dashboards apply one comparison rule: a change is shown only against
136
+ a previous period that has conversations and, in a bounded offline export, lies
137
+ inside the exported window; a cost change also needs both periods fully priced.
138
+ Long periods are drawn per UTC week or month, and the token series shares the
139
+ headline trend's axis. Each chart takes the form that fits its data: the token
140
+ mix is a ring with its total at the centre, turn outcomes a completion gauge,
141
+ context pressure one 0–100% track with its median and p95, the overall token
142
+ series and the weekly compaction trend dotted lines with their values written,
143
+ and the activity calendar fills each level to its own height. A period with a
144
+ single bound reads "from 3 Aug 2026" or "until 16 Aug 2026" rather than "All
145
+ history"; offline, an open end stops at the export's end and shows no comparison,
146
+ and a period that misses the export entirely keeps the dates entered and reads
147
+ "outside the export" with the export's dates, never an invented day. The token
148
+ mix adds a hatched "Unattributed" sector when a provider reports tokens it does
149
+ not split, so the ring's total equals the headline total.
150
+ Long row labels wrap instead of widening tables. The context pressure gauge keeps
151
+ its track and p95 tick in forced colours, marks a value above 100% at the end of
152
+ its track, and keeps its labels inside the track at any width; both gauges are
153
+ drawn as inline SVG with their numbers in HTML. A token share is never written as
154
+ 0% or 100% while another counter is non-zero. Token counts outside the detail
155
+ tables read compactly in three significant digits ("4.56M", "124k"), with the
156
+ exact count in their title and accessible text. Activity and Cohorts span the full width by default, and
157
+ narrow screens get conversation cards and sideways-scrolling tables. After a
158
+ failed reload, the persistent dashboard no longer shows, explores or exports a
159
+ selection that the filters no longer describe. `npm run check:contrast` measures
160
+ every painted colour pair in both themes against WCAG AA and runs in
161
+ `npm run verify` (G1L-911).
162
+
163
+ - `report insights` computes its indicators with SQL aggregates on SQLite and
164
+ PostgreSQL instead of loading the dashboard dataset, so a year of history no longer
165
+ hits the 250,000-record or 128 MiB selected-value limit and needs no `--since`.
166
+ Values are unchanged, including `n/a` coverage, replica exclusion, share-safe
167
+ aliases, and the routing what-if. Memory follows selected conversations and model
168
+ and project names rather than records (about 100 MiB and 2 s for 310,000 records);
169
+ only the 128 MiB index limit remains (G1L-908).
170
+ - Mistral Vibe collection honors `MISTRAL_VIBE_SESSION_ROOT`, links subagent
171
+ conversations to their parents, and diagnoses unsupported Unified log layouts.
172
+ - Grok Build, Kimi, Mistral Vibe, and OpenHands switch to bounded batches when a
173
+ store exceeds an aggregate limit or holds an oversized file, like the other
174
+ session-file providers. Their duplicate copies are now selected with the storage
175
+ rank, so a whole collection, batches, `sync`, and signed snapshots keep the same
176
+ copy. Kimi Code relationships now follow their child conversation copy, and Kimi
177
+ normalization version 2 refreshes stored copies whose project differs. Malformed
178
+ records of losing duplicate copies are counted.
179
+
180
+ ### Fixed
181
+
182
+ - Keep the dashboard's last budget statuses during a busy collector refresh, and
183
+ clear them across dashboard tabs when one detects session loss (G1L-924).
184
+ - Reuse authenticated collector budget and quota statuses for 30 seconds, bound
185
+ Codex quota history reads to the configured windows, and warn when the budget
186
+ endpoint has no read credential (G1L-921).
187
+ - Dashboard exports handle replicated token totals above BIGINT on SQLite and
188
+ PostgreSQL while preserving exact subtraction below the limit (G1L-912).
189
+ - `report insights` names the selection limit it exceeds (250,000 records, an
190
+ estimated 128 MiB of selected values, or the 128 MiB identifier and label index) and
191
+ suggests `--since` / `--until`, instead of blaming share-safe labels when share-safe
192
+ mode is off. Other `report --share-safe` views name the alias index limit. With
193
+ `--json`, `report_limit_exceeded` now also carries `limit` and `hint` (G1L-907).
194
+ - Git activity collection now parses the bounded prefix when a single pipe read exceeds
195
+ the byte limit, instead of discarding it and reporting zero commits (G1L-906).
196
+ - Kimi Code sessions imported from kimi-cli, Claude Code, or Codex now count the
197
+ usage, turns, and tools produced after the import. The imported history is still
198
+ excluded, so the original session is never counted twice. Kimi normalization
199
+ version 3 refreshes stored copies. Forks of imported sessions remain excluded.
200
+ - Kimi Code forks now count only the usage, turns, and tools recorded after their
201
+ last `forked` marker, so history copied from the source session, or from an
202
+ earlier fork, is no longer counted twice. Forks of imported sessions are counted
203
+ the same way instead of being skipped. Kimi normalization version 4 refreshes
204
+ stored copies (G1L-900).
205
+
206
+ - Exclude copied Kilo Code fork history from usage and turn counts while keeping
207
+ the original session ID and any new activity in the fork.
208
+
209
+ - Ignore Grok Build interjection chunks when reconstructing user turns.
210
+
211
+ - Count visible Goose prompts consisting only of a document as user turns.
212
+
213
+ - Pair Cursor CLI chat metadata discovered under `XDG_CONFIG_HOME` with transcripts
214
+ from the independent data directory, even when the chat store has a nested
215
+ directory named `projects`.
216
+
217
+ - Discover Pi journals in Pi's workspace directories so Codex rollouts and
218
+ unrelated session directories no longer generate Pi malformed-record warnings.
219
+
220
+ - Copilot CLI collection restores linked journal archives under one session ID
221
+ and excludes replayed activity from usage totals.
222
+ - Count OpenCode title and generate usage recorded in SQLite events. Discover
223
+ channel databases and honor `OPENCODE_DB` during local discovery.
224
+
225
+ - Discover relocated provider stores from documented directory environment
226
+ variables. Report unavailable overrides without exposing paths or interrupting
227
+ discovery of other providers.
228
+
229
+ - Align all-history terminal, dashboard, and model-call CSV totals, including tokens
230
+ already recorded in open turns and calls with no timestamp.
231
+
232
+ - Skip non-regular provider files, including FIFOs and direct symlinks, so regular
233
+ files can still be collected.
234
+
235
+ - `sync` and `snapshot create` read large provider stores in bounded, restart-safe
236
+ batches like `collect`, instead of failing with `provider_limit_exceeded`. `sync`
237
+ keeps each request within the collector's advertised size; `snapshot create` writes
238
+ numbered signed files when one file cannot hold everything, and `snapshot ingest`
239
+ accepts them and refuses incomplete, mixed, or renamed sets. Batched transfers never replace the collector's Codex subagent graph.
240
+ Snapshot schema 5 adds the `partial` flag; upgrade collectors before clients.
241
+ - Batched collection skips and counts only a file over a per-file size limit instead
242
+ of failing the whole provider; `--strict` still refuses it.
243
+ - `providers --json` (schema 3) inspects large stores in batches, so they are no longer
244
+ reported as `degraded`. A new `oversized` status and an `issues` list distinguish
245
+ skipped oversized files from malformed records and inspection failures.
246
+
247
+ - Recollect available transcripts to refresh stored usage when an adapter's
248
+ normalization changes. This applies the Qwen reasoning and Claude replicated-call
249
+ fixes to existing databases while keeping history for expired transcripts.
250
+ Upgrade central collectors before schema-4 clients.
251
+
252
+ - Claude Code responses copied into resumed or forked sessions are counted once in
253
+ reports, dashboards, and CSV exports, whatever the collection order or machine.
254
+ Snapshot schema 3 and database revision `0009` add an internal per-call digest of
255
+ the response identifiers; existing rows are counted as before until an unchanged
256
+ session is collected again. Upgrade the collector before clients.
257
+ - Codex usage copied by a forked session, or re-emitted after a rate-limit update or a
258
+ compaction, is counted once in reports, dashboards, and CSV exports. Compaction
259
+ context estimates are no longer counted as tokens. The Codex normalization version
260
+ becomes 2, so the next collection renormalizes stored Codex sessions whose rollout
261
+ is still available with at least as many events; other rows are counted as before.
262
+ No schema change is needed.
263
+ - Codex collection reads Zstandard-compressed session rollouts in both active and
264
+ archived stores, with bounded decompression and deduplication across formats.
265
+ - Copies with the same event count can refresh stored usage when they contain newer
266
+ activity or more complete counters, including settled OpenCode compactions.
267
+ - Qwen Code counts reasoning tokens once when completion usage already includes them.
268
+ - Claude Code subagent relationships survive transcript cleanup and are recorded as
269
+ soon as their child conversations are collected, including in batches.
270
+ - Collection accepts transcripts with out-of-order turn timestamps and leaves
271
+ inconsistent turn ends and durations unknown.
272
+ - Codex collection now also reads `archived_sessions/` in each Codex home, flat or
273
+ nested, under the same limits and in batched collection. Archived conversations
274
+ were previously missed after Codex moved them out of `sessions/`; they keep their
275
+ conversation IDs and subagent relationships, and a copy present in both locations
276
+ converges to the most complete one.
277
+
278
+ ## [0.5.0] - 2026-12-03
279
+
280
+ ### Added
281
+
282
+ - The `kimi` provider now collects Kimi Code 2.x model calls, tokens, turns, tools,
283
+ compactions, and subagents from the local Wire 1.5 store alongside legacy sessions.
284
+ Sessions imported from other CLIs are skipped.
285
+ - OpenCode 2.x stores (`session_v2`, `session_message`, `session_part`) are collected;
286
+ on upgraded databases the 2.x copy of a session replaces its frozen 1.x copy, forked
287
+ history is not counted twice, and compaction usage is counted once.
288
+ - Mistral Vibe 3.x unified sessions (`logs/session/unified/`) are collected alongside
289
+ 2.x sessions. Resumed imports contribute their post-migration usage, and the saved
290
+ projection supplies totals when the listing cache is missing or behind. Sessions
291
+ imported from other tools are skipped.
292
+ - Pi `usage` entries (cache keep-alive and extension-reported requests) count as model
293
+ calls.
294
+
295
+ ### Fixed
296
+
297
+ - Gemini CLI `$patch` history records are applied, so removed messages are no longer
298
+ counted.
299
+ - Cline sessions imported from other CLIs and display-only error banners are no
300
+ longer counted.
301
+ - Crush subagent reports and hidden continuations no longer open user turns.
302
+ - Copilot replayed `checkpoint` records are ignored; Cursor subagent stores no longer
303
+ appear as separate conversations.
304
+ - Grok turns closed as interrupted on session reopen are marked aborted without an
305
+ inflated duration.
306
+ - Claude Code collection now includes subagent transcripts under
307
+ `<session>/subagents/` and legacy `agent-*.jsonl` files as separate conversations
308
+ linked to their parent session. Their tokens were previously ignored, and a legacy
309
+ agent file could replace its parent session during duplicate selection. Sidechain
310
+ replays of parent responses are not counted twice.
311
+ - Claude Code collection now counts reasoning tokens from
312
+ `output_tokens_details.thinking_tokens` as a bounded subset of output, records each
313
+ advisor sub-inference from `usage.iterations` as its own model call under the
314
+ advisor model, and keeps the provider-reported one-hour cache-write share. Advisor
315
+ tokens were previously ignored. Already stored conversations are recounted only when
316
+ a more complete copy of their transcript is collected.
317
+ - Claude Code and Codex collection now reads each provider file once instead of twice,
318
+ so the aggregate 512 MiB read limit applies to the actual store size and the
319
+ selected copy is no longer parsed a second time. Only the normalized records of the
320
+ most complete copy of each conversation are retained between files.
321
+
322
+ ### Changed
323
+
324
+ - All 21 provider qualifications were rechecked against current upstream releases
325
+ on 2026-12-03 (see the qualification ledger).
326
+
327
+ - `collect` now switches automatically to bounded, restart-safe batches when an
328
+ incremental-capable provider exceeds the aggregate candidate, provider-read, or
329
+ normalized-record limit, instead of failing with `provider_limit_exceeded`. Pass
330
+ `--no-incremental` to keep the previous all-or-nothing failure. Only the
331
+ overflowing provider is batched; JSON output reports `"incremental": true`,
332
+ `"incremental_trigger": "automatic"`, and a per-provider `"batched"` flag.
333
+ `--incremental` still forces batches and now reports
334
+ `"incremental_trigger": "requested"`.
335
+ - Bounded incremental collection now covers Claude Code, Amp, Continue CLI, Gemini
336
+ CLI, Pi, and Qwen Code in addition to Codex. Claude Code batches keep every
337
+ transcript that shares a session identity, across sources and project
338
+ directories, in one batch, so batched results equal one collection, including
339
+ replayed parent responses, and subagent relationships converge instead of being
340
+ skipped. Per-file, per-line, symlink, and single-conversation limits are
341
+ unchanged, and one command is still capped at 10,000 batches.
342
+ - Snapshot schema 2 and database revision `0008` add an optional per-model-call
343
+ `cache_write_1h_input_tokens` counter: the one-hour share of cache-write input, null
344
+ when a provider reports no duration breakdown. Collectors accept schemas 1 and 2;
345
+ clients send schema 2, so upgrade the collector before its clients. The counter is
346
+ stored for cost estimation and is not yet included in dashboards or CSV exports.
347
+
348
+ ### Security
349
+
350
+ - Update the bundled dashboard to Next.js 16.5.0 and patch vulnerable web
351
+ development dependencies.
352
+ - Patch msgpack, certifi, filelock, and virtualenv in the Python lockfile.
353
+ - Update the persistent dashboard to Next.js 16.3.8 and refresh vulnerable web
354
+ dependencies; use Parcel watcher 2.6.0 to remove the unpatched braces dependency
355
+ from the Tailwind build toolchain. Rebuild the bundled dashboard runtime.
356
+ - Refresh vulnerable urllib3 and virtualenv development dependencies in the Python
357
+ lockfile.
358
+
359
+ ## [0.4.5] - 2026-09-11
360
+
361
+ ### Added
362
+
363
+ - `serve --front` now launches the FastAPI service and a bundled production Next.js
364
+ dashboard from the Python distribution, without requiring a repository checkout or
365
+ npm installation at runtime.
366
+
367
+ ## [0.4.4] - 2026-09-08
368
+
369
+ ### Fixed
370
+
371
+ - Mistral Vibe now counts each persisted assistant message as a model call while
372
+ retaining cumulative session tokens as one unsplit aggregate.
373
+
374
+ ## [0.4.3] - 2026-09-05
375
+
376
+ ### Added
377
+
378
+ - Added opt-in `collect --incremental` automatic bounded batching for large Codex
379
+ stores, with restart-safe ingestion, strict metadata-only preflight staging,
380
+ deterministic duplicate convergence, privacy-safe partial results, and unchanged
381
+ per-file and per-line safety limits; authoritative subagent graphs remain untouched.
382
+
383
+ ## [0.4.2] - 2026-09-05
384
+
385
+ ### Added
386
+
387
+ - Added reviewed autonomous web exports that freeze the visible dashboard layout,
388
+ bounded selection, privacy profile, and theme into a CSP-locked standalone file while
389
+ preserving query-only API and CLI export compatibility.
390
+ - Added the provider-neutral `DashboardLayout v1` contract, a bounded widget registry,
391
+ deterministic defaults and retired-widget recovery, plus SQLite/PostgreSQL
392
+ persistence for the single authenticated dashboard operator.
393
+ - Added an explicit, accessible dashboard edit mode with bounded undo/redo, deterministic
394
+ placement, and ETag/`If-Match` conflict protection for concurrent save and reset.
395
+
396
+ ## [0.4.1] - 2026-09-01
397
+
398
+ ### Changed
399
+
400
+ - Refined the persistent and offline dashboards with a compact side-by-side title
401
+ treatment, borderless page-colored cards, quieter spacing, and fewer decorative
402
+ effects across desktop and mobile layouts.
403
+
404
+ ## [0.4.0] - 2026-09-01
405
+
406
+ ### Added
407
+
408
+ - Added a blocking browser CI gate that opens detailed and share-safe dashboards
409
+ directly from `file://`, exercises their controls, and rejects network activity.
410
+ - Defined the versioned, scoped, and bounded contracts for database upload, persistent
411
+ dashboard reporting, conversation pagination, and standalone web export.
412
+ - Added read-only, migration-free extraction of bounded snapshot-schema-v1 payloads
413
+ from current local SQLite collection databases, including WAL-consistent reads,
414
+ exact schema verification, provider grouping, and privacy-safe failures.
415
+ - Added `upload-db` with stable per-snapshot replay keys, required capability
416
+ negotiation, bounded retries, deterministic partial results, resumable uploads, and
417
+ strict fail-fast automation.
418
+ - Added scoped `read` and `export` bearer credentials plus strict, bounded reporting
419
+ endpoints for dashboard datasets, filter options, opaque stable pagination,
420
+ conversation detail, and self-contained HTML downloads.
421
+ - Added a locked TypeScript workspace with versioned dashboard contracts, pure shared
422
+ analytics, presentation helpers, Vitest parity coverage, ESM output, and a
423
+ reproducible network-free browser bundle included in Python wheels.
424
+ - Added an authenticated responsive Next.js dashboard with a server-only collector
425
+ credential, bounded reporting BFF, URL-safe filters, conversation pagination and
426
+ detail, shared analytics, accessibility checks, and desktop/mobile browser coverage.
427
+ - Replaced the classic offline renderer with the self-contained React/Tailwind runtime,
428
+ shared web primitives, streamed bounded dataset injection, reproducible packaged
429
+ assets, and detailed/share-safe `file://` browser coverage. The temporary
430
+ `--renderer` migration option was removed.
431
+ - Added persistent-dashboard offline downloads for the exact visible selection, with
432
+ detailed/share-safe profiles, a credential-isolating bounded BFF, private temporary
433
+ cleanup, fixed failures, and self-contained browser coverage.
434
+
435
+ ## [0.3.3] - 2026-08-31
436
+
437
+ ### Added
438
+
439
+ - Added deterministic, compressed offline snapshot files authenticated with Ed25519,
440
+ with bounded verification-before-parsing and idempotent SQLite/PostgreSQL ingestion.
441
+
442
+ ### Fixed
443
+
444
+ - Continue now applies provider-specific cache semantics, preventing Anthropic cache
445
+ reads and writes from being omitted from input totals, and reports persisted
446
+ conversation-compaction markers.
447
+ - Codex now preserves valid token accounting when provider counters are inconsistent,
448
+ keeps partial work and compaction records from referencing nonexistent turns, and
449
+ safely handles malformed metadata and timestamps.
450
+ - OpenCode now rejects timezone-naive text timestamps consistently while retaining its
451
+ OpenCode 1.18.23 message/part extraction for models, tokens, and tools.
452
+
453
+ ## [0.3.2] - 2026-08-31
454
+
455
+ ### Changed
456
+
457
+ - Version releases now attach the validated wheel and source distribution to an
458
+ automatically generated GitHub Release after PyPI publication succeeds.
459
+
460
+ ### Fixed
461
+
462
+ - OpenCode 1.18.23 SQLite stores now extract model calls and token usage from
463
+ `message.data` and tool calls from `part.data`; incomplete current schemas are
464
+ reported as incompatible instead of silently producing zero usage.
465
+
466
+ ## [0.3.1] - 2026-08-31
467
+
468
+ ### Changed
469
+
470
+ - Python 3.11 is now supported and tested alongside Python 3.12, 3.13, and 3.14.
471
+ - Collection errors now distinguish provider limits, incompatible formats, invalid
472
+ snapshots, and unexpected adapter failures with privacy-safe human messages and
473
+ deterministic JSON codes.
474
+ - A pinned, privacy-preserving single-host production deployment example now covers
475
+ the central collector, PostgreSQL, and automatic TLS proxy operations.
476
+ - The README now leads with a reproducible synthetic dashboard preview and routes
477
+ operational and provider-qualification detail to dedicated guides.
478
+ - CI now performs scheduled Python security, locked dependency, and offline workflow
479
+ audits; third-party actions are pinned to immutable commits with least privileges.
480
+ - Provider adapters now carry auditable format qualification metadata backed by
481
+ synthetic fixtures, with a weekly check that flags qualifications older than 90
482
+ days and homogeneous privacy-minimized compatibility criteria.
483
+ - Linear is now the source of truth for new repository tasks and their progress, while
484
+ the roadmap remains focused on durable product direction.
485
+ - Dashboard token totals now include conversation aggregates and latest-context
486
+ snapshots for conversations overlapping the selected period, with explicit labels
487
+ distinguishing them from additive usage.
488
+ - Dashboard selection, period, aggregation, percentile, and comparison calculations
489
+ now use an independently tested JavaScript contract embedded in the offline report.
490
+ - Each detailed CSV export now uses a synchronized temporary file and atomic
491
+ replacement, preserving that table's previous file when generation fails early.
492
+ - Multi-provider sync now reuses one HTTP client, negotiates capabilities once, and
493
+ performs bounded idempotent retries when the collector advertises replay receipts.
494
+ - Sync automation now supports strict preflight refusal and deterministic JSON with
495
+ malformed/duplicate diagnostics, explicit partial success, and generic remote
496
+ errors that do not expose response or provider content.
497
+
498
+ ### Fixed
499
+
500
+ - Reject timezone-naive provider timestamps instead of interpreting them in the host
501
+ timezone.
502
+
503
+ ## [0.3.0] - 2026-08-29
504
+
505
+ ### Added
506
+
507
+ - Added privacy-safe database readiness checks and bounded request correlation for the
508
+ collector service ([#35]).
509
+
510
+ ### Changed
511
+
512
+ - Provider input processing now enforces cumulative discovery, byte, SQLite row, and
513
+ structured-field limits across a complete collection ([#31]).
514
+ - Dashboard generation now preflights bounded selections, streams its output, and
515
+ atomically replaces an existing report only after a successful write ([#32]).
516
+ - Concurrent schema initialization, upgrade, and downgrade are now serialized on
517
+ SQLite and PostgreSQL, with SQLite lock waits capped at 15 seconds ([#34]).
518
+ - Published source distributions exclude repository-only tests and automation while
519
+ retaining release metadata, the changelog and README, license notices, the runtime
520
+ package, and Hatchling's rebuild `.gitignore` ([#33]).
521
+ - Identical adapter primitives are shared while provider-specific parsing semantics
522
+ remain isolated ([#36]).
523
+
524
+ ### Fixed
525
+
526
+ - Older, identical, graph-only, and partially stale snapshots can no longer erase a
527
+ newer subagent relationship graph ([#30]).
528
+
529
+ ## [0.2.1] - 2026-08-29
530
+
531
+ ### Changed
532
+
533
+ - Hardened ingestion privacy and normalized persisted timestamps to canonical,
534
+ fixed-width UTC values ([#29]).
535
+
536
+ ## [0.2.0] - 2026-08-29
537
+
538
+ ### Added
539
+
540
+ - Added versioned SQLite and PostgreSQL schema migrations, retention previews, and a
541
+ metadata-only central collector and synchronization client ([#28]).
542
+ - Added streamed CSV exports, time-window selection, and a share-safe dashboard
543
+ profile ([#28]).
544
+
545
+ ### Changed
546
+
547
+ - Strengthened snapshot validation, transport defaults, storage deduplication, and
548
+ privacy regression coverage ([#28]).
549
+
550
+ ## [0.1.1] - 2026-08-27
551
+
552
+ ### Added
553
+
554
+ - Added the Mistral Vibe CLI adapter ([#27]).
555
+
556
+ ## [0.1.0] - 2026-08-27
557
+
558
+ ### Changed
559
+
560
+ - Refreshed the provider guide for the first minor release ([#26]).
561
+
562
+ [Unreleased]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.6.0...HEAD
563
+ [0.6.0]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.5.0...v0.6.0
564
+ [0.5.0]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.4.5...v0.5.0
565
+ [0.4.5]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.4.4...v0.4.5
566
+ [0.4.4]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.4.3...v0.4.4
567
+ [0.4.3]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.4.2...v0.4.3
568
+ [0.4.2]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.4.1...v0.4.2
569
+ [0.4.1]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.4.0...v0.4.1
570
+ [0.4.0]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.3.3...v0.4.0
571
+ [0.3.3]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.3.2...v0.3.3
572
+ [0.3.2]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.3.1...v0.3.2
573
+ [0.3.1]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.3.0...v0.3.1
574
+ [0.3.0]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.2.1...v0.3.0
575
+ [0.2.1]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.2.0...v0.2.1
576
+ [0.2.0]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.1.1...v0.2.0
577
+ [0.1.1]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.1.0...v0.1.1
578
+ [0.1.0]: https://github.com/Guillaume-Lombardo/cli-consumption/compare/v0.0.18...v0.1.0
579
+ [#26]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/26
580
+ [#27]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/27
581
+ [#28]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/28
582
+ [#29]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/29
583
+ [#30]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/30
584
+ [#31]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/31
585
+ [#32]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/32
586
+ [#33]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/33
587
+ [#34]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/34
588
+ [#35]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/35
589
+ [#36]: https://github.com/Guillaume-Lombardo/cli-consumption/pull/36