UAT: agents plan rollback JSON/YAML output uses wrong field names and is missing spec-required fields #5073

Closed
opened 2026-04-09 00:54:47 +00:00 by HAL9000 · 2 comments
Owner

Bug Report

Feature Area: Sandbox and Checkpoint
Tested By: UAT worker (uat-pool-1), feature area: Sandbox and Checkpoint
Severity: Medium (output format deviation — machine-readable output broken for integrations)


What Was Tested

The JSON/YAML output format of agents plan rollback <PLAN_ID> <CHECKPOINT_ID> was compared against the specification's required output schema (§CLI Commands — agents plan rollback, lines 16133–16170).

Expected Behavior (from spec)

The spec defines the following JSON output structure:

{
  "command": "plan rollback",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "rollback_summary": {
      "plan": "<PLAN_ID>",
      "checkpoint": "<CHECKPOINT_ID>",
      "label": "before auth refactor",
      "files_reverted": 6
    },
    "changes_reverted": [
      { "file": "src/auth/session.py", "action": "restored" },
      { "file": "tests/test_session.py", "action": "removed" }
    ],
    "impact": {
      "child_plans_invalidated": 2,
      "sandbox": "restored to cp_01HXM8C2",
      "decisions_after_cp": "2 discarded",
      "tool_calls_after_cp": "5 undone"
    },
    "post_rollback_state": {
      "phase": "execute",
      "state": "queued (awaiting input)",
      "checkpoints_remaining": 2
    }
  },
  "timing": { "started": "...", "duration_ms": 1850 },
  "messages": ["Rollback complete"]
}

Actual Behavior (from code)

The implementation at src/cleveragents/cli/commands/plan.py lines 3677–3694 produces:

data = {
    "rollback_summary": {
        "plan_id": plan_id,              # ❌ spec: "plan"
        "from_checkpoint_id": ...,       # ❌ spec: "checkpoint"
        "restored_files_count": ...,     # ❌ spec: "files_reverted"
        # ❌ missing: "label"
    },
    "changes_reverted": result.changed_paths,  # ❌ spec: [{file, action}] list of dicts; impl: list of strings
    "impact": {
        "files_affected": ...,           # ❌ spec: "child_plans_invalidated", "sandbox", "decisions_after_cp", "tool_calls_after_cp"
    },
    "post_rollback_state": {
        "active_checkpoint": ...,        # ❌ spec: "phase", "state", "checkpoints_remaining"
        "plan_id": plan_id,              # ❌ not in spec
    },
    ...
}

Deviations Summary

Field Spec Implementation
rollback_summary.plan "plan" "plan_id"
rollback_summary.checkpoint "checkpoint" "from_checkpoint_id"
rollback_summary.label present missing
rollback_summary.files_reverted "files_reverted" "restored_files_count"
changes_reverted [{file, action}] [string] (paths only)
impact.child_plans_invalidated present missing
impact.sandbox present missing
impact.decisions_after_cp present missing
impact.tool_calls_after_cp present missing
post_rollback_state.phase present missing
post_rollback_state.state present missing
post_rollback_state.checkpoints_remaining present missing

Code Location

src/cleveragents/cli/commands/plan.py, lines 3677–3694 (rollback_plan function)

Steps to Reproduce

  1. Create a plan with a checkpoint
  2. Run agents plan rollback --format json <PLAN_ID> <CHECKPOINT_ID>
  3. Observe the JSON output uses wrong field names and is missing required fields

Impact

Any integration or automation that parses plan rollback JSON/YAML output will fail because the field names don't match the spec. The changes_reverted field returns a flat list of strings instead of the spec-required list of {file, action} objects, making it impossible to distinguish between "restored" and "removed" file actions.


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

