Repository navigation
feat(reports): one JSON envelope across cmduse, ocuse and arkuse - #17
Merged
Merged
Conversation
The three binaries disagreed on the report shape a consumer reads:
daily cmduse lacked source
hourly cmduse lacked total
model cmduse said since, the others sinceMs; cmduse lacked scope
session cmduse said projects, the others sessions
Every envelope now carries the same keys: daily/hourly {scope, source, total,
days|hours}, model {scope, source, since, sinceMs, models}, session both
'sessions' and 'projects' with identical rows. 'since' stays because mpc's
--usage contract reads it; 'sinceMs' is what ocuse/arkuse already emitted, so
both names exist rather than one being renamed out from under a consumer.
Flag, subcommand and MCP-tool parity were already clean; the only divergences
are the source-forced ones the repo documents.
Version 0.7.33.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JeffreyJYZ
approved these changes
Nov 13, 2026
JeffreyJYZ
added a commit
that referenced
this pull request
Nov 13, 2026
The parity work in #17 was enforced by prose and an ad-hoc script. REPORT_*_KEYS in report_render.rs is now the single contract, and each binary asserts its own emitter against it (daily, hourly, model, session), so a key dropped from either side fails all three tests. Mutation-checked: shrinking REPORT_SESSION_KEYS to drop 'projects' fails the cmduse and ocuse tests with the exact left/right key sets, and the suite returns green when restored. Test-only constants, so production code cannot read the contract back and agree with itself. Co-authored-by: Yizhou Jiang <yizhoujiang11@gmail.com>
This branch was successfully deployed
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.
PR #16 merged first, so the dashboard panel is on
main. This closes the remaining axis: the report envelopes.What diverged (measured, after #16)
After
Naming choices, so nothing breaks:
sincestays — mpc's--usagecontract reads{source, since, models}fromcmduse model --json;sinceMsis added beside it rather than replacing it.sessionsandprojectsboth appear onsession --json, identical rows;cmdusespelled itprojectsfirst, ocuse/arkusesessions, so both names exist instead of renaming either.sourcenames the origin (command-code,opencode,local), which is what lets a consumer read one shape.Other axes, already clean
MCP tool arguments differ only where the source forces it (
local,tzon cmduse;planon ocuse/arkuse), andmcp_tests::tool_paramspins that sorted set per binary — 28 tests pass.Gates
Version
0.7.33. The envelope contract is now written intoAGENTS.mdbeside the existing machine-readable-surface rule.