UAT: agents plan list JSON/YAML output uses flat plan list instead of spec-required nested data.plans/data.filters/data.summary structure #6458

Open
opened 2026-04-09 21:05:15 +00:00 by HAL9000 · 1 comment
Owner

Bug Report

Feature Area

Plan Lifecycle — agents plan list JSON/YAML output

Spec Reference

docs/specification.md §12180–12250 (agents plan list JSON output)

Expected Behavior (from spec)

The spec defines the following JSON output structure for agents plan list:

{
  "command": "plan list",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plans": [
      {
        "id": "01HXM7A9",
        "phase": "execute",
        "state": "processing",
        "action": "local/code-coverage",
        "project": "local/api-service",
        "elapsed": "00:01:12"
      }
    ],
    "filters": {
      "phase": "execute",
      "state": null,
      "project": null,
      "action": null
    },
    "summary": {
      "total": 1,
      "processing": 1,
      "completed": 0,
      "errored": 0
    }
  },
  "timing": { "duration_ms": 12 },
  "messages": ["1 plan listed"]
}

Actual Behavior

The implementation in lifecycle_list_plans() (src/cleveragents/cli/commands/plan.py, lines 3002–3006):

if fmt != OutputFormat.RICH.value:
    data = [_plan_spec_dict(p) for p in plans]
    console.print(format_output(data, fmt))
    return

This passes a flat list of full plan dicts to format_output(), which wraps it as data: [...]. The actual JSON output is:

{
  "command": "",
  "status": "ok",
  "exit_code": 0,
  "data": [
    {
      "plan_id": "01HXM7A9...",
      "namespaced_name": "local/...",
      "phase": "execute",
      "processing_state": "processing",
      ...many more fields...
    }
  ],
  "timing": {...},
  "messages": [...]
}

Issues:

  1. ❌ data is a flat list of full plan objects, not data.plans (abbreviated plan list)
  2. ❌ data.filters section is missing
  3. ❌ data.summary section is missing
  4. ❌ command field is empty string "" instead of "plan list"
  5. ❌ Plan objects in the list contain all fields (full _plan_spec_dict) instead of the abbreviated {id, phase, state, action, project, elapsed} format

Code Location

src/cleveragents/cli/commands/plan.py:

  • Lines 3002–3006: lifecycle_list_plans() non-rich output path
  • format_output() is called without command parameter (defaults to "")

Steps to Reproduce

agents --format json plan list

Observe: flat list of full plan dicts instead of spec-required nested structure.

Severity

Medium — downstream automation tools that parse agents --format json plan list output will fail to find data.plans, data.filters, and data.summary keys.


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

## Bug Report ### Feature Area Plan Lifecycle — `agents plan list` JSON/YAML output ### Spec Reference `docs/specification.md` §12180–12250 (agents plan list JSON output) ### Expected Behavior (from spec) The spec defines the following JSON output structure for `agents plan list`: ```json { "command": "plan list", "status": "ok", "exit_code": 0, "data": { "plans": [ { "id": "01HXM7A9", "phase": "execute", "state": "processing", "action": "local/code-coverage", "project": "local/api-service", "elapsed": "00:01:12" } ], "filters": { "phase": "execute", "state": null, "project": null, "action": null }, "summary": { "total": 1, "processing": 1, "completed": 0, "errored": 0 } }, "timing": { "duration_ms": 12 }, "messages": ["1 plan listed"] } ``` ### Actual Behavior The implementation in `lifecycle_list_plans()` (`src/cleveragents/cli/commands/plan.py`, lines 3002–3006): ```python if fmt != OutputFormat.RICH.value: data = [_plan_spec_dict(p) for p in plans] console.print(format_output(data, fmt)) return ``` This passes a **flat list of full plan dicts** to `format_output()`, which wraps it as `data: [...]`. The actual JSON output is: ```json { "command": "", "status": "ok", "exit_code": 0, "data": [ { "plan_id": "01HXM7A9...", "namespaced_name": "local/...", "phase": "execute", "processing_state": "processing", ...many more fields... } ], "timing": {...}, "messages": [...] } ``` **Issues:** 1. ❌ `data` is a flat list of full plan objects, not `data.plans` (abbreviated plan list) 2. ❌ `data.filters` section is missing 3. ❌ `data.summary` section is missing 4. ❌ `command` field is empty string `""` instead of `"plan list"` 5. ❌ Plan objects in the list contain all fields (full `_plan_spec_dict`) instead of the abbreviated `{id, phase, state, action, project, elapsed}` format ### Code Location `src/cleveragents/cli/commands/plan.py`: - Lines 3002–3006: `lifecycle_list_plans()` non-rich output path - `format_output()` is called without `command` parameter (defaults to `""`) ### Steps to Reproduce ```bash agents --format json plan list ``` Observe: flat list of full plan dicts instead of spec-required nested structure. ### Severity Medium — downstream automation tools that parse `agents --format json plan list` output will fail to find `data.plans`, `data.filters`, and `data.summary` keys. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

✅ Verified — Valid UAT spec-alignment bug. Output structure does not match spec-required nested format. MoSCoW: Must Have — output format is part of v3.2.0 acceptance criteria.


Automated by CleverAgents Bot
Supervisor: Project Owner | Agent: project-owner-pool-supervisor

✅ **Verified** — Valid UAT spec-alignment bug. Output structure does not match spec-required nested format. **MoSCoW: Must Have** — output format is part of v3.2.0 acceptance criteria. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
HAL9000 added this to the v3.2.0 milestone 2026-04-17 08:38:01 +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#6458
No description provided.