feat(review): filter unreviewable content from diff context - #1008
Draft
guyoron1 wants to merge 1 commit into
Draft
feat(review): filter unreviewable content from diff context#1008guyoron1 wants to merge 1 commit into
guyoron1 wants to merge 1 commit into
Conversation
Review context includes lockfile, minified, sourcemap, and @generated hunks that no model can meaningfully assess; on a mixed PR they are pure input cost for every review dimension. filter-review-diff.sh strips them deterministically before context assembly - migrations are exempt from every rule, and the exclusion is always disclosed (as an info-level finding, the same mechanism the provenance-warning finding already uses) so a changed lockfile stays visible even though no model read it. Small-PR and large-PR paths now share one definition of "generated" instead of the large-PR path's prompt-level list. Signed-off-by: guy oron <goron@redhat.com>
Functional tests did not runFunctional tests run automatically for org/repo members and collaborators on pull requests. For other contributors, a maintainer must add the |
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.
Review context includes lockfile, minified, sourcemap, and
@generatedhunks that no model can meaningfully assess; on a mixed PR they are
pure input cost for all dimensions. This filters them deterministically
before context assembly — migrations exempt, the exclusion always
disclosed in the review body so a changed lockfile is still visible.
Small-PR and large-PR paths now share one definition of "generated"
instead of a prompt-level list.
What changed
skills/pr-review/scripts/filter-review-diff.sh: a single awkprogram over a unified diff on stdin. Strips lockfile sections
(mirrors the
is_lock()regex in fullsend's.github/scripts/route-review-model.sh, comment cites the source),*.min.js/*.min.css,*.map, andvendor//node_modules//third_party/paths, plus any section with@generatedin its first5 added lines.
migrations//migrate/paths are exempt from everyrule. Filtered diff on stdout (byte-identical for untouched
sections), one-line-per-file exclusion summary written only to the
file given as
$1, never to stdout.scripts/filter-review-diff-test.sh, wired intomake script-test:byte-identical pass-through (via
cmp), lockfile/mixed-diffstripping, the added-vs-removed-line
@generateddistinction, themigration exemption, minified/sourcemap/vendored stripping, summary
format and stdout-silence, all-stripped output, and malformed-input
pass-through. All pass locally (bash 3.2, macOS); shellcheck clean.
skills/pr-review/SKILL.mdstep 2: small-PR path now pipes the fulldiff through the filter before it enters any context package; the
large-PR per-file path's "lockfiles, vendor/, protobuf, etc." vibes
list is replaced with the same script, so both paths share one
deterministic definition.
FILE_COUNT/LINE_COUNTstay computedfrom the unfiltered file-stats response (unchanged) — routing must
see the true size.
skills/pr-review/SKILL.mdstep 3d'sdiffcontext-packagedescription updated to match.
Design note: disclosure via info finding, not a footer
An earlier draft disclosed the exclusion through a review-body footer.
Step 7 forbids that explicitly ("No footer. Do not append any
footer, action-hints block, or boilerplate after findings."), so the
disclosure uses the file's existing precedent for orchestrator-level
process disclosure instead: an info-level finding, the same mechanism
the
provenance-warningfinding (right above it in step 7) alreadyuses. The new
excluded-contentinfo finding sits alongside it.Rebase note
Open PR agents#1006 (
feat/review-untrusted-text) also touchesSKILL.md — its hunks are in step 6d's Part 3/4 blocks, mine are in
steps 2 and 3d. Different sections, shouldn't collide, but noting the
adjacency. #1004's step 6g hunk is further down in step 6, also should
not overlap.
Non-goals
No filtering of step 2b's file-contents fetch beyond what already
exists there, no change to
route-review-model.sh, no config knob.Scope
The filter script is architecture-neutral; the wiring here is the claude
review path's orchestrator (
skills/pr-review). The pi-runtime review(no sub-agents) assembles its own context and can adopt the same script
when that path stabilizes.