Repository navigation
Description
Problem
At the release/v0.2.25 tip (da50329), a finding that its verification criteria verify never reaches the verifier, and a false finding can now take that path.
_evaluate_criteria_verdict (src/devops_cli/ai/review/review_environment.py:476-505) returns VERIFIED with by="criteria" when one passing verification command counts as evidence and every verification command has finished (:498-504). Criteria run during deterministic pre-verification (ai/review/verification.py:1444-1447). Only an UNVERIFIED finding is shown to the verifier (_awaits_verdict, verification.py:2186-2188, used at :2267-2275), so that verdict is final. The module docstring says so: "A verdict the criteria settle is final: the model never sees the finding" (ai/review/criteria_evidence.py:3).
Before #847, criteria ran with a 5 s limit, and a script that imports this project's code often timed out: 1,310 of the 2,817 saved python criteria that import it (devops_cli or src.devops_cli) did, both of S8's chunker asserts among them. #847 (PR #1040, merged 02:14 UTC on 2026-10-03) runs them with the reviewed project's .venv first on PATH (sandbox/host.py:453-467) and a 30 s python limit (config/defaults.py:423). That widens the path. A script that imports quickly could already take it (chaos_runner.py:87-94, below).
Golden case. Review session 20261003-012555 (S8) raised src/devops_cli/ai/review/chunker.py:395 MEDIUM, "Undefined method call on PurePosixPath". It claims PurePosixPath has no full_match, so the call raises AttributeError. The claim is false: PurePath.full_match exists on Python 3.13 and later, and pyproject.toml:10 requires Python 3.14 or later. Its two verification criteria are:
python -c "from devops_cli.ai.review.chunker import skips_persona_review; assert skips_persona_review('some/unknown/file.txt') is False"python -c "from devops_cli.ai.review.chunker import skips_persona_review; assert skips_persona_review('docs/commands/example.md') is True"
In S8 both timed out at 5 s (5.155 s and 5.003 s), and the verifier then INVALIDATED the finding. An offline replay at da50329 ran S8's finding through _validate_segment_findings, with the real bubblewrap sandbox, a read-only clone of da50329, a copy of the project's .venv and a stub verifier client:
- Both commands exited 0, in 15.6 s and 15.2 s, at a 1-minute load of 13 on 16 CPUs.
- The finding ended VERIFIED,
verified_by="criteria", confidence 1.0. The stub was never called. - Run directly with the project interpreter, each command took 7.4 to 8.4 s (8.7 to 9.6 s CPU) at load 5 to 7, and 15 to 25 s at load 13 to 22. The evaluation measured 6.1 s and 7.3 s.
- Every run is under the 30 s limit.
S9 (20261003-021501) did not raise this finding and ran no criteria. It started at da50329, but the checkout moved to 0ce4736 at 02:39:03, during its persona stage. Its verification stage then imported 0ce4736's sandbox/host.py beside da50329's review_environment.py. All 7 findings with executable criteria ended verification-unavailable: AttributeError ('HostSandboxResult' object has no attribute 'timed_out', reproduced offline with the same mix; pure da50329 runs the criteria). No review has shown the path live yet.
Why #846's evidence rule counts these commands. The rule did what it says:
- Each script imports
skips_persona_reviewfromdevops_cli.ai.review.chunker, a name the cited file imports as (_module_names,criteria_evidence.py:360-374). - The
assertcomputes with that name (_uses,:244-247). - It compares with
FalseorTrue, notNone, so_tests_existence(:225-242) does not treat it as an existence test. checksreturns True (:269-272).
The rule answers one question: does the command run the cited code and check its outcome? It cannot answer the second one: which side of the claim does a pass support? Both asserts check the opposite of the claim, that the function returns the right value without raising. Their descriptions say so: "returns False and does not raise an exception". They are invalidation criteria filed as verification criteria, and they pass because the claim is false. src/devops_cli/ai/tasks/review.md:44 already tells the persona that verification criteria "pass only while the defect exists". The direction depends on what the claim means, so no AST rule can check it. Only the verifier can.
History agrees. A replay of da50329's counts_as_evidence over the 1,456 criteria verdicts saved in 20 sessions (574 VERIFIED, 882 INVALIDATED) finds:
- 0 of the 574 VERIFIED rest on a command that counts. S8's chunker case would be the first, and it is false.
- Over all 2,292 passing verification commands (once per finding), 2 count. Both are on
src/devops_cli/k8s/chaos_runner.py:87-94CRITICAL in20260928-201857, "Insecure Namespace Validation Allows Privilege Escalation", and passed in 4.2 s and 4.8 s. Both check that the code rejects the namespaces..and/etc, the opposite of the claim, as S8's asserts do. A passing invalidationprintthat does not count made the finding non-discriminating at da50329, and the verifier INVALIDATED it. Without thatprint, a false CRITICAL would be VERIFIED by criteria, and the CRITICAL cap would not apply. - 4 of the 882 INVALIDATED do. 2 test the claim directly (
exceptions/security.py:48andai/review_schema.py:767-770). 2 test a success path beside the claim (commands/install_tools.py:225in20261001-224227,telemetry/memory_profiler.py:339-350in20260928-201857). All 4 outcomes are right (one person's judgment).
A criterion that runs the cited test does not count. In S8, tests/test_rag_multi_project_indexer.py:66 LOW claims the test raises TypeError when it builds DummyEmbedder. Its invalidation criterion imports test_multi_project_indexing, the test that spans line 66 (defined at :24), and calls it. The command exited 0 in 4.135 s in S8 and 7.6 s in the replay, which refutes the claim. counts_as_evidence returns False, because the script holds no assert, raise or exit: the check is the test's own asserts. The finding went to the verifier, the reply was cut, and it was reported as LOW UNVERIFIED. Wrapping the same call in a trivial assert ... is None makes it count.
Calling the cited test is common, and it shows why the verdict change must come first. In saved sessions, more than 70 distinct criteria call a test function imported from the cited test module. Such a call passed on 11 findings:
- 2 as an invalidation criterion alone: this test_rag:66 case in S5 (
20261002-205520), where it settled INVALIDATED before fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846's rule, and in S8. - 5 where the persona filed the same call on both sides, all titled "Incorrect assertion in ..." (
tests/test_review_prompt_guardrails.py:50,:64,:80,:98and:119in20261001-224227). Both sides pass, so the non-discriminating rule leaves them UNVERIFIED. - 4 as a verification criterion alone, on claims that a test is wrong or too weak. A passing run does not confirm such a claim.
tests/test_pipeline_protocol.py:114was VERIFIED by criteria this way in20260928-201857, and:114-117again in20261001-224227. The others aretests/test_finding_repetition_compression.py:60-85andtests/test_watchers.py:30, both in20261001-224227.
If the test call counted while a criteria VERIFIED stays final, those 4 passes would settle VERIFIED by criteria.
Two leftovers depend on criteria VERIFIED.
- The hedge cap exempts a hedged title that is VERIFIED by
criteria(ai/review/calibration.py:77-82, withCONST_REVIEW_EVIDENTIAL_ADJUDICATORSatconfig/constants.py:2974). After this fix no finding can meet it. - Merging two findings writes
verified_by="criteria"on a VERIFIED result that has no adjudicator (ai/review_schema.py:1139). The verdict invariants already require an adjudicator on every VERIFIED finding (ai/review/verdicts.py:107-110).
Tests pin the current behaviour:
tests/test_executable_criteria.py:296-311,:314-331,:457-467,:545and:604expect("VERIFIED", ..., "criteria", ...).test_criteria_execution_verdict_finality(tests/test_verdict_writers.py:118-166) expects VERIFIED bycriteriaand a verifier that is never called.- The hedge case at
tests/test_review_taxonomy_and_severity.py:129-136expects a hedged title VERIFIED bycriteriato keep HIGH. docs/SDLC.md:233says hedged titles are MEDIUM at most "unless executed criteria verified them".
Acceptance criteria
-
_evaluate_criteria_verdictnever returns VERIFIED. A passing verification command that counts as evidence is recorded inverified_criteria_matched, and the finding stays UNVERIFIED, so the verifier is shown it. Criteria set no confidence on it. The parameters that only served the VERIFIED branch (verification_commands,exec_resultsand thecompletedset) go. - A golden test trims S8's
chunker.py:395finding to a fixture with its two commands, writes the cited file at its path under the test's root (criteria run only for a cited file that exists,verification.py:1479-1486), replays the commands as passing (recorded results with the sandbox faked, as_replayingdoes intests/test_executable_criteria.py), and runs it through_validate_segment_findingswith a stub client. The stub is shown the finding. When the stub reply is cut (finish_reasonlength) or gives no verdict, the finding ends UNVERIFIED with that note. When the stub refutes it, it ends INVALIDATED byllm. The test fails on the current code, where the finding ends VERIFIED bycriteriaand the stub is never called. - A passing invalidation command that counts still settles INVALIDATED by
criteria. Passing commands on both sides still leave the finding UNVERIFIED withCONST_CRITERIA_NON_DISCRIMINATING(review_environment.py:492-493). The existing tests for both keep passing. -
counts_as_evidencecounts apython -cscript that calls, as a statement, the test function whose definition spans the cited line, imported from the cited test module. It returns True for S8'stests/test_rag_multi_project_indexer.py:66invalidation command. It returns False for a bare call to another test in the same module, and for a bare call to a cited function that is not a test. The first case fails on the current code. - With that command replayed as passing, the test_rag:66 finding ends INVALIDATED by
criteria. The same kind of call filed as a verification criterion (goldentests/test_pipeline_protocol.py:114from20260928-201857) leaves the finding for the verifier. - No code path writes VERIFIED with
verified_by="criteria". A merge of two VERIFIED findings keeps an input's adjudicator and never falls back tocriteria(ai/review_schema.py:1139). The hedge exemption (calibration.py:77-82) andCONST_REVIEW_EVIDENTIAL_ADJUDICATORSare removed, so a hedged title is MEDIUM at most. A calibration test covers it. -
tests/test_executable_criteria.py:296-311,:314-331,:457-467,:545and:604assert the new outcome: UNVERIFIED, with the command inverified_criteria_matched.test_criteria_execution_verdict_finality(tests/test_verdict_writers.py:118-166) asserts that the stub verifier is shown the finding and its verdict applies. The criteria row attests/test_review_taxonomy_and_severity.py:129-136goes. - The docstrings at
criteria_evidence.py:1-23,review_environment.py:484-491andcalibration.py:9-10, anddocs/SDLC.md:233, say what criteria settle now. - The new tests run offline and call no model. They use recorded criteria results instead of a sandbox, stub RAG as
tests/test_review_advisory_backing.py:164-166does, and each runs in under 1 s. -
changelog.d/1043.mdrecords the fix under### Fixed.CHANGELOG.mdis not edited. -
uv run devops cipasses. - (person-run) On the homelab gateway, run a branch review of release/v0.2.25 at the fix commit. No candidate is VERIFIED by
criteria. Every candidate with a non-emptyverified_criteria_matchedcarries a verdict from the verifier or a verifier note. Record both counts in the PR.
Key questions
- Does INVALIDATED by criteria stay final? (proposed) Yes, for three reasons. First, the mistake seen here is a criterion that asserts the code's correct behaviour. Filed as verification, its pass is a false confirmation. Filed as invalidation, its pass is a correct refutation. Second, the verifier refutes well and confirms badly. In S7 and S8 its refutations were right 18 of 18, and 0 of its 19 confirmations were strictly valid (
.data/review-evaluation-20261003-s7-s8.md, section 3). Sending an evidential refutation to the verifier would let its weak side overturn its strong side. Third, the rule accepts few refutations: 4 of 882 in history, all with the right outcome. Each one names its command ininvalidation_reason, so a person can check it. - Should the verifier see which criteria passed? (proposed) No. fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846 keeps run-varying data out of the verifier prompt so its replies replay from cache (
CONST_VERIFIER_FINDING_FIELDS,constants.py:2933-2946), and a pass flips with a timeout. The verifier already sees the criteria as written. In S7 a verifier reason claimed "the test execution passes" for a criterion that had failed, so a pass shown as evidence would be leaned on. - What adjudicator does a confirmed finding carry, and what lifts the hedge cap? (proposed)
llm, with the commands kept inverified_criteria_matched. Nothing lifts the hedge cap. A pass can point the wrong way, as here, and the verifier's confirmations were strictly valid 0 of 19 in S7 and S8, so neither is evidence enough. The exemption has not applied since fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948 added it: S8 and S9 had no criteria VERIFIED verdict. - Should the prompt teach the direction instead? (proposed) Not in this item.
review.md:44already says verification criteria pass only while the defect exists, and the persona wrote the opposite. A prompt change cannot make a criteria VERIFIED safe, because no rule can check the direction. The persona prompt is fix(review): the devsecops persona reports misconfiguration and error-handling defects again, scored against a fixed recall set #1015's in this release. - Does a passing run of the cited test refute a claim that the test is too weak? (proposed) No, and the rule cannot tell those claims from "the test fails" claims. Accept it. In history only test_rag:66 passed as an invalidation criterion alone that called the cited test (S5 and S8), and it refuted correctly. Where a persona put the same call on both sides (5 findings in
20261001-224227, among themtests/test_review_prompt_guardrails.py:50), both pass and the non-discriminating rule leaves the finding UNVERIFIED. A test finding is LOW at most (calibration.py:98-106). - Should a bare call to any cited function count? (proposed) No. A call that returns shows only that it did not raise for those inputs. A test's own asserts are what make the call a check.
- Is this a v0.2.25 critical fix? (proposed) Yes. fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846 kept a criteria VERIFIED final and fix(review): criteria commands run in the reviewed project's environment with a measured python timeout #847 widened the path to scripts that import this project's code. Both are in v0.2.25, which has not shipped. Since fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948 the report ranks VERIFIED findings first, so a false finding VERIFIED by criteria would lead the report and never be checked.
Depends on: none.
Order: lands before the v0.2.25 cut. The test-call change lands in the same PR as the verdict change, never before it: alone it would let 4 historical passes on "the test is wrong" claims settle VERIFIED by criteria. The fix touches review_environment.py (_evaluate_criteria_verdict), criteria_evidence.py, calibration.py, config/constants.py, ai/review_schema.py:1139, docs/SDLC.md and their tests. #845 edits verdict application in verification.py, not these parts.
Related: #846 (the evidence rule). #847 (the environment and limit that widened the path). #948 (the hedge exemption and the VERIFIED-first ranking). #845 (confirmations whose own reason refutes the claim). #770 (criteria rules stated in three places). #1015 (the persona prompt in this release). The scanned-clean dependency fix filed with this item.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(review): passing criteria leave a finding for the verifier instea…
dan-petty commentedon Oct 3, 2026
Closed by #1057, merged into
release/v0.2.25.GitHub only acts on closing keywords when a pull request merges into the default branch, so this was closed by
devops gh issues close-merged.feat(release): v0.2.25 (#1089)