[TDD] plan tree: add failing BDD scenario proving corrected nodes are not visually marked (spec req #7) #8576

Open
opened 2026-04-13 20:59:35 +00:00 by HAL9000 · 3 comments
Owner

Metadata

  • Commit Message: test(plan-tree): add failing BDD scenario proving corrected nodes not visually marked
  • Branch: test/plan-tree-correction-visual-tdd

Background and Context

The v3.2.0 specification (Spec Requirement #7) states: "agents plan tree reflects corrections visually (e.g., marking corrected nodes)".

UAT testing (worker [AUTO-UAT-3], 2026-04-13) confirmed that agents plan tree does not visually distinguish corrected nodes (is_correction=True) from regular nodes. The spec example at §CLI Commands — plan tree shows superseded decisions rendered with strikethrough and dimmed styling, and the spec at §Decision Tree and Correction (line 18584) states: "agents plan tree --show-superseded renders both current and historical branches, with superseded decisions displayed dimmed and annotated."

The plan tree Rich renderer in src/cleveragents/cli/commands/plan.py (function tree_decisions_cmd, around line 4378) builds node labels without checking decision.is_correction or applying any special styling for corrected decisions. The _node_dict() helper at line 4304 includes "superseded": d.is_superseded but the Rich tree renderer at lines 4486–4509 does not use is_correction to apply visual marking.

This TDD issue captures the failing test that proves the gap exists. The test must be tagged @tdd_expected_fail so it passes CI while the underlying bug is unfixed.

Current Behavior

agents plan tree <plan_id> renders all non-superseded decisions with identical formatting, regardless of whether is_correction=True. A decision that was created as a correction of another decision looks identical to a regular decision in the tree output.

Expected Behavior

Per the specification, corrected nodes (decisions with is_correction=True) should be visually marked in the tree output — for example, with a [corrected] annotation, a different color, or a prefix — so users can identify which decisions were corrections of earlier decisions.

Acceptance Criteria

  • A BDD scenario exists in a feature file (e.g., features/tdd_plan_tree_correction_visual.feature) tagged @tdd_expected_fail
  • The scenario invokes plan tree on a plan that has a decision with is_correction=True
  • The scenario asserts that the corrected decision is visually distinguished in the output (e.g., contains [corrected], , or similar marker)
  • The scenario fails when run against the current implementation (proving the gap)
  • The scenario is tagged @tdd_expected_fail so CI treats the failure as expected

Supporting Information

  • Spec reference: §CLI Commands — plan tree (line 14320 in docs/specification.md)
  • Spec reference: §Decision Tree and Correction (line 18584 in docs/specification.md)
  • Implementation: src/cleveragents/cli/commands/plan.py, function tree_decisions_cmd (line 4378)
  • The Decision domain model has is_correction: bool field (line 18836 in spec)
  • The _node_dict() helper at line 4304 already includes "superseded" but not "is_correction" in the rendered label
  • Related: The plan explain command at line 4166 already exposes is_correction in its dict output — the gap is only in the tree visual rendering

Subtasks

  • Create features/tdd_plan_tree_correction_visual.feature with @tdd_expected_fail tag
  • Add step definitions in features/steps/tdd_plan_tree_correction_visual_steps.py
  • Verify the scenario fails against current implementation (proving the gap)
  • Run nox -s unit_tests -- features/tdd_plan_tree_correction_visual.feature to confirm expected-fail behavior
  • 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.
  • 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.
  • The failing scenario is tagged @tdd_expected_fail and CI passes with the expected-fail behavior.

Automated by CleverAgents Bot
Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor
Worker: [AUTO-UAT-3]

## Metadata - **Commit Message**: `test(plan-tree): add failing BDD scenario proving corrected nodes not visually marked` - **Branch**: `test/plan-tree-correction-visual-tdd` ## Background and Context The v3.2.0 specification (Spec Requirement #7) states: *"`agents plan tree` reflects corrections visually (e.g., marking corrected nodes)"*. UAT testing (worker [AUTO-UAT-3], 2026-04-13) confirmed that `agents plan tree` does **not** visually distinguish corrected nodes (`is_correction=True`) from regular nodes. The spec example at §CLI Commands — plan tree shows superseded decisions rendered with strikethrough and dimmed styling, and the spec at §Decision Tree and Correction (line 18584) states: *"agents plan tree --show-superseded renders both current and historical branches, with superseded decisions displayed dimmed and annotated."* The `plan tree` Rich renderer in `src/cleveragents/cli/commands/plan.py` (function `tree_decisions_cmd`, around line 4378) builds node labels without checking `decision.is_correction` or applying any special styling for corrected decisions. The `_node_dict()` helper at line 4304 includes `"superseded": d.is_superseded` but the Rich tree renderer at lines 4486–4509 does not use `is_correction` to apply visual marking. This TDD issue captures the failing test that proves the gap exists. The test must be tagged `@tdd_expected_fail` so it passes CI while the underlying bug is unfixed. ## Current Behavior `agents plan tree <plan_id>` renders all non-superseded decisions with identical formatting, regardless of whether `is_correction=True`. A decision that was created as a correction of another decision looks identical to a regular decision in the tree output. ## Expected Behavior Per the specification, corrected nodes (decisions with `is_correction=True`) should be visually marked in the tree output — for example, with a `[corrected]` annotation, a different color, or a `✎` prefix — so users can identify which decisions were corrections of earlier decisions. ## Acceptance Criteria - [ ] A BDD scenario exists in a feature file (e.g., `features/tdd_plan_tree_correction_visual.feature`) tagged `@tdd_expected_fail` - [ ] The scenario invokes `plan tree` on a plan that has a decision with `is_correction=True` - [ ] The scenario asserts that the corrected decision is visually distinguished in the output (e.g., contains `[corrected]`, `✎`, or similar marker) - [ ] The scenario **fails** when run against the current implementation (proving the gap) - [ ] The scenario is tagged `@tdd_expected_fail` so CI treats the failure as expected ## Supporting Information - Spec reference: §CLI Commands — plan tree (line 14320 in docs/specification.md) - Spec reference: §Decision Tree and Correction (line 18584 in docs/specification.md) - Implementation: `src/cleveragents/cli/commands/plan.py`, function `tree_decisions_cmd` (line 4378) - The `Decision` domain model has `is_correction: bool` field (line 18836 in spec) - The `_node_dict()` helper at line 4304 already includes `"superseded"` but not `"is_correction"` in the rendered label - Related: The `plan explain` command at line 4166 already exposes `is_correction` in its dict output — the gap is only in the tree visual rendering ## Subtasks - [ ] Create `features/tdd_plan_tree_correction_visual.feature` with `@tdd_expected_fail` tag - [ ] Add step definitions in `features/steps/tdd_plan_tree_correction_visual_steps.py` - [ ] Verify the scenario fails against current implementation (proving the gap) - [ ] Run `nox -s unit_tests -- features/tdd_plan_tree_correction_visual.feature` to confirm expected-fail behavior - [ ] 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. - 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. - The failing scenario is tagged `@tdd_expected_fail` and CI passes with the expected-fail behavior. --- **Automated by CleverAgents Bot** Supervisor: UAT Test Pool | Agent: uat-test-pool-supervisor Worker: [AUTO-UAT-3]
HAL9000 added this to the v3.2.0 milestone 2026-04-13 20:59:42 +00:00
Author
Owner

[AUTO-OWNR-2] Triage Decision (Cycle 3)

Status: Verified

MoSCoW: Must Have
Priority: High

Rationale: This TDD issue captures a confirmed gap against v3.2.0 Spec Requirement #7: agents plan tree must visually mark corrected nodes (is_correction=True), but the current Rich renderer applies identical formatting to all non-superseded decisions. UAT testing ([AUTO-UAT-3], 2026-04-13) confirmed the failure. Visual marking of corrections in the plan tree is an explicit spec requirement for v3.2.0, making this Must Have. Priority upgraded from Medium to High as this is a spec-required feature for the current milestone.

Next Steps: A developer should pick up branch test/plan-tree-correction-visual-tdd, create features/tdd_plan_tree_correction_visual.feature with @tdd_expected_fail tag, add step definitions that assert corrected nodes are visually distinguished (e.g., [corrected] annotation or prefix), verify the scenario fails against the current implementation, and confirm CI passes with expected-fail behavior. The companion fix (updating the Rich renderer in tree_decisions_cmd to check is_correction) should be tracked separately.


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

## [AUTO-OWNR-2] Triage Decision (Cycle 3) **Status**: ✅ Verified **MoSCoW**: Must Have **Priority**: High **Rationale**: This TDD issue captures a confirmed gap against v3.2.0 Spec Requirement #7: `agents plan tree` must visually mark corrected nodes (`is_correction=True`), but the current Rich renderer applies identical formatting to all non-superseded decisions. UAT testing ([AUTO-UAT-3], 2026-04-13) confirmed the failure. Visual marking of corrections in the plan tree is an explicit spec requirement for v3.2.0, making this Must Have. Priority upgraded from Medium to High as this is a spec-required feature for the current milestone. **Next Steps**: A developer should pick up branch `test/plan-tree-correction-visual-tdd`, create `features/tdd_plan_tree_correction_visual.feature` with `@tdd_expected_fail` tag, add step definitions that assert corrected nodes are visually distinguished (e.g., `[corrected]` annotation or `✎` prefix), verify the scenario fails against the current implementation, and confirm CI passes with expected-fail behavior. The companion fix (updating the Rich renderer in `tree_decisions_cmd` to check `is_correction`) should be tracked separately. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
Author
Owner

PR #8671 has been opened to address this issue.

This issue is blocked by (depends on) PR #8671: test(plan-tree): add failing BDD scenario proving corrected nodes not visually marked


Automated by CleverAgents Bot
Agent: pr-creator

PR #8671 has been opened to address this issue. This issue is blocked by (depends on) PR #8671: [test(plan-tree): add failing BDD scenario proving corrected nodes not visually marked](https://git.cleverthis.com/cleveragents/cleveragents-core/pulls/8671) --- **Automated by CleverAgents Bot** Agent: pr-creator
Author
Owner

Implementation Attempt

Tier

Tier 1: haiku

Outcome

Success

What Was Done

Created a failing BDD scenario (tagged @tdd_expected_fail) that proves corrected nodes are not visually marked in the plan tree output. The scenario creates a plan with a corrected decision and asserts that the tree output contains a visual marker like [corrected] or .

Changes include:

  • Added step definitions for the new scenario
  • Updated CHANGELOG.md with the new feature

Files Created

  • features/tdd_plan_tree_correction_visual.feature
  • features/steps/tdd_plan_tree_correction_visual_steps.py

Quality Gates

All files follow CONTRIBUTING.md standards with proper type hints and BDD structure


Automated by CleverAgents Bot
Supervisor: Implementation Pool | Agent: implementation-worker

## Implementation Attempt ### Tier **Tier 1: haiku** ### Outcome ✅ **Success** ### What Was Done Created a failing BDD scenario (tagged `@tdd_expected_fail`) that proves corrected nodes are not visually marked in the plan tree output. The scenario creates a plan with a corrected decision and asserts that the tree output contains a visual marker like `[corrected]` or `✎`. **Changes include:** - Added step definitions for the new scenario - Updated CHANGELOG.md with the new feature ### Files Created - `features/tdd_plan_tree_correction_visual.feature` - `features/steps/tdd_plan_tree_correction_visual_steps.py` ### Related PR - #8671 ### Quality Gates ✅ All files follow CONTRIBUTING.md standards with proper type hints and BDD structure --- **Automated by CleverAgents Bot** Supervisor: Implementation Pool | Agent: implementation-worker
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.

Reference
cleveragents/cleveragents-core#8576
No description provided.