UAT: agents plan apply output missing spec-required structured panels — Apply Summary, Validation, Sandbox Cleanup, Plan Lifecycle, Next Steps #2474

Open
opened 2026-04-03 18:36:40 +00:00 by freemo · 0 comments
Owner

Metadata

Commit message: fix(cli): add structured output panels to agents plan apply command
Branch: fix/plan-apply-output-panels
Parent Epic: #397 (Epic: Server & Autonomy Infrastructure)

Bug Description

The agents plan apply command does not produce the spec-required structured output panels. The spec (§ agents plan apply, lines 13219–13401) defines five distinct output panels for the rich format and corresponding structured fields for JSON/YAML/plain formats. The current implementation outputs a generic plan status panel via _print_lifecycle_plan() instead.

Expected Behavior (from spec)

The spec requires the following panels in rich format:

  1. Apply Summary panel:

    • Plan ID
    • Artifacts (N files updated)
    • Changes (N insertions, N deletions)
    • Project (project name)
    • Applied At (timestamp)
  2. Validation (from Execute) panel:

    • Tests: passed/failed (N/N)
    • Lint: passed/failed (N warnings)
    • Type Check: passed/failed (N errors)
    • Duration
  3. Sandbox Cleanup panel:

    • Worktree: removed/retained
    • Branch: merged to main / status
    • Checkpoint: archived
  4. Plan Lifecycle panel:

    • Phase: apply
    • State: applied
    • Total Duration
    • Total Cost
    • Decisions Made
    • Child Plans
  5. Next Steps panel:

    • Review git diff
    • Commit changes

For JSON format, the spec requires:

{
  "command": "plan apply",
  "status": "ok",
  "exit_code": 0,
  "data": {
    "plan_id": "...",
    "artifacts": 6,
    "changes": { "insertions": 42, "deletions": 9 },
    "project": "local/api-service",
    "applied_at": "...",
    "validation": { "tests": {...}, "lint": {...}, "type_check": {...} },
    "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 }
  }
}

Actual Behavior

The agents plan apply command (lines 1942–2090 in src/cleveragents/cli/commands/plan.py) calls _print_lifecycle_plan(plan, title="Plan Applied") which renders a generic plan status panel. This panel:

  • Does NOT show "Apply Summary" with artifacts count, insertions/deletions, project name
  • Does NOT show "Validation (from Execute)" results
  • Does NOT show "Sandbox Cleanup" status (worktree removed, branch merged, checkpoint archived)
  • Does NOT show "Plan Lifecycle" with total duration, total cost, decisions made, child plans
  • Does NOT show "Next Steps" guidance
  • For non-rich formats, outputs _plan_spec_dict(plan) which also lacks the spec-required fields

Code Location

  • src/cleveragents/cli/commands/plan.py, lines 2054–2069 (apply output rendering)
  • src/cleveragents/application/services/plan_apply_service.py (apply service — has persist_apply_summary but it only stores apply_files_changed and apply_validations_run in error_details)

Subtasks

  • Add _build_apply_output_dict() helper that assembles all spec-required fields
  • Implement rich panel rendering for Apply Summary, Validation, Sandbox Cleanup, Plan Lifecycle, Next Steps
  • Implement JSON/YAML/plain structured output with spec-required fields
  • Wire sandbox cleanup status (worktree removed, branch merged, checkpoint archived) from SandboxManager/CheckpointService
  • Add unit tests (Behave) for apply output rendering

Definition of Done

  • agents plan apply <PLAN_ID> renders all five spec-required panels in rich format
  • JSON/YAML/plain formats include all spec-required fields
  • Sandbox cleanup status reflects actual sandbox state after apply
  • Validation summary from Execute phase is displayed
  • Test coverage ≥ 97%

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

## Metadata **Commit message**: `fix(cli): add structured output panels to agents plan apply command` **Branch**: `fix/plan-apply-output-panels` **Parent Epic**: #397 (Epic: Server & Autonomy Infrastructure) ## Bug Description The `agents plan apply` command does not produce the spec-required structured output panels. The spec (§ `agents plan apply`, lines 13219–13401) defines five distinct output panels for the rich format and corresponding structured fields for JSON/YAML/plain formats. The current implementation outputs a generic plan status panel via `_print_lifecycle_plan()` instead. ## Expected Behavior (from spec) The spec requires the following panels in rich format: 1. **Apply Summary** panel: - Plan ID - Artifacts (N files updated) - Changes (N insertions, N deletions) - Project (project name) - Applied At (timestamp) 2. **Validation (from Execute)** panel: - Tests: passed/failed (N/N) - Lint: passed/failed (N warnings) - Type Check: passed/failed (N errors) - Duration 3. **Sandbox Cleanup** panel: - Worktree: removed/retained - Branch: merged to main / status - Checkpoint: archived 4. **Plan Lifecycle** panel: - Phase: apply - State: applied - Total Duration - Total Cost - Decisions Made - Child Plans 5. **Next Steps** panel: - Review git diff - Commit changes For JSON format, the spec requires: ```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": "...", "validation": { "tests": {...}, "lint": {...}, "type_check": {...} }, "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 } } } ``` ## Actual Behavior The `agents plan apply` command (lines 1942–2090 in `src/cleveragents/cli/commands/plan.py`) calls `_print_lifecycle_plan(plan, title="Plan Applied")` which renders a generic plan status panel. This panel: - Does NOT show "Apply Summary" with artifacts count, insertions/deletions, project name - Does NOT show "Validation (from Execute)" results - Does NOT show "Sandbox Cleanup" status (worktree removed, branch merged, checkpoint archived) - Does NOT show "Plan Lifecycle" with total duration, total cost, decisions made, child plans - Does NOT show "Next Steps" guidance - For non-rich formats, outputs `_plan_spec_dict(plan)` which also lacks the spec-required fields ## Code Location - `src/cleveragents/cli/commands/plan.py`, lines 2054–2069 (apply output rendering) - `src/cleveragents/application/services/plan_apply_service.py` (apply service — has `persist_apply_summary` but it only stores `apply_files_changed` and `apply_validations_run` in `error_details`) ## Subtasks - [ ] Add `_build_apply_output_dict()` helper that assembles all spec-required fields - [ ] Implement rich panel rendering for Apply Summary, Validation, Sandbox Cleanup, Plan Lifecycle, Next Steps - [ ] Implement JSON/YAML/plain structured output with spec-required fields - [ ] Wire sandbox cleanup status (worktree removed, branch merged, checkpoint archived) from `SandboxManager`/`CheckpointService` - [ ] Add unit tests (Behave) for apply output rendering ## Definition of Done - `agents plan apply <PLAN_ID>` renders all five spec-required panels in rich format - JSON/YAML/plain formats include all spec-required fields - Sandbox cleanup status reflects actual sandbox state after apply - Validation summary from Execute phase is displayed - Test coverage ≥ 97% --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-uat-tester
freemo added this to the v3.5.0 milestone 2026-04-05 05:06:36 +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#2474
No description provided.