Skip to content

feat(ai): local ai commands declare that they make no external request #2247

Description

@dan-petty

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 20 local ai commands that do not obey it:

  • 20 commands make no external request and need only the no-external-request class.

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:

  • Mark only: give the command the no-external-request class. devops --dry-run <command> then runs it normally.
  • Remove an echo-only preview (render_dry_run_result or @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:

  • Most of these commands read local files (AST, repomap, pack-context, diagrams) or local state (harness, constellation). The work is mostly the no-external-request class, with a test that each runs with every client patched to fail.
  • ai quiesce, ai failover and ai resume change the local constellation state file. They already declare --dry-run; check that the preview writes nothing.
  • 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 no no mark only -
ai ast graph yes (echo only) no mark only -
ai ast parse yes (echo only) no mark only -
ai audit-library-usage yes (echo only) no mark only -
ai bundle-models no no mark only -
ai config no no mark only -
ai constellation no no mark only -
ai diagram yes (echo only) no mark only -
ai failover yes no mark only -
ai harness offload yes (echo only) no mark only -
ai harness run yes (echo only) no mark only -
ai harness status no no mark only -
ai pack-context yes (echo only) no mark only -
ai quiesce yes no mark only -
ai read yes (echo only) no mark only -
ai repomap yes (echo only) no mark only -
ai resume yes no mark only -
ai spec yes (echo only) no mark only -
ai test-gen yes (echo only) no mark only -
ai token-count no no mark only -

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 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 ci passes.

Source: #886

Proposed design

Problem statement

Twenty local ai commands do not declare the no-external-request class. They print a generic dry-run line and do not run, although running them is safe. This change gives each command the no-external-request class and removes echo-only previews. It also removes their paths from tests/fixtures/dry_run_gaps.json and adds tests.

Acceptance criteria

  • Criterion 1: Each command in the table is absent from tests/fixtures/dry_run_gaps.json.
    Verification: Run the dry-run class ratchet test and see it pass.
  • Criterion 2: Each mark-only command runs normally under devops --dry-run .
    Verification: Run the new tests after you patch the process runner and HTTP clients to fail.
  • Criterion 3: The echo-only previews of these commands are gone, with no shim.
    Verification: Search the changed command files for render_dry_run_result and @dry_run_command and find no matches.
  • Criterion 4: The new tests start no process, open no socket, and record their time.
    Verification: Run the new tests and inspect the pull request for their recorded time.
  • Criterion 5: uv run devops ci passes.
    Verification: Run uv run devops ci and see a passing result.
  • Criterion 6: The pull request records evidence for any inventory row that changes.
    Verification: Inspect the pull request description for the evidence.

Key questions

  • Which issue number represents the required sub-issue?: Use issue number 0 for sub-issue 00, the dry-run class ratchet test. (proposed)
  • Does this change fit one pull request?: Yes. One pull request can deliver all 20 command markings, preview removals, fixture updates, and tests. (proposed)
  • Does this item wait on anything outside the roadmap?: No. (proposed)
  • Do the repository tests already block unfaked network and process edges?: Yes. The test floor blocks unfaked network and process edges. [sources: tests/conftest.py]

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/feature
    on Oct 25, 2026
  2. dan-petty commented on Oct 25, 2026

    @dan-petty
    OwnerAuthor

    Intake placed this item to the backlog: intake puts every new item in the backlog. A person plans the milestones on the board.

    • Type: type/feature. The candidate adds a feature to declare dry-run classes for ai commands.
    • Priority: P1-High. This change enforces the dry-run rule and improves command safety.
    • Value: High. The change ensures all ai commands follow the dry-run rule and prevents external requests during dry runs.
    • Effort: Medium. Requires marking many commands with a new class and updating tests.
    • Related: feat(ai): ai runs, cost and cache commands list their requests in a dry run and make none #2245, which asks for a different change. Both items work on ai commands, but the candidate marks commands with no external request while item 2245 works on commands that make external requests.
  3. dan-petty commented on Oct 27, 2026

    @dan-petty
    OwnerAuthor

    Status set to Ready at d594b55 (see proposed design in issue body).

  4. added
    priority/p1-high
    status/ready
    effort/medium
    value/high
    scope/ai
    status/in-progress
    and removed
    status/ready
    on Oct 28, 2026
  5. added a commit that references this issue on Oct 31, 2026
    944d751
  6. added
    status/in-review
    and removed
    status/in-progress
    on Oct 31, 2026
  7. removed
    status/in-review
    on Oct 31, 2026
  8. added a commit that references this issue on Oct 31, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    effort/mediumpriority/p1-highscope/aisource/agenttype/featurevalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions