UAT: agents plan correct --dry-run rich output is missing spec-required panels and cost breakdown #4411

Open
opened 2026-04-08 12:22:10 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Plan Correction — agents plan correct --dry-run (rich output)

What Was Tested

Code-level analysis of src/cleveragents/cli/commands/plan.py (correct_decision function, lines 3267–3303) against the spec's agents plan correct dry-run section (spec lines 15200–15321).

Expected Behavior (from spec)

The spec defines a rich output with 3 panels for --dry-run:

╭─ Dry Run — Correction Preview ─────────────────────────────────────╮
│ ⚠  This is a preview only. No changes will be made.                │
╰────────────────────────────────────────────────────────────────────╯

╭─ Would Revert ───────────────────────────────────────╮
│ Decisions to invalidate: 3                           │
│   01HXM9A1..  strategy_choice    "sync pattern"      │
│   01HXM9A2..  implementation_choice  "requests"      │
│   01HXM9A3..  tool_invocation    write_file x4       │
│ Child plans to roll back: 2                          │
│ Artifacts to archive: 5 files                        │
│ Unaffected decisions: 2 (will be kept)               │
╰──────────────────────────────────────────────────────╯

╭─ Estimated Cost ──────────╮
│ Re-strategize: ~$0.012    │
│ Re-execute: ~$0.035       │
│ Total: ~$0.047            │
│ ETA: ~4 minutes           │
╰───────────────────────────╯

To execute this correction, remove --dry-run and add --yes

Key spec requirements:

  1. A "Dry Run — Correction Preview" warning panel
  2. A "Would Revert" panel listing each decision to invalidate with its type and label
  3. An "Estimated Cost" panel with separate re-strategize and re-execute cost estimates
  4. A hint: "To execute this correction, remove --dry-run and add --yes"

Actual Behavior (from implementation)

The implementation (plan.py lines 3285–3303) shows a single "Correction Impact (Dry Run)" panel:

console.print(
    Panel(
        f"[bold]Correction ID:[/bold] {request.correction_id}\n"
        f"[bold]Mode:[/bold] {request.mode.value}\n"
        f"[bold]Target Decision:[/bold] {request.target_decision_id}\n"
        f"[bold]Guidance:[/bold] {request.guidance}\n\n"
        f"[bold]Affected Decisions:[/bold] {', '.join(impact.affected_decisions) or '(none)'}\n"
        f"[bold]Affected Files:[/bold] {', '.join(impact.affected_files) or '(none)'}\n"
        f"[bold]Risk Level:[/bold] {impact.risk_level}\n"
        f"[bold]Estimated Cost:[/bold] {impact.estimated_cost or 'N/A'}",
        title="Correction Impact (Dry Run)",
        expand=False,
    )
)

Missing from implementation:

  1. No "Dry Run — Correction Preview" warning panel with the warning
  2. The "Would Revert" panel shows decisions as a comma-separated list of IDs, not as a table with decision type and label
  3. No "Estimated Cost" panel with separate re-strategize/re-execute breakdown
  4. No hint text: "To execute this correction, remove --dry-run and add --yes"
  5. No count of "Child plans to roll back" or "Unaffected decisions"

Code Location

  • src/cleveragents/cli/commands/plan.py, lines 3267–3303 (dry-run output block)
  • src/cleveragents/application/services/correction_service.pyCorrectionDryRunReport has estimated_recompute_time_seconds and warnings fields, but generate_dry_run_report() is not called from the CLI (the CLI calls analyze_impact() directly instead)

Note on generate_dry_run_report

The CorrectionService.generate_dry_run_report() method exists and generates a CorrectionDryRunReport with warnings and recompute time, but the CLI's correct_decision function calls analyze_impact() directly instead of generate_dry_run_report(). This means the richer dry-run data (warnings, recompute time, decisions_to_invalidate list) is never surfaced to the user.

