UAT: agents plan tree missing Tree Summary, Child Plans, and Decision IDs panels #3106

Open
opened 2026-04-05 06:17:46 +00:00 by freemo · 0 comments
Owner

Metadata

  • Branch: fix/v3.2.0-plan-tree-missing-panels
  • Commit Message: fix(plan-tree): add Tree Summary, Child Plans, and Decision IDs panels to plan tree output
  • Milestone: v3.2.0
  • Parent Epic: #357

Background and Context

The agents plan tree command is missing three required output sections that are explicitly specified in docs/specification.md (lines 14351–14481). This was discovered during UAT testing of the decision-recording feature area in milestone v3.2.0.

The build_decision_tree() helper (lines 3570–3646 of src/cleveragents/cli/commands/plan.py) returns a flat list of root-node dicts with children arrays, but computes no summary statistics, tracks no child plans, and builds no decision ID index. As a result, tree_decisions_cmd (lines 3646–3773) only renders the tree visualization via rich.tree.Tree and outputs a raw list for JSON — both missing the three panels required by the spec.

Current Behavior

  • Rich output: Only the tree visualization is rendered. No "Tree Summary", "Child Plans", or "Decision IDs (for correction)" panels are shown.
  • JSON output: Returns a raw list of root-node dicts, not the spec-required envelope format:
    {"command": "plan tree", "status": "ok", "data": {"plan_id": ..., "tree": {...}, "summary": {...}, "child_plans": [...], "decision_ids": {...}}, "timing": {...}, "messages": [...]}
    
  • build_decision_tree() does not compute: node count, tree depth, child plan count, invariant count, superseded count, child plan table (ID/Phase/State), or decision ID index by role.

Steps to reproduce:

  1. Create a plan with multiple decisions (including invariant_enforced and subplan_spawn decision types).
  2. Run agents plan tree <plan_id>.
  3. Observe: only the tree visualization is shown — no summary, child plans, or decision IDs panels.

Code location: src/cleveragents/cli/commands/plan.py lines 3570–3773 (build_decision_tree, tree_decisions_cmd)

Expected Behavior

Per docs/specification.md lines 14319–14481:

Rich output should include three panels after the tree:

  1. Tree Summary panel — Nodes count, Depth, Child Plans count, Invariants count, Superseded count (hidden/shown toggle)
  2. Child Plans table — table of child plan IDs with their Phase and State columns
  3. Decision IDs (for correction) panel — decision IDs listed by role (Root, Invariant 1/2, Strategy, Parallel, Spawn, etc.)

JSON output must use the envelope format:

{
  "command": "plan tree",
  "status": "ok",
  "data": {
    "plan_id": "<id>",
    "tree": { ... },
    "summary": {
      "nodes": <int>,
      "depth": <int>,
      "child_plans": <int>,
      "invariants": <int>,
      "superseded": <int>
    },
    "child_plans": [{"id": "...", "phase": "...", "state": "..."}],
    "decision_ids": {"root": "...", "invariant_1": "...", "strategy": "...", ...}
  },
  "timing": { ... },
  "messages": []
}

Subtasks

  • Extend build_decision_tree() to compute and return summary statistics: node count, tree depth, child plan count, invariant count, superseded count
  • Extend build_decision_tree() to collect child plan entries (ID, Phase, State) for subplan_spawn decision nodes
  • Extend build_decision_tree() to build a decision ID index keyed by role (Root, Invariant 1, Invariant 2, Strategy, Parallel, Spawn, etc.)
  • Update tree_decisions_cmd Rich output to render the "Tree Summary" panel after the tree visualization
  • Update tree_decisions_cmd Rich output to render the "Child Plans" table panel
  • Update tree_decisions_cmd Rich output to render the "Decision IDs (for correction)" panel
  • Update tree_decisions_cmd JSON output to use the spec-required envelope format with summary, child_plans, and decision_ids keys
  • Tests (Behave): Add/update scenarios covering Tree Summary, Child Plans, and Decision IDs panel rendering for both Rich and JSON output modes
  • Tests (Robot): Add integration test verifying all three panels appear in agents plan tree output
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), fix any errors

Definition of Done

This issue is complete when:

  • All subtasks above are completed and checked off.
  • A Git commit is created where the first line of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation.
  • The commit is pushed to the remote on the branch matching the Branch in Metadata exactly.
  • The commit is submitted as a pull request to master, reviewed, and merged before this issue is marked done.
  • All nox stages pass.
  • Coverage >= 97%.

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: ca-new-issue-creator

