Repository navigation
Closed
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/reviewMulti-persona code review engine, verification, and findingstype/bugType bug: the code does not do what it must
Milestone
Description
Summary
Found in the release/v0.2.23 review (line numbers at 7fdaa9d). Each item below was confirmed by reading or running the code.
- Unsupported mitigation claims remove confirmed findings.
- A MITIGATED verdict with no mechanism or perimeter is "degraded to UNVERIFIED" but also made
reportable=False(src/devops_cli/ai/review/verification.py:1278-1293,:1524-1526). A finding the verifier confirmed then disappears. This contradicts the rule "Only clear evidence removes a finding". - Placeholder values such as
"mitigating_mechanism": "none"or"perimeter_files": ["n/a"]pass the gate. tests/test_verdict_writers.py:267-277asserts the wrong result.
- A MITIGATED verdict with no mechanism or perimeter is "degraded to UNVERIFIED" but also made
- Verdicts attach to the wrong finding.
- Persona output can set
finding_idthrough theidandindexaliases (src/devops_cli/ai/review_schema.py:545-548), andreset_verification_state(:1244-1264) does not clear it. Those ids collide with the verifier's positional ids (verification.py:1652-1660,:1869-1878). - In the reproduction, the INVALIDATED verdict for "Unused import os" bound to a real SQL injection. The injection's own VERIFIED verdict was then dropped as a duplicate.
- Persona output can set
- Conflicting criteria invalidate without a check. When both a verification criterion and an invalidation criterion pass,
_reconcile_finding_from_criteria(src/devops_cli/ai/review/review_environment.py:302-310) returns INVALIDATED and skips the LLM. The LLM path treats the same "refuted and confirmed" case as UNVERIFIED and keeps it. - A null location drops the finding. A verifier reply with
"location": nullbecomes the string"None"(verification.py:1551-1552), and the report filter then drops the finding. - Verification copy-back loses fields. It drops
perimeter_filesandregression_test(src/devops_cli/ai/review/pipeline.py:2402-2423), so later perimeter checks fall back to the finding's own file. - The category false-positive baseline always reads 0%. It is computed from findings with INVALIDATED ones already removed (
pipeline.py:2825-2835,:2919;src/devops_cli/ai/review/category_metrics.py:85-119). - The mitigation ledger lives inside the installed package. It defaults to
mitigated_findings.jsonin the package directory (src/devops_cli/ai/review/mitigations.py:24-39; writer atsrc/devops_cli/commands/review.py:1001-1009). It is shared across repositories, reset by upgrades, and silently unwritable on read-only installs. devops review verifycan crash on older sessions. It checks verdict invariants across every finding in the session (commands/review.py:1084) and raises an uncaughtAssertionErrorbefore writing. The requested status change is lost.
Remediation Plan
- Keep degraded mitigations reportable as UNVERIFIED, and treat placeholder mechanisms and perimeters as missing.
- Clear persona-supplied ids, or namespace them, before the verifier assigns positional ids. Bind verdicts by id and title together.
- When both criteria pass, leave the finding UNVERIFIED and send it to LLM verification.
- Treat a null location as "unchanged".
- Copy
perimeter_filesandregression_testback after verification. - Compute the false-positive baseline from the candidates, including invalidated findings.
- Resolve the ledger under the data directory, through
resolve_data_path, for the reviewed repository. - Validate invariants only for the finding being updated, and report violations as domain errors.
- Add a test for each item, and fix
tests/test_verdict_writers.py:267-277.
Metadata
Metadata
Assignees
Labels
priority/p1-highPriority P1: high-impact work for the next planned milestonescope/reviewMulti-persona code review engine, verification, and findingstype/bugType bug: the code does not do what it must
Type
Projects
- StatusShow more project fieldsDone
Activity
fix(review): remediate response repair, review pipeline and verifier …