Repository navigation
Description
Context & Rationale
ai/review/verification.py is 2,230 lines with 100 private functions and no public one. Its entry point _validate_segment_findings (:2078-2140) takes 8 parameters and returns a 3-tuple; pipeline.py and runner.py import it, and tests patch it at three import sites. Tests import 18 underscored names from the module. Checked at 9c879ae.
A Finding reaches its Verdict through seven files: runner._run_orchestrator_review (:2147) → pipeline.execute_finding_verification (:2751) → _verify_single_file_payload (:2630) → verification._validate_segment_findings → _deterministic_pre_verification (:1346) → about 20 _check_*_hallucination functions → _check_catalog_hallucination (:1253) → common_hallucinations.is_common_hallucination / verify_ground_truth_hallucination → verdicts.apply_verdict → auto_record_invalidated_finding; then the LLM validation prompt → _bind_verdicts_to_findings → _apply_single_finding_verification (:1781) → review_environment.execute_finding_criteria → apply_verdict again; back in the pipeline a hand-written copy of 22 of the Finding's 30 fields (pipeline.py:2687-2708) → assert_verdict_invariants → files/*.json; stages/adversarial_debate may re-verdict.
apply_verdicthas 32 call sites in 7 files (23 inverification.py) and an**extra_updates: Anyescape hatch.- The human path,
commands/review.py verify_finding(:1023), re-implements a Verdict's consequences in_record_verdict_side_effects(:993-1019). pipeline.pyandverification.pyco-change in 20 of verification's 21 commits.
Deletion test: deterministic checks, catalog suppression, LLM binding, criteria execution and side-effect recording are one concept spread over five files. Collapsing them concentrates complexity.
Scope & Deliverables
- Deliverable: one verifier that takes findings plus file context and returns verdicted findings. It owns the Known false positive catalog (the rulebook refactor(review): one rulebook for known false positives #770 builds) and the mitigation ledger, so every Verdict's consequences are recorded inside it.
apply_verdictand the_check_*family become internal. The orchestrator anddevops review verify-findingcall the same verb; the 22-field copy-back disappears. - Tests: the 18 private imports become behaviour tests at the verifier's interface with a fake LLM adapter and an in-memory catalog.
test_verdict_writers,test_verdict_polarityand the common-hallucination tests survive re-pointed. - Key questions (open):
- What does the verifier's interface carry besides findings and file context (persona, scope, criteria sandbox)?
- Is adversarial debate inside the verifier or a second pass over its output?
- Where is the line between this item and refactor(review): one rulebook for known false positives #770: the verifier consumes the rulebook, or owns it?
- Constraint: no shims. refactor(review): one rulebook for known false positives #770 and refactor(review): review session store that owns layout, fingerprints and verdicts #771 touch the same files; sequence them.
Strategic Alignment
- Milestone: Backlog (no release)
- Design: CONTEXT.md (Finding, Verdict, Known false positive)
- Depends on: none
- Related: refactor(review): one rulebook for known false positives #770, feat(cli): one verdict writer, cited refutations and no unverified fix claims #601, fix(review): verdicts land on the finding shown, record who gave them, and machine-invalidated candidates can be overturned #949, fix(review): verifier verdicts bind to the wrong finding and drop confirmed findings #660, fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846
- Source: architecture review of 2026-10-02, review pipeline cluster
Scope added 2026-10-02: checked at 38517a8. #949 (e4ea2e0) moved the human path's verdict side effects into ai/review/adjudication.py (Verdict, judge_reported, judge_candidate, _record_entries). _record_verdict_side_effects no longer exists, and devops review verify (commands/review.py:1012) calls that module. #950 (v0.2.25, in flight) stops deterministic checkers from writing the learned catalog; today they still do (ai/review/verification.py:410-508, :1227-1229). After #950 a machine Verdict records nothing outside the session, and the only rule both paths share is verdicts.apply_verdict with assert_verdict_invariants. Counts at 38517a8: apply_verdict (verdicts.py:189, not :174) has 30 calls in 7 files, 23 of them in verification.py and 2 in the legacy dry-run builders that #995 deletes. **extra_updates is used at verification.py:1823 and review_environment.py:437. Tests import 37 underscored names from verification.py across 23 files, not 18. _validate_segment_findings (:2078-2140) is patched at 3 sites through 2 import paths. The 22-field copy-back is at pipeline.py:2687-2708. stages/adversarial_debate.py is a substring filter of known false positives run at reranking (pipeline.py:2871-2875), not a model debate. pipeline.py changed in 20 of verification.py's 22 commits. #987 (b1fddd0) moved pipeline.py lines after the baseline.
Acceptance criteria
- The verifier module has one public entry point. It takes one file's findings and that file's context (numbered source, diff text, analysis metadata, conventions) and returns the same findings with verdicts.
_validate_segment_findingsand its 3-tuple are gone, and the pipeline calls the entry point once per file. - The pipeline copies no Finding field back after verification. A test gives a fake verifier verdicts that set each of the 22 fields copied today to a non-default value, and asserts that each value reaches the session's files.
-
apply_verdicthas no**extra_updates. Its two users pass named fields. - The verifier takes its model through the review's client protocol (refactor(review): delete the legacy segment engine so the orchestrator is the only review engine #995) and the known-false-positive catalog as a parameter. Tests pass a fake model and an in-memory catalog, and patch no module path.
- No test imports an underscored name from the verifier module. Each behaviour those 37 imports cover is tested through the entry point, or as a refactor(review): one rulebook for known false positives #770 rulebook record once that lands.
- A test runs the verifier with an in-memory catalog and mitigation ledger, produces an INVALIDATED and a MITIGATED verdict, and asserts that both stores are unchanged.
- Only
verdicts.pyassignsstatus,verified_byorverified_aton a finding underai/review/. An AST test finds no attribute assignment to them elsewhere. It fails at 38517a8 on the copy-back (pipeline.py:2687-2708). - The tests run offline, with no model, network or scanner.
-
changelog.d/996.mdrecords the change under### Changed.CHANGELOG.mdis not edited. -
uv run devops cipasses. - (person-run) A path review of
src/devops_cli/ai/reviewcompletes after the change, anddevops review findingslists verdicts from both the deterministic checks and the model verifier.
Key questions
- What does the verifier's interface carry besides findings and file context (persona, scope, criteria sandbox)? (proposed) No persona. It carries the diff text, the file's analysis metadata (removed symbols exempt a finding), the conventions text, the thinking flag and the criteria sandbox root: today's
_validate_segment_findingsparameters (verification.py:2078-2087) withall_segmentsfolded into the file context. - Is adversarial debate inside the verifier or a second pass over its output? (proposed) Neither. It is a keyword filter of known false positives, so it belongs to refactor(review): one rulebook for known false positives #770's rulebook, which already plans to fold it in or remove it.
- Where is the line between this item and refactor(review): one rulebook for known false positives #770: the verifier consumes the rulebook, or owns it? (proposed) It consumes it. refactor(review): one rulebook for known false positives #770 owns the records and their deterministic checks, and lands first, so the
_check_*functions it folds in are not wrapped here and then rewritten there. - Does
devops review verifycall the verifier's verb, as the deliverable says? (proposed) No. Since fix(review): verdicts land on the finding shown, record who gave them, and machine-invalidated candidates can be overturned #949 a person's verdict is recorded throughadjudication.py, not verified. The paths shareapply_verdictand the invariants, and the deliverable's "same verb" line is dropped. - When does it land? (proposed) After refactor(review): delete the legacy segment engine so the orchestrator is the only review engine #995 (one engine, so
runner.pystops importing the verifier), fix(review): the review learns only from a person's verdicts, and every reader of the feedback dataset is honest #950, fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846 and fix(review): criteria commands run in the reviewed project's environment with a measured python timeout #847 (v0.2.25), refactor(review): one rulebook for known false positives #770, and the review evaluation's verifier fixes, #fix(review): the verifier sees masked windows around the cited lines, not the whole file and the linked-file skeletons #1017 (windows around cited lines) and #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), which edit the same functions.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
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 person-verdict path (adjudication.py) carries into #1150 as "person-recorded verdicts become suppressions".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-bot commentedon Oct 10, 2026
Moved to v0.2.34: v0.2.34 started with fewer than its 16 items and was topped up to 16 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)
dan-petty commentedon Oct 11, 2026
Superseded by #1150