Repository navigation
Description
Problem
Two guards that protect findings from hallucinated refutations undo correct ones. In review session 20261002-205520 (S5, the first branch review after #951, at 38517a8), 11 of 19 raw verifier refutations were overturned (58%, against 9 of 43 in S3 and 7 of 42 in S4). 10 of the 11 refutations were correct, and the overturned findings are 10 of S5's 24 reported entries (.data/review-evaluation-20261002-s5.md, section 5.3). Had they stood, about 15 entries would have been reported. S6 (20261002-214641) replays the same verdicts from the cache.
How each guard misfires (lines at 79e1e93):
- A path token becomes the construct.
extract_finding_construct_candidates(src/devops_cli/ai/review/construct_validator.py:228-243) takes symbols from the title and description. For 4 Semgrep findings (indexer, qdrant, and settings twice), the only candidate isdevops_cli, taken from the absolute/workspaces/...path in the scanner's description. No cited line contains it, so_validate_citation_line(src/devops_cli/ai/review/verification.py:1615-1668) downgrades the refutation to UNVERIFIED. The same token drives_find_text_relocation(construct_validator.py:271-277), which moved those findings to the first line mentioningdevops_cli: the import linesindexer.py:12,qdrant.py:18andsettings.py:19. That is the mechanism behind fix(review): location parsing keeps placeholder, prose-laden and truncated locations #788's wrong-line relocations. - The citation check reads one line. For
tests/test_ai_request_priority.py, the verifier cited line 200, but the assertion is on line 202, inside the finding's own range 201-202._validate_citation_linereads only the cited line (verification.py:1654). The verifier also miscites lines while quoting the right one (it citedsettings.py:678while quoting line 656). - Self-refutation withdrawal on generic words.
_without_self_refutation(verification.py:1550-1567) withdraws an invalidation whose reason "confirms" the finding when the reason's words overlap the finding's claims at_RESTATEMENT_OVERLAP= 0.6 (:1511). On 4 kube-linter findings, the shared words are scanner boilerplate (kube, linter, security, warning), at 0.667. On the task-593 finding,_NEGATION(:1508-1510) misses "incorrectly", so a negating reason reads as a confirmation.
The guards still do their job once: the 11th overturned refutation, on tests/test_review_prompt_consistency.py:434-439, was hallucinated (it said line 439 is blank; it holds exec(code, …)), and the guard rightly distrusted it. The fix must keep that case.
Acceptance criteria
- Path components never become construct candidates or relocation anchors. A candidate that occurs only inside a filesystem path in the finding's text (a segment between
/separators, or the package name of the reviewed file's own path) is dropped. A test with a Semgrep finding whose description holds/workspaces/x/src/devops_cli/ai/rag/indexer.pygets nodevops_clicandidate and is not relocated. - A refutation's citation counts when the cited line or any line of the finding's own cited range holds a construct token, or the quoted text in the reason matches a line within 3 lines of the citation that lies inside the finding's range. A test replays the
test_ai_request_priority.pycase: the refutation stands. - The restatement overlap ignores scanner boilerplate words (the scanner's name and its rule-title vocabulary, kept as a named table beside the guard), and
_NEGATIONrecognises "incorrect", "incorrectly", "false", "falsely", "mistaken" and "wrongly". Tests replay the 4 kube-linter findings and the task-593 finding: no withdrawal. - Golden replays from S5's saved verdicts (
.data/reviews/20261002-205520, fixtures trimmed to the finding, the verifier item and the cited lines): indexer, qdrant, settings twice and test_ai_request_priority keep INVALIDATED; the 4 kube-linter findings and task-593 keep INVALIDATED; test_review_prompt_consistency stays UNVERIFIED (the hallucinated refutation is still blocked). - The tests run offline, call no model, and each runs well under 1 s.
-
changelog.d/1021.mdrecords the fix under### Fixed.CHANGELOG.mdis not edited. -
uv run devops cipasses. - (person-run) A branch review of the same commit with
--no-cachereports about 15 entries where S5 reported 24, with no valid finding lost against S5's classification (section 3.1 of the S5 evaluation).
Key questions
- Why not drop the guards? (proposed) No. They block hallucinated refutations; the test_review_prompt_consistency case shows they still do. The fix narrows what counts as evidence against a refutation.
- Does this overlap fix(review): a finding that cites a removed symbol keeps its mark, the verifier sees the removed lines, and a refutation of it stands #1018 (refutations of findings about removed symbols)? (proposed) Same guard, different trigger. fix(review): a finding that cites a removed symbol keeps its mark, the verifier sees the removed lines, and a refutation of it stands #1018 handles a construct that no line holds because the diff removed it; this item handles tokens that were never constructs and citations that are off by a line. Whichever lands second rebases.
- Does this overlap fix(review): location parsing keeps placeholder, prose-laden and truncated locations #788? (proposed) It removes the path-token relocation at its root. fix(review): location parsing keeps placeholder, prose-laden and truncated locations #788 keeps absolute scanner paths and the other relocation cases.
- Does refactor(review): one finding verifier owns the verdict and its side effects #996 (one finding verifier) make this moot? (proposed) No. refactor(review): one finding verifier owns the verdict and its side effects #996 is a P2 refactor that moves this code without changing its rules. Fixing the rules now gives refactor(review): one finding verifier owns the verdict and its side effects #996 tests to keep green.
Depends on: none.
Order: after #846 (v0.2.25), which edits the same verification module; #1018 and #996 follow.
Related: #788, #1018, #996, #846, #948 (severity of what remains).
Scope added 2026-10-02 from review session 20261002-214641 (.data/review-evaluation-20261002-s6.md, section 4.1): scanner findings feed the same guard spurious construct tokens from two more sources.
-
Bandit writes its description as "Bandit {test_name} flaw detected at line N" (
security/bandit.py:34), so the construct check took the rule namehardcoded_tmp_directoryas the cited code and invalidated 3 B108 findings because that "code" is absent. The outcome was right; the reason was wrong. -
Semgrep's finding on
tests/test_pr_cmd.py:1589was invalidated on the file stemtest_pr_cmd. -
Construct candidates never come from a scanner's rule or test name, or from the stem of the reviewed file. Golden cases: S6's 3 B108 candidates get no deterministic construct verdict from a rule-name token, and
test_pr_cmd.py:1589none from its file stem.
Scope added 2026-10-03 from review sessions 20261003-005122 (S7, at b6847e9) and 20261003-012555 (S8, at 0ce4736) (.data/review-evaluation-20261003-s7-s8.md, sections 3, 6 and 7). Lines are at da50329. The construct guard downgraded 3 INVALIDATED verdicts in S7 and 9 in S8, all on false findings. In S8 it was the largest single cause of UNVERIFIED (9 of 17 candidates). All 9 S8 downgrades reproduce at da50329 through _validate_citation_line (src/devops_cli/ai/review/verification.py:1734-1790). Four of them are cases this issue already names: qdrant.py:18, settings.py:19 twice and test_ai_request_priority.py:201. The settings pair cite the except lines :653 and :655, not the logger calls at :656 and :659, so they clear only because no construct token remains once path tokens are dropped. Four gaps remain.
-
A citation inside the construct's own call.
tests/test_scan_outcomes_and_gating.py:322is a false finding about a test fixture. Both runs refuted it with evidence (S7 cachellm_5a3a2f22…, ledger row 10002; S8llm_76a0d6bf…, row 10057: "Line 322 constructs a subprocess.TimeoutExpired with a command list…"). The candidates aresubprocess.TimeoutExpired,timeoutexpired,subprocessand the test's name.subprocess.TimeoutExpired(is on :321, inside apytest.mark.parametrizedecorator, and the call spans 321-323. Line 322 holds only its arguments._check_ast_symbol_at_line(verification.py:1713-1731) compares definition symbols only, and the test function's span starts at itsdefon :328, so the decorator is outside it.collect_ast_constructs(src/devops_cli/ai/review/construct_validator.py:181) already yields acallconstructsubprocess.TimeoutExpiredspanning 321-323, but the guard does not use it. The finding's range is the single line 322, so this issue's "inside the finding's own range" criterion does not reach it. -
"Cannot verify" refutations. The 4 kube-linter
dangling-servicefindings onk8s/monitoring/service-aliases.yamlthat this issue's golden replay names got different replies in S8. qwen3-coder (row 10062, cachellm_baf9dfc4…) refuted all 4 because "the issue cannot be verified from the given code excerpt". The replies matched the prompt's Location rule (src/devops_cli/ai/tasks/verify_finding_system.md:22), although the path resolves, and one reason agrees the Service "lacks matching pod labels". The prompt asks for the opposite when the settling code is not shown: "Unverified is the answer" (verify_finding_system.md:11), and for a claimed absence, "leave the finding unverified" (:41). S5's replies (llm_2741b32c…) carry no evidence either. They call the finding "a configuration concern" and "not a security vulnerability", citeports:or- name:lines (14, 34, 53, 72) and name no pods. Replayed at da50329 with the withdrawal fixed as this issue specifies, the construct guard still downgrades all 4 S5 replies, because the candidates, each Service's quoted name and its namespacemonitoring, are on none of the cited lines. So "the 4 kube-linter findings keep INVALIDATED" can pass only by loosening the guard for replies that hold no evidence. fix(review): the review's scanner config drops the rules that never produced a valid finding on this repository #1024 dropsdangling-servicefrom the review's scanners, which would make these 4 cases moot. The same wording appears in 3 other S7/S8 refutations, all applied as INVALIDATED. S7's reply onpyproject.toml:133-134(llm_f67fcf25…, row 10001) says "this finding cannot be validated or invalidated based on the provided code alone". S8's reply on the same finding (llm_f32dcd98…, row 10049) says "dependency advisories … cannot be verified", about advisories, not the claim. S8's reply onchunker.py:395(llm_b39f5376…, row 10058) says "we cannot verify against the exact line". No S5 or S6 refutation uses the wording. -
A rejected verdict still writes.
_apply_single_finding_verification(verification.py:1928-1993) applies the verifier's severity andseverity_raw(:1984-1985, from_resolve_finding_attributesat:1876-1896), confidence (:1982), location, observed and expected values (:1986-1988) and matched criteria (:1989-1990), whatever status the guards leave. Severity is new with fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846. Confidence and the matched lists were already written in S5 and S6. S8's qdrant.py:18 shows it: the rejected refutation (llm_dc9a0d9b…, row 10046) took the finding from MEDIUM to LOW withseverity_rawMEDIUM, set confidence 0.9 and two matched invalidation criteria, and the report shows it as LOW. Replayed at da50329 with the finding's location made relative, the same rejected verdict also rewrites the location to the verifier's absolute/workspaces/...path. That refutation cites :165, inside the finding's original range 164-166, and its only candidate is the path tokendevops_cli. Once this issue's path-token fix lands it stands, so it cannot be this defect's golden case. -
The guard's note has no kind. The note is free text ("Refutation cited line N does not contain cited construct tokens; downgraded to UNVERIFIED",
verification.py:1786)._unverified_note_counts(src/devops_cli/ai/review_schema.py:1632-1645) counts it asother, as its docstring documents. S8'sprofile.jsonshowsother: 9, so S8's largest cause of UNVERIFIED cannot be read from the profile. -
A refutation's citation also counts when the cited line lies inside the span of a
callconstruct whose name matches a construct token (collect_ast_constructs). A golden replay oftests/test_scan_outcomes_and_gating.py:322with S7's and S8's verdicts keeps INVALIDATED, and fails on the current code. The same verdict citing :320 or :324, outside the call, is still downgraded. The hallucinated test_review_prompt_consistency refutation still ends UNVERIFIED. -
A refutation whose reason says the finding, its claim or the issue cannot be verified, validated or confirmed from the code shown is not applied. The finding ends UNVERIFIED with
verifier-inconclusive, whatever the citation guard decides. Golden: S8's 4 dangling-service verdicts (llm_baf9dfc4…) and S7'spyproject.toml:133-134verdict (llm_f67fcf25…), which fails on the current code (INVALIDATED). Not caught: the evidence-based S8 refutations of qdrant.py:18, test_ai_request_priority.py:201 and test_scan_outcomes_and_gating.py:322, and the two S8 replies whose wording is about something else (llm_f32dcd98…, advisories;llm_b39f5376…, the line). -
The golden expectation for the 4 dangling-service findings changes. The no-withdrawal test on S5's replies stays. A synthetic refutation that cites a line of the Service's
selectorand names the workload or chart whose pod labels match it keeps INVALIDATED. S5's and S8's replies have neither, and all 8 end UNVERIFIED with a note. If fix(review): the review's scanner config drops the rules that never produced a valid finding on this repository #1024 lands first, these 4 golden cases are dropped instead. -
A verdict that a guard turns into UNVERIFIED writes only its note. That covers the citation guard, the rule above, the criteria-refutation rule (
verification.py:1837-1838), the self-refutation withdrawal and the MITIGATED degradation (:1604-1618,:1855-1857). The finding keeps its severity,severity_raw, confidence, location, citation line, observed and expected values and matched-criteria lists. Golden: S8's qdrant.py:18 verdict (llm_dc9a0d9b…) with itscitation_lineremoved, which the guard still rejects after this fix, on a MEDIUM finding with a relative location. The finding stays MEDIUM with noseverity_raw, keeps its location, and its confidence and matched lists are unchanged. It fails on the current code (LOW, raw MEDIUM, confidence 0.9, two matched criteria, absolute location). -
The citation guard's notes name a kind of their own in
CONST_VERIFICATION_NOTE_KINDS(src/devops_cli/config/constants.py:2919-2927), with the detail after:. This covers all four notes_validate_citation_linewrites: no cited line, out of range, past the end of the file, and no construct token. A test gives_unverified_note_countsone UNVERIFIED finding per note and counts 4 under that kind and none underother. It fails on the current code, which counts them asother.
Scope added 2026-10-03 from review session 20261003-021501 (S9; .data/review-evaluation-20261003-s9.md, section 4): a fresh refutation of dryrun:99 cited the adjacent line :98 and was downgraded, another case for scope (a). S9's 9 "other" notes were 7 S8 verdicts replayed through the guard, the dryrun refutation and 1 checkout artifact, which supports scope (d): each guard reason gets its own note kind. D2 recurred (qdrant:18 MEDIUM to LOW).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 3, 2026
What S10 adds (review session
20261003-034353, release/v0.2.25 at d6ebe97;.data/review-evaluation-20261003-s10.md, section 3).Gaps in scope (d). All 18 of S10's
othernotes are one guard reason, "Refutation cited line N does not contain cited construct tokens" (verification.py:1786). So (d) as written would bringotherto 0. It does not cover::1797);:1816-1820);:1846). It is never counted, because_unverified_note_counts(review_schema.py:1632-1645) counts only UNVERIFIED findings;If PR fix(review): mitigation and confirmation verdicts point at evidence that exists, and a verdict whose reason refutes it is not applied (#845) #1055 (fix(review): mitigation and confirmation verdicts must point at evidence that exists #845) merges first, it replaces the MITIGATED notes with a counted
mitigation-unprovenkind. The criteria-refutation note stays free text there.Golden negative:
llm_68866e04×9 must stay blocked.stop) refuted the 9 valid kube-linterno-read-only-root-fsfindings onk8s/llm/profiles/ollama-profiles.yaml.---separator line (106 to 834) and applies the "internal connectors" convention, which.devops/review.md:20-22limits to SSRF claims.ollama-16gib,ollama,llm), not path or rule tokens, and kube-linter rows have no line range. So this issue's changes keep these refutations blocked. A test should pin that.Interaction with fix(review): the severity cap for unverified findings does not depend on whether the title happens to hedge #1051 (D2). 13 reported rows took LOW from a verdict the guards rejected: the 9 ollama rows and qdrant:18 (raw MEDIUM), and pricing ×3 (raw HIGH). Every move was in the right direction this time. Scope (c) would put the ollama rows back to MEDIUM and pricing back to HIGH, so fix(review): the severity cap for unverified findings does not depend on whether the title happens to hedge #1051's broad-except cap has to land with (c) or before it.
Title echo in the withdrawal (from 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). A reason with no
_NEGATIONword that repeats the title ("This mitigates the potential race condition described in the finding") covers the title at 1.0._reason_confirmsthen reads it as a confirmation, even when the criteria are the right way round: the verification criterion alone is covered at only 0.45. 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 handles the case where a verdict both confirms and refutes, by changing the order of the checks. On a verdict that only refutes, the same echo would withdraw a correct refutation. That belongs with this issue's withdrawal-on-generic-words scope.dan-petty commentedon Oct 3, 2026
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). Its v0.2.29 slot is freed when it closes; the evidence comment stays as input to #1150. In S5 its guards overturned 10 correct refutations.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.dan-petty commentedon Oct 8, 2026
Moved to the backlog: a Blocked item can't join a starting release (v0.2.29). (devops roadmap reprioritize)
dan-petty commentedon Oct 11, 2026
Moved to the backlog: a Blocked item can't join a starting release (v0.2.35). (devops roadmap reprioritize)
dan-petty commentedon Oct 17, 2026
Closed as not planned in the 2026-10-17 unblocking review: Superseded by #1150. The construct, citation and self-refutation guards are deleted. The kube-linter dangling-service part stays with #1024.