fix(review): framework-aware false-positive guards for injection/constructor claims (#337)#396
Merged
Merged
Conversation
…tor claims (#337) The model recurrently flags "missing no-arg/default constructor" on CDI beans whose constructor is annotated @Inject — a Quarkus/Jakarta false positive (seen on PR #270). Add a deterministic FrameworkFalsePositiveFilter that drops such a finding when the flagged file's own diff shows an injection-annotated (@Inject/@Autowired) constructor, wired into both FindingPipeline paths right after quote validation. Also add the CDI constructor-injection fact to the reviewer and verifier prompts and to .github/thrillhousebot.md. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
Contributor
Dependency Review✅ No vulnerabilities or license issues or OpenSSF Scorecard issues found.Scanned FilesNone |
🤖 ThrillhouseBot PR SummaryWhat this PR doesAdds FrameworkFalsePositiveFilter that drops AI findings about missing no-arg constructors when the diff shows an @Inject or @Autowired constructor, and updates prompts to prevent such claims upstream. Wires the filter into both pipeline paths. Control-Flow Diagram🔀 Show diagramflowchart TD
A["ReviewResponse (raw AI output)"]
B["quoteValidator.validate()"]
C["frameworkFilter.filter() (new)"]
D["deduplicator.dedupe()"]
E["findingVerificationService.verify()"]
F["Final findings"]
A --> B
B --> C
C --> D
D --> E
E --> F
Changes Overview
Changed Files
Risk Assessment
No new issues found in this PR, but the review cannot be approved until required CI is confirmed green.
|
| Check | Type | Status | Detail |
|---|---|---|---|
| format | missing | ⏳ Pending | - |
| test | missing | ⏳ Pending | - |
| frontend | missing | ⏳ Pending | - |
| trivy | missing | ⏳ Pending | - |
| dependency-review | missing | ⏳ Pending | - |
Automated review by ThrillhouseBot. Reply with /review to re-run.
Codecov Report✅ All modified and coverable lines are covered by tests. 📢 Thoughts on this report? Let us know! |
Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
…ize keep-tests Splits the no-arg-constructor claim pattern into simple token patterns with a proximity pairing (S5843), extracts the annotation lookahead into a helper (S3776), and merges the similar keep-the-finding tests into one parameterized test (S5976). Adds a token-proximity negative case for full branch coverage. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
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.



Summary
FrameworkFalsePositiveFilter(review/) that drops "missing no-arg/default constructor" findings when the flagged file's own diff shows a constructor annotated@Inject(CDI/Quarkus/Jakarta, bare or fully qualified) or@Autowired(Spring) — constructor injection needs no no-arg constructor, so the diff refutes the claim outright. Conservative in the same direction asFindingQuoteValidator: deleted lines never count as evidence, other files' hunks can't refute, and when the constructor sits outside the diff window the finding passes through unchanged.FindingPipelinepaths (single-callrefineand per-batchprocessBatch), right after quote validation, with the summary recounted on drop.PrReviewPrompts.SYSTEMconfidence-calibration section) and as a rejection rule inFindingVerifierPrompts.SYSTEM, plus a new "Framework facts" section in.github/thrillhousebot.md.Reproduces the #270 dogfood shape: the bot posted MEDIUM — missing no-arg CDI constructor on
PrSummaryGeneratordespite a valid@Injectconstructor. That exact shape is the primary test fixture and is now suppressed deterministically, with the prompt guardrails preventing the claim upstream.Issue
Fixes #337
Test plan
FrameworkFalsePositiveFilterTest(20 tests): drops the fix(review): v0.3.0 final-review — unreadable CI first-class + CiStatusEvaluator cleanup + glob-filter perf #270-class claim on an@Injectconstructor-only bean (annotation above, inline, and with interleaved annotations; claim in title or description); keeps the finding when there is no@Injectconstructor, when@Injectis on a field, when the annotated constructor was deleted, when the evidence is in another file, on constructor invocations (new X(...)), on non-Java/missing file paths, and on unrelated findings; recounts the summary when dropping.FindingPipelineTest/ReviewOrchestratorTestupdated for the new pipeline dependency../mvnw verifypasses locally (1608 tests, SpotBugs, JaCoCo gate); new class at 99% instruction coverage with the one previously-missed line now covered.🤖 Generated with Claude Code