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 21 ai runs, cost and cache commands that do not obey it:
- 8 commands make an external request, or possibly make one, and have no request plan.
- 2 commands change local state, make no external request and have no
--dry-run. - 11 commands make no external request and need only the
no-external-requestclass. - These commands have 10 more paths under a second name. A class on the callback clears those paths too.
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:
ai runsreach Valkey for the run store.ai cost update-pricingdownloads the price table.ai cost resetandai cost set-pricechange the local ledger. They get a--dry-runpreview that writes nothing (feat(cli): commands with no dry-run preview: read-only ones run, mutators gain one #886 namesai cost reset).- 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 |
|---|---|---|---|---|
ai cache clear |
yes (echo only) | no | mark only | - |
ai cache status |
no | no | mark only | - |
ai cost |
no | no | mark only | - |
ai cost list-pricing |
no | no | mark only | - |
ai cost payback |
no | no | mark only | - |
ai cost payoff |
no | no | mark only | - |
ai cost prometheus |
no | no | mark only | - |
ai cost report |
no | no | mark only | - |
ai cost reset |
no | no | local preview | - |
ai cost roi |
no | no | mark only | - |
ai cost set-price |
no | no | local preview | - |
ai cost update-pricing |
no | yes | request plan | http: httpx2.get @ ai.spend.pricing:PricingRegistry._fetch_raw_pricing_payload:672 |
ai runs baseline list |
no | no | mark only | - |
ai runs baseline set |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
ai runs baseline show |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
ai runs check |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
ai runs compare |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
ai runs connect |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
ai runs list |
no | no | mark only | - |
ai runs reindex |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
ai runs show |
no | yes | request plan | valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151 |
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
Twenty-one ai runs, cost, and cache commands do not follow the dry-run rule. Some make an external request, and some make no request but still refuse to run under devops --dry-run. This item makes each command show its planned requests, or run safely when it makes no external request.
Acceptance criteria
- Criterion 1: Every command in the issue table is removed from
tests/fixtures/dry_run_gaps.json.
Verification: Run the dry-run ratchet test and confirm the fixture has no listed path. - Criterion 2: Each request-plan command accepts
--dry-runand makes no external request.
Verification: Rundevops --dry-runanddevops --dry-runin tests with the process runner and clients patched to fail. - Criterion 3: Each request-plan command prints the ordered planned requests.
Verification: Check the dry-run output for the orderedPlannedRequestitems. - Criterion 4: Each request-plan command with a JSON flag returns the real result type marked as a dry run.
Verification: Run the command with--format jsonor--jsonand checkdry_run=True. - Criterion 5: Each request-plan command's plan matches the real run's requests in order.
Verification: Run the real command against a recording fake and compare its calls with the plan. - Criterion 6: Each local-preview command prints the change and writes nothing under
--dry-run.
Verification: Patch the writer to fail, run--dry-run, and confirm no write occurs. - Criterion 7: Each mark-only command runs normally under
devops --dry-run.
Verification: Run the command with the global flag and the process runner and HTTP clients patched to fail. - Criterion 8: Echo-only previews for these commands are removed without a shim.
Verification: Search the command code forrender_dry_run_resultand@dry_run_commandand confirm they are gone. - Criterion 9: The command class clears the second-name paths for each command.
Verification: Run the ratchet test for both names of each command. - Criterion 10: The new tests start no process and open no socket.
Verification: Run the new tests and confirm the test floor records no edge reach. - Criterion 11: The pull request records the time of the new tests.
Verification: Read the pull request description for the recorded test time. - Criterion 12: The CI gate passes.
Verification: Runuv run devops ci.
Key questions
- Does the repository already provide the request plan primitives?: Yes.
PlannedRequestandrender_request_planare available insrc/devops_cli/commands/ci.py. [sources: src/devops_cli/commands/ci.py:54] - Do the existing tests block unfaked network and process calls?: Yes.
tests/conftest.pyinstalls the network guard and the process guard. [sources: tests/conftest.py] - Does this item need to be split into more pull requests?: No. The change is one command group and one fixture. (proposed)
- Is the dependency on sub-issue 00 an outside block?: No. It is a dependency on another roadmap item. (proposed)
- Must the implementer record the sub-issue 00 issue number before starting?: Yes. The issue text names the dependency without its number. (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 new behavior for ai commands under dry-run mode.This change affects how ai commands behave during dry runs and is part of a larger initiative.Users will see clearer request plans during dry runs which improves transparency and debugging.The change requires modifications to multiple commands and their associated tests.Both items work on ai commands but the candidate focuses on runs, cost and cache while the related item covers model and gateway commands.dan-petty commentedon Oct 27, 2026
Status set to Ready at d594b55 (see proposed design in issue body).
feat(ai): preview requests in dry run for runs cost cache