Skip to content

feat(ai): ai rag, ingest, analyze and research commands list their requests in a dry run and make none #2244

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 21 ai rag, ingest, analyze and research commands that do not obey it:

  • 16 commands make an external request, or possibly make one, and have no request plan.
  • 5 commands make no external request and need only the no-external-request class.

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-run if 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 ordered PlannedRequest items (argv, stdin and env with <placeholders>, plus condition and repeat). Build each PlannedRequest from the same argument builder that the real run uses, so that the plan cannot drift from the run. Print it with render_request_plan. Give the command the request-plan class.
  • 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:

  • The RAG commands reach Qdrant and the embedding endpoints. A plan names each collection request and embedding call.
  • 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 analyze no no mark only -
ai analyze branch yes yes request plan http: httpx2.Client @ ai.rag.embeddings:EmbeddingsEngine._query_ollama_node_batch:908
ai analyze path yes yes request plan http: httpx2.Client @ ai.rag.embeddings:EmbeddingsEngine._query_ollama_node_batch:908
ai analyze pr yes yes request plan http: httpx2.Client @ ai.rag.embeddings:EmbeddingsEngine._query_ollama_node_batch:908
ai ingest docs no yes request plan http: httpx2.Client @ ai.library.docs_ingester:DocsIngester.ingest_remote_docs:253
ai ingest index-libraries yes yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai ingest library no no mark only -
ai ingest query-library no yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai rag no no mark only -
ai rag clear no yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai rag drift yes (echo only) yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai rag index yes (echo only) yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai rag index-kb yes (echo only) yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai rag query yes (echo only) yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai rag search yes (echo only) yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai rag status no yes request plan valkey: valkey.Valkey @ valkey.client:ValkeyClient.init:151
ai research analogies yes (echo only) yes request plan kubernetes-client: kubernetes.get_default_copy @ k8s.service_proxy:_kube_configuration:239
ai research annotate yes (echo only) no mark only -
ai research forage yes (echo only) no mark only -
ai research model yes (echo only) yes request plan http: httpx2.Client @ http.client:new_http_client:169
ai research socratic yes (echo only) yes request plan http: httpx2.Client @ http.client:new_http_client:169

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-run and devops --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 json or --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 ci passes.

Source: #886

Proposed design

Problem statement

The ai rag, ingest, analyze, and research commands do not follow the dry-run rule. A dry run must make no external request. It must return the requests that a real run would make. This issue fixes 21 commands that do not follow it.

Acceptance criteria

  • Criterion 1: Each command in the table is out of tests/fixtures/dry_run_gaps.json.
    Verification: Check that the dry-run ratchet test passes.
  • Criterion 2: Each request-plan command dry run in both flag positions makes no external request and prints the ordered requests.
    Verification: Run tests for both flag positions that patch the process runner and clients to fail.
  • Criterion 3: Each request-plan command with --format json or --json returns its real result type. It is marked as a dry run and holds the planned requests.
    Verification: Check the JSON dry run for the mark and the planned requests.
  • Criterion 4: Each request-plan command plan lists the real run requests in the same order.
    Verification: Run a test that records fake client calls and compares them to the plan.
  • Criterion 5: Each mark-only command runs normally under devops --dry-run .
    Verification: Run tests with the process runner and HTTP clients patched to fail.
  • Criterion 6: Echo-only previews of these commands are gone, with no shim.
    Verification: Search the code for render_dry_run_result and @dry_run_command in these commands.
  • Criterion 7: The new tests start no process and open no socket.
    Verification: Run the new tests. Check the pull request for their recorded time.
  • Criterion 8: The full CI command passes.
    Verification: Check that uv run devops ci passes.

Key questions

  • Does the change fit one pull request?: Yes, one pull request can deliver the change for all 21 commands. (proposed)
  • Which issue number does the dry-run class ratchet test dependency use?: The body names sub-issue 00, so the dependency is recorded as 0. (proposed)
  • What dry-run request helper does the repository already provide?: It provides PlannedRequest and render_request_plan in devops_cli.dry_run.requests. [sources: src/devops_cli/commands/ci.py:54]
  • What test pattern verifies that a plan matches the real run?: tests/test_roadmap_dry_runs.py runs a dry run with refused connections, DNS, and process starts, then compares the printed plan to the recorded calls. [sources: tests/test_roadmap_dry_runs.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 proposes new functionality for ai commands to list requests in dry run mode.
    • Priority: P1-High. This change is part of a larger effort (#886) to enforce consistent dry-run behavior across all commands.
    • Value: High. Improves developer experience and tool reliability by ensuring dry runs behave consistently.
    • Effort: High. Requires changes to multiple ai commands with different types of external requests and request plans.
    • Related: feat(ai): ai model and gateway commands list their requests in a dry run and make none #2241, which asks for a different change. Both items deal with dry-run changes, but the candidate focuses on ai rag, ingest, analyze and research commands while item 2241 covers ai model and gateway commands.
  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/high
    value/high
    scope/ai
    status/in-progress
    and removed
    status/ready
    on Oct 28, 2026
  5. added 3 commits that reference this issue on Oct 31, 2026
    61aeade
    c4009dd
    915d15a
  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/highpriority/p1-highscope/aisource/agenttype/featurevalue/high

    Type

    No type

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions