UAT: agents plan rollback --format json data schema incorrect — wrong field names in rollback_summary and impact missing required fields #6828

Open
opened 2026-04-10 02:23:32 +00:00 by HAL9000 · 0 comments
Owner

What Was Tested

Code analysis of agents plan rollback <PLAN_ID> <CHECKPOINT_ID> --format json output schema against the specification (§ agents plan rollback, lines 16133–16169).

Expected Behavior (from spec)

{
  "command": "plan rollback",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "rollback_summary": {
      "plan": "01HXM8C2ZK4Q7C2B3F2R4VYV6J",
      "checkpoint": "cp_01HXM8C2",
      "label": "before auth refactor",
      "files_reverted": 6
    },
    "changes_reverted": [
      { "file": "src/auth/session.py", "action": "restored" },
      ...
    ],
    "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

rollback_plan() in src/cleveragents/cli/commands/plan.py (lines 4023–4042) produces:

{
  "rollback_summary": {
    "plan_id": "...",           // spec: "plan"
    "from_checkpoint_id": "...", // spec: "checkpoint"
    "restored_files_count": 3   // spec: "files_reverted"
  },
  "changes_reverted": [...],
  "impact": {
    "files_affected": 3         // spec requires: child_plans_invalidated, sandbox, decisions_after_cp, tool_calls_after_cp
  },
  "post_rollback_state": {
    "active_checkpoint": "...", // spec: "phase", "state", "checkpoints_remaining"
    "plan_id": "..."            // spec does NOT include plan_id here
  },
  "timing": { "elapsed_seconds": 0.123 },  // spec: "started" + "duration_ms"
  "messages": ["Rollback completed successfully."]
}

Detailed field-by-field comparison:

Spec field Actual field Status
rollback_summary.plan rollback_summary.plan_id Wrong name
rollback_summary.checkpoint rollback_summary.from_checkpoint_id Wrong name
rollback_summary.label Missing Absent
rollback_summary.files_reverted rollback_summary.restored_files_count Wrong name
impact.child_plans_invalidated Missing (only populated if attribute exists on result) Absent from JSON output
impact.sandbox Missing from JSON (only populated if attribute exists on result) Absent from JSON output
impact.decisions_after_cp Missing from JSON Absent from JSON output
impact.tool_calls_after_cp Missing from JSON Absent from JSON output
post_rollback_state.phase Missing Absent
post_rollback_state.state Missing Absent
post_rollback_state.checkpoints_remaining Missing Absent

Note: the rich-text output partially populates impact fields from getattr(result, "child_plans_invalidated", None) etc., but these are not included in the JSON data dict built at lines 4024–4042, so --format json is missing them entirely.

Steps to Reproduce

agents plan rollback --yes <PLAN_ID> <CHECKPOINT_ID> --format json

Observe that the JSON response does not match the spec schema.

Code Location

src/cleveragents/cli/commands/plan.pyrollback_plan(), lines 4023–4042 (the data dict construction).


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

## What Was Tested Code analysis of `agents plan rollback <PLAN_ID> <CHECKPOINT_ID> --format json` output schema against the specification (§ `agents plan rollback`, lines 16133–16169). ## Expected Behavior (from spec) ```json { "command": "plan rollback", "status": "ok", "exit_code": 0, "data": { "rollback_summary": { "plan": "01HXM8C2ZK4Q7C2B3F2R4VYV6J", "checkpoint": "cp_01HXM8C2", "label": "before auth refactor", "files_reverted": 6 }, "changes_reverted": [ { "file": "src/auth/session.py", "action": "restored" }, ... ], "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 `rollback_plan()` in `src/cleveragents/cli/commands/plan.py` (lines 4023–4042) produces: ```json { "rollback_summary": { "plan_id": "...", // spec: "plan" "from_checkpoint_id": "...", // spec: "checkpoint" "restored_files_count": 3 // spec: "files_reverted" }, "changes_reverted": [...], "impact": { "files_affected": 3 // spec requires: child_plans_invalidated, sandbox, decisions_after_cp, tool_calls_after_cp }, "post_rollback_state": { "active_checkpoint": "...", // spec: "phase", "state", "checkpoints_remaining" "plan_id": "..." // spec does NOT include plan_id here }, "timing": { "elapsed_seconds": 0.123 }, // spec: "started" + "duration_ms" "messages": ["Rollback completed successfully."] } ``` Detailed field-by-field comparison: | Spec field | Actual field | Status | |---|---|---| | `rollback_summary.plan` | `rollback_summary.plan_id` | **Wrong name** | | `rollback_summary.checkpoint` | `rollback_summary.from_checkpoint_id` | **Wrong name** | | `rollback_summary.label` | Missing | **Absent** | | `rollback_summary.files_reverted` | `rollback_summary.restored_files_count` | **Wrong name** | | `impact.child_plans_invalidated` | Missing (only populated if attribute exists on result) | **Absent from JSON output** | | `impact.sandbox` | Missing from JSON (only populated if attribute exists on result) | **Absent from JSON output** | | `impact.decisions_after_cp` | Missing from JSON | **Absent from JSON output** | | `impact.tool_calls_after_cp` | Missing from JSON | **Absent from JSON output** | | `post_rollback_state.phase` | Missing | **Absent** | | `post_rollback_state.state` | Missing | **Absent** | | `post_rollback_state.checkpoints_remaining` | Missing | **Absent** | Note: the rich-text output partially populates impact fields from `getattr(result, "child_plans_invalidated", None)` etc., but these are **not included in the JSON `data` dict** built at lines 4024–4042, so `--format json` is missing them entirely. ## Steps to Reproduce ```bash agents plan rollback --yes <PLAN_ID> <CHECKPOINT_ID> --format json ``` Observe that the JSON response does not match the spec schema. ## Code Location `src/cleveragents/cli/commands/plan.py` — `rollback_plan()`, lines 4023–4042 (the `data` dict construction). --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:23:53 +00:00
HAL9000 self-assigned this 2026-04-10 06:06:38 +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.

Dependencies

No dependencies set.

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