Repository navigation
Description
Problem
devops review path --watch reviews every target again whenever any watched file changes. Lines are at release/v0.2.25 (e3ff98c).
DebouncedFileWatcherpasses the changed paths to its callback (src/devops_cli/watchers/file_watcher.py:100-107)._on_change(changed)(src/devops_cli/commands/review.py:393-395) uses them only to print a count. It then calls_execute_current_review()(:335-387), which builds pages from every target inpath_targets(:336-368) and runs the whole workflow.--watchruns no review when it starts (:389-404). It waits for the first change.
So devops review path src --watch reviews all of src after each save:
- With the reply cache on, unchanged pages replay from the cache. Pre-analysis, the static scan, the per-file RAG lookups, verification and the report still run over every target, and each run writes a new session for all of them.
- With
--no-cacheor--force, every page goes to the model. For a whole-repository target that is a full review per save: S9 (20261003-021501, 356 files) took 2,152.7 s with 371 model calls [measured: profile.json]. - The slow-tier plan routes
--watchto the background tier (devops-background, qwen3-coder on hog at about 47 tok/s, one request at a time), where a full re-review per save cannot keep up.
Source: .data/slow-tier-plan-20261003.md, section 4 (--watch), re-read at e3ff98c.
Acceptance criteria
-
On a change,
--watchreviews only the changed files:- those that still exist;
- lie under one of the targets;
- and pass the same
--patternand reviewable-file filters a path review applies.
They form one path-review session. A deleted file is skipped. A change with no reviewable file prints one line and runs no review.
-
The same stage flags, personas, concurrency and clients apply as for the full targets. Only the pages change.
-
A test drives the
review path --watchcommand withDebouncedFileWatcher.watchpatched to callon_change([<tmp>/a.py])once, over a target directory holdinga.pyandb.py. It asserts that_execute_review_workflowreceives pages fora.pyonly. It fails on the current code, which sends both. A second case passes only a deleted path and asserts that no review runs. -
HELP.options.watch, which onlyreview pathuses (review.py:286), says that each change reviews only the changed files. -
The tests run offline, use a fake review workflow, call no model, and each runs in under 1 s.
-
uv run devops cipasses. -
(person-run) Run
devops review path src --watchand save one file. The new session'sprofile.jsonlists that file alone.
Key questions
- Does a file reviewed alone lose context from the files around it? (proposed) No more than in any path review of one file. Linked-file context and RAG lookups still read the repository; only the pages under review shrink.
- Should
--watchstart with a full review? (proposed) Not in this item. Today it waits for the first change, and a person who wants a baseline runs the command once without--watch. - Several files saved within the debounce window? (proposed) One session with all of them. The watcher already batches them (
--debounce-ms, default 500). - Does
review branchorreview prhave the same loop? (proposed) No.--watchexists only onreview path(review.py:284-287). - Is this P1? (proposed) No, P2. It wastes time and slots but loses nothing, and the reply cache absorbs the persona calls for unchanged pages.
Depends on: none.
Order: #995 (delete the legacy segment engine) and #1047 (a branch review reads the commit it reviews) also edit commands/review.py, in other functions. Whichever lands second rebases.
Related:
- fix(k8s): every ollama tier keeps one model loaded and serves one request at a time, so its kv cache holds one context #1061 and its follow-up fix(k8s): ollama-48gib-slow keeps its embedding model and qwen3-coder loaded and leaves every interactive pool, so a review no longer evicts the embedder #1064: the
devops-backgroundtier that--watchis pointed at. - refactor(review): delete the legacy segment engine so the orchestrator is the only review engine #995: the legacy review engine.
- refactor(mcp): the mcp tool bridge is generated from the typer app instead of 147 hand-written argv lists #997:
--watchis one of the interactive options the MCP bridge leaves out.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
dan-petty commentedon Oct 3, 2026
Review redesign (#1137, 2026-10-03): linked to phase P3's tool-run cache (P3-3), not re-scoped. This item keeps its
--watchfix unless the owner accepts the re-scope.