feat: add --verify-fixes and --check-new-findings CLI flags - #18
Merged
Conversation
Introduces ReviewMode(str, Enum) with FULL/VERIFY_FIXES/CHECK_NEW values in review_models.py. Adds review_mode field to ReviewJobConfig and review_mode parameter to BatchReviewJob.__init__.
…sk 2) Adds --verify-fixes and --check-new-findings as a mutually exclusive argparse group in run_agent.py. Resolves to ReviewMode enum and passes review_mode= to BatchReviewJob. In BatchReviewJob.run(), skips _fetch_previous_findings() when review_mode is CHECK_NEW. Passes review_mode to both single-session and batched ReviewJobConfig constructors.
CHECK_NEW guard skips standalone prior-findings fetch; add _build_verify_only_instructions() and _build_check_new_instructions() methods for mode-specific prompt injection; add defense-in-depth guards in _write_findings() that strip findings[] for VERIFY_FIXES and fix_verifications[] for CHECK_NEW, and stamp review_modes list with the active mode string. 203/203 tests pass.
…e changes) Task 5 already committed in 88ba054. This commit records completion in progress.json and updates .gitignore (exclude CLAUDE.md) and requirements.md (scoped to review-modes feature).
…s, post_findings)
31 test cases in tests/unit/test_review_modes.py covering: - Enum: ReviewMode values, string comparison, default - CLI: --verify-fixes, --check-new-findings, mutual exclusion, default FULL - BatchReviewJob: CHECK_NEW skips _fetch_previous_findings(), FULL/VERIFY_FIXES call it, mode passed to ReviewJobConfig - Prompt injection: VERIFY-ONLY MODE, FRESH REVIEW MODE, FULL neither - Write guards: findings[] stripped for VERIFY_FIXES, fix_verifications[] for CHECK_NEW, FULL preserves both - post_findings: gate passes with zero findings, no inline comments, summary title 234/234 tests pass (203 existing + 31 new).
…ptance criteria met)
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
ReviewModeenum (FULL,VERIFY_FIXES,CHECK_NEW) to control review behavior--verify-fixes: only verify whether prior findings were fixed, skip new finding generation--check-new-findings: fresh review only, skip fix verification entirelyImplementation
Three-layer defense-in-depth chain:
BatchReviewJob→ReviewJobConfig→ReviewJob_write_findings()strips findings/fix_verifications per mode regardless of agent outputFiles changed
src/models/review_models.py—ReviewModeenumsrc/run_agent.py— CLI flags (--verify-fixes,--check-new-findings)src/batch_review_job.py—review_modethreading, conditional_fetch_previous_findings()skipsrc/review_job.py— prompt injection, write guardssrc/post_findings.py— verify-only mode handlingtests/unit/test_review_modes.py— 31 new testsTest plan
--verify-fixesparsed,--check-new-findingsparsed, both rejected, default FULL_fetch_previous_findings()