Skip to content

fix(review): drop false description gaps for ignored files#378

Open
devops-thiago wants to merge 3 commits into
mainfrom
fix/description-gap-ignored-files
Open

fix(review): drop false description gaps for ignored files#378
devops-thiago wants to merge 3 commits into
mainfrom
fix/description-gap-ignored-files

Conversation

@devops-thiago

@devops-thiago devops-thiago commented Jul 12, 2026

Copy link
Copy Markdown
Owner

What type of PR is this?

  • 🐛 Bug fix
  • ✨ Feature
  • 📝 Documentation
  • 🔧 Refactor
  • 🚀 Performance
  • ✅ Test
  • 🔒 Security
  • 📦 Dependency update
  • 🏗️ CI/CD

Description

Filters false description_gaps bullets that claim ignored files (e.g. pom.xml, lockfiles) are missing from the PR when those files appear as skipped: matches ignored pattern in the diff. Also clarifies the review prompt so the model does not treat intentionally omitted patches as absent changes.

The filter only drops gaps whose absence claim targets the ignored file itself (not gaps that merely mention an ignored path elsewhere), and skips basename-only matching when the gap cites a different qualified path (e.g. keeps module-b/pom.xml is not in the diff when only module-a/pom.xml changed).

Fixes the false positive on PR #377 where a legitimate root pom.xml version bump was flagged as a description/implementation mismatch.

Related Issues

N/A

How Has This Been Tested?

  • Unit tests
  • Integration tests
  • Manual testing
mvn test -Dtest=DescriptionGapFilterTest,VerdictBuilderTest

Checklist

  • My code follows the project's coding standards
  • I have performed a self-review of my own code
  • I have added tests that prove my fix is effective or that my feature works
  • New and existing unit tests pass locally with my changes
  • I have updated the documentation accordingly
  • My changes generate no new warnings or errors

Screenshots / Logs

N/A

Additional Notes

Targets release/v0.4.0. Re-run /review on a release PR that bumps pom.xml to confirm the "Description vs. Implementation" warning is gone.

Ignored files like pom.xml appear in the diff without a patch, which made
the model flag legitimate release bumps as missing from the change.

Co-authored-by: Cursor <cursoragent@cursor.com>
@thrillhousebot

Copy link
Copy Markdown

🤖 ThrillhouseBot PR Summary

What this PR does

Adds a post-processing filter to remove description_gaps that incorrectly flag ignored files (e.g., pom.xml, lockfiles) as missing from the PR, and updates the AI review prompt to prevent the model from generating such gaps.

Control-Flow Diagram

🔀 Show diagram
flowchart TD
  A["VerdictBuilder.build()"]
  B["AI response"]
  C["withFilteredDescriptionGaps"]
  D{"summary null?"}
  E["return original"]
  F["dropIgnoredFilePresenceGaps"]
  G{"filtered equals original?"}
  H["create new ReviewResponse"]
  I["return new response"]
  J["buildResult"]
  A --> B --> C
  C --> D
  D -- yes --> E
  D -- no --> F
  F --> G
  G -- yes --> E
  G -- no --> H --> I
  E --> J
  I --> J
Loading

Changes Overview

  • Files changed: 4
  • Lines added: +188
  • Lines removed: -3

Changed Files

File Change Summary
src/main/java/dev/thiagogonzaga/thrillhousebot/review/DescriptionGapFilter.java Added New filter class that removes description gaps about ignored files.
src/main/java/dev/thiagogonzaga/thrillhousebot/review/VerdictBuilder.java Modified Integrates the filter into review result building.
src/main/java/dev/thiagogonzaga/thrillhousebot/review/ai/PrReviewPrompts.java Modified Clarifies AI prompt to avoid false description gaps about ignored files.
src/test/java/dev/thiagogonzaga/thrillhousebot/review/DescriptionGapFilterTest.java Added Tests for the description gap filter.

Risk Assessment

Risk Count
🔴 Critical 0
🟠 High 0
🟡 Medium 1
🔵 Low 0

Key Findings

  • MEDIUM: Overly broad gap filter may drop valid description gaps about non-ignored files (src/main/java/dev/thiagogonzaga/thrillhousebot/review/DescriptionGapFilter.java:63)

⚠️ CI Checks Status

Some checks are still pending or have failed:

Check Type Status Detail
test check-run ⏳ Pending -
frontend check-run ⏳ Pending -
changes check-run ⏳ Pending -
format check-run ⏳ Pending -
trivy check-run ⏳ Pending -
actionlint check-run ⏳ Pending -

Automated review by ThrillhouseBot. Reply with /review to re-run.

return gaps.stream().filter(gap -> !isIgnoredFilePresenceGap(gap, ignoredPaths)).toList();
}

private static boolean isIgnoredFilePresenceGap(String gap, Set<String> ignoredPaths) {

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 MEDIUM — Overly broad gap filter may drop valid description gaps about non-ignored files (medium confidence — verify before acting)

The filter in DescriptionGapFilter.isIgnoredFilePresenceGap drops any gap that contains any ignored file name and matches the absence claim regex, regardless of whether the absence claim actually refers to the ignored file. For example, a gap like “pom.xml is changed, but README is not in the diff” would be dropped because it mentions the ignored pom.xml and includes an absence marker, even though the real mismatch (missing README) is about a reviewable file. This can cause legitimate description/implementation mismatches to be incorrectly hidden. Consider tightening the logic to verify that the claimed-missing file is indeed the ignored one, e.g., by checking if the ignored file name appears adjacent to the absence phrase.

@codecov

codecov Bot commented Jul 12, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 83.13253% with 14 lines in your changes missing coverage. Please review.

Files with missing lines Patch % Lines
...ga/thrillhousebot/review/DescriptionGapFilter.java 77.41% 5 Missing and 9 partials ⚠️

📢 Thoughts on this report? Let us know!

devops-thiago and others added 2 commits July 12, 2026 19:23
Only drop gaps whose absence claim targets the ignored file itself,
not any gap that merely mentions an ignored path elsewhere. Add tests
for the VerdictBuilder integration path and edge cases.

Co-authored-by: Cursor <cursoragent@cursor.com>
Skip basename-only gap filtering when the gap cites a qualified path
that differs from the ignored file, so module-b/pom.xml gaps are not
dropped just because module-a/pom.xml changed.

Co-authored-by: Cursor <cursoragent@cursor.com>
@sonarqubecloud

Copy link
Copy Markdown

Base automatically changed from release/v0.4.0 to main July 12, 2026 22:44
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