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 17 pr commands that do not obey it:
- 17 commands make an external request, or possibly make one, and have no request plan.
- These commands have 18 more paths under a second name. A class on the callback clears those paths too.
- Already done, not in scope:
pr update.
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.
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. - 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:
- All
prcommands reach GitHub throughgithub/rate_limiter.py:run_ghorGhCliClient.pr updatealready has a request plan (commands/pr.py:_plan_update_single_pr); use it as the model. pr waitandpr monitorpoll. Their plan lists one poll round and names the repeat inPlannedRequest.repeat.pr createreads the branch and the remote with localgitcalls. Those calls are not external requests, but the push and the GitHub calls are.- 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 |
|---|---|---|---|---|
pr check-readiness |
no | yes | request plan | gh api @ commands.pr:_fetch_pr_details:237 |
pr checks |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr close |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr create |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr diff |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr edit |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr hardening-report |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr list |
no | yes | request plan | gh api @ commands.pr:_render_pr_list_fallback:158 |
pr monitor |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr ready |
no | yes | request plan | gh api @ commands.pr:_fetch_pr_details:237 |
pr threads list |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr threads reply |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr threads resolve |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr threads resolve-all |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr threads unresolve |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr view |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
pr wait |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
Target Subsystem
SDLC, Git & PR Governance
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). - 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
Seventeen pr commands make external requests through gh or GhCliClient but do not implement the dry-run rule (#412). Under --dry-run they print a generic message, fail with No such option: --dry-run, or echo their arguments. None returns the ordered requests that a real run would make. This issue adds a request plan to each command so that --dry-run makes no external request and prints the planned requests.
Acceptance criteria
- Criterion 1: Each of the 17 commands in the table is removed from tests/fixtures/dry_run_gaps.json.
Verification: The ratchet test from sub-issue 00 passes. Run uv run devops ci test and confirm the test does not list any of the 17 commands. - Criterion 2: For each command, devops --dry-run and devops --dry-run make no external request and print the ordered requests.
Verification: Tests patch the process runner, HTTP clients, and other clients to fail. The test asserts exit code 0 and that the output contains the planned request lines. - Criterion 3: For each command with --format json or --json, the dry run returns the real result type marked as a dry run, with the planned requests.
Verification: A test invokes the command with --dry-run --format json and asserts the returned object has dry_run=True and a non-empty requests list. - Criterion 4: For each command, the plan holds the requests that the real run makes, in the same order.
Verification: A test runs the real command against a fake runner or client that records each call, then compares the recorded calls with the plan. Follow the pattern in tests/test_roadmap_dry_runs.py. - Criterion 5: Echo-only previews (render_dry_run_result or
@dry_run_command) for these commands are removed with no shim.
Verification: Grep the codebase for render_dry_run_result and@dry_run_command. Confirm none of the 17 commands reference them. - Criterion 6: The new tests start no process and open no socket.
Verification: The session-scoped guards in tests/conftest.py (prevent_external_network_calls, refuse_real_programs) fail the test on any unguarded reach. Run uv run devops ci test and confirm all new tests pass. - Criterion 7: uv run devops ci passes.
Verification: Run uv run devops ci in the pull request and confirm all checks are green.
Key questions
- How do pr wait and pr monitor handle polling in their plan?: Their plan lists one poll round and names the repeat in PlannedRequest.repeat. (proposed)
- Should each row in the table be verified against the code before changing it?: Yes. The table comes from a static walk of each callback and the functions it calls. Check each row against the code before changing it. If a row is wrong, change the class to match the code and record the evidence in the pull request. (proposed)
Open questions
- What is the model for the request plan implementation? (missing verified source)
- Are the local git calls in pr create external requests? (missing verified source)
- What issue must be delivered before this one? (missing verified source)
- What is the path for the rate limiter that all pr commands use to reach GitHub? (missing verified source)
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsNew
- 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 that adds dry-run capability to several pr commands.This change fixes a core rule violation and improves the predictability of command behavior under dry-run mode.Users benefit from knowing exactly what requests a command would make during a dry run, improving trust and debugging capabilities.The change requires implementing request plans for multiple commands and modifying existing code to use the new pattern consistently.Both items relate to dry-run functionality for pr commands but differ in scope: one is about declaring dry-run class and adding ratchet test, the other is about implementing request listing in dry run for specific commands.dan-petty commentedon Oct 27, 2026
Refine cannot set this item to Ready at 520e8b8 until a person answers the questions below. Reply in a comment or edit the body, and the next refine round looks at the item again.
feat(roadmap): the investigation answers through pydantic-ai's output…
chore(main): release 0.26.0 (#2837)