General code review - #2
Merged
Merged
Conversation
- Remove trailing commas in JSON examples in prompts.py (invalid JSON syntax) - Update example URLs in slash commands to reference PSPDFKit-labs/claude-code-review Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
- Test only general review runs when security is disabled
- Test only security review runs when general is disabled
- Test error when both passes are disabled
- Test findings have correct review_type ('general' vs 'security')
- Test review_type is preserved if already set (setdefault behavior)
Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Remove security from general code review to avoid overlap: - General pass: correctness, reliability, performance, maintainability, testing - Security pass: security only (unchanged) This gives each pass focused attention without duplicate findings. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
matej
added a commit
that referenced
this pull request
Jul 29, 2026
Both reviews independently confirmed several weaknesses in the previous commit; all valid findings are addressed here. Security (GitHub #1/#2, Codex F8): - Replace the bypassable Bash denylist with an allowlist: the review subprocess may only run read-only git commands (diff/log/show/status/ blame); everything else (python, node, openssl, arbitrary binaries) is denied in headless mode. Network tools stay denylisted as defense in depth. - Remove credentials persisted by actions/checkout from .git/config before the scan step, so the review subprocess cannot read the workflow token (env stripping alone did not cover this). - Reword README to describe defense-in-depth honestly instead of claiming egress is blocked. Correctness (GitHub #3/#4/#5/#6, Codex F1/F2/F3/F5/F9): - Diff packing now keeps fetching later pages until the character budget is genuinely exhausted; an oversized file on page 1 no longer hides every file on pages 2+. - The filter-prompt window now grows outward from the finding line, so the char cap can never truncate away the very line being validated; focus lines beyond EOF clamp to the end of the file. - API validation now pings the configured model instead of a hardcoded one - a misconfigured/retired CLAUDE_MODEL is caught up front instead of silently failing open on every finding (plus a loud warning when all validation calls fail). - Reactions short-circuit is stricter: only an exact two-seed summary skips the fetch; single thumbs (possible human reaction after seed failure) and null counters are fetched safely. Review quality (GitHub #7/#8, Codex F6/F7/F10): - Dedup no longer suppresses findings whose previous thread is outdated (position: null) and only matches bot-authored comments; suppressed duplicates are listed in the review summary so they stay discoverable. - Comment pagination degrades gracefully on mid-pagination API errors (e.g. GitHub's 3,000-file cap) instead of aborting the run; a page-1 failure still surfaces as an error. - The prompt's borderline-finding guidance now reflects whether the downstream Claude filter is actually enabled at runtime, instead of assuming it. - The injection guardrail no longer demands a HIGH finding for inert prompt-injection strings in test fixtures/docs; it asks for judgment and intent-matched severity. Tests: 243 Python + 28 JS passing (6 new Python tests, 1 new JS test, dedup mocks updated for live-position/bot-author semantics). Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Overview
This PR generalizes the action into a dual‑pass reviewer: a broad code‑quality review plus a dedicated security pass. It also refreshes the slash commands, filtering logic, and docs to match the new workflow.
What Changed
run-general-review,run-security-review).claude/commands/code-review.mdand.claude/commands/security-review.mdto align with the new multi‑agent workflowWhy
A single pass blends concerns and can dilute security‑specific signal. Running a dedicated security pass improves focus without losing broader quality review coverage.
Testing
python -m pytest claudecode -v