UAT: agents plan artifacts --format json data schema wrong — missing artifacts, summary, and by_plan keys; returns internal plan state instead #6826

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

What Was Tested

Code analysis of agents plan artifacts <PLAN_ID> --format json output schema against the specification (§ agents plan artifacts, lines 15750–15779).

Expected Behavior (from spec)

The JSON output data object must have:

{
  "command": "plan artifacts",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "artifacts": [
      { "path": "src/auth/session.py", "type": "write", "size": "2.1 KB", "change": "+8 -2", "child_plan": "root" },
      ...
    ],
    "summary": {
      "total": 4,
      "writes": 2,
      "edits": 2,
      "deletes": 0,
      "total_size": "11.8 KB"
    },
    "by_plan": {
      "root": 3,
      "auth-tests": 1
    }
  },
  "timing": { "started": "...", "duration_ms": 480 },
  "messages": ["4 artifacts listed"]
}

Actual Behavior

_build_artifacts_dict() in src/cleveragents/application/services/plan_apply_service.py (lines 211–243) returns:

{
  "plan_id": "...",
  "phase": "apply",
  "processing_state": "complete",
  "changeset_id": null,
  "sandbox_refs": [],
  "changeset_summary": null,
  "files_changed": [
    { "path": "src/foo.py", "operation": "write" }
  ]
}

This is the internal changeset data model — not the spec-required artifacts schema. Key differences:

Spec field Actual field Status
data.artifacts (array with path, type, size, change, child_plan) data.files_changed (array with path, operation only) Wrong key name and missing fields
data.summary with total, writes, edits, deletes, total_size Missing entirely Absent
data.by_plan with per-plan artifact counts Missing entirely Absent
data.artifacts[].type (write/edit/delete) data.files_changed[].operation Wrong field name
data.artifacts[].size Missing Absent
data.artifacts[].change (e.g. "+8 -2") Missing Absent
data.artifacts[].child_plan Missing Absent

Steps to Reproduce

# After completing a plan execution:
agents plan artifacts <PLAN_ID> --format json

Observe that the JSON data object contains plan_id, changeset_id, sandbox_refs, and files_changed instead of artifacts, summary, and by_plan.

Code Location

  • src/cleveragents/application/services/plan_apply_service.py_build_artifacts_dict() function (lines 211–243)
  • src/cleveragents/cli/commands/plan.pyplan_artifacts() command (lines 3321–3351)

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

## What Was Tested Code analysis of `agents plan artifacts <PLAN_ID> --format json` output schema against the specification (§ `agents plan artifacts`, lines 15750–15779). ## Expected Behavior (from spec) The JSON output `data` object must have: ```json { "command": "plan artifacts", "status": "ok", "exit_code": 0, "data": { "artifacts": [ { "path": "src/auth/session.py", "type": "write", "size": "2.1 KB", "change": "+8 -2", "child_plan": "root" }, ... ], "summary": { "total": 4, "writes": 2, "edits": 2, "deletes": 0, "total_size": "11.8 KB" }, "by_plan": { "root": 3, "auth-tests": 1 } }, "timing": { "started": "...", "duration_ms": 480 }, "messages": ["4 artifacts listed"] } ``` ## Actual Behavior `_build_artifacts_dict()` in `src/cleveragents/application/services/plan_apply_service.py` (lines 211–243) returns: ```json { "plan_id": "...", "phase": "apply", "processing_state": "complete", "changeset_id": null, "sandbox_refs": [], "changeset_summary": null, "files_changed": [ { "path": "src/foo.py", "operation": "write" } ] } ``` This is the **internal changeset data model** — not the spec-required `artifacts` schema. Key differences: | Spec field | Actual field | Status | |---|---|---| | `data.artifacts` (array with `path`, `type`, `size`, `change`, `child_plan`) | `data.files_changed` (array with `path`, `operation` only) | **Wrong key name and missing fields** | | `data.summary` with `total`, `writes`, `edits`, `deletes`, `total_size` | Missing entirely | **Absent** | | `data.by_plan` with per-plan artifact counts | Missing entirely | **Absent** | | `data.artifacts[].type` (`write`/`edit`/`delete`) | `data.files_changed[].operation` | **Wrong field name** | | `data.artifacts[].size` | Missing | **Absent** | | `data.artifacts[].change` (e.g. `"+8 -2"`) | Missing | **Absent** | | `data.artifacts[].child_plan` | Missing | **Absent** | ## Steps to Reproduce ```bash # After completing a plan execution: agents plan artifacts <PLAN_ID> --format json ``` Observe that the JSON `data` object contains `plan_id`, `changeset_id`, `sandbox_refs`, and `files_changed` instead of `artifacts`, `summary`, and `by_plan`. ## Code Location - `src/cleveragents/application/services/plan_apply_service.py` — `_build_artifacts_dict()` function (lines 211–243) - `src/cleveragents/cli/commands/plan.py` — `plan_artifacts()` command (lines 3321–3351) --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.4.0 milestone 2026-04-10 02:22:55 +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#6826
No description provided.