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

Open
opened 2026-04-09 19:48:22 +00:00 by HAL9000 · 0 comments
Owner

Spec Reference

Spec §agents plan apply (lines 13321–13358) defines the JSON output envelope:

{
  "command": "plan apply",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plan_id": "...",
    "artifacts": 6,
    "changes": {"insertions": 42, "deletions": 9},
    "project": "local/api-service",
    "applied_at": "2026-02-08T13:04:00Z",
    "validation": {"tests": {...}, "lint": {...}, "type_check": {...}, "duration_s": 12.4},
    "sandbox_cleanup": {"worktree": "removed", "branch": "merged to main", "checkpoint": "archived"},
    "lifecycle": {"phase": "apply", "state": "applied", "total_duration": "...", "total_cost": "...", "decisions_made": 8, "child_plans": 2}
  },
  "timing": {"started": "...", "duration_ms": 1250},
  "messages": ["Changes applied"]
}

Expected Behavior

agents plan apply <PLAN_ID> --format json should return the full spec-required JSON envelope with:

  • Top-level command, status, exit_code, data, timing, messages keys
  • data.artifacts (number of files updated)
  • data.changes (insertions, deletions)
  • data.project (project name)
  • data.applied_at (timestamp)
  • data.validation (test/lint/type-check results)
  • data.sandbox_cleanup (worktree, branch, checkpoint status)
  • data.lifecycle (phase, state, total_duration, total_cost, decisions_made, child_plans)

Actual Behavior

The implementation uses _plan_spec_dict(plan) (see src/cleveragents/cli/commands/plan.py line 2618) which returns a flat dict without the command envelope. Missing: command, status, exit_code, timing, messages, artifacts, changes, applied_at, validation, sandbox_cleanup, lifecycle.

Code Location

  • src/cleveragents/cli/commands/plan.py lines 2617–2619 (lifecycle_apply_plan, non-rich output)

Steps to Reproduce

agents plan apply <PLAN_ID> --yes --format json

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

## Spec Reference Spec §agents plan apply (lines 13321–13358) defines the JSON output envelope: ```json { "command": "plan apply", "status": "ok", "exit_code": 0, "data": { "plan_id": "...", "artifacts": 6, "changes": {"insertions": 42, "deletions": 9}, "project": "local/api-service", "applied_at": "2026-02-08T13:04:00Z", "validation": {"tests": {...}, "lint": {...}, "type_check": {...}, "duration_s": 12.4}, "sandbox_cleanup": {"worktree": "removed", "branch": "merged to main", "checkpoint": "archived"}, "lifecycle": {"phase": "apply", "state": "applied", "total_duration": "...", "total_cost": "...", "decisions_made": 8, "child_plans": 2} }, "timing": {"started": "...", "duration_ms": 1250}, "messages": ["Changes applied"] } ``` ## Expected Behavior `agents plan apply <PLAN_ID> --format json` should return the full spec-required JSON envelope with: - Top-level `command`, `status`, `exit_code`, `data`, `timing`, `messages` keys - `data.artifacts` (number of files updated) - `data.changes` (insertions, deletions) - `data.project` (project name) - `data.applied_at` (timestamp) - `data.validation` (test/lint/type-check results) - `data.sandbox_cleanup` (worktree, branch, checkpoint status) - `data.lifecycle` (phase, state, total_duration, total_cost, decisions_made, child_plans) ## Actual Behavior The implementation uses `_plan_spec_dict(plan)` (see `src/cleveragents/cli/commands/plan.py` line 2618) which returns a flat dict without the command envelope. Missing: `command`, `status`, `exit_code`, `timing`, `messages`, `artifacts`, `changes`, `applied_at`, `validation`, `sandbox_cleanup`, `lifecycle`. ## Code Location - `src/cleveragents/cli/commands/plan.py` lines 2617–2619 (lifecycle_apply_plan, non-rich output) ## Steps to Reproduce ```bash agents plan apply <PLAN_ID> --yes --format json ``` --- **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#6281
No description provided.