Repository navigation
Description
Part of #886. Depends on sub-issue 00 (the dry-run class ratchet test).
Problem or Motivation
The owner's dry-run rule (#412) says that a dry run makes no external request and returns the requests that the real run would make. The #886 inventory (2026-10-25, commit 1bb164b) found 19 review commands that do not obey it:
- 12 commands make an external request, or possibly make one, and have no request plan.
- 1 commands change local state, make no external request and have no
--dry-run. - 6 commands make no external request and need only the
no-external-requestclass. - These commands have 20 more paths under a second name. A class on the callback clears those paths too.
- Already done, not in scope:
review rules fetch.
A command without a request plan either prints the generic Would run delegated command line under devops --dry-run, or fails with No such option: --dry-run, or prints an echo of its arguments. None of these shows the requests.
A command that makes no external request prints the generic Would run delegated command line under devops --dry-run and does not run, although running it is safe. Some of these commands have an echo-only --dry-run that prints only their arguments.
Proposed Solution & Architectural Design
For each command in the table:
- Request plan: add
--dry-runif it is missing. The dry run makes no external request, reads included. It returns the command's real result type, marked as a dry run, with the orderedPlannedRequestitems (argv, stdin and env with<placeholders>, plusconditionandrepeat). Build eachPlannedRequestfrom the same argument builder that the real run uses, so that the plan cannot drift from the run. Print it withrender_request_plan. Give the command therequest-planclass. - Local preview: add
--dry-run. The preview prints the change and writes nothing. Give the command theno-external-requestclass. - Mark only: give the command the
no-external-requestclass.devops --dry-run <command>then runs it normally. - Remove an echo-only preview (
render_dry_run_resultor@dry_run_command) when the command gets its new dry run, with no shim. - Remove the command's paths from
tests/fixtures/dry_run_gaps.json.
Notes from the inventory:
review rules fetchalready has a request plan (commands/review.py:rules_fetch).- A review reads a tree that devops-cli does not own (fix(security): reviews take config, data, contracts, scanner config and probe suppressions from the tree under review #972). Keep
reading_untrusted_trees()in the dry-run path too. - The table comes from a static walk of each callback and the functions that it calls. Check each row against the code before you change it. If a row is wrong, change the class to match the code, and record the evidence in the pull request.
| Command | --dry-run today |
External request | Work | Evidence |
|---|---|---|---|---|
review |
no | no | mark only | - |
review benchmark |
no | yes | request plan | http: httpx2.Client @ ai.gateway:_query_model_info:281 |
review branch |
yes | yes | request plan | http: httpx2.Client @ ai.rag.embeddings:EmbeddingsEngine._query_ollama_node_batch:908 |
review corpus generate |
no | yes | request plan | http: httpx2.Client @ ai.rag.embeddings:EmbeddingsEngine._query_ollama_node_batch:908 |
review corpus score |
no | yes | request plan | http: httpx2.Client @ ai.gateway:_query_model_info:281 |
review export-feedback |
no | no | local preview | - |
review findings |
no | no | mark only | - |
review path |
yes | yes | request plan | http: httpx2.Client @ ai.rag.embeddings:EmbeddingsEngine._query_ollama_node_batch:908 |
review pr |
yes | yes | request plan | http: httpx2.Client @ ai.rag.embeddings:EmbeddingsEngine._query_ollama_node_batch:908 |
review rules test |
yes | no | mark only | manual: semgrep --test --metrics off on local rules |
review samples fetch |
yes | yes | request plan | manual: git fetch/clone of sample repositories |
review samples list |
no | no | mark only | manual: git rev-parse in local checkouts |
review samples validate |
no | yes | request plan | http: httpx2.Client @ ai.gateway:_query_model_info:281 |
review score |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
review stats |
no | no | mark only | - |
review templates check |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
review templates list |
no | no | mark only | - |
review templates sweep |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
review verify |
no | yes | request plan | http: httpx2.Client @ ai.rag.embeddings:EmbeddingsEngine._query_ollama_node_batch:908 |
Target Subsystem
AI & Agentic Review Pipeline
Existing Tool Considered
The work uses what the repository has: devops_cli.dry_run.requests.PlannedRequest and render_request_plan (#741), the dry-run class decorator and ratchet test from sub-issue 00, and the test guards in tests/conftest.py and tests/test_roadmap_dry_runs.py. No new dependency is necessary.
Acceptance Criteria
- Each command in the table is out of
tests/fixtures/dry_run_gaps.json, and the ratchet test passes. - For each request-plan command,
devops <command> --dry-runanddevops --dry-run <command>make no external request and print the ordered requests. Verified by tests with the process runner, the HTTP clients and the other clients patched to fail. - For each request-plan command with
--format jsonor--json, the dry run returns the real result type marked as a dry run, with the planned requests. Verified by tests. - For each request-plan command, the plan holds the requests that the real run makes, in the same order. Verified by a test that runs the real command against a fake runner or client that records each call, and compares the calls with the plan (the pattern of
tests/test_roadmap_dry_runs.py). - For each local-preview command,
--dry-runprints the change and writes nothing. Verified by tests with the writer patched to fail. - For each mark-only command,
devops --dry-run <command>runs the command normally. Verified by tests with the process runner and the HTTP clients patched to fail. - Echo-only previews of these commands are gone, with no shim.
- The new tests start no process and open no socket. The pull request records their time.
-
uv run devops cipasses.
Source: #886
Proposed design
Problem statement
The review commands do not follow the dry-run rule. A dry run can make an external request or print only the arguments. The change gives each command a safe dry run that lists the planned requests.
Acceptance criteria
- Criterion 1: The change removes each command in the table from tests/fixtures/dry_run_gaps.json.
Verification: Run the ratchet test and confirm the file has no paths for these commands. - Criterion 2: Each request-plan command makes no external request in a dry run.
Verification: Run devops --dry-run and devops --dry-run with failing clients. - Criterion 3: Each request-plan command prints its ordered planned requests.
Verification: Confirm render_request_plan output lists the PlannedRequest items in order. - Criterion 4: Each request-plan command with --format json or --json returns its real result type marked as a dry run.
Verification: Run the JSON dry run and confirm the result has dry_run true and planned requests. - Criterion 5: Each request-plan plan matches the real run requests and order.
Verification: Run the real command against a fake runner or client that records calls and compare the calls with the plan. - Criterion 6: The local-preview command prints the change and writes nothing in a dry run.
Verification: Run review export-feedback --dry-run with a failing writer. - Criterion 7: Each mark-only command runs normally under devops --dry-run.
Verification: Run devops --dry-run with failing process and HTTP clients. - Criterion 8: The change removes echo-only previews of these commands without a shim.
Verification: Search the command code for render_dry_run_result and@dry_run_commandand confirm they are absent. - Criterion 9: Each command has the correct dry-run class.
Verification: Inspect the command code and confirm the request-plan or no-external-request class is present. - Criterion 10: The dry-run path keeps the untrusted tree guard.
Verification: Inspect the dry-run path and confirm it calls reading_untrusted_trees(). - Criterion 11: Each plan uses the same argument builder as the real run.
Verification: Inspect the plan builder and confirm it calls the same builder the real run calls. - Criterion 12: The new tests start no process and open no socket, and the pull request records their time.
Verification: Run the new tests, confirm no process or socket reach, and read the pull request for the test time. - Criterion 13: The full CI passes.
Verification: Run uv run devops ci.
Key questions
- Does this change fit one pull request?: Yes, one pull request can deliver the dry-run change for all listed review commands. (proposed)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsReady
- StatusShow more project fieldsNew
Activity
dan-petty commentedon Oct 25, 2026
Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.
The candidate proposes a new feature to improve dry-run behavior for review commands.This change affects core functionality and follows an established rule for dry runs.Improves user experience by showing planned requests in dry runs, which is a key usability feature.Requires changes to multiple review commands with different types of dry-run behavior.Both items address dry-run behavior, but the candidate focuses on review commands while the related item focuses on pr commands.dan-petty commentedon Oct 27, 2026
Status set to Ready at d594b55 (see proposed design in issue body).
feat(review): preview requests in dry run for review commands
chore(main): release 0.30.0 (#2893)