## Bug Report **Feature Area**: Sandbox and Checkpoint **Tested By**: UAT worker (uat-pool-1), feature area: Sandbox and Checkpoint **Severity**: Medium (output format deviation — machine-readable output broken for integrations) --- ## What Was Tested The JSON/YAML output format of `agents plan rollback <PLAN_ID> <CHECKPOINT_ID>` was compared against the specification's required output schema (§CLI Commands — agents plan rollback, lines 16133–16170). ## Expected Behavior (from spec) The spec defines the following JSON output structure: ```json { "command": "plan rollback", "status": "ok", "exit_code": 0, "data": { "rollback_summary": { "plan": "<PLAN_ID>", "checkpoint": "<CHECKPOINT_ID>", "label": "before auth refactor", "files_reverted": 6 }, "changes_reverted": [ { "file": "src/auth/session.py", "action": "restored" }, { "file": "tests/test_session.py", "action": "removed" } ], "impact": { "child_plans_invalidated": 2, "sandbox": "restored to cp_01HXM8C2", "decisions_after_cp": "2 discarded", "tool_calls_after_cp": "5 undone" }, "post_rollback_state": { "phase": "execute", "state": "queued (awaiting input)", "checkpoints_remaining": 2 } }, "timing": { "started": "...", "duration_ms": 1850 }, "messages": ["Rollback complete"] } ``` ## Actual Behavior (from code) The implementation at `src/cleveragents/cli/commands/plan.py` lines 3677–3694 produces: ```python data = { "rollback_summary": { "plan_id": plan_id, # ❌ spec: "plan" "from_checkpoint_id": ..., # ❌ spec: "checkpoint" "restored_files_count": ..., # ❌ spec: "files_reverted" # ❌ missing: "label" }, "changes_reverted": result.changed_paths, # ❌ spec: [{file, action}] list of dicts; impl: list of strings "impact": { "files_affected": ..., # ❌ spec: "child_plans_invalidated", "sandbox", "decisions_after_cp", "tool_calls_after_cp" }, "post_rollback_state": { "active_checkpoint": ..., # ❌ spec: "phase", "state", "checkpoints_remaining" "plan_id": plan_id, # ❌ not in spec }, ... } ``` ## Deviations Summary | Field | Spec | Implementation | |-------|------|----------------| | `rollback_summary.plan` | `"plan"` | `"plan_id"` | | `rollback_summary.checkpoint` | `"checkpoint"` | `"from_checkpoint_id"` | | `rollback_summary.label` | present | **missing** | | `rollback_summary.files_reverted` | `"files_reverted"` | `"restored_files_count"` | | `changes_reverted` | `[{file, action}]` | `[string]` (paths only) | | `impact.child_plans_invalidated` | present | **missing** | | `impact.sandbox` | present | **missing** | | `impact.decisions_after_cp` | present | **missing** | | `impact.tool_calls_after_cp` | present | **missing** | | `post_rollback_state.phase` | present | **missing** | | `post_rollback_state.state` | present | **missing** | | `post_rollback_state.checkpoints_remaining` | present | **missing** | ## Code Location `src/cleveragents/cli/commands/plan.py`, lines 3677–3694 (`rollback_plan` function) ## Steps to Reproduce 1. Create a plan with a checkpoint 2. Run `agents plan rollback --format json <PLAN_ID> <CHECKPOINT_ID>` 3. Observe the JSON output uses wrong field names and is missing required fields ## Impact Any integration or automation that parses `plan rollback` JSON/YAML output will fail because the field names don't match the spec. The `changes_reverted` field returns a flat list of strings instead of the spec-required list of `{file, action}` objects, making it impossible to distinguish between "restored" and "removed" file actions. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.2.0 milestone 2026-04-09 01:01:43 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: Medium — Spec compliance bug; deviates from documented behavior
  • Milestone: v3.2.0
  • Story Points: 3 — M
  • MoSCoW: Must Have — Spec compliance is required

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

Issue triaged by project owner: - **State**: Verified - **Priority**: Medium — Spec compliance bug; deviates from documented behavior - **Milestone**: v3.2.0 - **Story Points**: 3 — M - **MoSCoW**: Must Have — Spec compliance is required --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
Author
Owner

Closing as duplicate of #4730 — both issues report the same problem: agents plan rollback JSON output uses wrong field names.


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

Closing as duplicate of #4730 — both issues report the same problem: `agents plan rollback` JSON output uses wrong field names. --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: 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.

Dependencies

No dependencies set.

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