Skip to content

fix(review): a dry-run review writes no session directory or findings #872

Closed

Description

@dan-petty

Context & Rationale

Under dry run, the review runner saves no segments (src/devops_cli/ai/review/runner.py:1268) and skips persona review and verification (runner.py:2063). It still writes to disk:

  • ReviewPipelineOrchestrator.__init__ always creates the session and files directories (src/devops_cli/ai/review/pipeline.py:1415-1420).
  • The report stage runs anyway (runner.py:2080-2083). It writes findings.json and candidates.json (pipeline.py:3601, :3608).

devops review stats counts every directory with a findings.json as a session (src/devops_cli/commands/review.py:1242). The #434 baseline and the feedback export read the same directories (#607).

#412 (v0.2.26) makes command dry-run branches reachable from the CLI, so this has to be fixed first. It comes from the extension under #475's roadmap entry (docs/ROADMAP.md:314, "PR 3").

Scope & Deliverables

Deliverable: A dry-run review creates no session directory. It writes no findings.json, candidates.json, profile.json or per-file JSON, and it still prints its preview.

Acceptance criteria:

  • An offline test points _get_reviews_base_dir at a tmp dir, sets DEVOPS_CLI_DRY_RUN=true and reviews a tmp target through the orchestrator path. It asserts that the reviews dir stays empty and that devops review stats on it reports no saved sessions. Structural tuple assertions; under 1 s.
  • test_run_review_dry_run_skips_client_calls (tests/test_review_path.py:348) still passes.
  • uv run devops ci passes.

Key questions:

Constraint:

  • No behaviour change outside dry run.
  • Tests stay offline.

Strategic Alignment

Split off #475 during the v0.2.25/v0.2.26 readiness review (2026-10-01): This is PR 3 of the extension under #475's roadmap entry (docs/ROADMAP.md:314). It has nothing to do with measuring models. It must land before #412 (v0.2.26), which makes command dry-run branches reachable.

Update 2026-10-08: refinement

The bug holds: a dry run still writes findings.json, candidates.json, findings.sarif and review.md (ai/review/runner.py:2216-2217), also through the routed-files path (:2245-2266).

  • The files not written include findings.sarif and review.md.
  • A dry run whose only change is a routed file leaves the reviews directory empty.

Activity

  1. added
    type/bug
    scope/review
    priority/p2-medium
    on Oct 1, 2026
  2. dan-petty commented on Oct 8, 2026

    @dan-petty
    OwnerAuthor

    Linked: #412 depends on this item, because forwarding makes devops --dry-run review path . write a session. #771 and #1008 edit the same constructor and report writer; whichever lands second rebases. Found by the 2026-10-08 backlog review.

  3. added this to the v0.2.36 milestone on Oct 14, 2026
  4. dan-petty commented on Oct 14, 2026

    @dan-petty
    OwnerAuthor

    Moved to v0.2.36: v0.2.36 started with fewer than its 16 items and was topped up to 16 from Ready items, critical fixes and P0 features first. (devops roadmap reprioritize)

  5. added
    status/in-progress
    on Oct 16, 2026
  6. dan-petty commented on Oct 16, 2026

    @dan-petty
    OwnerAuthor

    What changed

    #1587, merged into release/v0.2.36 as bedbf6f.

    Closes #872

    6 file(s) changed.

    How it was verified

    Check runs at cfd4d95:

    • Prune PR DevContainer Images: pass
    • Audit Defect PR Hardening: skipping
    • devops-cli: pass
    • bandit: pass
    • CodeQL: pass
    • Changed-Test Independence: pass
    • Tests & Coverage: pass
    • Analyze (python): pass
    • Analyze (actions): pass
    • Static Analysis: pass
    • DevContainer Image: skipping
    • Service Image: skipping
    • Dependency Freshness: skipping

    Acceptance Criteria of docs/agent/tasks/task-872-review-dry-run-no-session-dir.md:

    • An offline test points _get_reviews_base_dir at a tmp dir, sets DEVOPS_CLI_DRY_RUN=true and reviews a tmp target through the orchestrator path, asserting that the reviews dir stays empty and devops review stats reports no saved sessions (tests/test_review_path.py::test_run_review_dry_run_skips_client_calls).
    • test_run_review_dry_run_skips_client_calls in tests/test_review_path.py passes under 1 s (tests/test_review_path.py::test_run_review_dry_run_skips_client_calls).
    • The files not written include findings.sarif and review.md (tests/test_review_path.py::test_run_review_dry_run_skips_client_calls).
    • A dry run whose only change is a routed file leaves the reviews directory empty (tests/test_review_path.py::test_dry_run_routed_files_only_leaves_reviews_dir_empty).
    • uv run devops ci passes.
  7. removed
    status/in-progress
    on Oct 30, 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

    priority/p2-mediumscope/reviewtype/bug

    Type

    No type

    Projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions