Skip to content

fix(review): the corpus generate dry run lists no request #5396

Done

Description

@dan-petty

Problem Description

The dry-run plan of devops review corpus generate lists one request, POST <embedding endpoint>/embeddings (plan_review_corpus_generate in src/devops_cli/review/review_plans.py). The real run makes no external request: it reads the source files, injects defects from the local templates with generate_corpus (src/devops_cli/ai/review/defects.py) and writes the corpus folder. So the plan names a request that the run never makes, and the command has the request-plan dry-run class where the rule of #412 gives a local command that writes files the no-external-request class with a preview that writes nothing.

Reproduction Steps

  1. Run uv run devops review corpus generate src --dry-run.
  2. Read the planned request.
  3. Read corpus_generate in src/devops_cli/commands/review.py and generate_corpus in src/devops_cli/ai/review/defects.py: no model client and no HTTP client.

Expected vs Actual Behavior

  • Expected: the dry run shows the corpus folder and the files that the run would write, and lists no external request.
  • Actual: the dry run lists an embedding request.

Environment Diagnostics

origin/main at release 0.127.0.

Logs, Traces, or Terminal Output

None.

Proposed Fix

Give review corpus generate and its ai review alias the no-external-request class with a local preview that writes nothing, as review export-feedback has. Delete plan_review_corpus_generate and _get_review_embedding_target, and update the requirement review-request-plans of openspec/specs/command-dry-run-class/spec.md and the lists of tests/commands/test_review_dry_run.py.

Refs #5345, #412.

Alternatives check of 2026-11-28: none.
Tool: none found.
Reason: Searches for an open tool that classifies CLI dry runs found only unrelated web-platform docs. The need is a project-internal reclassification of review corpus generate and removal of its own plan helpers, which no library supplies.

Lacks:

  • No tool assigns a project's dry-run classes
  • No tool removes the command's unused plan helpers
  • No tool renders a local preview of files a run would write

Proposed design

Problem statement

The review corpus generate dry run plans an embedding request that the real run never makes. The real run reads local source files, injects defects, and writes a corpus folder. The dry run must use the local no-external-request class, show the planned folder and files, and delete the unused plan code.

Acceptance criteria

Requirement: Corpus dry run class

The review corpus generate command SHALL use the no-external-request dry-run class.

Scenario: Local corpus dry run

  • WHEN uv run devops review corpus generate src --dry-run runs
  • THEN the command exits 0, lists the corpus output folder and the files it would write, and its request list is empty.

Requirement: Corpus dry run writes nothing

The dry run of review corpus generate MUST write no file.

Scenario: No files written

  • WHEN uv run devops review corpus generate src --dry-run runs
  • THEN the command creates no file and no folder.

Requirement: Alias dry run

The ai review alias of review corpus generate SHALL use the same no-external-request dry-run class.

Scenario: Alias local dry run

  • WHEN uv run devops ai review corpus generate src --dry-run runs
  • THEN the command exits 0, lists the corpus output folder and the files it would write, and its request list is empty.

Requirement: Unused plan helpers removed

The review dry-run plan module MUST NOT define plan_review_corpus_generate or _get_review_embedding_target.

Scenario: Plan helpers removed

  • WHEN a source test inspects src/devops_cli/review/review_plans.py
  • THEN the test finds no definition or call of plan_review_corpus_generate or _get_review_embedding_target.

Requirement: Spec and test lists updated

The review-request-plans requirement and the dry-run test lists MUST record review corpus generate under no-external-request.

Scenario: Spec and test alignment

  • WHEN uv run pytest tests/commands/test_review_dry_run.py -q runs
  • THEN the test passes and asserts the command is in the no-external-request class and not in the request-plan class.

Existing Tool Considered

The alternatives check in the issue body records verdict none and no tool. No open, maintained tool or library covers the classification of a project-specific CLI dry-run. The change reuses the project's existing no-external-request dry-run class and removes the project-specific plan code; it adds no library.

Key questions

  • Does review corpus generate make an external request?: No. The command reads local source files, injects defects with generate_corpus, and writes a corpus folder. It calls no model client and no HTTP client. [sources: src/devops_cli/commands/review.py:1950, src/devops_cli/ai/review/defects.py:1294]
  • Which dry-run class should review corpus generate use?: Use the no-external-request class with a local preview that writes nothing. The command writes local files and makes no external request. (best practice) [sources: src/devops_cli/review/review_plans.py:145, openspec/specs/command-dry-run-class/spec.md]
    • Rejected: Keep the request-plan class. It names an embedding request that the run never makes.
    • Chosen: Use the no-external-request class. It matches a local command that writes files and makes no external request.
  • Should the corpus plan helper and the embedding target helper be deleted?: Yes. Delete plan_review_corpus_generate and _get_review_embedding_target. The corpus plan is their only caller. (best practice) [sources: src/devops_cli/review/review_plans.py:45, src/devops_cli/review/review_plans.py:145, src/devops_cli/commands/review.py:1950]
    • Rejected: Keep the unused helpers. They would stay dead code and keep the false request path.
    • Chosen: Delete both helpers. The corpus plan is their only caller, so no other plan uses them.
  • What should the local dry-run preview show?: Show the corpus output folder and the files that the real run would write. Write no file and no folder. (best practice) [sources: src/devops_cli/ai/review/defects.py:1294, src/devops_cli/commands/review.py:1950]
    • Rejected: Show only the output folder. It hides the files that the run writes.
    • Chosen: Show the output folder and the files, and write nothing. It matches the local write and the no-external-request class.
  • Which specification and test lists must change?: Update the review-request-plans requirement in openspec/specs/command-dry-run-class/spec.md and the dry-run class lists in tests/commands/test_review_dry_run.py. (best practice) [sources: openspec/specs/command-dry-run-class/spec.md, tests/commands/test_review_dry_run.py]
    • Rejected: Update only the test lists. The specification would keep the wrong request-plan entry.
    • Rejected: Update only the specification. The test lists would keep the wrong class.
    • Chosen: Update both. The specification and the tests then agree with the command behavior.

Fit

Fits in one pull request.

Suspected block

None.

Dependencies

None.

Activity

  1. added
    source/agent
    type/bug
    scope/review
    status/new
    value/medium
    effort/low
    on Nov 13, 2026
  2. dan-petty commented on Nov 13, 2026

    @dan-petty
    OwnerAuthor
  3. added
    priority/p2-medium
    on Nov 13, 2026
  4. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

    Alternatives check: none

    Reason: The issue is a misclassification inside the project's own dry-run plan code (plan_review_corpus_generate in src/devops_cli/review/review_plans.py): the fix is to move review corpus generate to the existing no-external-request dry-run class and delete the plan function. Searches for an open tool or library that builds dry-run previews of local file writes for a CLI returned only unrelated HTTP and tutorial pages, so no external tool covers the need.

    Tool: none found

    Lacks:

    • A library that classifies a CLI command's dry-run plan as local file writes versus external requests
    • Reuse of the project's own no-external-request dry-run class for review corpus generate and its ai review alias
    • Removal of plan_review_corpus_generate and _get_review_embedding_target, which is project-specific code

    Searches run:

    • Python CLI library dry-run plan preview of local files written, no external request, results: 5
    • click option dry-run preview listing files a command would write library, results: 5
    • "dry run" tool shows files that would be written instead of HTTP requests, generator CLI, results: 5

    Sources:

    Checked on 2026-11-17. A person decides what this means for the item. The check changes no label and closes no issue.

  5. added
    status/ready
    and removed
    status/new
    on Nov 17, 2026
  6. devops-cli-service commented on Nov 17, 2026

    @devops-cli-service
    Contributor

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

  7. added
    owner/agent
    status/in-progress
    and removed
    status/ready
    on Nov 29, 2026
  8. added
    status/in-review
    and removed
    status/in-progress
    on Nov 29, 2026
  9. removed
    status/in-review
    owner/agent
    on Nov 29, 2026
  10. devops-cli-service commented on Nov 29, 2026

    @devops-cli-service
    Contributor

    Live since 2026-11-29 16:17 UTC

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/lowpriority/p2-mediumscope/reviewsource/agenttype/bugvalue/medium

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions