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 13 scan commands that do not obey it:
- 5 commands make an external request, or possibly make one, and have no request plan.
- 8 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. - 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:
- The static walk reaches every scanner through
security/base.py:BaseSecurityScanner._execute, so it cannot tell scanners apart. The table uses the scanner that each command starts:trivyandosv-scannerreach the network;gitleaks,checkov(with no platform key) andzizmor --offlinedo not;semgrepdepends on its--configvalues. - 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 |
|---|---|---|---|---|
scan |
yes | yes | request plan | trivy json @ config.commands:build_trivy_scan_cmd:137 |
scan aibom |
yes | no | mark only | - |
scan complexity |
yes | no | mark only | - |
scan fix |
yes | yes | request plan | http .post() @ security.vulnerability_lookup:_execute_single_osv_query:161 |
scan iac |
yes | no | mark only | manual: checkov on local files with no platform key; the analyzer reached trivy only through BaseSecurityScann |
scan injection |
yes | no | mark only | - |
scan report |
yes | yes | request plan | osv-scanner scan @ config.commands:build_osv_scan_cmd:156 |
scan sarif |
no | no | mark only | - |
scan sast |
yes | unclear | request plan | manual: semgrep with --config values; a registry config (p/...) downloads rules, a local path does not |
scan sbom |
yes | no | mark only | - |
scan secrets |
yes | no | mark only | manual: gitleaks on local files; the analyzer reached trivy only through BaseSecurityScanner dispatch |
scan trivy |
yes | yes | request plan | trivy json @ config.commands:build_trivy_scan_cmd:137 |
scan workflows |
yes | no | mark only | manual: zizmor runs with --offline (config/commands.py:build_zizmor_cmd) |
Target Subsystem
Security & Vulnerability Scanners
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 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 owner's dry-run rule (#412) says a dry run makes no external request and returns the requests the real run would make. Thirteen scan commands do not obey it. Five make an external request and have no request plan. Eight make no external request and need only the no-external-request class. A command without a request plan prints a generic line or fails under --dry-run. A no-external-request command prints the generic line and does not run, although running it is safe.
Acceptance criteria
- Criterion 1: Every command in the table is removed from tests/fixtures/dry_run_gaps.json, and the ratchet test passes.
Verification: Run the ratchet test and confirm the file lists no scan command from the table. - Criterion 2: For each request-plan command, both devops --dry-run and devops --dry-run make no external request and print the ordered requests.
Verification: Run tests with the process runner, the HTTP clients, and the other clients patched to fail. - Criterion 3: For each request-plan command with a JSON flag, the dry run returns the real result type, marked as a dry run, with the planned requests.
Verification: Run tests that call the command with --format json or --json and check the returned type and requests. - Criterion 4: For each request-plan command, the plan holds the requests that the real run makes, in the same order.
Verification: Run the real command against a fake runner or client that records each call, and compare the calls with the plan. - Criterion 5: For each mark-only command, devops --dry-run runs the command normally.
Verification: Run tests with the process runner and the HTTP clients patched to fail. - Criterion 6: The echo-only previews of these commands are removed, with no shim.
Verification: Confirm no render_dry_run_result or@dry_run_commandremains for these commands. - Criterion 7: The new tests start no process and open no socket, and the pull request records their time.
Verification: Run the new tests and confirm the session network and process guards record no reach. - Criterion 8: The full CI run passes.
Verification: Run uv run devops ci and confirm it passes.
Key questions
None.
Open questions
- Do the dry-run rule and the PlannedRequest and render_request_plan machinery already exist (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 to enhance dry-run functionality for scan commands.This change improves the correctness and usability of the dry-run feature which is essential for testing and validation.The change ensures that scan commands behave correctly under dry-run mode, providing users with accurate information about what would happen during execution.The effort involves implementing request plans for multiple scan commands and updating existing code to support the new functionality.Both items share the dry-run class ratchet test but the candidate is specific to scan commands while the related item is about declaring dry-run classes for all commands.dan-petty commentedon Oct 27, 2026
Refine cannot set this item to Ready at d594b55 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.
fix(scan): update scanner dry-run test assertions and catch specific …
chore(main): release 0.33.0 (#2907)