Repository navigation
Description
Problem
Branch and PR reviews know which symbols their diff removed (#593). When a finding names one, validate_construct_location does not invalidate it for citing a construct the file lacks. It moves the finding to the nearest diff hunk and sets verification_note = "cites removed symbol" (src/devops_cli/ai/review/construct_validator.py:396-414, reached from :466-467). That note is the only mark. It keeps the finding from the model (src/devops_cli/ai/review/verification.py:2105-2112 and :2046), and it is what removed_symbol_findings_count and the report's "Removed-Symbol Findings" line count (src/devops_cli/ai/review/pipeline.py:3683-3685, src/devops_cli/ai/review/runner.py:450 and :683-690).
The mark does not survive pre-verification. Right after the construct check, _run_file_level_deterministic_checks runs the finding's criteria (verification.py:1337-1341). When the finding has an executable verification criterion, or an invalidation criterion passes, _reconcile_finding_from_criteria applies a verdict through apply_verdict (src/devops_cli/ai/review/review_environment.py:432-443). Every status apply_verdict writes sets verification_note, to None when no note is given (_build_verdict_updates, src/devops_cli/ai/review/verdicts.py:121-186, applied by apply_verdict at :189-234). So a finding with executable criteria loses its mark, goes to the model, and is not counted. removed_symbol_findings_count was 0 in the four branch reviews of release/v0.2.25 (sessions 20261002-142541, -163203, -180320 and -200610), whose diffs removed 94, 160, 177 and 184 symbols. The #593 test test_verification_exempts_only_a_real_removal_and_the_summary_counts_it (tests/test_review_symbol_delta.py:305-337) passes because its findings carry no criteria.
At the model, a refutation of such a finding cannot stand. _validate_citation_line (verification.py:1615-1668) turns an INVALIDATED verdict into UNVERIFIED when the cited line holds none of the finding's construct tokens (:1645-1667). A deleted symbol is on no line of the head file.
The case in the data is "Removal of DynamicWorkflow Capability Introduces Critical RCE Vulnerability", CRITICAL, on src/devops_cli/ai/harness/workflow.py, after #964 deleted DynamicWorkflow (d5e5c08). Replayed at 38517a8 with S3's finding, session metadata and diff, a criteria runner faked to fail all four commands (in S3 all four timed out at 5 s), and a fake verifier that refutes it citing line 394:
- the construct check moves it from
:408-722to the hunk:394-399and marks it; - the criteria step clears the mark;
- the model is asked, and its refutation becomes UNVERIFIED with "Refutation cited line 394 does not contain cited construct tokens; downgraded to UNVERIFIED";
- the finding ends UNVERIFIED and reportable.
Sessions -163203 and -180320 reported it with exactly that note, and in -180320 it was the only CRITICAL. Session -200610 reported it again, UNVERIFIED with no note.
Restoring the mark alone does not help. The same replay with the criteria removed keeps the mark, never asks the model, and ends UNVERIFIED and reportable, still CRITICAL. The exemption stops a wrong invalidation, since the symbol is absent because the diff removed it. It also stops every verdict. The verifier could not judge the removal anyway: its context is the head file (pipeline.py:2669), and the diff text is used only to find hunks (verification.py:2097).
Changes since the evaluation: #949 (e4ea2e0) and #951 (38517a8) did not touch this path. Lines here are cited at 38517a8. #987 (b1fddd0) and #1009 (79e1e93) merged after it and moved pipeline.py lines down by about 170, without changing the functions cited.
Acceptance criteria
- The mark is a field, not a note.
Findinggetsremoved_symbol: SkipJsonSchema[str | None] = None, the symbol the finding cites, set where the construct check sets the note today.apply_verdictand the criteria step never clear it. The pipeline copies it back with the verdict fields (pipeline.py:2687-2708, or fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846'sVERDICT_FIELDSif that has landed). It is not in the persona schema, asrelocated_fromis not (src/devops_cli/ai/review_schema.py:613), and not in the verifier prompt's findings JSON. A persona reply cannot set it:reset_verification_state(review_schema.py:1282-1303) and_strip_model_set_verification_state(:1306-1317) clear it as they clearverification_note, and a test feeds a reply that sets it. -
removed_symbol_findings_count, the report line and the markdown summary count the field. No code comparesverification_notewith"cites removed symbol"any more. - A marked finding is still never invalidated by the construct check. It is sent to the model verifier like any other UNVERIFIED finding.
- A marked finding's code section in the verifier prompt includes the removed lines of the diff hunk it was moved to, under a label that says they were removed from the file. They are masked and boundary-sanitized as the rest of the code section is. They start at the line that defines the removed symbol and stop after 81 lines, or at the end of the hunk. When a hunk's removed lines define the symbol, the construct check moves the finding to that hunk rather than to the nearest one (
_find_closest_diff_hunk,src/devops_cli/ai/review/construct_validator.py:388-393). - An INVALIDATED verdict on a marked finding stands when its citation line falls inside the finding's hunk. A citation outside the hunk is checked as today. VERIFIED and MITIGATED verdicts are unchanged.
- A refutation of an unmarked finding whose cited line lacks the finding's construct is still downgraded.
- A replay test in
tests/test_review_symbol_delta.py, whosereview_repofixture already builds a base, a head and a diff, covers the DynamicWorkflow case. It uses the S3 finding with its fourpython -ccriteria (two verification, two invalidation), a head file and a diff that removes the class, a criteria runner faked to fail, and a fake verifier that refutes it citing a line in the hunk. The finding ends INVALIDATED withremoved_symbol == "DynamicWorkflow", the session counts 1 removed-symbol finding, and the verifier prompt holds the removedclass DynamicWorkflowline. It fails on the current code. -
test_verification_exempts_only_a_real_removal_and_the_summary_counts_itfollows the new rule. Thelegacy_helperfinding is sent to the model once, with its hunk in the prompt.ghost_fnis still INVALIDATED with no model call. The count stays 1. A variant gives thelegacy_helperfinding a failing executable criterion and expects the same. - The tests run no real criteria command and no network, in under 1 s together.
-
changelog.d/1018.mdrecords the fix under### Fixed.CHANGELOG.mdis not edited. -
uv run devops cipasses. - (person-run) In a scratch repository whose branch deletes a function that another file calls,
devops review branchwith a live model reports at least 1 removed-symbol finding when a finding names the function. The finding carries a verdict with a reason, or a no-verdict note.
Key questions
- Should a finding that cites a removed symbol go to the model at all, or stay exempt as feat(review): branch and pr reviews compute their own base-vs-head symbol delta #593 shipped it? (proposed) Go to the model. The exemption was meant to stop the construct check from calling the finding a hallucination, and that part is right: the symbol existed at the base. It also stopped every verdict, so every such finding is reported UNVERIFIED at whatever severity the reviewer gave it. The DynamicWorkflow finding, the clearest case in four sessions, was false and CRITICAL. With the removed lines in front of it, the verifier judges a removal like any other change, under feat(review): review prompts state a threat model and an evidence bar, and send nothing the pipeline does not use #951's evidence standard.
- Why a field instead of having the criteria step keep the note? (proposed) A field. The note is free text that every verdict writer overwrites (
verdicts.py:121-186), and five places compare the string (verification.py:2046,:2109,pipeline.py:3684,runner.py:450,:687). A field is set once, by the check that knows, and survives later verdicts. - Should the criteria step skip a marked finding? (proposed) No. Its criteria still run and are recorded. Under fix(review): grep-only criteria neither verify nor invalidate a finding, and prompt examples stop teaching them #846's evidence rule they settle nothing unless they run the cited code, and criteria for a deleted symbol cannot.
- Which line may a refutation of a removal cite? (proposed) Any head line inside the hunk the finding was moved to. Removed lines have no head line number (
number_diff_linesgives them a tab only,src/devops_cli/ai/review/chunker.py:64-66), so the hunk is the narrowest place in the head file that shows the removal. - How much of a large removal does the verifier see? (proposed) The definition and up to 81 removed lines. fix(security): delete DynamicWorkflow and CodeMode, whose sandboxes let model-written code reach os and start processes (#947) #964's hunk removed 323 lines (base lines 408-736), about the cost of a whole file. The claim is about the removal, and the definition and its first lines show what was removed. 81 lines is the size of a ±40-line window in fix(review): the verifier sees masked windows around the cited lines, not the whole file and the linked-file skeletons #1017.
- Does fix(review): the report ranks verified findings first, keeps only scanned advisories, and uses one category taxonomy and calibrated severity #948's "CRITICAL requires VERIFIED" make this unnecessary? (proposed) No. It lowers the false finding's severity but still reports it. This item lets the verifier remove it.
Depends on: none.
Order: after #846 and #845 (v0.2.25). All three change the verdict path in verification.py, #845 extends the evidence check that _validate_citation_line makes for INVALIDATED verdicts to VERIFIED and MITIGATED ones, #846 extends reset_verification_state, and #846 replaces the copy-back at pipeline.py:2687-2708, which must carry the new field. If #1017 is scheduled, land it first: both change how _build_validation_prompt builds its code section.
Related: #593 (shipped the exemption). #845 and #846 (verdict evidence and criteria). #948 (CRITICAL requires VERIFIED). #947 and its PR #964 (deleted DynamicWorkflow). #996 (one finding verifier; this logic moves into it). #901 (renamed files keep their removed symbols). #1017.
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).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 17, 2026
Closed as not planned in the 2026-10-17 unblocking review: Superseded by #1150. construct_validator, verification and the 'cites removed symbol' note are deleted. Admission uses the tool's own path and line.