UAT: agents plan artifacts JSON output missing spec-required command envelope and uses wrong data structure #6260

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

Bug Report

Summary

The agents plan artifacts --format json output is missing the spec-required standard command envelope. Additionally, the data structure uses internal plan/changeset metadata fields instead of the spec-required artifacts[] array with Path, Type, Size, Change, and Child Plan fields, plus summary{} and by_plan{} sections.

Expected Behavior (per specification §agents plan artifacts)

The spec requires:

{
  "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" },
      { "path": "tests/test_session.py", "type": "write", "size": "4.7 KB", "change": "+47 -0", "child_plan": "root" },
      { "path": "src/auth/tokens.py", "type": "edit", "size": "1.8 KB", "change": "+4 -2", "child_plan": "root" },
      { "path": "tests/test_tokens.py", "type": "write", "size": "3.2 KB", "change": "+32 -0", "child_plan": "auth" }
    ],
    "summary": {
      "total": 4,
      "writes": 2,
      "edits": 2,
      "deletes": 0,
      "total_size": "11.8 KB"
    },
    "by_plan": {
      "root": 3,
      "auth-tests": 1,
      "payment-tests": "pending"
    }
  },
  "timing": { "started": "...", "duration_ms": 480 },
  "messages": ["4 artifacts listed"]
}

Actual Behavior

The artifacts() method in src/cleveragents/application/services/plan_apply_service.py calls _build_artifacts_dict() which returns:

{
  "plan_id": "...",
  "phase": "execute",
  "processing_state": "complete",
  "changeset_id": "...",
  "sandbox_refs": [...],
  "changeset_summary": { ... },
  "files_changed": [
    { "path": "src/auth/session.py", "operation": "modify" }
  ],
  "validation_summary": { ... }
}

Specific Divergences

  1. No command envelope — spec requires command, status, exit_code, data, timing, messages wrapper.
  2. No artifacts[] array — spec requires each artifact to have type (write/edit/delete), size (human-readable KB), change (+N -M), and child_plan fields.
  3. files_changed[] uses operation instead of spec's type; no size, change (+N -M), or child_plan fields.
  4. No summary{} section — spec requires total, writes, edits, deletes, total_size.
  5. No by_plan{} section — spec requires artifact counts grouped by child plan.
  6. Extraneous internal fieldsphase, processing_state, changeset_id, sandbox_refs, changeset_summary, validation_summary are internal data not specified for this endpoint.

Code Locations

  • src/cleveragents/application/services/plan_apply_service.py:
    • PlanApplyService.artifacts() (lines ~330–355)
    • _build_artifacts_dict() (lines ~213–245)

Steps to Reproduce

agents plan artifacts --format json <PLAN_ID>

Observe that the output does not match the spec schema.


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

## Bug Report ### Summary The `agents plan artifacts --format json` output is missing the spec-required standard command envelope. Additionally, the data structure uses internal plan/changeset metadata fields instead of the spec-required `artifacts[]` array with `Path`, `Type`, `Size`, `Change`, and `Child Plan` fields, plus `summary{}` and `by_plan{}` sections. ### Expected Behavior (per specification §agents plan artifacts) The spec requires: ```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" }, { "path": "tests/test_session.py", "type": "write", "size": "4.7 KB", "change": "+47 -0", "child_plan": "root" }, { "path": "src/auth/tokens.py", "type": "edit", "size": "1.8 KB", "change": "+4 -2", "child_plan": "root" }, { "path": "tests/test_tokens.py", "type": "write", "size": "3.2 KB", "change": "+32 -0", "child_plan": "auth" } ], "summary": { "total": 4, "writes": 2, "edits": 2, "deletes": 0, "total_size": "11.8 KB" }, "by_plan": { "root": 3, "auth-tests": 1, "payment-tests": "pending" } }, "timing": { "started": "...", "duration_ms": 480 }, "messages": ["4 artifacts listed"] } ``` ### Actual Behavior The `artifacts()` method in `src/cleveragents/application/services/plan_apply_service.py` calls `_build_artifacts_dict()` which returns: ```json { "plan_id": "...", "phase": "execute", "processing_state": "complete", "changeset_id": "...", "sandbox_refs": [...], "changeset_summary": { ... }, "files_changed": [ { "path": "src/auth/session.py", "operation": "modify" } ], "validation_summary": { ... } } ``` ### Specific Divergences 1. **No command envelope** — spec requires `command`, `status`, `exit_code`, `data`, `timing`, `messages` wrapper. 2. **No `artifacts[]` array** — spec requires each artifact to have `type` (write/edit/delete), `size` (human-readable KB), `change` (`+N -M`), and `child_plan` fields. 3. **`files_changed[]` uses `operation`** instead of spec's `type`; no `size`, `change` (`+N -M`), or `child_plan` fields. 4. **No `summary{}` section** — spec requires `total`, `writes`, `edits`, `deletes`, `total_size`. 5. **No `by_plan{}` section** — spec requires artifact counts grouped by child plan. 6. **Extraneous internal fields** — `phase`, `processing_state`, `changeset_id`, `sandbox_refs`, `changeset_summary`, `validation_summary` are internal data not specified for this endpoint. ### Code Locations - `src/cleveragents/application/services/plan_apply_service.py`: - `PlanApplyService.artifacts()` (lines ~330–355) - `_build_artifacts_dict()` (lines ~213–245) ### Steps to Reproduce ```bash agents plan artifacts --format json <PLAN_ID> ``` Observe that the output does not match the spec schema. --- **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#6260
No description provided.