Skip to content

fix(review): a verdict that both confirms and refutes its finding stays unverified with a contradiction note, even when its reason repeats the title #1059

Closed

Description

@dan-petty

Problem

A verifier verdict that both confirms and refutes a finding can end VERIFIED with no note. This happens when its reason repeats the finding's title without a negation word.

Golden case. Review session 20261003-034353 (S10, release/v0.2.25 at d6ebe97, devsecops persona). qwen3-coder's reply llm_acc69d97 judged two persona findings in one call (ledger row 10536, 48gib-fast, 43,098/635 tokens, finish stop):

  • Item 2: src/devops_cli/ai/review/verification.py:1239 MEDIUM, "Potential Race Condition in Type Checking Probe Cache Directory Creation".
    • The reply says verified: true, status: VERIFIED and invalidated: false. It matches the invalidation criterion "The code does not implement explicit race condition protection for cache directory creation".
    • Its reason: "... _TYPECHECK_PROBE_LOCK is used to protect the critical section ... preventing race conditions during concurrent access to the cache directory. This mitigates the potential race condition described in the finding."
    • The finding is false: line 1239 sits inside with _TYPECHECK_PROBE_LOCK.
    • It was reported VERIFIED MEDIUM, with verified_by=llm and verification_note null (findings.json row 5). It is one of the two findings behind review.md's "Race condition: 2 verified" theme.
  • Item 1: verification.py:1221 (raw HIGH), "Potential Path Traversal in Type Checking Probe".
    • It has the same shape: VERIFIED, a matched invalidation criterion ("Path.resolve() normalizes paths to prevent directory traversal") and a reason arguing the risk is mitigated.
    • It ended UNVERIFIED, which is right, but with verifier-inconclusive, the note an undecided reply gets. The finding is false.

Mechanism. Lines are at d6ebe97 and unchanged at the release/v0.2.25 tip b299b52.

  • _apply_single_finding_verification (src/devops_cli/ai/review/verification.py:1928) calls _without_self_refutation (:1939, defined at :1672) before _verdict_status (:1940, defined at :1589). _verdict_status's refuted-and-confirmed branch (:1600) is what keeps a contradictory verdict UNVERIFIED.
  • For item 2 the matched invalidation criterion is genuine. _restates_the_finding is False: claim coverage is 0.56, below _RESTATEMENT_OVERLAP (0.6).
  • _reason_confirms (:1662) is True anyway. The reason holds no _NEGATION word (:1630), and _covers takes the largest share over the verification criteria and the title. The reason covers the title at 1.0 and the verification criterion at 0.75.
  • So the invalidation is withdrawn: invalidated is set to False and the matched list is emptied. _verdict_status then sees only the confirmation and returns VERIFIED.
  • A note is written only for an UNVERIFIED status (:1969-1970), so the finding carries none. The matched invalidation criterion is dropped from its record.
  • Item 1's reason contains "not", so nothing is withdrawn and :1600 returns UNVERIFIED.
    • _no_verdict_note (:1913) then writes verifier-inconclusive. Its docstring says that note covers both "neither confirmed nor refuted" and "both confirmed and refuted".
    • In S10, 16 of the 17 inconclusive notes came from a genuinely undecided reply (llm_448a037a, services.yaml) and 1 from this contradiction. The profile cannot tell them apart.

Criteria polarity does not matter. The persona inverted its criteria on :1239: its verification criterion, "Cache directory creation is protected by a lock to prevent race conditions", describes the safe state. I replayed it with the criteria the right way round and the reply's matched lists swapped to match. The invalidation is still genuine, _reason_confirms is still True on the title alone, and the finding still ends VERIFIED MEDIUM with no note. A fix cannot rely on the criteria's polarity.

Independent of PR #1055 (#845). I replayed offline at origin/fix/verdicts-point-at-evidence (66cc387). The saved reply and S10's two candidates, with their verdict fields reset, went through _parse_verifier_payload, _bind_verdicts_to_findings and _apply_bound_verdicts_to_findings, with no model, gateway or network call.

Not a v0.2.25 regression. The withdrawal and its place before _verdict_status shipped in v0.2.23 (ea49d6e). The same replay with v0.2.24's code gives VERIFIED MEDIUM with no note.

