Repository navigation
test(reports): pin the shared JSON envelope on all three binaries - #18
Merged
Merged
Conversation
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.
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
JeffreyJYZ
approved these changes
Nov 13, 2026
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 #17 merged first (
8527474), so the envelope fixes are onmain. This adds the missing enforcement: parity was pinned by prose and a/tmpscript, not by a test.The contract
REPORT_*_KEYSincmduse/src/report_render.rs:Each binary now has
report_json_envelopes_are_the_shared_contract, asserting its own emitters against those constants:cmduse:table,hourly_table,model_table,project_tableocuse:bucket_text(day + hour),model_report,session_textarkuse: same three buildersMutation check (the test proves it bites)
Dropping
projectsfromREPORT_SESSION_KEYS:Restored →
3 passed; 207 filtered out.Gates
The constants are
#[cfg(test)]on purpose: production code must not read the contract back and agree with itself.Binaries built from merged
main, all four reports