Steps to Reproduce

  1. Create a plan with decisions
  2. Run agents plan correct <DECISION_ID> --mode revert --guidance "test" --dry-run
  3. Observe that the output is a single panel without the warning, decision type details, cost breakdown, or hint

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Bug Report **Feature Area:** Plan Correction — `agents plan correct --dry-run` (rich output) ### What Was Tested Code-level analysis of `src/cleveragents/cli/commands/plan.py` (`correct_decision` function, lines 3267–3303) against the spec's `agents plan correct` dry-run section (spec lines 15200–15321). ### Expected Behavior (from spec) The spec defines a rich output with **3 panels** for `--dry-run`: ``` ╭─ Dry Run — Correction Preview ─────────────────────────────────────╮ │ ⚠ This is a preview only. No changes will be made. │ ╰────────────────────────────────────────────────────────────────────╯ ╭─ Would Revert ───────────────────────────────────────╮ │ Decisions to invalidate: 3 │ │ 01HXM9A1.. strategy_choice "sync pattern" │ │ 01HXM9A2.. implementation_choice "requests" │ │ 01HXM9A3.. tool_invocation write_file x4 │ │ Child plans to roll back: 2 │ │ Artifacts to archive: 5 files │ │ Unaffected decisions: 2 (will be kept) │ ╰──────────────────────────────────────────────────────╯ ╭─ Estimated Cost ──────────╮ │ Re-strategize: ~$0.012 │ │ Re-execute: ~$0.035 │ │ Total: ~$0.047 │ │ ETA: ~4 minutes │ ╰───────────────────────────╯ To execute this correction, remove --dry-run and add --yes ``` Key spec requirements: 1. A "Dry Run — Correction Preview" warning panel 2. A "Would Revert" panel listing each decision to invalidate **with its type and label** 3. An "Estimated Cost" panel with **separate re-strategize and re-execute cost estimates** 4. A hint: "To execute this correction, remove --dry-run and add --yes" ### Actual Behavior (from implementation) The implementation (`plan.py` lines 3285–3303) shows a single "Correction Impact (Dry Run)" panel: ```python console.print( Panel( f"[bold]Correction ID:[/bold] {request.correction_id}\n" f"[bold]Mode:[/bold] {request.mode.value}\n" f"[bold]Target Decision:[/bold] {request.target_decision_id}\n" f"[bold]Guidance:[/bold] {request.guidance}\n\n" f"[bold]Affected Decisions:[/bold] {', '.join(impact.affected_decisions) or '(none)'}\n" f"[bold]Affected Files:[/bold] {', '.join(impact.affected_files) or '(none)'}\n" f"[bold]Risk Level:[/bold] {impact.risk_level}\n" f"[bold]Estimated Cost:[/bold] {impact.estimated_cost or 'N/A'}", title="Correction Impact (Dry Run)", expand=False, ) ) ``` **Missing from implementation:** 1. No "Dry Run — Correction Preview" warning panel with the `⚠` warning 2. The "Would Revert" panel shows decisions as a comma-separated list of IDs, not as a table with decision type and label 3. No "Estimated Cost" panel with separate re-strategize/re-execute breakdown 4. No hint text: "To execute this correction, remove --dry-run and add --yes" 5. No count of "Child plans to roll back" or "Unaffected decisions" ### Code Location - `src/cleveragents/cli/commands/plan.py`, lines 3267–3303 (dry-run output block) - `src/cleveragents/application/services/correction_service.py` — `CorrectionDryRunReport` has `estimated_recompute_time_seconds` and `warnings` fields, but `generate_dry_run_report()` is not called from the CLI (the CLI calls `analyze_impact()` directly instead) ### Note on `generate_dry_run_report` The `CorrectionService.generate_dry_run_report()` method exists and generates a `CorrectionDryRunReport` with warnings and recompute time, but the CLI's `correct_decision` function calls `analyze_impact()` directly instead of `generate_dry_run_report()`. This means the richer dry-run data (warnings, recompute time, decisions_to_invalidate list) is never surfaced to the user. ### Steps to Reproduce 1. Create a plan with decisions 2. Run `agents plan correct <DECISION_ID> --mode revert --guidance "test" --dry-run` 3. Observe that the output is a single panel without the warning, decision type details, cost breakdown, or hint --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.5.0 milestone 2026-04-08 17:42:53 +00:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
cleveragents/cleveragents-core#4411
No description provided.