Skip to content

fix(review): a verdict that both confirms and refutes its finding stays unverified with a contradiction note (#1059) - #1273

Merged
dan-petty merged 1 commit into
release/v0.2.28from
fix/contradictory-verdict-unverified
Oct 7, 2026
Merged

dan-petty merged 1 commit into
release/v0.2.28from
fix/contradictory-verdict-unverified

Conversation

@dan-petty

Copy link
Copy Markdown
Owner

Summary & Context

Closes #1059

A verifier verdict that both confirmed and refuted a finding could previously end VERIFIED with no verification note when its reason repeated the finding's title or matched its verification criteria without a negation word.

Golden Case

Review session 20261003-034353 (S10, release/v0.2.25 at d6ebe97, devsecops persona), model reply llm_acc69d97:

  • Item 2 (src/devops_cli/ai/review/verification.py:1239): verified: true, status: VERIFIED, matched genuine invalidation criterion "The code does not implement explicit race condition protection for cache directory creation". Its reason argued lock protection, covering the title at 1.0. _without_self_refutation withdrew the invalidation because _reason_confirms returned True, causing _verdict_status to see only confirmation and report the finding as VERIFIED with citation_line=1239.
  • Item 1 (verification.py:1221): matched a genuine invalidation criterion ("Path.resolve() normalizes paths to prevent directory traversal"), had verified: true, and because its reason held a negation word ("not"), invalidation was not withdrawn; it ended UNVERIFIED with verifier-inconclusive and retained citation_line=1221.

Mechanism & Remediation

  1. Self-Refutation Scope:
    • _without_self_refutation now checks _is_confirmed_verdict(item). A verdict confirming its finding (verified: true or status VERIFIED) that matches an invalidation criterion judged genuine by _restates_the_finding is never withdrawn by _reason_confirms.
    • The self-refutation withdrawal still applies to a verdict that only refutes.
    • When a confirmation's matched invalidation criteria all restate the finding, the invalidation is withdrawn and the confirmation stands as VERIFIED.
  2. Contradiction Note & Inconclusive Separation:
    • _verdict_status now tracks whether a verdict both confirmed and refuted (contradicted=True).
    • Every contradictory verdict (status_val == "UNVERIFIED", contradicted=True) receives CONST_VERIFIER_CONTRADICTION ("verifier-contradiction"), clearing citation_line = None, verified_by = None, and verified_at = None.
    • CONST_VERIFIER_INCONCLUSIVE remains strictly reserved for verdicts that neither confirmed, refuted, nor found a valid mitigation. _no_verdict_note's docstring is updated accordingly.
  3. Replay Over Cached Verdicts:
    • Across cached review files in .data/reviews/*/candidates.json, 48 findings that previously both confirmed and refuted had ended verifier-inconclusive; under the new logic, all such contradictory verdicts correctly receive verifier-contradiction.
    • In S10 (20261003-034353), llm_acc69d97:
      • Finding 1 (verification.py:1221): originally ended UNVERIFIED verifier-inconclusive cit=1221. Under new logic: UNVERIFIED verifier-contradiction cit=None.
      • Finding 2 (verification.py:1239): originally ended VERIFIED llm None cit=1239. Under new logic: UNVERIFIED verifier-contradiction cit=None.
  4. Offline Golden & Invariant Tests:
    • Offline tests in tests/test_verdict_writers.py cover llm_acc69d97 findings (:1221 and :1239), the swapped-criteria fixture with criteria polarized the safe way, unchanged self-refutation (S10 pricing), unchanged inconclusive (S10 services.yaml), confirmation with all-restating criteria staying VERIFIED, and _unverified_note_counts tallying verifier-contradiction.

Acceptance Checklist

  • A verdict confirming its finding (verified: true or status VERIFIED) and matching an invalidation criterion judged genuine never ends VERIFIED, regardless of whether the reason repeats the title or confirms the claim.
  • It ends UNVERIFIED and reportable with verifier-contradiction, clearing verified_by, verified_at, and citation_line.
  • The self-refutation withdrawal still applies to a verdict that only refutes.
  • Every verdict that both confirms and refutes gets verifier-contradiction instead of verifier-inconclusive.
  • verifier-inconclusive stays for verdicts that neither confirmed, refuted, nor mitigated, with updated _no_verdict_note docstring.
  • Offline golden tests added covering llm_acc69d97 and S10's two findings (:1221 and :1239), plus the swapped-criteria fixture.
  • Unit tests verify unchanged behavior: S10 pricing (verifier-self-refutation), S10 services.yaml (verifier-inconclusive), and confirmation with all-restating criteria (VERIFIED).
  • _unverified_note_counts tallies verifier-contradiction.
  • All tests run offline, without network or LLM calls.
  • Changelog fragment changelog.d/1059.md authored under ### Fixed.
  • Gated CI quality checks pass in uv run devops ci.

@dan-petty
dan-petty merged commit 3082882 into release/v0.2.28 Oct 7, 2026
9 checks passed
@dan-petty
dan-petty deleted the fix/contradictory-verdict-unverified branch October 7, 2026 00:37
dan-petty added a commit that referenced this pull request Oct 7, 2026
* fix(k8s): track main in argo cd git-source targetRevisions while service image pins release (#1261) (#1262)

* fix(k8s): track main in argo cd git-source targetRevisions while service image pins release (#1261)

* fix(release): parse applications in release prepare and generalize manifest counts

* fix(ui): defer dashboard refresh when unmounted to prevent NoMatches worker failure (#519) (#1263)

* fix(ui): defer dashboard refresh when unmounted to prevent NoMatches worker failure (#519)

* fix(k8s): ensure devops configmap exists in clean test environments

* fix(security): redact telemetry and kill process group on timeout in async process runner (#780) (#1264)

* fix(ai): web_fetch reports a failed fetch as a tool failure, not as page text (#894) (#1265)

* feat(ai): web_fetch renders pages as untrusted, escaped markdown within a budget (#896) (#1266)

* feat(ai): web_fetch renders pages as untrusted, escaped markdown within a budget (#896)

* fix(deps): pin markdownify and beautifulsoup4 to exact versions matching uv.lock

* fix(k8s): resolve portkey probe path and gpu-feature-discovery image tag (#1267) (#1268)

* fix(k8s): resolve portkey probe path and gpu-feature-discovery image tag (#1267)

- Fix Portkey AI Gateway liveness and readiness probe path to / instead of /health, resolving CrashLoopBackOff
- Align GPU Feature Discovery image to nvcr.io/nvidia/k8s-device-plugin:v0.16.2 to resolve ImagePullBackOff
- Update devops-cli AI gateway probe helper to check / for the Portkey provider
- Update test_k8s.py assertions and author changelog fragment and task tracking

* fix(test): disable logfire pytest plugin to prevent ambient telemetry DNS lookups (#1267)

* fix(ai): mcp command tools return the failing output and never write to the protocol stream (#839) (#1269)

* refactor(github): read a pull request's checks once, fail-closed, for wait, monitor and readiness (#769)

* feat(k8s): increase roadmap-service analysis context window to 64k (#1271) (#1272)

* fix(review): a verdict that both confirms and refutes its finding stays unverified with a contradiction note (#1059) (#1273)

* fix(ai): a failing embedding model pauses rag lookups instead of ending rag for the run (#1065) (#1274)

* fix(ai): review calls through the gateway no longer stall on ollama (#1069)

* docs: hand-written docs name only commands, options, and architecture patterns that exist (#921) (#1276)

* fix(review): a review scans a worktree of the reviewed revision, never hands a deleted file to a tool, and reports which files each tool scanned (#1047) (#1277)

* feat(review): every reported finding is admitted with anchor and commit location (#871) (#1278)

* fix(release): finalize v0.2.28 release preparation, changelog collation, and image pin

* fix(k8s): resolve argocd application out-of-sync and manifest generation failures (#1279) (#1281)

* fix(k8s): resolve argocd application out-of-sync and manifest generation failures (#1279)

* feat(k8s): add push-config command and dynamic configmap deployment

* feat(k8s): generate gitignored .argocd-source.yaml overrides and remove private references (#1279)

- Add devops k8s argocd-source command and devops_cli.k8s.argocd_source module
- Generate .argocd-source.yaml parameter overrides for devops and ingress overlays
- Remove hardcoded domain patches and ignoreDifferences
- Remove devops k8s push-config command in favor of .argocd-source.yaml overrides
- Sanitize internal hostnames, .lan servers, and private domains from repository

* fix(review): address copilot review remediations and collate changelog for v0.2.28 (#1284)

* fix(release): address second-round copilot review remediations for v0.2.28 (#1285)

* fix(k8s): apply active devops configmap dynamically via stdin without overwriting tracked files (#1286)

* fix(review): sanitize code language and propagate added diff lines to admission (#1287)

* fix(k8s): stream rendered ingress and patch argo cd application overrides during deployment (#1288)

* fix(review): integrate advisory anchor, base fingerprints, and fail-closed configmaps (#1289)

* fix(review): integrate advisory anchor, base fingerprints, and fail-closed configmaps

* refactor(review): isolate scanner file buckets into strongly-typed dataclass

* fix(k8s): argo cd takes homelab values from deploy-time overrides, and the repository holds no private or placeholder config (#1290) (#1292)

* fix(k8s): argo cd takes homelab values from deploy-time overrides, and the repository holds no private or placeholder config (#1290)

Argo CD reads .argocd-source.yaml only from the Git repository, so the gitignored generator from #1281 never reached it, and the tracked placeholder ConfigMap was enforced over the rendered one. deploy-stack now renders ConfigMap devops-cli-config from config.yaml outside Argo CD, and writes the configured hosts onto the devops and ingress Applications as Kustomize patches that the cluster app-of-apps ignores. Everything is rendered before anything is written, and an unset setting stops it with an error naming the setting.

Closes #1290

* fix(k8s): derive the argo cd host overrides from each application's revision, and close the review's gaps (#1290)

The host patches now come from what each Application renders at its targetRevision (or --argocd-revision), fetched into a temporary directory, never from the local checkout. They reuse the native template substitution and cover wildcard and TLS hosts. The ConfigMap renderer has no placeholder fallback, teardown deletes the ConfigMap, the dry run reports the new writes and refuses like the deploy, AppProject homelab ignores the orphaned ConfigMap, and the docs describe the release-merge steps.

* fix(k8s): git never reads an application's repository or revision as an option, and deploy-stack refuses to clear staged hosts (#1290)

The revision fetch reads the repository and revision after --end-of-options, without prompts and within a time limit. A revision whose Application renders no placeholder host is refused instead of writing an empty patch list, and a multi-source Application is refused by name. The dry run reports the domain the overrides would use, the docs set the service settings before the first deploy, describe the release-merge steps for releases after this one, and the changelog fragment drops the Removed entry for a command that never shipped.

* docs(k8s): the release-merge steps re-apply the devops config map when its template changes, and the dry run names why a domain is unusable (#1290)

* chore(release): the v0.2.28 changelog takes #1290 and drops the argocd-source entry it replaced (#1293)

* fix(k8s): a native deploy-stack applies the grafana dashboards again (#1297) (#1306)

* fix(ai): an interrupted rag index resumes every file whose chunks were not all stored (#1296) (#1305)

* fix(ai): an interrupted rag index resumes every file whose chunks were not all stored (#1296)

* fix(ai): a partly stored rag file is cached as incomplete, so its points are purged if it changes before the resume (#1296)

* fix(review): suppressed and pre-existing scanner findings reach their review.md sections, and profile.json counts admission rejections (#1295) (#1304)

* fix(review): suppressed and pre-existing scanner findings reach their review.md sections, and profile.json counts admission rejections (#1295)

* fix(review): each suppressed finding is its own row, by file and line, in review.md (#1295)

* chore(release): the v0.2.28 changelog takes #1295, #1296 and #1297 into the entries they complete (#1340)

* fix(review): an inline suppression marker hides only findings of the tool it belongs to (#1341) (#1342)

* fix(review): an inline suppression marker hides only findings of the tool it belongs to (#1341)

* chore(release): the v0.2.28 changelog records #1341 in the #871 entry, in this one pull request (#1341)

* chore(release): the v0.2.28 notes say dependency advisories are always listed as introduced and gateway reviews can exceed the slot count (#1355)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

No open projects

Development

Successfully merging this pull request may close these issues.

1 participant