UAT: agents plan correct JSON/YAML output missing spec-required command envelope and uses wrong data structure #6318

Open
opened 2026-04-09 20:09:49 +00:00 by HAL9000 · 0 comments
Owner

Bug Report

Feature Area: Plan Lifecycle
Spec Reference: docs/specification.md §agents plan correct (around line 15000)
Instance: uat-worker-W1-cycle3


Summary

agents plan correct --format json produces a minimal flat dictionary that does not match the spec-required command envelope. The spec mandates a structured envelope with nested data.correction, data.affected_subtree, data.sandbox_rollback, data.recompute, and data.history fields, plus command, status, exit_code, timing, and messages top-level keys.


Code Location

/app/src/cleveragents/cli/commands/plan.py, lines 3672–3688:

data = {
    "correction_id": result.correction_id,
    "status": result.status.value,
    "mode": correction_mode.value,
    "new_decisions": result.new_decisions,
    "reverted_decisions": result.reverted_decisions,
}
console.print(format_output(data, fmt))

Steps to Reproduce

agents plan correct <DECISION_ID> --mode revert --guidance "Fix this" --yes --format json

Expected (per spec §agents plan correct)

{
  "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": "2025-06-15T10:24:00Z", "duration_ms": 2350 },
  "messages": ["Correction applied"]
}

Actual

{
  "correction_id": "...",
  "status": "applied",
  "mode": "revert",
  "new_decisions": [...],
  "reverted_decisions": [...]
}

Impact

  • Programmatic consumers parsing plan correct --format json cannot use standard envelope parsing
  • Missing command, exit_code, timing, messages fields breaks A2A protocol envelope contract
  • data.correction, data.affected_subtree, data.sandbox_rollback, data.recompute, data.history structure is entirely absent

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

## Bug Report **Feature Area**: Plan Lifecycle **Spec Reference**: `docs/specification.md` §`agents plan correct` (around line 15000) **Instance**: uat-worker-W1-cycle3 --- ### Summary `agents plan correct --format json` produces a minimal flat dictionary that does not match the spec-required command envelope. The spec mandates a structured envelope with nested `data.correction`, `data.affected_subtree`, `data.sandbox_rollback`, `data.recompute`, and `data.history` fields, plus `command`, `status`, `exit_code`, `timing`, and `messages` top-level keys. --- ### Code Location `/app/src/cleveragents/cli/commands/plan.py`, lines 3672–3688: ```python data = { "correction_id": result.correction_id, "status": result.status.value, "mode": correction_mode.value, "new_decisions": result.new_decisions, "reverted_decisions": result.reverted_decisions, } console.print(format_output(data, fmt)) ``` --- ### Steps to Reproduce ```bash agents plan correct <DECISION_ID> --mode revert --guidance "Fix this" --yes --format json ``` --- ### Expected (per spec §agents plan correct) ```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": "2025-06-15T10:24:00Z", "duration_ms": 2350 }, "messages": ["Correction applied"] } ``` ### Actual ```json { "correction_id": "...", "status": "applied", "mode": "revert", "new_decisions": [...], "reverted_decisions": [...] } ``` --- ### Impact - Programmatic consumers parsing `plan correct --format json` cannot use standard envelope parsing - Missing `command`, `exit_code`, `timing`, `messages` fields breaks A2A protocol envelope contract - `data.correction`, `data.affected_subtree`, `data.sandbox_rollback`, `data.recompute`, `data.history` structure is entirely absent --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
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#6318
No description provided.