Skip to content

feat(review): one verdict writer and cited refutations (#601) - #625

Merged
dan-petty merged 1 commit into
release/v0.2.23from
feat/601-one-verdict-writer-and-cited-refutations
Sep 26, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.23from
feat/601-one-verdict-writer-and-cited-refutations

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary

Completes Part 2 of #601:

  • One Verdict Writer (apply_verdict): Introduced single central writer in src/devops_cli/ai/review/verdicts.py that sets status, verified, reportable, mitigated, verified_by, and verified_at synchronously.
  • Verdict Invariants: Added invariant validator assert_verdict_invariants enforcing:
    • INVALIDATED -> not reportable, not verified
    • VERIFIED -> requires non-empty verified_by and verified_at
    • UNVERIFIED -> verified_by is None, verified_at is None
    • MITIGATED -> stays reportable
    • Invariants asserted during findings.json serialization, devops review verify CLI invocation, and whole-result pipeline copy-back.
  • Final Criteria Verdicts: Prevented model review phase from overwriting deterministic criteria verification when all commands completed execution.
  • Cited Refutations:
    • Added citation_line and mitigating_mechanism to Finding, SavedFinding, and FeedbackRecord.
    • Refutations must cite a valid target line in changed ranges or AST symbol spans; refutations lacking valid citations are safely downgraded to UNVERIFIED with verification_note.
    • Per-adjudicator citation rates computed in compute_verdict_distributions.
  • MCP & CLI Verification: Added --mitigated filter to devops review findings and enabled --status queries for all 4 states in review_findings MCP tool.
  • Comprehensive Test Suite: Added tests/test_verdict_writers.py asserting invariant conformance across all 19 verdict-producing paths.

Closes #601

- Introduce unified apply_verdict writer writing status, verified, reportable, mitigated, verified_by, and verified_at together
- Enforce verdict invariants at findings.json serialization, review verify CLI, and pipeline copy-back
- Ensure executed criteria verdicts are final when all commands ran without overwrite by model verification
- Add citation_line and mitigating_mechanism to Finding and FeedbackRecord
- Validate refutation citation line bounds and construct tokens, downgrading missing/invalid refutations to UNVERIFIED
- Compute per-adjudicator citation rates in compute_verdict_distributions
- Support --status with all four states in MCP review_findings tool
@dan-petty dan-petty added this to the v0.2.23 milestone Sep 26, 2026
@dan-petty
dan-petty merged commit c93abc9 into release/v0.2.23 Sep 26, 2026
8 checks passed
@dan-petty
dan-petty deleted the feat/601-one-verdict-writer-and-cited-refutations branch September 26, 2026 19:04
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