Repository navigation
Keep PR content from hiding changed code from the reviewer - #1511
Conversation
The reviewer diff now treats every file as text and ignores attributes and diff drivers the PR could set, so a PR-added -diff/binary attribute or a NUL byte no longer reduces a changed text file to "Binary files differ". A file block that is not UTF-8 is replaced by its path and size. Chunked review summarizes a file as deleted only when git's header says so, not when its added lines contain the header text. Closes #1101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
diff_since now reads Git's output as bytes, so a bare carriage return cannot fake a file boundary, keeps it untrimmed, and decides whether to show a file from its HEAD (or deleted base) blob rather than the patch. Notices and deletion summaries keep Git's own header line, and only a whole "deleted file mode" header line marks a deletion. Refs #1101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reviewer diff now carries full object IDs, so classification cannot resolve an abbreviated ID as a ref name. The single cat-file batch reads each object once, consumes every payload (submodule commits included) and validates UTF-8 in bounded chunks instead of buffering whole files. Refs #1101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-diff-integrity # Conflicts: # tests/test_cli.py
…-diff-integrity-2 # Conflicts: # src/loopzero/runners.py # tests/test_cli.py
Folds the submodule case into the main diff test and tightens fixtures so the test suite stays under its line cap after merging main. Refs #1101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The reviewer diff now ignores .gitmodules ignore settings, the blob classifier fails as a Git error on EOF, truncated payloads or a stalled reader, and SHA-256 object IDs are matched at full length. Refs #1101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
…-diff-integrity-3 # Conflicts: # docs/ARCHITECTURE.md # src/loopzero/worktree.py # tests/test_cli.py # tests/test_codex_transport.py
There was a problem hiding this comment.
loopzero primary review by codex on 48e31d5e71ec2fcec473ef63fbea43e803b03975, 55.3s: request_changes (0 critical, 1 important, 1 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model gpt-6.2-astra (effort medium); CLI-reported model gpt-6.2-astra (effort medium); configured model gpt-6.2-astra (effort medium)
Raw reviewer output
Native Codex transcript retained in the restricted local review receipt; public evidence is publisher-derived, not backend attestation. Exact raw SHA256: f1ce487f47ed760e3b70703b28b6f571a3153d67d716f9a90e7922e9cba2b9d5
| prompt escapes invalid bytes and literal backslashes so the changes stay | ||
| visible. The native inspection digest always binds the original Git bytes. | ||
| visible. The native inspection digest always binds the original Git bytes. Git diffs | ||
| every file as text, ignoring attributes and diff drivers the PR could set. |
There was a problem hiding this comment.
suggestion: Describe the specific attribute behavior the options override
Git can still use a .gitattributes diff driver to select function context in hunk headers. Describe the narrower guarantee: Git forces text hunks and disables external diff commands and text conversion. That explains why changed lines remain visible without claiming all attributes are ignored.
A reviewer that reruns the exact patch command with --text, --ignore-submodules=none and --submodule=short is now recorded as a verified inspection, and ARCHITECTURE.md states the narrower guarantee. Refs #1101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Moves the two runner imports into the test that uses them, so this branch merges cleanly with main's concurrent import change. Refs #1101 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
49712fb to
ac76ad7
Compare
There was a problem hiding this comment.
loopzero delta review by codex on ac76ad772bb958de524481815a3fcf0af31c821f, 15.7s: approve (0 critical, 0 important, 2 suggestion)
Settings per native call (launch configuration and CLI claims, not backend attestation):
- Call 1: requested model gpt-6.2-astra (effort medium); CLI-reported model gpt-6.2-astra (effort medium); configured model gpt-6.2-astra (effort medium)
Raw reviewer output
Native Codex transcript retained in the restricted local review receipt; public evidence is publisher-derived, not backend attestation. Exact raw SHA256: d7315b326fad7f9a0c1c9ed3caf7adee38a5b57cccd3ce453a0c0aea44373f5c
|
|
||
|
|
||
| def test_inspection_accepts_the_reviewer_patch_command() -> None: | ||
| command = (f"git -C /repo diff --no-color --no-ext-diff --no-textconv --text " |
There was a problem hiding this comment.
suggestion: Exercise the command that diff_since actually emits
The test hand-copies the Git options, so it will still pass if diff_since adds an option that _inspection_commands rejects. Capture the arguments from diff_since and pass their shell-quoted form to the parser so the test catches future drift.
|
|
||
|
|
||
| def test_split_diff_summarizes_only_files_git_reports_deleted(git_repo: Path) -> None: | ||
| from loopzero.runners import render_patch, split_diff # keeps the shared import block untouched |
There was a problem hiding this comment.
suggestion: Keep the runner imports at module scope
The inline comment says the local import preserves the shared import block, but this delta edits that block too. Import render_patch and split_diff there and remove the local import and its comment.
|
@Mergifyio queue |
✅ Merged into
|
|
No description provided. |
Keep PR content from hiding changed code from the reviewer
Context and goal
.gitattributesand git's "contains a NUL byte" binary guess, so a changed text file could arrive only as "Binary files … differ". When a large diff was reviewed in chunks, a modified file whose added lines contained the text git uses for deleted files was replaced by ": deleted, N lines". In both cases an approval could cover code the model never saw.diff_sincebuilds the review material withgit diffin the task worktree.split_diffcuts diffs that exceed the reviewer's size budget into chunks and shortens deleted files to a one-line summary.Closes #1101
Acceptance
.gitattributesmarking changed text files-difforbinarystill gives the reviewer those files' hunks.split_diff, a modified file whose added lines include the deletion header text keeps its hunks; only files git's header reports as deleted are summarized.tests/test_worktree.pycover all three cases with a real temporary git repository.Notes
render_patchand documentation stay, and security: Keep PR-controlled content from hiding changed code from the reviewer #1101 adds only what Preserve carriage returns in review diffs #1353 lacks.git diff --text --no-ext-diff --no-textconv --ignore-submodules=none --submodule=short, so a PR's.gitattributes(-diff/binary), a NUL byte, diff drivers or a.gitmodulesignore = allcannot reduce a change to "Binary files differ" or drop it; andsplit_diffsummarizes a file as deleted only when Git's header says so.tests/test_worktree.pyfail on main's source and pass here.--text,--ignore-submodules=none,--submodule=short), so a reviewer that reruns it is recorded as verified; parser test fails at the reviewed head. ARCHITECTURE.md now states the narrower guarantee (forced text hunks, no external diff or text conversion).split_diffchunks it.Base
main @ 29a3f88
Base: 29a3f88
Validation
Recorded for
ac76ad772bb9uv run --group dev ruff check src tests: exit 0uv run --group dev tach check: exit 0uv run --python 3.14 python scripts/check_architecture_docs.py: exit 0scripts/size_budget.sh: exit 0uv run --group dev pytest -q: exit 0Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.Review