Skip to content

ruff_charon: remove a stale rows.tsv and refuse section offsets past 4 GiB - #134

Merged
AdaWorldAPI merged 1 commit into
mainfrom
claude/codegraph-bin-followup
Nov 2, 2026
Merged

AdaWorldAPI merged 1 commit into
mainfrom
claude/codegraph-bin-followup

Conversation

@AdaWorldAPI

Copy link
Copy Markdown
Owner

Summary

Two defects in the binary rows format from #133.

  • A stale TSV survived a re-import. Re-importing a crate with with_tsv_export(false) left the previous revision's rows.tsv in place. rows_tsv() then returned the old relations next to a current rows.bin. The import now removes an existing rows.tsv whenever the export is off; a missing file is not an error.
  • Saturated section offsets. When the laid-out file exceeded 4 GiB, the writer saturated section offsets, lengths and the section count to u32::MAX, reported success, and replaced the stored artifact with a file the reader refuses. These directory fields, and each section's end, now go through dir_field. A value that does not fit returns WriteError::FileTooLarge before anything is written.

Test Plan

New tests:

  • turning_the_export_off_removes_a_stale_tsv imports cg_lib revision 1 with the TSV on, then revision 2 with it off, and asserts the old TSV is gone. It also asserts the two revisions really differ.
  • a_directory_field_past_u32_is_an_error checks that u32::MAX converts and u32::MAX + 1 is refused.

Disable checks (each change was applied with an asserted anchor, run, and reverted):

  • Keeping the old TSV fails the first test.
  • Restoring the saturating conversion fails the second.

Results: cargo test in crates/ruff_charon passes every suite, and cargo clippy --all-targets -- -D warnings is clean.


Generated by Claude Code

…4 GiB

Re-importing a crate with the TSV export off left the previous revision's
rows.tsv in place, so rows_tsv() returned old relations beside a current
rows.bin; the import now removes it. The writer saturated section offsets
and lengths to u32::MAX when the laid-out file exceeded 4 GiB and reported
success with a file the reader refuses; it now returns
WriteError::FileTooLarge before anything is written.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01X6y3drwKSE2zSgoexheLFX
@coderabbitai

coderabbitai Bot commented Nov 2, 2026

Copy link
Copy Markdown

Important

  • Trigger review

This repository does not receive automatic reviews because it has fewer than 10 stars.

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 5c968497-0041-4dba-bc74-27d69a629223
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

Share

@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 2, 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-11-02T16:57:48.071748Z 1aff873 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.

@AdaWorldAPI
AdaWorldAPI merged commit 913f9e7 into main Nov 2, 2026
37 of 38 checks passed
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.

2 participants