Repository navigation
fix(pr-review-cli): show every changed file's text in the full diff - #884
Conversation
The full-diff step ran git diff in the head checkout, so a pull request that adds a .gitattributes marking a path -diff or binary, or puts a NUL byte in a text file, turned that file into "Binary files differ" and hid its text from the reviewer. Both model jobs now write the diff with --text --no-textconv (plus the existing --no-ext-diff). A test runs the step against a repository whose head hides three files those three ways and requires each file's text in the written diff. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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. |
|
Claude finished @kyle-sexton's task in 3m 53s —— View job Claude's review —
|
|
Claude finished @kyle-sexton's task in 1m 59s —— View job Security review complete
Scope: No security issues found. Analysis:
GitHub Actions hardening (pinning, permissions, triggers) is unchanged in this diff and is zizmor's lane, not re-reported here. critical-findings: 0 claude-lane-summary: lane=claude-security-review sha=b27e98ed51d1df0a97a6fe7a954b6ce6522e946d run=40135033058 |
|
claude-security-review has reviewed this pull request through b27e98e; a later push is reviewed from there. |
|
claude-review has reviewed this pull request through b27e98e; a later push is reviewed from there. |
…contract (#878) Refs: melodic-software/ci-workflows#884 ## Summary Registers the `pr-review-cli.yml` reusable-workflow contract at ci-workflows [v0.65.9](https://github.com/melodic-software/ci-workflows/releases/tag/v0.65.9) (`4fbceb4b75ffd568dfa5db31de0d0e753c0c64e6`). Callers pinned to that release then pass runner-policy. ## Fix - Copies the v0.65.8 entry (`@4f79cc9244498ae856504cf74aeeb05dcc9c6b43`) forward in `components/runner-policy/policy.json`. - Adds the matching copy-forward test in `runner-policy.test.mjs`, following #877. - v0.65.9 ([ci-workflows#884](melodic-software/ci-workflows#884)) writes the review's full diff with `git diff --text`. A head `.gitattributes` or a NUL byte can no longer hide a file's text from the review model. - Inputs, secrets and runner are unchanged. ## Verification - `node components/runner-policy/runner-policy.mjs --root <worktree>`: Runner policy passed. - `node --test components/runner-policy/runner-policy.test.mjs`: 351 pass, 0 fail. - `biome ci` on the two changed files: clean. ## Related - [melodic-software/ci-workflows#884](melodic-software/ci-workflows#884) (released as v0.65.9) - #877 (the v0.65.8 contract) 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-authored-by: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: review-input hardening from #9875 review (F1, F5)
Summary
Two findings from the review of claude-code-plugins#9875 about what the review model reads.
full-diffstep rangit diffin the head checkout. A head that adds a.gitattributesmarking a path-difforbinary, or that puts a NUL byte in a text file, turned that file intoBinary files ... differ, so the reviewer never saw its text.CLAUDE.md,AGENTS.md,.claude/**or.mcp.jsonloads into the reviewer's context.run-claude-clialready starts the CLI with--restricted --strict-mcp-config(lane.cjscliArgs). A credential-free probe on CLI 2.1.310 showed none of those files reach the model, in the main session or in a subagent. Details below.Fix
git diff --no-color --no-ext-diff --no-textconv --text "$base" "$HEAD_SHA".--textshows every changed file as text, whatever the attributes or content say.--no-textconvkeeps the text raw.--no-ext-diffwas already there.--attr-source=<base>alone would not be enough: a NUL byte makes git treat a file as binary with no attributes involved. The new test covers that case.Metric, baseline, expected change
.claude-lane/pr.diff.-difforbinary, or that holds a NUL byte, appears only asBinary files ... differ.-difffiles, such aspackage-lock.jsonin these repositories, now appear in full. A genuine binary, such as a PNG, now writes its raw bytes into the diff file. That makes the file larger for PRs that change lockfiles or images. Nothing bounds the diff file's size today.Verification
pr-review-cli.test.cjs, for both the key job and the subscription job:full-diffstep's script against a temporary repository whose head hides one file each way:-diff,binary, and a NUL byte.+echo ...line in the written diff.main: the first assertion fails and the diff showsBinary files /dev/null and b/hidden.sh differ. It passes with the fix.node --testover.github/scripts/**/*.test.cjsand.github/actions/**/*.test.cjs: 852 pass, 0 fail.biome ci .githubis clean.zizmor --offlineon the workflow: no findings.actionlinton the workflow: the same 18 findings asmain(local 1.7.12 does not knowcache-modeor$/action refs), none new.naming-lint(enforcing): 0 blocking.F1 evidence
CLAUDE.mdor a rootAGENTS.mdsub/AGENTS.mdandsub2/CLAUDE.md.claude/rules/r.md.claude/agents/head-agent.md.claude/skills/headskill/SKILL.md.mcp.json--restricted, the requests carried every marker: root files at launch, nested ones after a Read in that directory, and the subagent's requests too.--restricted --strict-mcp-config(whatlane.cjspasses), no request carried any marker: main session, subagent, at launch or after the Reads. The init message listed no head agent, no head skill and no MCP server.project memory is offandproject settings are not read.--restrictedrow says it "loads only managed settings and--settings". It does not name CLAUDE.md, so this is observed behaviour, not a documented guarantee.--restrictedor how instruction files load. The lane runscli-version: latestunless it is pinned.lane.test.cjsalready asserts that the launcher passes--restricted.CLAUDE_CODE_DISABLE_CLAUDE_MDS=1was tested and is not needed: under--restrictedit adds nothing, and without--restrictedit still lets project agents and skills load.Related
-diffpackage-lock.json(claude-code-plugins commit 941f96a), so the attribute does not hide text there. A file GitHub treats as binary gets the "read the file at the head commit" placeholder, and the full diff now shows its text.🤖 Generated with Claude Code