[BUG] agents plan diff --correction is a stub — returns placeholder text instead of real correction diff #9085

Closed
opened 2026-04-14 07:22:30 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit Message: fix(cli): implement plan diff --correction to show real correction attempt diff
  • Branch: fix/plan-diff-correction-stub

Background and Context

The specification (v3.2.0/v3.3.0) defines the agents plan diff command with a --correction flag:

agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>)

This command is supposed to show the diff for a specific correction attempt, allowing users to review what changes a correction would make before applying it.

Current Behavior:

The implementation in src/cleveragents/cli/commands/plan.py at the plan_diff function (around line 3296–3307) contains a stub:

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

When a user runs agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID>, they receive a placeholder panel saying "Correction diff will be available after M4.2." instead of an actual diff.

Expected Behavior

agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID> should return a real diff showing the changes that the specified correction attempt would make (or has made) to the plan's decision tree and associated artifacts. The output should follow the same format as the regular plan diff command (supporting --format rich|plain|json|yaml).

Acceptance Criteria

  • agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID> returns a real diff (not a stub/placeholder)
  • The diff shows which decisions were reverted or added by the correction
  • The diff supports all output formats (--format rich|plain|json|yaml)
  • The stub comment and placeholder text are removed

Subtasks

  • Implement CorrectionService.get_correction_diff() or equivalent method to retrieve diff data for a correction attempt
  • Wire the --correction flag in plan_diff CLI command to call the real diff implementation
  • Support all output formats (rich, plain, json, yaml) for correction diffs
  • Add BDD scenarios in features/plan_diff_artifacts.feature or a new feature file for the --correction path
  • Remove stub code and placeholder text
  • Run nox (all default sessions), fix any errors
  • Verify coverage >=97% via nox -s coverage_report

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.

Supporting Information:

  • File: src/cleveragents/cli/commands/plan.py, function plan_diff (around line 3265–3318)
  • The stub comment explicitly says "Correction diff will be available after M4.2." indicating this was intentionally deferred
  • Related feature file: features/plan_diff_artifacts.feature (does not test the --correction flag path)
  • Spec reference: agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>) — Plan Corrections section

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor

## Metadata - **Commit Message**: `fix(cli): implement plan diff --correction to show real correction attempt diff` - **Branch**: `fix/plan-diff-correction-stub` ## Background and Context The specification (v3.2.0/v3.3.0) defines the `agents plan diff` command with a `--correction` flag: ``` agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>) ``` This command is supposed to show the diff for a specific correction attempt, allowing users to review what changes a correction would make before applying it. **Current Behavior:** The implementation in `src/cleveragents/cli/commands/plan.py` at the `plan_diff` function (around line 3296–3307) contains a stub: ```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 ``` When a user runs `agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID>`, they receive a placeholder panel saying "Correction diff will be available after M4.2." instead of an actual diff. ## Expected Behavior `agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID>` should return a real diff showing the changes that the specified correction attempt would make (or has made) to the plan's decision tree and associated artifacts. The output should follow the same format as the regular `plan diff` command (supporting `--format rich|plain|json|yaml`). ## Acceptance Criteria - `agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID>` returns a real diff (not a stub/placeholder) - The diff shows which decisions were reverted or added by the correction - The diff supports all output formats (`--format rich|plain|json|yaml`) - The stub comment and placeholder text are removed ## Subtasks - [ ] Implement `CorrectionService.get_correction_diff()` or equivalent method to retrieve diff data for a correction attempt - [ ] Wire the `--correction` flag in `plan_diff` CLI command to call the real diff implementation - [ ] Support all output formats (`rich`, `plain`, `json`, `yaml`) for correction diffs - [ ] Add BDD scenarios in `features/plan_diff_artifacts.feature` or a new feature file for the `--correction` path - [ ] Remove stub code and placeholder text - [ ] Run `nox` (all default sessions), fix any errors - [ ] Verify coverage >=97% via `nox -s coverage_report` ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. **Supporting Information:** - File: `src/cleveragents/cli/commands/plan.py`, function `plan_diff` (around line 3265–3318) - The stub comment explicitly says "Correction diff will be available after M4.2." indicating this was intentionally deferred - Related feature file: `features/plan_diff_artifacts.feature` (does not test the `--correction` flag path) - Spec reference: `agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>)` — Plan Corrections section --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
HAL9000 added this to the v3.3.0 milestone 2026-04-14 07:37:29 +00:00
Author
Owner

🔍 Triage Decision — [AUTO-OWNR-2]

Status: VERIFIED

MoSCoW: Must have
Priority: High
Milestone: v3.3.0

Reasoning: The agents plan diff --correction command returns placeholder text instead of a real correction diff, which is a stub implementation that directly violates the v3.3.0 spec. This must be fixed before the release.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

## 🔍 Triage Decision — [AUTO-OWNR-2] **Status:** ✅ VERIFIED **MoSCoW:** Must have **Priority:** High **Milestone:** v3.3.0 **Reasoning:** The `agents plan diff --correction` command returns placeholder text instead of a real correction diff, which is a stub implementation that directly violates the v3.3.0 spec. This must be fixed before the release. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Author
Owner

Implementation Attempt — Tier 1: haiku — Success

Implemented the correction diff functionality:

  • Added correction_diff() method to PlanApplyService that retrieves correction attempt data from the database
  • Implemented helper functions for rendering correction diffs in multiple formats (rich, plain, json, yaml)
  • Updated the CLI command to call the new method instead of showing the stub placeholder
  • Removed the stub Panel display that showed "Correction diff will be available after M4.2"

Quality Gates Status

Gate Status Details
Typecheck ✓ Passed 0 errors, 3 warnings
Lint ✓ Passed No issues in modified files

Linked to PR #9221


Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker

**Implementation Attempt** — Tier 1: haiku — Success Implemented the correction diff functionality: - **Added `correction_diff()` method** to PlanApplyService that retrieves correction attempt data from the database - **Implemented helper functions** for rendering correction diffs in multiple formats (rich, plain, json, yaml) - **Updated the CLI command** to call the new method instead of showing the stub placeholder - **Removed the stub Panel display** that showed "Correction diff will be available after M4.2" ### Quality Gates Status | Gate | Status | Details | |------|--------|---------| | Typecheck | ✓ Passed | 0 errors, 3 warnings | | Lint | ✓ Passed | No issues in modified files | ### Related PR Linked to PR #9221 --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-worker
hurui200320 2026-04-17 09:56:32 +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.

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