UAT: agents plan diff --correction is an unimplemented stub — outputs placeholder text instead of correction diff #2045

Open
opened 2026-04-03 03:31:21 +00:00 by freemo · 2 comments
Owner

Metadata

  • Branch: bugfix/m4-plan-diff-correction-stub
  • Commit Message: fix(cli): implement correction diff output for agents plan diff --correction
  • Milestone: v3.7.0
  • Parent Epic: #358

Bug Description

The agents plan diff --correction <CORRECTION_ATTEMPT_ID> command is not implemented. It outputs a placeholder stub message instead of the actual correction diff comparing the original and corrected execution.

Code location: src/cleveragents/cli/commands/plan.py, function plan_diff (line ~2755)

Actual Behavior

The implementation outputs a stub panel:

if correction:
    # Show correction-specific diff (stub: shows info panel)
    console.print(
        Panel(
            f"[bold]Correction Attempt:[/bold] {correction}\n"
            f"[bold]Plan:[/bold] {plan_id}\n\n"
            "[dim]Correction diff will be available after M4.2.[/dim]",
            title="Correction Diff",
            expand=False,
        )
    )
    return

This outputs: "Correction diff will be available after M4.2." — a placeholder that was never replaced with the actual implementation.

Expected Behavior (per spec §15521–15670)

When --correction is provided, the command must show a diff comparing the original plan execution vs the corrected execution, including:

  • Correction metadata — correction ID, original decision, mode (revert or append)
  • Comparison table — files changed before/after correction (insertions, deletions, summary)
  • Patch preview — line-by-line diff between original and corrected artifact versions
  • JSON/YAML output — structured output with correction_diff, comparison, and patch_preview sections

Steps to Reproduce

  1. Create a plan, execute it, apply a correction via agents plan correct
  2. Run agents plan diff --correction <CORRECTION_ATTEMPT_ID>
  3. Observe the stub message "Correction diff will be available after M4.2." instead of actual diff output

Subtasks

  • Implement correction diff retrieval from CorrectionService or CorrectionAttemptRecord
  • Implement comparison between original and corrected changeset (insertions, deletions, file summary)
  • Implement rich output with "Correction Diff", "Comparison", and "Patch Preview" panels
  • Implement JSON/YAML output with correction_diff, comparison, patch_preview sections
  • Remove the stub placeholder message and return guard
  • Write BDD tests for the correction diff output (all output modes: rich, JSON, YAML)

Definition of Done

  • agents plan diff --correction <ID> shows actual diff data (not stub text)
  • Rich output includes "Correction Diff", "Comparison", and "Patch Preview" panels matching spec §15521–15670
  • JSON output matches spec structure with correction_diff, comparison, patch_preview keys
  • YAML output matches spec structure with the same keys
  • Stub placeholder message and early return are fully removed from plan_diff
  • BDD scenarios cover rich, JSON, and YAML output modes for --correction
  • All nox stages pass
  • Coverage >= 97%

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `bugfix/m4-plan-diff-correction-stub` - **Commit Message**: `fix(cli): implement correction diff output for agents plan diff --correction` - **Milestone**: v3.7.0 - **Parent Epic**: #358 ## Bug Description The `agents plan diff --correction <CORRECTION_ATTEMPT_ID>` command is not implemented. It outputs a placeholder stub message instead of the actual correction diff comparing the original and corrected execution. **Code location**: `src/cleveragents/cli/commands/plan.py`, function `plan_diff` (line ~2755) ### Actual Behavior The implementation outputs a stub panel: ```python if correction: # Show correction-specific diff (stub: shows info panel) console.print( Panel( f"[bold]Correction Attempt:[/bold] {correction}\n" f"[bold]Plan:[/bold] {plan_id}\n\n" "[dim]Correction diff will be available after M4.2.[/dim]", title="Correction Diff", expand=False, ) ) return ``` This outputs: `"Correction diff will be available after M4.2."` — a placeholder that was never replaced with the actual implementation. ### Expected Behavior (per spec §15521–15670) When `--correction` is provided, the command must show a diff comparing the original plan execution vs the corrected execution, including: - **Correction metadata** — correction ID, original decision, mode (`revert` or `append`) - **Comparison table** — files changed before/after correction (insertions, deletions, summary) - **Patch preview** — line-by-line diff between original and corrected artifact versions - **JSON/YAML output** — structured output with `correction_diff`, `comparison`, and `patch_preview` sections ### Steps to Reproduce 1. Create a plan, execute it, apply a correction via `agents plan correct` 2. Run `agents plan diff --correction <CORRECTION_ATTEMPT_ID>` 3. Observe the stub message `"Correction diff will be available after M4.2."` instead of actual diff output ## Subtasks - [ ] Implement correction diff retrieval from `CorrectionService` or `CorrectionAttemptRecord` - [ ] Implement comparison between original and corrected changeset (insertions, deletions, file summary) - [ ] Implement rich output with "Correction Diff", "Comparison", and "Patch Preview" panels - [ ] Implement JSON/YAML output with `correction_diff`, `comparison`, `patch_preview` sections - [ ] Remove the stub placeholder message and `return` guard - [ ] Write BDD tests for the correction diff output (all output modes: rich, JSON, YAML) ## Definition of Done - [ ] `agents plan diff --correction <ID>` shows actual diff data (not stub text) - [ ] Rich output includes "Correction Diff", "Comparison", and "Patch Preview" panels matching spec §15521–15670 - [ ] JSON output matches spec structure with `correction_diff`, `comparison`, `patch_preview` keys - [ ] YAML output matches spec structure with the same keys - [ ] Stub placeholder message and early `return` are fully removed from `plan_diff` - [ ] BDD scenarios cover rich, JSON, and YAML output modes for `--correction` - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.7.0 milestone 2026-04-03 03:31:45 +00:00
freemo self-assigned this 2026-04-03 16:58:13 +00:00
Author
Owner

Label compliance fix applied:

  • Removed conflicting label: State/Unverified
  • Kept: State/Verified
  • Reason: Issue had two conflicting State/* labels. Per CONTRIBUTING.md, only one State/* label is permitted. Kept the more advanced state (State/Verified).

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Label compliance fix applied: - Removed conflicting label: `State/Unverified` - Kept: `State/Verified` - Reason: Issue had two conflicting `State/*` labels. Per CONTRIBUTING.md, only one `State/*` label is permitted. Kept the more advanced state (`State/Verified`). --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
Author
Owner

Label compliance fix applied:

  • Removed conflicting label: State/Unverified
  • Retained: State/Verified
  • Reason: Issue had two conflicting State/* labels simultaneously. Per CONTRIBUTING.md, only one State/* label is permitted. State/Verified is the more advanced state and has been retained.

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: ca-backlog-groomer

Label compliance fix applied: - Removed conflicting label: `State/Unverified` - Retained: `State/Verified` - Reason: Issue had two conflicting `State/*` labels simultaneously. Per CONTRIBUTING.md, only one `State/*` label is permitted. `State/Verified` is the more advanced state and has been retained. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: ca-backlog-groomer
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.

Blocks
Reference
cleveragents/cleveragents-core#2045
No description provided.