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
Problem
Re-scoped on 2026-10-03 as phase P1a of the evidence-first review (#1137). The original live defect stays the core of this item: a branch review read the checkout, not the reviewed commit, for metadata, scanners, verifier context and the citation guard (S9: 2 verdicts changed and 9 wrong cited_code records). The verifier and the citation guard are deleted by #1150; metadata and scanners now read a worktree of the commit. Until this lands, the tools-only review (--no-persona-review --no-verification) on a clean checkout is the interim.
- Tools and the verifier read the checkout, not the reviewed commit (fix(review): a review scans a worktree of the reviewed commit, never hands a deleted file to a tool, and reports which files each tool scanned #1047).
- Deleted files reach scanners. The file list is parsed from diff headers [code: ai/review/runner.py:2302], so deleted files reach kube-linter and Pluto (fix(review): a branch review leaves the files it deletes out of persona pages and scanners, and a file a scanner cannot read does not mark the scanner failed #1140).
- Golden and fixture data reach persona pages: the golden page had findings in 11/11 runs (D15).
- Coverage is lost silently:
- Semgrep given a gitignored directory exits 0 having scanned 0 files [measured: d-guarantees];
- gitleaks' regex fallback ran under its name in 16/16 sessions [code: security/gitleaks.py:27-101, :249];
- kube-linter's JSON lists only Checks, Reports and Summary. Given an unparsable YAML file, it said nothing about it, and its exit code 1 also means "lint errors found" [measured: c-feasibility].
Acceptance criteria
- The change set comes from
git diff --name-status -M <base>...<commit>. D entries are never targets, and renames keep the old path (fix(analyze): renamed files keep their removed symbols in branch analysis #901). - Worktrees:
- A detached worktree of the commit, and of the base for branch and PR reviews, lives under the user data root, outside every repository, and is removed with the session.
- PR heads come from
refs/pull/N/head; when that is not possible, the run is marked "partial context". - Path reviews of uncommitted work scan in place and say so.
- From fix(review): a path review of single files runs its criteria from the repository root, not from the file's folder #1038: a path review of single files resolves its root with
git rev-parse --show-toplevel, not the file's parent (commands/review.py:340). 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 againstgit ls-treeneeds it. - Pre-analysis of the worktree reuses the checkout's cached metadata for every file whose content hash matches the commit's blob, and analyzes only the others (from the original body: 1,668 files took 121 s serially without reuse, against 9.6 s cached).
- The original regression test passes: in a
tmp_pathrepository with a base commit, a branch commit that changesapp.pyand an uncommitted edit that adds a functionextra, the branch review's metadata forapp.pyhas the commit'scontent_hash(sha256 ofgit show <commit>:app.py) and noextrainkey_symbols. - Path classes (src, test, fixture, iac, docs) come from
.devops/review.tomlat the base revision. Fixtures and golden sets go to the secret scanner only. - A coverage matrix per (tool, file) records scanned, skipped(reason), failed(reason), timed out after N s, not installed or canary failed. It goes into profile.json and a review.md "Coverage" section.
- Where a tool reports what it scanned, its list is compared with its targets: Semgrep
paths.scanned, Bandit per-file metrics, osv-scanner sources. - Other tools: the targets are pre-parsed by devops-cli (YAML for kube-linter and Pluto, readability for gitleaks), and coverage is marked "inferred".
- One unreadable file fails only itself.
- Where a tool reports what it scanned, its list is compared with its targets: Semgrep
- The gitleaks regex fallback is deleted. A missing binary reads "not installed".
- (person-run) On the S11 and loop inputs, kube-linter and Pluto show "ran" with per-file counts, and every applicable tool ran or is listed.
- Tests run offline with fakes and recorded tool output: no network, no real scanner, no model; each test under 1 s.
-
changelog.d/<n>.mdrecords the change;CHANGELOG.mdanddocs/ROADMAP.mdare not edited. -
uv run devops cipasses.
Key questions
- Is this fix(review): a branch review leaves the files it deletes out of persona pages and scanners, and a file a scanner cannot read does not mark the scanner failed #1140? (proposed) fix(review): a branch review leaves the files it deletes out of persona pages and scanners, and a file a scanner cannot read does not mark the scanner failed #1140 fixes the current pipeline; this builds on its change-set parsing.
.devops/review.mdprose? (proposed) Enforceable rules move to.devops/review.tomland the rest to AGENTS.md (feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 Q10).
Strategic alignment
- Milestone: none; the roadmap tooling places it. Depends on: fix(review): a branch review leaves the files it deletes out of persona pages and scanners, and a file a scanner cannot read does not mark the scanner failed #1140, fix(security): a review's isolated Semgrep scan hands Semgrep only targets under its working directory, so it finishes instead of rediscovering each file across the checkout #1079. Related: fix(analyze): renamed files keep their removed symbols in branch analysis #901 (already fixed by feat(review): branch and pr reviews compute their own base-vs-head symbol delta #593, commit 89cbaa2, and pinned by
test_list_changed_files_gives_a_rename_its_old_and_new_pathandtest_analyze_branch_compares_a_renamed_file_with_its_old_path; a person confirms and closes it), fix(review):review path --watchreviews only the files that changed #1067, fix(review): a path review of single files runs its criteria from the repository root, not from the file's folder #1038 (closed as superseded by this item; its root-resolution line is above). - Parent: feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137 (phase P1a).
- Evidence tags ([measured: …], [code: path:line], [sourced: …], [estimate], [inference]; "S11" is the single review run of 2026-10-03 and "the loop" the ten runs S12–S21; c-feasibility and c-fidelity are the two design critiques) are explained in feat(review): evidence-first code review — tools find, version-pinned facts ground, models explain and plan, fixes are re-checked #1137.
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): a branch review reads the commit it reviews, not the checkout, for metadata, scanners, verifier context and the citation guard[/-][+]fix(review): a review scans a worktree of the reviewed commit, never hands a deleted file to a tool, and reports which files each tool scanned[/+]dan-petty-bot commentedon Oct 6, 2026
Moved to v0.2.28: v0.2.28 started with fewer than its 12 items and was topped up to 12 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)
fix(review): a review scans a worktree of the reviewed revision, neve…
dan-petty-bot commentedon Oct 7, 2026
What changed
#1277, merged into
release/v0.2.28as 97b27fc.19 file(s) changed.
How it was verified
Check runs at 80dd8ac:
Acceptance Criteria of
docs/agent/tasks/task-1047-review-worktree.md:app.py, and uncommitted working tree edit addingextra(), branch review metadata forapp.pyhas commitcontent_hashand does not containextrainkey_symbols.deletedand excluded fromall_files, never passed to static analyzers.old_pathand track the target path at head for analysis.refs/pull/N/head; if unavailable, marked withpartial_context=Trueand a clear console warning..devops/review.toml; fixtures and golden sets are scanned by Gitleaks only.(tool, file)recorded inprofile.jsonand rendered inreview.mdunder## Coverage.not installedwithout regex fallback.uv run devops cion the delivering tree.feat(release): v0.2.28 (#1283)