UAT: agents plan use JSON/YAML output uses flat _plan_spec_dict instead of spec-required structured data with inputs/actors/automation/context/next_steps fields #6462

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

Bug Report

Feature Area

Plan Lifecycle — agents plan use JSON/YAML output

Spec Reference

docs/specification.md §12602–12680 (agents plan use JSON/YAML output)

Expected Behavior (from spec)

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

{
  "command": "plan use",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J",
    "phase": "strategize",
    "action": "local/code-coverage",
    "project": "local/api-service",
    "automation_profile": "trusted",
    "attempt": 1,
    "inputs": {
      "target_coverage_percent": 85,
      "automation_profile": "trusted"
    },
    "actors": {
      "strategy": "local/strategist",
      "execution": "local/executor",
      "estimation": null
    },
    "automation": {
      "profile": "trusted",
      "source": "CLI flag",
      "read_only": false
    },
    "context": {
      "resources": 2,
      "indexed_files": 347,
      "view": "strategize",
      "hot_token_budget": 12000
    },
    "next_steps": [
      "agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J",
      "agents plan status 01HXM8C2ZK4Q7C2B3F2R4VYV6J",
      "agents plan tree 01HXM8C2ZK4Q7C2B3F2R4VYV6J"
    ]
  },
  "timing": { "started": "2026-02-09T14:30:00Z", "duration_ms": 95 },
  "messages": ["Plan created"]
}

Actual Behavior

The implementation in use_action() (src/cleveragents/cli/commands/plan.py, lines 2239–2241):

if fmt != OutputFormat.RICH.value:
    data = _plan_spec_dict(plan)
    console.print(format_output(data, fmt))

_plan_spec_dict(plan) returns a flat dict with fields like plan_id, namespaced_name, phase, processing_state, project_links, arguments, action_name, etc. — but missing the spec-required structured fields:

  • data.inputs (action arguments as a dict)
  • data.actors (strategy, execution, estimation as nested dict)
  • data.automation (profile, source, read_only as nested dict)
  • data.context (resources, indexed_files, view, hot_token_budget)
  • data.next_steps (list of next-step commands)
  • data.attempt (plan attempt number)
  • command field is empty string "" instead of "plan use"

The data.project field is also missing (the spec uses "project" not "project_links").

Code Location

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

  • Lines 2239–2241: use_action() non-rich output path — uses _plan_spec_dict() instead of spec-required structured dict

Steps to Reproduce

agents --format json plan use local/code-coverage local/api-service --arg target_coverage_percent=85

Observe: flat plan dict without inputs, actors, automation, context, next_steps fields.

Severity

Medium — downstream automation tools that parse agents --format json plan use output will fail to find the structured fields defined in the spec.


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

## Bug Report ### Feature Area Plan Lifecycle — `agents plan use` JSON/YAML output ### Spec Reference `docs/specification.md` §12602–12680 (agents plan use JSON/YAML output) ### Expected Behavior (from spec) The spec defines the following JSON output structure for `agents plan use`: ```json { "command": "plan use", "status": "ok", "exit_code": 0, "data": { "plan_id": "01HXM8C2ZK4Q7C2B3F2R4VYV6J", "phase": "strategize", "action": "local/code-coverage", "project": "local/api-service", "automation_profile": "trusted", "attempt": 1, "inputs": { "target_coverage_percent": 85, "automation_profile": "trusted" }, "actors": { "strategy": "local/strategist", "execution": "local/executor", "estimation": null }, "automation": { "profile": "trusted", "source": "CLI flag", "read_only": false }, "context": { "resources": 2, "indexed_files": 347, "view": "strategize", "hot_token_budget": 12000 }, "next_steps": [ "agents plan execute 01HXM8C2ZK4Q7C2B3F2R4VYV6J", "agents plan status 01HXM8C2ZK4Q7C2B3F2R4VYV6J", "agents plan tree 01HXM8C2ZK4Q7C2B3F2R4VYV6J" ] }, "timing": { "started": "2026-02-09T14:30:00Z", "duration_ms": 95 }, "messages": ["Plan created"] } ``` ### Actual Behavior The implementation in `use_action()` (`src/cleveragents/cli/commands/plan.py`, lines 2239–2241): ```python if fmt != OutputFormat.RICH.value: data = _plan_spec_dict(plan) console.print(format_output(data, fmt)) ``` `_plan_spec_dict(plan)` returns a flat dict with fields like `plan_id`, `namespaced_name`, `phase`, `processing_state`, `project_links`, `arguments`, `action_name`, etc. — but **missing** the spec-required structured fields: - ❌ `data.inputs` (action arguments as a dict) - ❌ `data.actors` (strategy, execution, estimation as nested dict) - ❌ `data.automation` (profile, source, read_only as nested dict) - ❌ `data.context` (resources, indexed_files, view, hot_token_budget) - ❌ `data.next_steps` (list of next-step commands) - ❌ `data.attempt` (plan attempt number) - ❌ `command` field is empty string `""` instead of `"plan use"` The `data.project` field is also missing (the spec uses `"project"` not `"project_links"`). ### Code Location `src/cleveragents/cli/commands/plan.py`: - Lines 2239–2241: `use_action()` non-rich output path — uses `_plan_spec_dict()` instead of spec-required structured dict ### Steps to Reproduce ```bash agents --format json plan use local/code-coverage local/api-service --arg target_coverage_percent=85 ``` Observe: flat plan dict without `inputs`, `actors`, `automation`, `context`, `next_steps` fields. ### Severity Medium — downstream automation tools that parse `agents --format json plan use` output will fail to find the structured fields defined in the spec. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
Author
Owner

Verified — Valid UAT spec-alignment bug. The plan use output structure does not match spec-required format with inputs/actors/automation/context/next_steps fields. 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. The plan use output structure does not match spec-required format with inputs/actors/automation/context/next_steps fields. **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:34:33 +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#6462
No description provided.