Skip to content

fix(verify): deterministic fix verification + developer dismissal handling - #22

Merged
dsiddharth2 merged 2 commits into
mainfrom
fix/post-review-fixes
May 25, 2026
Merged

fix(verify): deterministic fix verification + developer dismissal handling#22
dsiddharth2 merged 2 commits into
mainfrom
fix/post-review-fixes

Conversation

@dsiddharth2

Copy link
Copy Markdown
Owner

Summary

  • Replaced agent-based fix verification with deterministic per-file LLM calls — the agent loop (sliding window of 3) caused it to re-read the same files endlessly and mark unchecked findings as "still_present". Now one LLM call per file, every finding verified, 10x cheaper ($0.19 vs $1.78).
  • Added developer dismissal evaluation — when a developer replies to a CodeHawk finding with a technical reason, the verifier evaluates the full thread conversation and accepts valid dismissals (status="dismissed", 0 penalty).

Changes

Fix verification overhaul (fix_verifier.py, batch_review_job.py)

  • One LLM call per modified file with full content (50K cap) + git diff
  • Configurable model (defaults to gpt-5-codex)
  • Path fallback via glob when ADO paths don't match workspace layout
  • Graceful handling when git diff fails (shallow clone) — verifies all files via LLM
  • Token usage tracking and cost reporting

Developer dismissal (fix_verifier.py, fetch_pr_comments_activity.py)

  • Fetches full thread conversation with [CodeHawk] / [Developer Name] labels
  • Evaluates dismissals with code context + .codereview.md project context
  • Collaborative prompt: accepts plausible technical reasons, rejects bare "Invalid"
  • Dismissed findings get 0 penalty in scoring
  • PR summary shows dismissal count and resolution rate

Scoring & display (post_findings.py, review_models.py)

  • New "dismissed" status alongside fixed/still_present/not_relevant
  • PR summary shows dismissed count with 💬 icon

Test plan

  • 381 unit tests pass (including 18 new dismissal tests)
  • Integration test against PR 6707: 10 fixed, dismissed findings accepted, all 31 verified
  • Cost verified: 77K tokens / $0.19 for 31 findings

🤖 Generated with Claude Code

…per-file LLM calls

The agent-based verifier used a sliding window of 3 turns, causing it to
forget previously read files and loop endlessly — re-reading the same 5-6
files across 57 turns while never reaching the remaining 20+. This made
verification unreliable (findings marked "still_present" without checking)
and expensive (836K tokens / $1.78).

Switch to the deterministic fix_verifier which makes one LLM call per file
with all findings for that file. Key improvements:

- Model: configurable, defaults to gpt-5-codex (was hardcoded gpt-4o-mini)
- File content cap: 50K chars (was 8K, truncating large files)
- Git diff: included in prompt so LLM sees exactly what changed
- Prompt: judges whether underlying problem is resolved, not exact match
- Path fallback: glob-based file resolution when ADO paths don't match
- Usage tracking: token counts and cost reported in findings.json
- Graceful diff failure: when git diff fails (shallow clone), verifies all
  files via LLM instead of marking everything "not modified"

Result: 77K tokens / $0.19 (10x cheaper), all 31 findings verified, 10
correctly identified as fixed vs 0 before.
When a developer replies to a CodeHawk finding with a technical reason
(e.g., "spreading undefined is valid JS", "sequential uploads are
intentional"), the fix verifier now evaluates the dismissal using an LLM
call with the full thread conversation and code context.

Key changes:
- fetch_pr_comments_activity: add get_developer_replies() returning full
  conversation threads labeled [CodeHawk] / [Developer Name]
- fix_verifier: post-processing step evaluates still_present findings
  that have developer replies; accepted dismissals get status="dismissed"
  with 0 penalty (same as fixed)
- Prompt includes .codereview.md for project context (versions, conventions)
- Collaborative tone: benefit of the doubt for plausible technical reasons;
  reject only bare "Invalid" or provably wrong claims
- Token usage from dismissal LLM calls tracked in total cost
- JSON parser handles single-object responses (not just arrays)
- post_findings: displays dismissed findings with resolution rate
@dsiddharth2
dsiddharth2 merged commit 18f426a into main May 25, 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