Skip to content

fix: enforce graph limit on canonical stream - #307

Open
GQAdonis wants to merge 1 commit into
crabbuild:mainfrom
GQAdonis:codex/fix-preflight-size-gate
Open

fix: enforce graph limit on canonical stream#307
GQAdonis wants to merge 1 commit into
crabbuild:mainfrom
GQAdonis:codex/fix-preflight-size-gate

Conversation

@GQAdonis

Copy link
Copy Markdown

Summary

  • enforce COMPASS_MAX_GRAPH_BYTES against bytes actually emitted by canonical full and delta publication paths
  • abort staged publication on a real overrun while preserving the active graph and SQLite reference
  • add a bounded five-estate graph/source ratio qualification command and publish the measured distribution

Qualification

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_flags and worker_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.

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Aug 30, 2026

Copy link
Copy Markdown

Codex Review Summary

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review Completed 2026-08-30T17:56:30.167857Z 54dbee7 PR opened
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

💡 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)]

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Badge 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 👍 / 👎.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant