Skip to content

feat: add --verify-fixes and --check-new-findings CLI flags - #18

Merged
dsiddharth2 merged 13 commits into
mainfrom
feat/review-modes
May 8, 2026
Merged

feat: add --verify-fixes and --check-new-findings CLI flags#18
dsiddharth2 merged 13 commits into
mainfrom
feat/review-modes

Conversation

@dsiddharth2

Copy link
Copy Markdown
Owner

Summary

  • Adds ReviewMode enum (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 entirely
  • Flags are mutually exclusive; default behavior (no flags) is unchanged

Implementation

Three-layer defense-in-depth chain:

  1. CLI flags → enum threading through BatchReviewJobReviewJobConfigReviewJob
  2. Prompt injection — mode-specific agent instructions (VERIFY-ONLY / FRESH REVIEW)
  3. Write guards_write_findings() strips findings/fix_verifications per mode regardless of agent output
  4. post_findings — verify-only mode skips inline comments, processes fix verifications, changes summary title

Files changed

  • src/models/review_models.pyReviewMode enum
  • src/run_agent.py — CLI flags (--verify-fixes, --check-new-findings)
  • src/batch_review_job.pyreview_mode threading, conditional _fetch_previous_findings() skip
  • src/review_job.py — prompt injection, write guards
  • src/post_findings.py — verify-only mode handling
  • tests/unit/test_review_modes.py — 31 new tests

Test plan

  • 221/221 tests passing (190 existing + 31 new)
  • ReviewMode enum values and string comparison
  • CLI: --verify-fixes parsed, --check-new-findings parsed, both rejected, default FULL
  • CHECK_NEW skips _fetch_previous_findings()
  • VERIFY_FIXES prompt contains "VERIFY-ONLY MODE"
  • CHECK_NEW prompt contains "FRESH REVIEW MODE"
  • Write guards: VERIFY_FIXES strips findings[], CHECK_NEW strips fix_verifications[]
  • post_findings: verify-only summary title, gate passes with zero findings
  • Default FULL mode behavior completely unchanged

dsiddharth2 added 13 commits May 8, 2026 13:20
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).
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).
@dsiddharth2
dsiddharth2 merged commit ec3512e into main May 8, 2026
3 checks passed
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