feat(decision): integrate decision recording with subplan execution #8972

Open
opened 2026-04-14 04:34:35 +00:00 by HAL9000 · 1 comment
Owner

Background and Context

With v3.3.0 introducing subplan spawning during plan execution, the Decision Framework must be extended to record decisions made within subplans under the parent plan's decision tree. Currently, DecisionService records decisions at the top-level plan scope only. When a parent plan spawns child subplans, each subplan makes its own strategize and execute decisions that must be captured with proper parent-child relationship tracking so the full decision lineage is visible via plan tree and plan explain.

Acceptance Criteria

  • Decisions recorded during subplan execution are linked to the parent plan's decision tree with a parent_decision_id reference
  • plan tree <parent_plan_id> renders the full decision tree including all subplan decisions in a hierarchical view
  • plan explain <decision_id> works for decisions originating from subplans and shows the subplan context
  • Subplan decision paths are retrievable via DecisionRepository.get_subplan_decisions(plan_id, subplan_id)
  • Decision recording does not block or slow parallel subplan execution (async-safe)
  • Test coverage >= 97%

Subtasks

  • Extend DecisionRepository with parent_subplan_id column and migration
  • Update DecisionService.record() to accept optional subplan_id context parameter
  • Wire subplan context into PlanLifecycleService so subplan decisions are tagged correctly
  • Update plan tree CLI output to render subplan decision branches hierarchically
  • Update plan explain CLI to show subplan origin context in decision details
  • Add docs/reference/decision_subplans.md documenting subplan decision tracking
  • Tests (Behave): Add features/decision_subplan_recording.feature scenarios
  • Tests (Robot): Add robot/decision_subplan_recording.robot integration tests
  • Tests (ASV): Add benchmarks/decision_subplan_bench.py for parallel recording overhead
  • Verify coverage >= 97% via nox -s coverage_report; iterate until passing
  • Run nox (all default sessions including benchmark), fix any errors

Definition of Done

  • All acceptance criteria met
  • Tests written and passing (coverage >= 97%)
  • Code reviewed and approved
  • Documentation updated if needed
  • No regressions introduced

Metadata

  • Commit message: feat(decision): integrate decision recording with subplan execution
  • Branch name: feat/decision-subplan-recording

Automated by CleverAgents Bot
Supervisor: Epic Planning Pool | Agent: epic-planning-pool-supervisor

## Background and Context With v3.3.0 introducing subplan spawning during plan execution, the Decision Framework must be extended to record decisions made within subplans under the parent plan's decision tree. Currently, `DecisionService` records decisions at the top-level plan scope only. When a parent plan spawns child subplans, each subplan makes its own strategize and execute decisions that must be captured with proper parent-child relationship tracking so the full decision lineage is visible via `plan tree` and `plan explain`. ## Acceptance Criteria - [ ] Decisions recorded during subplan execution are linked to the parent plan's decision tree with a `parent_decision_id` reference - [ ] `plan tree <parent_plan_id>` renders the full decision tree including all subplan decisions in a hierarchical view - [ ] `plan explain <decision_id>` works for decisions originating from subplans and shows the subplan context - [ ] Subplan decision paths are retrievable via `DecisionRepository.get_subplan_decisions(plan_id, subplan_id)` - [ ] Decision recording does not block or slow parallel subplan execution (async-safe) - [ ] Test coverage >= 97% ## Subtasks - [ ] Extend `DecisionRepository` with `parent_subplan_id` column and migration - [ ] Update `DecisionService.record()` to accept optional `subplan_id` context parameter - [ ] Wire subplan context into `PlanLifecycleService` so subplan decisions are tagged correctly - [ ] Update `plan tree` CLI output to render subplan decision branches hierarchically - [ ] Update `plan explain` CLI to show subplan origin context in decision details - [ ] Add `docs/reference/decision_subplans.md` documenting subplan decision tracking - [ ] Tests (Behave): Add `features/decision_subplan_recording.feature` scenarios - [ ] Tests (Robot): Add `robot/decision_subplan_recording.robot` integration tests - [ ] Tests (ASV): Add `benchmarks/decision_subplan_bench.py` for parallel recording overhead - [ ] Verify coverage >= 97% via `nox -s coverage_report`; iterate until passing - [ ] Run `nox` (all default sessions including benchmark), fix any errors ## Definition of Done - [ ] All acceptance criteria met - [ ] Tests written and passing (coverage >= 97%) - [ ] Code reviewed and approved - [ ] Documentation updated if needed - [ ] No regressions introduced ## Metadata - **Commit message:** `feat(decision): integrate decision recording with subplan execution` - **Branch name:** `feat/decision-subplan-recording` --- **Automated by CleverAgents Bot** Supervisor: Epic Planning Pool | Agent: epic-planning-pool-supervisor
Author
Owner

Verified — Decision recording integration with subplan execution is required for v3.3.0 subplan orchestration. MoSCoW: Must-have. Priority: High — decisions must be recorded at all execution levels.


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

✅ **Verified** — Decision recording integration with subplan execution is required for v3.3.0 subplan orchestration. MoSCoW: Must-have. Priority: High — decisions must be recorded at all execution levels. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
HAL9000 added this to the v3.3.0 milestone 2026-04-14 05:31: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#8972
No description provided.