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 22 config, workspace, openspec and docs commands that do not obey it:
- 1 commands make an external request, or possibly make one, and have no request plan.
- 4 commands change local state, make no external request and have no
--dry-run. - 17 commands make no external request and need only the
no-external-requestclass.
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:
- feat(cli): commands with no dry-run preview: read-only ones run, mutators gain one #886 names two criteria here:
devops --dry-run config showprints the configuration, anddevops --dry-run config set ai.provider ollamaprints a preview and writes nothing (test:save_settingspatched to fail). config initreads the GitHub user, so it gets a request plan.workspace add,workspace removeandworkspace generatechange the workspace file;config setchanges the config file. Each gets a--dry-runpreview.openspecanddocshave 3 commands each, so they join this group.- 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 |
|---|---|---|---|---|
config audit-keys |
yes (echo only) | no | mark only | - |
config audit-stream |
no | no | mark only | - |
config auth-headless |
no | no | mark only | - |
config env |
no | no | mark only | - |
config env-vars |
no | no | mark only | - |
config get |
no | no | mark only | - |
config init |
no | yes | request plan | gh @ github.rate_limiter:run_gh:1774 |
config output |
no | no | mark only | - |
config set |
no | no | local preview | - |
config show |
no | no | mark only | - |
config unset |
yes (echo only) | no | mark only | - |
docs check |
no | no | mark only | - |
docs generate |
yes (echo only) | no | mark only | - |
docs sync-readme |
yes (echo only) | no | mark only | - |
openspec archive |
yes (echo only) | no | mark only | manual: pinned local openspec binary |
openspec check |
no | no | mark only | manual: pinned local openspec binary (config/commands.py:build_openspec_cmd) |
openspec regenerate |
yes (echo only) | no | mark only | manual: pinned local openspec binary |
workspace add |
no | no | local preview | - |
workspace clean |
yes (echo only) | no | mark only | - |
workspace generate |
no | no | local preview | - |
workspace open |
no | no | mark only | manual: starts the local VS Code CLI |
workspace remove |
no | no | local preview | - |
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). - 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-two config, workspace, openspec, and docs commands do not follow the dry-run rule. A dry run can start an external request, change local state, or print false compliance text. This item gives each command a dry run that shows the real requests or the local change. It removes echo-only previews and clears the gap fixture.
Acceptance criteria
- Criterion 1: Each command in the table is removed from tests/fixtures/dry_run_gaps.json.
Verification: Runuv run pytest -q tests/test_roadmap_dry_runs.pyand confirm the ratchet test passes. - Criterion 2: devops config init --dry-run and devops --dry-run config init make no external request and print the ordered requests.
Verification: Run tests with the process runner and HTTP clients patched to fail. Confirm the output shows the planned gh command. - Criterion 3: devops config init --dry-run --json returns the real result type marked as a dry run, with the planned requests.
Verification: Run the test and confirm the result has dry_run=True and a requests list. - Criterion 4: The plan of config init holds the requests that the real run makes, in the same order.
Verification: Run a test that records each call with a fake runner and compares the calls with the plan. - Criterion 5: devops config set --dry-run prints the change and writes nothing.
Verification: Run the test with save_settings patched to fail. Confirm the preview is printed. - Criterion 6: devops workspace add --dry-run, workspace remove --dry-run, and workspace generate --dry-run print the change and write nothing.
Verification: Run tests with the writer patched to fail. Confirm the preview is printed. - Criterion 7: devops --dry-run config show prints the configuration.
Verification: Runuv run devops --dry-run config showand confirm the configuration is printed. - Criterion 8: Each mark-only command runs normally under devops --dry-run.
Verification: Run tests with the process runner and HTTP clients patched to fail. Confirm the command executes. - Criterion 9: Echo-only previews of these commands are gone, with no shim.
Verification: Search the command modules for render_dry_run_result and@dry_run_command. Confirm no hit for these commands. - Criterion 10: The new tests start no process and open no socket.
Verification: Run the new tests and confirm the session guard records no edge reach. - Criterion 11: The pull request records the time of the new tests.
Verification: Read the pull request description and confirm the time is present. - Criterion 12: uv run devops ci passes.
Verification: Runuv run devops ciand confirm the exit code is 0. - Criterion 13: The test test_config_audit_keys_dry_run in tests/test_config_audit_keys.py is updated for the removal of the echo-only preview.
Verification: Runuv run pytest -q tests/test_config_audit_keys.pyand confirm it passes.
Key questions
- Which commands need a local preview?: config set, workspace add, workspace remove, and workspace generate. (proposed)
- What class does a request-plan command get?: The command gets the request-plan class. (proposed)
- What class does a local-preview command get?: The command gets the no-external-request class. (proposed)
- What does a mark-only command do under devops --dry-run?: It runs the command normally. (proposed)
- Do the echo-only previews stay?: No. Remove them with no shim when the command gets its new dry run. (proposed)
- Does the repository already have the dry-run request tools?: Yes. PlannedRequest and render_request_plan exist. [sources: tests/test_roadmap_dry_runs.py, CHANGELOG.md:1337]
- What test pattern proves a plan matches the real run?: Record each call with a fake runner or client and compare the calls with the plan. [sources: tests/test_roadmap_dry_runs.py]
- Do the test guards block external network and process starts?: Yes. The session fixtures install network and process guards. [sources: tests/conftest.py]
- What does this item depend on?: It depends on sub-issue 00 of feat(cli): commands with no dry-run preview: read-only ones run, mutators gain one #886, the dry-run class ratchet test. (proposed)
- Does this item fit one pull request?: Yes. It changes one command group and uses existing tools. (proposed)
- What does the config audit-keys echo-only dry run do that is wrong?: It prints fixed values zero_plaintext_compliance: VERIFIED and status: COMPLIANT_DRY_RUN without scanning. A CI step that adds --dry-run passes when a leak is present. The work of this issue removes this preview. [sources: tests/test_config_audit_keys.py]
Open questions
- Which command needs a request plan? (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 new functionality for dry-run behavior in multiple commands.This change affects core devops functionality and follows the project's established dry-run rule.Improves usability and predictability of devops commands during dry runs for all users.Requires changes to many commands across different areas with complex request planning logic.Both items work on dry-run functionality but target different command groups: config/workspace/openspec/docs vs review commands.dan-petty commentedon Oct 27, 2026
Refine cannot set this item to Ready at 69636b6 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.
dan-petty commentedon Oct 28, 2026
More evidence for the
config audit-keysrow. The review of PR #2401 found it.The echo-only dry run of
devops config audit-keysdoes more than echo the arguments. It prints the fixed valueszero_plaintext_compliance: VERIFIEDandstatus: COMPLIANT_DRY_RUN, and it exits 0. It does not scan a file or read the keyring. Thus a dry run claims compliance that it did not check, also when a config file holds a plaintext secret. Itskeys_checkedlist names 3 keys, but the audit checks every key ofKEYRING_KEYS.Reproduction on main at d739a47: a config file named by
DEVOPS_CLI_CONFIGholdsgrafana.token: <fake value>.devops config audit-keys --jsonexits 1 and reports the leak.devops config audit-keys --dry-runexits 0 and reportsVERIFIED. A CI step or a hook that adds--dry-runpasses when a leak is present.The work of this issue ("mark only", and the removal of the echo-only preview) removes this false claim. Thus no separate issue is filed. The test
test_config_audit_keys_dry_runintests/test_config_audit_keys.pypins the echo-only preview today, so that work also changes it.dan-petty commentedon Oct 28, 2026
Refine cannot set this item to Ready at 19412fa 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(config): preview requests in dry run for config commands