fix: enforce graph limit on canonical stream - #307
Conversation
Codex Review SummaryThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 54dbee7656
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| if not estate.graph.is_file(): | ||
| raise ValueError(f"{estate.graph}: graph artifact does not exist") | ||
| prefix = read_metadata_prefix(estate.graph, maximum) | ||
| sizes = [int(match.group(1)) for match in BYTE_SIZE.finditer(prefix)] |
There was a problem hiding this comment.
Validate the graph metadata before calculating ratios
When an estate path contains malformed JSON, an unsupported graph schema, or any non-file metadata with a matching "byteSize":<digits> token, this raw regex scan silently counts those tokens as admitted files and emits a seemingly valid compass.qualification.graph-size-ratios/1 report with incorrect totals. Parse and validate the bounded graph metadata object, then sum only its typed files inventory before publishing qualification evidence.
AGENTS.md reference: AGENTS.md:L86-L89
Useful? React with 👍 / 👎.
Summary
COMPASS_MAX_GRAPH_BYTESagainst bytes actually emitted by canonical full and delta publication pathsQualification
The combined five-estate root rebuilt successfully under the unchanged 2 GiB limit: 4,953 indexed files, 217,518 nodes, 344,681 edges, and a 531,544,948-byte canonical graph.
Measured graph/source ratios: 0.048637x minimum, 0.556460x median, and 7.749607x maximum. This evidence is diagnostic and is not used as a publication predictor.
Verification
cargo test -p compass-cli --test '*' --locked(new limit tests pass; two unrelated existing history cases fail:diff_emits_semantic_text_json_html_and_rejects_removed_flagsandworker_drains_fifo_after_an_earlier_job_fails)\n-cargo test --workspace --test '*' --locked(same two existing history failures; all completed targets and the new publication-limit suite pass)\n-cargo clippy --workspace --lib --bins --locked -- -D warnings\n-cargo fmt --all -- --check\n-sh scripts/check_product_boundary.sh\n- five-estate qualification command reproduced the documented table exactly\n\nThe fork-main version of this fix was independently verified with a fully passing workspace integration-only suite before merge.