How often [estimate]:

  • Of 2,628 verifier verdicts in .data/cache/llm, 320 both confirm and match an invalidation criterion.
  • 74 of those have no _NEGATION word in the reason.
  • 46 of those cover their own title or matched verification criteria at 0.6 or more.
  • This is a proxy. It uses the reply's own title and matched criteria, not the finding's, and does not separate genuine criteria from restating ones.

Source: .data/review-evaluation-20261003-s10.md, sections 1.3 and 3. This uses the D10 mechanism as the evaluation's verification pass corrected it.

Acceptance criteria

  • A verdict that confirms its finding (verified: true or status VERIFIED) and matches an invalidation criterion that _restates_the_finding judges genuine never ends VERIFIED, whatever its reason says.
    • It ends UNVERIFIED and reportable, with the contradiction note.
    • It takes no verified_by, verified_at or citation from the verdict.
    • The self-refutation withdrawal still applies to a verdict that only refutes.
  • Every verdict that both confirms and refutes (_verdict_status's refuted-and-confirmed branch) gets the contradiction note instead of verifier-inconclusive.
  • Golden test: llm_acc69d97's reply and S10's two findings (verification.py:1221 and :1239, verdict fields reset), trimmed to a fixture and run through _bind_verdicts_to_findings and _apply_bound_verdicts_to_findings.
    • Both end UNVERIFIED with the contradiction note.
    • The test fails on the current code, where :1239 ends VERIFIED and :1221 ends verifier-inconclusive.
  • The :1239 fixture with its criteria the right way round also ends UNVERIFIED with the contradiction note, and fails on the current code. Its verification criterion is "The code does not implement explicit race condition protection for cache directory creation", its invalidation criterion is "Cache directory creation is protected by a lock to prevent race conditions", and the reply's matched lists are swapped to match.
  • Tests pin what stays unchanged:
    • S10's three pricing verdicts stay UNVERIFIED with verifier-self-refutation (llm_4df8c3ec: verified: false, INVALIDATED on criteria that restate the finding).
    • S10's 16 services.yaml verdicts stay verifier-inconclusive (llm_448a037a, all UNVERIFIED).
    • A confirmation whose matched invalidation criteria all restate the finding is still VERIFIED.
  • A replay over the cached verifier replies whose findings are saved in .data/reviews/*/candidates.json counts the verdicts whose outcome or note changes. The PR lists them with a one-line judgment each.
  • _unverified_note_counts counts the contradiction note under its own kind. A test gives it one such finding.
  • The tests run offline, call no model, and each runs well under 1 s.
  • changelog.d/1059.md records the fix under ### Fixed. CHANGELOG.md is not edited.
  • uv run devops ci passes.

Key questions

Depends on: none.
Order:

Related:

Activity

  1. added
    type/bug
    scope/review
    priority/p1-high
    on Oct 3, 2026
  2. dan-petty commented on Oct 3, 2026

    @dan-petty
    OwnerAuthor

    Frozen by the evidence-first review redesign (#1137, owner direction of 2026-10-03): patches to the model generator and verifier stop, and tool-layer fixes continue. This item patches code that #1150 deletes (the verifier path in verification.py, the guards and verifier prompts, construct_validator.py, criteria_evidence.py, and the known-false-positive catalog).

    It stays open, labelled status/blocked, and closes as not planned with "Superseded by #1150" when that item lands. Until then, the interim is the tools-only review (--no-persona-review --no-verification). Do not start work on it.

  3. added
    status/blocked
    on Oct 3, 2026
  4. added this to the v0.2.28 milestone on Oct 6, 2026
  5. dan-petty-bot commented on Oct 6, 2026

    @dan-petty-bot
    Collaborator

    Moved to v0.2.28: v0.2.28 started with fewer than its 12 items and was topped up to 12 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)

  6. dan-petty commented on Oct 7, 2026

    @dan-petty
    OwnerAuthor

    Resolved by PR #1273 into release/v0.2.28

  7. added a commit that references this issue on Oct 7, 2026
  8. removed
    status/blocked
    on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority/p1-highscope/reviewtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions