UAT: agents plan diff --correction is a stub — correction diff not implemented #3496

Open
opened 2026-04-05 18:39:30 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/plan-diff-correction-stub
  • Commit Message: fix(cli): implement correction diff rendering for agents plan diff --correction
  • Milestone: None (backlog — see backlog note below)
  • Parent Epic: #358

Backlog note: This issue was discovered during autonomous operation
on milestone v3.3.0. It does not block milestone completion and has been
placed in the backlog for human review and future milestone assignment.


Summary

The agents plan diff --correction <CORRECTION_ATTEMPT_ID> command is implemented as a stub that displays a placeholder message instead of the actual correction diff. The spec requires this command to show the diff for a specific correction attempt.

Spec Reference

The spec defines agents plan diff as:

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

Purpose: Show diffs for a plan or a correction attempt.

Arguments:

  • <PLAN_ID>: Show diff for a plan (positional argument). Mutually exclusive with --correction.
  • --correction CORRECTION_ATTEMPT_ID: Show diff for a correction attempt instead.

Current Implementation

# src/cleveragents/cli/commands/plan.py, line 2739-2750
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

The implementation explicitly marks this as a stub with the message "Correction diff will be available after M4.2." This means the --correction flag is non-functional.

Impact

  • Users cannot view diffs for specific correction attempts via CLI
  • The agents plan diff --correction command silently returns a placeholder instead of an error or actual diff
  • Correction workflow is incomplete — users cannot inspect what changed during a correction

Expected Behavior

When agents plan diff --correction <CORRECTION_ATTEMPT_ID> is run:

  1. The CorrectionService should be queried for the correction attempt
  2. The diff between the original decision subtree and the corrected subtree should be computed
  3. The diff should be rendered in the requested format (rich/plain/json/yaml)

Steps to Reproduce

# After creating a correction attempt:
agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID>
# Expected: Shows diff for the correction attempt
# Actual: Shows "Correction diff will be available after M4.2."

Code Location

src/cleveragents/cli/commands/plan.py, lines 2739–2750 (the plan_diff command handler)


Subtasks

  • Remove the stub block in plan_diff for the --correction path
  • Query CorrectionService for the correction attempt by CORRECTION_ATTEMPT_ID
  • Validate that the correction attempt exists and belongs to the given PLAN_ID; surface a clear error if not
  • Compute the diff between the original decision subtree and the corrected subtree
  • Render the diff in the requested output format (rich / plain / json / yaml)
  • Write Behave unit tests covering the new --correction diff path (happy path + error cases)
  • Write Robot Framework integration test for agents plan diff --correction
  • Update CLI help text / docstring to remove the "available after M4.2" note

Definition of Done

  • agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID> returns the actual correction diff (not a placeholder)
  • All four output formats (rich, plain, json, yaml) render the correction diff correctly
  • Invalid or mismatched CORRECTION_ATTEMPT_ID / PLAN_ID produces a clear, actionable error message
  • No stub or "available after M4.2" messaging remains in the codebase
  • Behave unit tests written and passing
  • Robot Framework integration test written and passing
  • All nox stages pass
  • Coverage >= 97%

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

## Metadata - **Branch**: `fix/plan-diff-correction-stub` - **Commit Message**: `fix(cli): implement correction diff rendering for agents plan diff --correction` - **Milestone**: None (backlog — see backlog note below) - **Parent Epic**: #358 > **Backlog note:** This issue was discovered during autonomous operation > on milestone v3.3.0. It does not block milestone completion and has been > placed in the backlog for human review and future milestone assignment. --- ## Summary The `agents plan diff --correction <CORRECTION_ATTEMPT_ID>` command is implemented as a stub that displays a placeholder message instead of the actual correction diff. The spec requires this command to show the diff for a specific correction attempt. ## Spec Reference The spec defines `agents plan diff` as: ``` agents plan diff (--correction <CORRECTION_ATTEMPT_ID>|<PLAN_ID>) ``` **Purpose**: Show diffs for a plan or a correction attempt. **Arguments**: - `<PLAN_ID>`: Show diff for a plan (positional argument). Mutually exclusive with `--correction`. - `--correction CORRECTION_ATTEMPT_ID`: Show diff for a correction attempt instead. ## Current Implementation ```python # src/cleveragents/cli/commands/plan.py, line 2739-2750 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 ``` The implementation explicitly marks this as a stub with the message "Correction diff will be available after M4.2." This means the `--correction` flag is non-functional. ## Impact - Users cannot view diffs for specific correction attempts via CLI - The `agents plan diff --correction` command silently returns a placeholder instead of an error or actual diff - Correction workflow is incomplete — users cannot inspect what changed during a correction ## Expected Behavior When `agents plan diff --correction <CORRECTION_ATTEMPT_ID>` is run: 1. The `CorrectionService` should be queried for the correction attempt 2. The diff between the original decision subtree and the corrected subtree should be computed 3. The diff should be rendered in the requested format (rich/plain/json/yaml) ## Steps to Reproduce ```bash # After creating a correction attempt: agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID> # Expected: Shows diff for the correction attempt # Actual: Shows "Correction diff will be available after M4.2." ``` ## Code Location `src/cleveragents/cli/commands/plan.py`, lines 2739–2750 (the `plan_diff` command handler) --- ## Subtasks - [ ] Remove the stub block in `plan_diff` for the `--correction` path - [ ] Query `CorrectionService` for the correction attempt by `CORRECTION_ATTEMPT_ID` - [ ] Validate that the correction attempt exists and belongs to the given `PLAN_ID`; surface a clear error if not - [ ] Compute the diff between the original decision subtree and the corrected subtree - [ ] Render the diff in the requested output format (rich / plain / json / yaml) - [ ] Write Behave unit tests covering the new `--correction` diff path (happy path + error cases) - [ ] Write Robot Framework integration test for `agents plan diff --correction` - [ ] Update CLI help text / docstring to remove the "available after M4.2" note ## Definition of Done - [ ] `agents plan diff --correction <CORRECTION_ATTEMPT_ID> <PLAN_ID>` returns the actual correction diff (not a placeholder) - [ ] All four output formats (rich, plain, json, yaml) render the correction diff correctly - [ ] Invalid or mismatched `CORRECTION_ATTEMPT_ID` / `PLAN_ID` produces a clear, actionable error message - [ ] No stub or "available after M4.2" messaging remains in the codebase - [ ] Behave unit tests written and passing - [ ] Robot Framework integration test written and passing - [ ] All nox stages pass - [ ] Coverage >= 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
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#3496
No description provided.