UAT: agents plan correct --format json output data schema wrong — missing correction, affected_subtree, sandbox_rollback, recompute, history keys #6809

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

What Was Tested

agents plan correct --mode revert -g "..." --yes --format json <DECISION_ID> JSON output schema (code analysis of src/cleveragents/cli/commands/plan.py, lines 3672–3680).

Expected Behavior (from Spec §agents plan correct JSON output, lines 15008–15044)

The JSON data object must contain these 5 named sub-objects:

{
  "command": "plan correct",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "correction": {
      "mode": "revert",
      "impact": "3 decisions, 2 child plans, 5 artifacts",
      "new_decision": "01HXM9B7Z3Q1Q8K2E9H7K3W2M8",
      "corrects": "01HXM9A1C2Q7W3R5G8Z0P4Q1X9",
      "attempt": 2
    },
    "affected_subtree": {
      "decisions_invalidated": 3,
      "child_plans_rolled_back": 2,
      "artifacts_archived": 5,
      "unaffected_decisions": 2
    },
    "sandbox_rollback": {
      "checkpoint": "cp_01HXM8C2",
      "files_reverted": 5,
      "status": "restored"
    },
    "recompute": {
      "queued": "2 child plans",
      "eta": "4m"
    },
    "history": [
      "Original decision superseded",
      "Prior artifacts archived for comparison",
      "agents plan diff --correction 01HXM9B7Z3Q1Q8K2.."
    ]
  },
  "timing": { "started": "...", "duration_ms": 2350 },
  "messages": ["Correction applied"]
}

Actual Behavior

The implementation at lines 3672–3680 outputs a flat dict without the spec-required nested structure:

data = {
    "correction_id": result.correction_id,       # wrong field name
    "status": result.status.value,               # not inside "correction" sub-object
    "mode": correction_mode.value,               # not inside "correction" sub-object
    "new_decisions": result.new_decisions,       # wrong shape — should be single "new_decision"
    "reverted_decisions": result.reverted_decisions,  # no "affected_subtree" object
    # missing: sandbox_rollback, recompute, history, attempt
}
console.print(format_output(data, fmt))
# No outer envelope: no command, exit_code, timing, messages

Violations:

  1. No command, exit_code, timing, messages envelopedata is output directly
  2. No correction sub-object — fields are at top level with wrong names
  3. No affected_subtree sub-objectreverted_decisions is a flat list of IDs
  4. No sandbox_rollback sub-object — entirely absent
  5. No recompute sub-object — entirely absent
  6. No history list — entirely absent
  7. new_decisions (plural list) instead of new_decision (single ID string)

Steps to Reproduce

  1. Review src/cleveragents/cli/commands/plan.py lines 3672–3680
  2. Compare to spec §agents plan correct JSON output example (lines 15008–15044)

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

## What Was Tested `agents plan correct --mode revert -g "..." --yes --format json <DECISION_ID>` JSON output schema (code analysis of `src/cleveragents/cli/commands/plan.py`, lines 3672–3680). ## Expected Behavior (from Spec §agents plan correct JSON output, lines 15008–15044) The JSON `data` object must contain these 5 named sub-objects: ```json { "command": "plan correct", "status": "ok", "exit_code": 0, "data": { "correction": { "mode": "revert", "impact": "3 decisions, 2 child plans, 5 artifacts", "new_decision": "01HXM9B7Z3Q1Q8K2E9H7K3W2M8", "corrects": "01HXM9A1C2Q7W3R5G8Z0P4Q1X9", "attempt": 2 }, "affected_subtree": { "decisions_invalidated": 3, "child_plans_rolled_back": 2, "artifacts_archived": 5, "unaffected_decisions": 2 }, "sandbox_rollback": { "checkpoint": "cp_01HXM8C2", "files_reverted": 5, "status": "restored" }, "recompute": { "queued": "2 child plans", "eta": "4m" }, "history": [ "Original decision superseded", "Prior artifacts archived for comparison", "agents plan diff --correction 01HXM9B7Z3Q1Q8K2.." ] }, "timing": { "started": "...", "duration_ms": 2350 }, "messages": ["Correction applied"] } ``` ## Actual Behavior The implementation at lines 3672–3680 outputs a flat dict without the spec-required nested structure: ```python data = { "correction_id": result.correction_id, # wrong field name "status": result.status.value, # not inside "correction" sub-object "mode": correction_mode.value, # not inside "correction" sub-object "new_decisions": result.new_decisions, # wrong shape — should be single "new_decision" "reverted_decisions": result.reverted_decisions, # no "affected_subtree" object # missing: sandbox_rollback, recompute, history, attempt } console.print(format_output(data, fmt)) # No outer envelope: no command, exit_code, timing, messages ``` Violations: 1. **No `command`, `exit_code`, `timing`, `messages` envelope** — `data` is output directly 2. **No `correction` sub-object** — fields are at top level with wrong names 3. **No `affected_subtree` sub-object** — `reverted_decisions` is a flat list of IDs 4. **No `sandbox_rollback` sub-object** — entirely absent 5. **No `recompute` sub-object** — entirely absent 6. **No `history` list** — entirely absent 7. **`new_decisions` (plural list)** instead of `new_decision` (single ID string) ## Steps to Reproduce 1. Review `src/cleveragents/cli/commands/plan.py` lines 3672–3680 2. Compare to spec §agents plan correct JSON output example (lines 15008–15044) --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:12:31 +00:00
HAL9000 self-assigned this 2026-04-10 06:06:40 +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#6809
No description provided.