## Metadata - **Branch**: `fix/v3.2.0-plan-tree-missing-panels` - **Commit Message**: `fix(plan-tree): add Tree Summary, Child Plans, and Decision IDs panels to plan tree output` - **Milestone**: v3.2.0 - **Parent Epic**: #357 ## Background and Context The `agents plan tree` command is missing three required output sections that are explicitly specified in `docs/specification.md` (lines 14351–14481). This was discovered during UAT testing of the decision-recording feature area in milestone v3.2.0. The `build_decision_tree()` helper (lines 3570–3646 of `src/cleveragents/cli/commands/plan.py`) returns a flat list of root-node dicts with `children` arrays, but computes no summary statistics, tracks no child plans, and builds no decision ID index. As a result, `tree_decisions_cmd` (lines 3646–3773) only renders the tree visualization via `rich.tree.Tree` and outputs a raw list for JSON — both missing the three panels required by the spec. ## Current Behavior - **Rich output**: Only the tree visualization is rendered. No "Tree Summary", "Child Plans", or "Decision IDs (for correction)" panels are shown. - **JSON output**: Returns a raw list of root-node dicts, not the spec-required envelope format: ```json {"command": "plan tree", "status": "ok", "data": {"plan_id": ..., "tree": {...}, "summary": {...}, "child_plans": [...], "decision_ids": {...}}, "timing": {...}, "messages": [...]} ``` - `build_decision_tree()` does not compute: node count, tree depth, child plan count, invariant count, superseded count, child plan table (ID/Phase/State), or decision ID index by role. **Steps to reproduce**: 1. Create a plan with multiple decisions (including `invariant_enforced` and `subplan_spawn` decision types). 2. Run `agents plan tree <plan_id>`. 3. Observe: only the tree visualization is shown — no summary, child plans, or decision IDs panels. **Code location**: `src/cleveragents/cli/commands/plan.py` lines 3570–3773 (`build_decision_tree`, `tree_decisions_cmd`) ## Expected Behavior Per `docs/specification.md` lines 14319–14481: **Rich output** should include three panels after the tree: 1. **Tree Summary panel** — Nodes count, Depth, Child Plans count, Invariants count, Superseded count (hidden/shown toggle) 2. **Child Plans table** — table of child plan IDs with their Phase and State columns 3. **Decision IDs (for correction) panel** — decision IDs listed by role (Root, Invariant 1/2, Strategy, Parallel, Spawn, etc.) **JSON output** must use the envelope format: ```json { "command": "plan tree", "status": "ok", "data": { "plan_id": "<id>", "tree": { ... }, "summary": { "nodes": <int>, "depth": <int>, "child_plans": <int>, "invariants": <int>, "superseded": <int> }, "child_plans": [{"id": "...", "phase": "...", "state": "..."}], "decision_ids": {"root": "...", "invariant_1": "...", "strategy": "...", ...} }, "timing": { ... }, "messages": [] } ``` ## Subtasks - [ ] Extend `build_decision_tree()` to compute and return summary statistics: node count, tree depth, child plan count, invariant count, superseded count - [ ] Extend `build_decision_tree()` to collect child plan entries (ID, Phase, State) for `subplan_spawn` decision nodes - [ ] Extend `build_decision_tree()` to build a decision ID index keyed by role (Root, Invariant 1, Invariant 2, Strategy, Parallel, Spawn, etc.) - [ ] Update `tree_decisions_cmd` Rich output to render the "Tree Summary" panel after the tree visualization - [ ] Update `tree_decisions_cmd` Rich output to render the "Child Plans" table panel - [ ] Update `tree_decisions_cmd` Rich output to render the "Decision IDs (for correction)" panel - [ ] Update `tree_decisions_cmd` JSON output to use the spec-required envelope format with `summary`, `child_plans`, and `decision_ids` keys - [ ] Tests (Behave): Add/update scenarios covering Tree Summary, Child Plans, and Decision IDs panel rendering for both Rich and JSON output modes - [ ] Tests (Robot): Add integration test verifying all three panels appear in `agents plan tree` output - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), fix any errors ## Definition of Done This issue is complete when: - All subtasks above are completed and checked off. - A Git commit is created where the **first line** of the commit message matches the Commit Message in Metadata exactly, followed by a blank line, then additional lines providing relevant details about the implementation. - The commit is pushed to the remote on the branch matching the **Branch** in Metadata exactly. - The commit is submitted as a **pull request** to `master`, reviewed, and **merged** before this issue is marked done. - All nox stages pass. - Coverage >= 97%. --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: ca-new-issue-creator
freemo added this to the v3.2.0 milestone 2026-04-05 06:17:51 +00:00
freemo removed this from the v3.2.0 milestone 2026-04-06 20:50:35 +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.

Blocks
Reference
cleveragents/cleveragents-core#3106
No description provided.