[BUG] agents plan diff --correction is a stub — correction diff not implemented (v3.3.0 spec deviation) #9053

Open
opened 2026-04-14 06:45:00 +00:00 by HAL9000 · 2 comments
Owner

Metadata

  • Commit message: fix(plan): implement agents plan diff --correction — correction diff output and optional plan_id
  • Branch name: fix/plan-diff-correction-stub

Background and Context

During UAT testing of the Subplans, Checkpoints & Merge Strategies feature area, the agents plan diff --correction command was found to be a stub that does not implement the correction diff functionality required by the v3.3.0 specification.

Feature Area: Subplans, Checkpoints & Merge Strategies
Spec Reference: docs/specification.mdagents plan diff section (line 15323)

The --correction path in src/cleveragents/cli/commands/plan.py (lines 3296–3307) currently displays a placeholder panel and exits immediately, with no actual diff computation. Additionally, the CLI signature violates the spec by requiring plan_id as a mandatory positional argument even when --correction is used.

Expected Behavior

Per the specification, agents plan diff --correction <CORRECTION_ATTEMPT_ID> should show a full correction diff including:

  • Correction metadata (correction ID, original decision, mode)
  • File-by-file comparison (before/after)
  • Patch preview (corrected vs original)
  • Structured JSON/YAML output with correction_diff, comparison, and patch_preview fields

The spec signature is: agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>) — these are mutually exclusive alternatives, meaning plan_id must be optional when --correction is provided.

Acceptance Criteria

  • agents plan diff --correction <CORRECTION_ATTEMPT_ID> returns a structured response with a correction_diff object containing: correction ID, original decision, mode, files changed, insertions, deletions
  • Response includes a comparison array with per-file before/after stats
  • Response includes a patch_preview array with unified diff hunks
  • plan_id positional argument is optional (not required) when --correction is used — the spec signature (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>) must be respected
  • No stub panel is shown; actual diff data is computed and returned
  • Satisfies M4 feature requirement #9: "agents plan diff — Shows diff of plan changes or correction attempt"

Subtasks

  • Remove or gate the stub panel in src/cleveragents/cli/commands/plan.py lines 3296–3307
  • Make plan_id positional argument optional when --correction flag is present
  • Implement correction diff computation logic (fetch correction attempt, compute before/after diff)
  • Build correction_diff output object with required fields (correction ID, original decision, mode, files changed, insertions, deletions)
  • Build comparison array with per-file before/after stats
  • Build patch_preview array with unified diff hunks
  • Add/update unit tests for --correction path
  • Add/update integration/UAT tests verifying the full correction diff output structure

Definition of Done

This issue is closed when:

  1. agents plan diff --correction <CORRECTION_ATTEMPT_ID> produces a fully structured correction diff response matching the spec schema (no stub panel)
  2. plan_id is not required when --correction is used
  3. All acceptance criteria above are met and verified by automated tests
  4. The UAT scenario for M4 feature requirement #9 passes end-to-end

Bug Report

Feature Area: Subplans, Checkpoints & Merge Strategies
Milestone: v3.3.0
Spec Reference: docs/specification.md — agents plan diff section (line 15323)

Expected Behavior

Per the specification, agents plan diff --correction <CORRECTION_ATTEMPT_ID> should show a full correction diff including:

  • Correction metadata (correction ID, original decision, mode)
  • File-by-file comparison (before/after)
  • Patch preview (corrected vs original)
  • Structured JSON/YAML output with correction_diff, comparison, and patch_preview fields

The spec signature is: agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>) — these are mutually exclusive alternatives.

Actual Behavior

The --correction path in src/cleveragents/cli/commands/plan.py (lines 3296–3307) is a stub that displays:

╭─ Correction Diff ─────────────────────────────────╮
│ Correction Attempt: <id>                           │
│ Plan: <plan_id>                                    │
│                                                    │
│ Correction diff will be available after M4.2.      │
╰────────────────────────────────────────────────────╯

Two additional issues:

  1. The implementation requires plan_id as a mandatory positional argument even when --correction is used, violating the spec's mutually exclusive signature.
  2. No actual diff data is computed or returned — the command exits immediately after showing the stub panel.

Steps to Reproduce

  1. Create a plan and execute a correction
  2. Run: agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID>
  3. Observe: stub panel shown instead of actual correction diff

Acceptance Criteria Impact

Violates spec requirement: "agents plan diff — Shows diff of plan changes or correction attempt" (M4 feature requirement #9 in the UAT spec).

The correction diff output must include:

  • correction_diff object with correction ID, original decision, mode, files changed, insertions, deletions
  • comparison array with per-file before/after stats
  • patch_preview array with unified diff hunks
  • plan_id positional argument must be optional (not required) when --correction is used

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: AUTO-UAT-3


Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit message:** `fix(plan): implement agents plan diff --correction — correction diff output and optional plan_id` - **Branch name:** `fix/plan-diff-correction-stub` ## Background and Context During UAT testing of the **Subplans, Checkpoints & Merge Strategies** feature area, the `agents plan diff --correction` command was found to be a stub that does not implement the correction diff functionality required by the v3.3.0 specification. **Feature Area:** Subplans, Checkpoints & Merge Strategies **Spec Reference:** `docs/specification.md` — `agents plan diff` section (line 15323) The `--correction` path in `src/cleveragents/cli/commands/plan.py` (lines 3296–3307) currently displays a placeholder panel and exits immediately, with no actual diff computation. Additionally, the CLI signature violates the spec by requiring `plan_id` as a mandatory positional argument even when `--correction` is used. ## Expected Behavior Per the specification, `agents plan diff --correction <CORRECTION_ATTEMPT_ID>` should show a full correction diff including: - Correction metadata (correction ID, original decision, mode) - File-by-file comparison (before/after) - Patch preview (corrected vs original) - Structured JSON/YAML output with `correction_diff`, `comparison`, and `patch_preview` fields The spec signature is: `agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>)` — these are mutually exclusive alternatives, meaning `plan_id` must be **optional** when `--correction` is provided. ## Acceptance Criteria - [ ] `agents plan diff --correction <CORRECTION_ATTEMPT_ID>` returns a structured response with a `correction_diff` object containing: correction ID, original decision, mode, files changed, insertions, deletions - [ ] Response includes a `comparison` array with per-file before/after stats - [ ] Response includes a `patch_preview` array with unified diff hunks - [ ] `plan_id` positional argument is optional (not required) when `--correction` is used — the spec signature `(--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>)` must be respected - [ ] No stub panel is shown; actual diff data is computed and returned - [ ] Satisfies M4 feature requirement #9: "`agents plan diff` — Shows diff of plan changes or correction attempt" ## Subtasks - [ ] Remove or gate the stub panel in `src/cleveragents/cli/commands/plan.py` lines 3296–3307 - [ ] Make `plan_id` positional argument optional when `--correction` flag is present - [ ] Implement correction diff computation logic (fetch correction attempt, compute before/after diff) - [ ] Build `correction_diff` output object with required fields (correction ID, original decision, mode, files changed, insertions, deletions) - [ ] Build `comparison` array with per-file before/after stats - [ ] Build `patch_preview` array with unified diff hunks - [ ] Add/update unit tests for `--correction` path - [ ] Add/update integration/UAT tests verifying the full correction diff output structure ## Definition of Done This issue is closed when: 1. `agents plan diff --correction <CORRECTION_ATTEMPT_ID>` produces a fully structured correction diff response matching the spec schema (no stub panel) 2. `plan_id` is not required when `--correction` is used 3. All acceptance criteria above are met and verified by automated tests 4. The UAT scenario for M4 feature requirement #9 passes end-to-end --- ## Bug Report **Feature Area:** Subplans, Checkpoints & Merge Strategies **Milestone:** v3.3.0 **Spec Reference:** docs/specification.md — `agents plan diff` section (line 15323) ### Expected Behavior Per the specification, `agents plan diff --correction <CORRECTION_ATTEMPT_ID>` should show a full correction diff including: - Correction metadata (correction ID, original decision, mode) - File-by-file comparison (before/after) - Patch preview (corrected vs original) - Structured JSON/YAML output with `correction_diff`, `comparison`, and `patch_preview` fields The spec signature is: `agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>)` — these are mutually exclusive alternatives. ### Actual Behavior The `--correction` path in `src/cleveragents/cli/commands/plan.py` (lines 3296–3307) is a stub that displays: ``` ╭─ Correction Diff ─────────────────────────────────╮ │ Correction Attempt: <id> │ │ Plan: <plan_id> │ │ │ │ Correction diff will be available after M4.2. │ ╰────────────────────────────────────────────────────╯ ``` Two additional issues: 1. The implementation requires `plan_id` as a mandatory positional argument even when `--correction` is used, violating the spec's mutually exclusive signature. 2. No actual diff data is computed or returned — the command exits immediately after showing the stub panel. ### Steps to Reproduce 1. Create a plan and execute a correction 2. Run: `agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID>` 3. Observe: stub panel shown instead of actual correction diff ### Acceptance Criteria Impact Violates spec requirement: "`agents plan diff` — Shows diff of plan changes or correction attempt" (M4 feature requirement #9 in the UAT spec). The correction diff output must include: - [ ] `correction_diff` object with correction ID, original decision, mode, files changed, insertions, deletions - [ ] `comparison` array with per-file before/after stats - [ ] `patch_preview` array with unified diff hunks - [ ] `plan_id` positional argument must be optional (not required) when `--correction` is used --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: AUTO-UAT-3 --- **Automated by CleverAgents Bot** Agent: new-issue-creator
Author
Owner

🔍 Triage Decision — [AUTO-OWNR-2]

Status: VERIFIED

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

Reasoning: The agents plan diff --correction stub implementation violates the v3.3.0 spec. Note: This issue appears to be a duplicate of #9085, which covers the same bug. Please review both issues and consider closing one as a duplicate to avoid duplicate work.


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` stub implementation violates the v3.3.0 spec. **Note: This issue appears to be a duplicate of #9085**, which covers the same bug. Please review both issues and consider closing one as a duplicate to avoid duplicate work. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
HAL9000 added this to the v3.3.0 milestone 2026-04-14 17:39:07 +00:00
Author
Owner

Triage Decision [AUTO-OWNR-1]: Verified as a valid stub implementation bug. The agents plan diff --correction command returns placeholder text instead of a real correction diff. Note: This may be a duplicate of #9085 which is already verified with the same assessment. Must Have for v3.3.0.


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

✅ **Triage Decision [AUTO-OWNR-1]**: Verified as a valid stub implementation bug. The `agents plan diff --correction` command returns placeholder text instead of a real correction diff. Note: This may be a duplicate of #9085 which is already verified with the same assessment. `Must Have` for v3.3.0. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#9053
No description provided.