Repository navigation
Description
Problem
devops review path <file> with one target sets target_dir to the file's parent folder: target_dir = target_resolved if target_resolved.is_dir() else target_resolved.parent (src/devops_cli/commands/review.py:333, at 0ce4736). The orchestrator passes it to verification as repo_root (ai/review/pipeline.py:2866), and execute_finding_criteria runs every criterion with that directory as its working directory. Findings and criteria cite repository-relative paths, so each criterion of a single-file path review that names a file fails before it checks anything.
Measured in the #1015 recall runs (.data/measurements/recall, 2026-10-02):
docs/VISION.md(session 20261002-232517): both criteria exited 1 withFileNotFoundError: [Errno 2] No such file or directory: 'docs/VISION.md', and the finding was still VERIFIED at 0.95 on the model's reading alone.k8s/otel/networkpolicy.yaml(session 20261002-234825):grep ... k8s/otel/networkpolicy.yamlexited 2 withNo such file or directory, and the verifier INVALIDATED a valid finding citing the failed check.
The sandbox is not the cause. Run with the repository root as cwd, the same two commands pass inside the bubblewrap sandbox (python -c "...Path('docs/VISION.md').exists()" prints True; grep -c 0.0.0.0 k8s/otel/networkpolicy.yaml prints 1). Directory targets and several targets keep the working directory's root, and branch and PR reviews use the repository or head checkout, so they are unaffected.
Acceptance criteria
- A path review of a single file uses the repository root that contains the file (
git rev-parse --show-toplevelfrom the file's folder, or the existing repository-root helper) astarget_dir, and falls back to the file's folder only outside a repository. - A test reviews one file in a nested folder of a tmp git repository with a stub model and a criterion that reads the file by its repository-relative path; the criterion runs from the repository root and passes. It fails on the current code.
- Everything else that reads
target_dirfor a single-file review (conventions, linked files, the static analyzers' file list, the session's recorded paths) still finds what it found before; a test pins the analyzer file list and the conventions digest for that case. - Tests run offline, call no model, and each runs well under 1 s.
-
changelog.d/1038.mdrecords the fix under### Fixed.CHANGELOG.mdis not edited. -
uv run devops cipasses.
Key questions
- Should a single file outside any repository still review? (proposed) Yes, from its folder, as today.
Depends on: none.
Order: any time. #847 (criteria environment, in v0.2.25) changes how criteria run but not which directory they get.
Related: #847, #846, #1015 (where it was measured).
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 3, 2026
Superseded by #1047, re-scoped on 2026-10-03 as the redesign's "a review scans a worktree of the reviewed commit" (#1137). This item's root-resolution half is now a #1047 criterion: a path review of single files resolves its root with
git rev-parse --show-toplevel, not the file's parent (commands/review.py:340). Its criteria-runner half is frozen with the verifier (#1150).