Repository navigation
Native-data snapshot: read token reports up to their documented embedded size - #373
Merged
seathatflowsinourveins merged 1 commit intoSep 26, 2026
Merged
Conversation
|
You have reached your Codex usage limits for code reviews. You can see your limits in the Codex usage dashboard. |
…ded size The token report embeds its returned-results attachments (at most 16 MiB in total) twice: as base64 and as JSON-escaped text. A valid report therefore passed the snapshot's 16 MiB read bound on the workstation (40.5 MB), every report-derived savings row went unknown, and u2's host apply refused to deploy. The bound becomes 128 MiB, derived from the token report's own constants: base64 at 4/3 plus escaped text at up to 6 bytes per byte. One test pins that relationship; another projects a report larger than 16 MiB. Review round (GPT-6): Resolve the GPT-6 round: the report bound is a consumer ceiling, boundary-tested - snapshot.py and README: 128 MiB is an explicit consumer ceiling, not a producer maximum. The token report bounds only its attachments (16 MiB, up to about 117 MiB once embedded twice); its other sections are unbounded. A larger report stays unavailable and its rows unknown. The README's stale 16 MiB line is corrected. - tests: the arithmetic test drops its unsupported 4 MiB allowance. A new boundary test shows the ceiling is inclusive and that one byte more keeps the rows unknown. Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
seathatflowsinourveins
force-pushed
the
claude/native-data-report-limit-20260926
branch
from
September 26, 2026 23:04
9d88126 to
213f262
Compare
seathatflowsinourveins
deleted the
claude/native-data-report-limit-20260926
branch
September 26, 2026 23:18
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.
Summary
The native-data snapshot (G2, #365) rejected the workstation's token report as
unavailable_or_invalid_report. All four report-derived savings rows therefore stayedunknown, and u2's host apply refused to deploy ("ERROR: a preflight row is unknown").Root cause.
content_base64and as a JSON-escapedtextcopy (tools/token-report/token_manifest.py:386-392).tools/token-report/README.md;RETURNED_RESULTS_TOTAL_LIMIT). Its other sections are not bounded.additional_evidence.returned_results(650 records). The snapshot read at most 16 MiB of the whole report.Fix.
REPORT_LIMITbecomes 128 MiB. This is an explicit consumer ceiling, not a producer maximum: it sits above the attachments' worst embedded size, about 117 MiB (base64 at 4/3 plus escaped text at up to 6 bytes per control byte, RFC 8259 §7).Verification
tests.test_native_dashboard_dataruns 41 tests OK.test_report_limit_covers_the_token_reports_embedded_attachment_totalpins the ceiling above the attachments' worst case, computed fromtoken_manifestconstants.test_report_beyond_the_attachment_total_still_projects_its_rowsrunscollect()on a report larger than 16 MiB.test_report_ceiling_is_inclusive_and_a_larger_report_stays_unknownpatches the ceiling: a report of exactly the ceiling is read; one byte more givesunavailable_or_invalid_reportand unknown rows.scripts/validate.pyFAILS=0.ff4f69dcb5a37ca4, unchanged across both runs.u2-p2/apply.sh --dry-runon main4a32e646(the live clone) exits 1.--dry-run --repository <this branch>exits 0.~, and the scratch path with<scratch>:Before: main 4a32e64, exit 1
After: this branch, exit 0
/usr/bin/time -v python3 -c 'json.loads(...)': 0.43 s wall and 260 MiB maximum RSS.native-data.timer.example:OnUnitActiveSec=2min), withTimeoutStartSec=90and no memory limit.Scope and residuals
nativeandcoverage_matrixonly, would avoid parsing the attachments every 2 minutes. That is a producer change, not done here.2994a725and found 2 mediums and 2 lows. All four hold, and9d88126eresolves them:SOTA sources
tools/token-report/README.md("Limits are 2 MiB per attachment and 16 MiB total") andtools/token-report/token_manifest.py:323-324and:386-392at4a32e646: the producer's documented embedding.\u00XX.jsondocumentation (docs.python.org/3/library/json.html):ensure_ascii=Falsestill escapes control characters.🤖 Generated with Claude Code