feat(subplans): implement SubplanSpawner to create child plans during Execute phase #4995

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

Metadata

  • Commit Message: feat(subplans): implement SubplanSpawner to create child plans during Execute phase
  • Branch: feat/m4/subplan-spawner
  • Parent Epic: #4972

Background and Context

The CleverAgents system needs to support spawning child subplans during plan execution. This enables hierarchical plan decomposition where a parent plan can delegate subtasks to child plans.

This issue implements the SubplanSpawner service that creates child plan records, links them to the parent, and queues them for execution.

Expected Behavior

  • SubplanSpawner.spawn(parent_plan_id, guidance, context) creates a child plan
  • Child plans are linked to parent via parent_plan_id foreign key
  • Child plans are queued for execution with configurable concurrency
  • Parent plan tracks all child plan statuses
  • Child plans are identified by ULID (no namespaced name per spec)

Acceptance Criteria

  • SubplanSpawner service implemented in src/cleveragents/plans/
  • SubplanSpawner.spawn() creates child plan record in DB with parent_plan_id
  • Child plans are queued for execution
  • Parent plan status reflects child plan states
  • max_parallel concurrency limit is respected
  • Unit tests (Behave) cover spawning scenarios
  • Integration test (Robot) verifies parent-child plan relationship

Subtasks

  • Add parent_plan_id column to plans table (migration)
  • Implement SubplanSpawner service class
  • Implement SubplanSpawner.spawn() with DB persistence
  • Wire SubplanSpawner into ExecutePhase
  • Implement max_parallel concurrency enforcement
  • Tests (Behave): Add scenarios for subplan spawning
  • Tests (Robot): Add integration test
  • 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.
  • 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.

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planner

## Metadata - **Commit Message**: `feat(subplans): implement SubplanSpawner to create child plans during Execute phase` - **Branch**: `feat/m4/subplan-spawner` - **Parent Epic**: #4972 ## Background and Context The CleverAgents system needs to support spawning child subplans during plan execution. This enables hierarchical plan decomposition where a parent plan can delegate subtasks to child plans. This issue implements the `SubplanSpawner` service that creates child plan records, links them to the parent, and queues them for execution. ## Expected Behavior - `SubplanSpawner.spawn(parent_plan_id, guidance, context)` creates a child plan - Child plans are linked to parent via `parent_plan_id` foreign key - Child plans are queued for execution with configurable concurrency - Parent plan tracks all child plan statuses - Child plans are identified by ULID (no namespaced name per spec) ## Acceptance Criteria - [ ] `SubplanSpawner` service implemented in `src/cleveragents/plans/` - [ ] `SubplanSpawner.spawn()` creates child plan record in DB with `parent_plan_id` - [ ] Child plans are queued for execution - [ ] Parent plan status reflects child plan states - [ ] `max_parallel` concurrency limit is respected - [ ] Unit tests (Behave) cover spawning scenarios - [ ] Integration test (Robot) verifies parent-child plan relationship ## Subtasks - [ ] Add `parent_plan_id` column to `plans` table (migration) - [ ] Implement `SubplanSpawner` service class - [ ] Implement `SubplanSpawner.spawn()` with DB persistence - [ ] Wire `SubplanSpawner` into `ExecutePhase` - [ ] Implement `max_parallel` concurrency enforcement - [ ] Tests (Behave): Add scenarios for subplan spawning - [ ] Tests (Robot): Add integration test - [ ] 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. - 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. --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planner
HAL9000 added this to the v3.3.0 milestone 2026-04-09 01:03:27 +00:00
Author
Owner

Issue triaged by project owner:

  • State: Verified
  • Priority: High — Core checkpoint/subplan feature required for Decision Intelligence Legendary
  • Milestone: v3.3.0
  • Story Points: 8 — XL
  • MoSCoW: Must Have — Required for Checkpoint/Subplan Epics (#4973/#4972)

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

Issue triaged by project owner: - **State**: Verified - **Priority**: High — Core checkpoint/subplan feature required for Decision Intelligence Legendary - **Milestone**: v3.3.0 - **Story Points**: 8 — XL - **MoSCoW**: Must Have — Required for Checkpoint/Subplan Epics (#4973/#4972) --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner
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#4995
No description provided.