Repository navigation
Description
Context & Rationale
Problems with how review finding locations are parsed on release/v0.2.24:
- Placeholders survive parsing. 95ed4cc (fix(review): remediate response repair, review pipeline and verifier defects (#656, #657, #658, #659, #660, #664) #675) made
_parse_locationpreserve case by default (ai/review_schema.py:784). The placeholder check atai/review_schema.py:648still compares case-sensitively, so "N/A" and "None" locations now survive parsing. At 1ad24ac they were dropped. - Location cleanup keeps prose or loses parts of the location (
ai/review_schema.py:184,:405):- Extensionless root files keep their prose:
Dockerfile:3 - unpinned base image,Makefile:12 in build target. src/app.py line 42 in get_userbecomessrc/app.pyand loses the line.src/my app.py:42is cut tosrc/my.
- Extensionless root files keep their prose:
- Corpus scoring misses mixed-case paths. It compares against
injection.file.lower()(ai/review/defects.py:1415), so it never matches a path that keeps its case.
Found while checking the #659 fix.
Scope & Deliverables
- Deliverable: placeholder locations are dropped whatever their case. Canonical
path:line[-line]tokens come out for extensionless files,line Nprose and paths that contain spaces. Corpus matching compares paths the same way on both sides. Each case gets a test. - Constraint: the original path case is still preserved (fix(review): construct and location checks drop absence findings and rewrite finding paths #659).
Strategic Alignment
- Milestone: Backlog (no release)
- Design: none
- Depends on: none
Generated by Claude Code
Scope added 2026-10-02: static scanner findings have their own location defects. The review passes absolute paths to the scanners (Semgrep at security/semgrep.py:96-101, Bandit at security/bandit.py:66), and each finding keeps the path the scanner prints in its location and description (semgrep.py:54-70, bandit.py:19-25). _match_static_findings_to_files (ai/review/pipeline.py:487-504) attaches a finding to the reviewed file by suffix but leaves its location absolute. In session 20261002-180320, 12 Semgrep candidates carried /workspaces/devops-cli/... paths, 9 were reportable, and 8 reached the report after a merge. Scanner findings then go through the construct check like model findings (ai/review/verification.py:1328). That check took the candidate devops_cli from the path in the Semgrep description. It moved the two logger findings at config/settings.py:645 and :648 (commit 8271385, which that session reviewed) to the import at :19, where they merged into one. This reproduces with validate_construct_location at 38517a8. A repository-relative path alone does not stop it: with src/devops_cli/config/settings.py:648 the finding still moves to :19. Bandit findings carry absolute paths too now that Bandit runs again: #1012 (merged at 79e1e93, after 38517a8) still passes str(p.resolve()). Land after #972 (v0.2.25), which changes how these scanners are run.
- Scanner findings carry repository-relative paths, both in
locationand in the text they embed. A test passes fake Semgrep and Bandit results with absolute paths through the review's static-scan step and assertssrc/app.py:12. - The construct check neither relocates nor invalidates a finding that a static scanner produced, because a parser gave its line. A golden test with the two Semgrep logger findings at
config/settings.py:645and:648(session 20261002-180320) keeps them as two findings at their own lines. - The tests run offline and call no scanner binary.
Scope added 2026-10-02 from review session 20261002-214641 (.data/review-evaluation-20261002-s6.md, section 4.1):
-
All 4 Bandit and all 14 Semgrep candidates carried absolute
/workspaces/devops-cli/...paths, and 5 of the 24 report rows print them. -
_are_findings_duplicate(ai/review_schema.py:905) treats two findings with the same title in one file as duplicates however far apart they are, and across tools. It mergedtests/test_devcontainer.py:897and:1006, and put Bandit's title on Semgrep's description attest_review_prompt_consistency.py:439. -
Scanner finding locations are repository-relative before consolidation. A test with a Semgrep result carrying an absolute path inside the repository gets a relative location.
-
Two scanner findings merge only when tool, rule, file and line all match. A test with two same-title findings 109 lines apart keeps both.
Scope under the review redesign (2026-10-03)
The evidence-first review (#1137) keeps tool-layer fixes and freezes model-generator patches. This item is split along that line:
- Kept, phase P0: scanner paths are repo-relative.
security/semgrep.py:124andsecurity/bandit.py:74passstr(p.resolve())today, so findings carry absolute paths. feat(review): devops review score scores saved review sessions against a label file offline and reproduces the S11 and loop baselines #1138's rule + path + line key needs this half, so it lands in P0. - Frozen: the persona-location half (placeholder, prose-laden and truncated locations from model replies). feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871's location check against
git ls-treeat the reviewed commit replaces it, and persona findings go with refactor(review): the persona review stage, the legacy segment engine and review-time RAG are deleted, and devops review builds a model client only for the explanation stages #1151.
Acceptance criteria (added).
- Semgrep and Bandit findings carry paths relative to the scan root; a test with a fixture tree shows
app/x.py, not an absolute path. - The persona-location criteria above are not built; they close with this item, as covered by feat(review): every reported finding is admitted with its producer's anchor and a location that exists in the reviewed commit, the review writes findings.sarif, and review.md shows findings and suppressions #871.
Update 2026-10-08: refinement
Bandit and Semgrep findings still carry absolute paths (security/bandit.py:74; security/semgrep.py:202-209); #871 relativizes only findings.sarif. The construct check goes with #1150 and the merge rule with #1151 and #1141.
- Fake results with absolute paths come out as
src/app.py:12infindings.jsonandreview.md, with no absolute path in the description; offline.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 8, 2026
Linked: #1045 (v0.2.30). Both give scanner findings a repo-relative, per-file location (Bandit and Semgrep here, kube-linter there), which #1141's fingerprint needs. Found by the 2026-10-08 backlog review.
dan-petty commentedon Oct 11, 2026
Moved to v0.2.35: v0.2.35 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)
fix(review): location parsing keeps placeholder, preserving review fi…
feat(release): v0.2.35 (#1581)