Skip to content

feat(review): filter unreviewable content from diff context - #1008

Draft
guyoron1 wants to merge 1 commit into
fullsend-ai:mainfrom
guyoron1:feat/review-diff-filtering
Draft

feat(review): filter unreviewable content from diff context#1008
guyoron1 wants to merge 1 commit into
fullsend-ai:mainfrom
guyoron1:feat/review-diff-filtering

Conversation

@guyoron1

@guyoron1 guyoron1 commented Aug 25, 2026

Copy link
Copy Markdown

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 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

  • New skills/pr-review/scripts/filter-review-diff.sh: a single awk
    program 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, and vendor//node_modules//
    third_party/ paths, plus any section with @generated in its first
    5 added lines. migrations//migrate/ paths are exempt from every
    rule. 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 into make script-test:
    byte-identical pass-through (via cmp), lockfile/mixed-diff
    stripping, the added-vs-removed-line @generated distinction, the
    migration 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.md step 2: small-PR path now pipes the full
    diff 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_COUNT stay computed
    from the unfiltered file-stats response (unchanged) — routing must
    see the true size.
  • skills/pr-review/SKILL.md step 3d's diff context-package
    description 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-warning finding (right above it in step 7) already
uses. The new excluded-content info finding sits alongside it.

Rebase note

Open PR agents#1006 (feat/review-untrusted-text) also touches
SKILL.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.

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>
@github-actions

Copy link
Copy Markdown

Functional tests did not run

Functional tests run automatically for org/repo members and collaborators on pull requests.

For other contributors, a maintainer must add the ok-to-test label after the latest push.

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.

1 participant