Files
cleveragents-core/features/subplan_spawn_orchestration.feature
T
freemo 21e9a65c33
CI / benchmark-publish (pull_request) Has been skipped
CI / lint (pull_request) Successful in 15s
CI / build (pull_request) Successful in 27s
CI / typecheck (pull_request) Successful in 31s
CI / quality (pull_request) Successful in 31s
CI / security (pull_request) Successful in 43s
CI / unit_tests (pull_request) Successful in 2m56s
CI / integration_tests (pull_request) Successful in 3m45s
CI / docker (pull_request) Successful in 56s
CI / e2e_tests (pull_request) Successful in 4m14s
CI / coverage (pull_request) Successful in 7m37s
CI / lint (push) Successful in 15s
CI / build (push) Successful in 38s
CI / quality (push) Successful in 41s
CI / typecheck (push) Successful in 55s
CI / security (push) Successful in 56s
CI / benchmark-regression (push) Has been skipped
CI / unit_tests (push) Successful in 1m41s
CI / docker (push) Successful in 55s
CI / integration_tests (push) Successful in 3m39s
CI / e2e_tests (push) Successful in 5m9s
CI / coverage (push) Successful in 6m46s
CI / benchmark-publish (push) Has been cancelled
CI / benchmark-regression (pull_request) Successful in 37m40s
fix(plan): implement end-to-end subplan execution orchestration
Replace the metadata-only subplan spawn with real child Plan domain object
creation. SubplanService.spawn() now creates full Plan instances with proper
PlanIdentity (linking parent_plan_id and root_plan_id), sets them to
PlanPhase.STRATEGIZE / ProcessingState.QUEUED, and returns them in the
SpawnResult.child_plans list for downstream lifecycle orchestration.

Key changes:
- SubplanService.spawn() now creates Plan domain objects for each spawn entry
  with complete PlanIdentity linking, inheriting the parent plan's namespace,
  actors, project links, definition_of_done, and access settings.
- SpawnResult dataclass extended with child_plans: list[Plan] field to carry
  the created child plans alongside the existing metadata and statuses.
- Parent plan's subplan_statuses list is updated with SubplanStatus entries
  tracking each child's lifecycle state.
- Fixed Pyright type errors: added missing definition_of_done, reusable,
  read_only, and server parameters to Plan and NamespacedName constructors.
- Removed @tdd_expected_fail tags from TDD test files since the bug is fixed.
- Added Behave scenarios and Robot integration tests verifying child plan
  creation, lifecycle phase/state, and parent tracking.

ISSUES CLOSED: #823
2026-03-18 17:07:07 +00:00

45 lines
2.2 KiB
Gherkin

@mock_only @subplan @orchestration
Feature: Subplan spawn → execute → merge orchestration lifecycle
As a system orchestrating hierarchical plan execution
I want SubplanService.spawn() to create real child Plan domain objects
and wire them through the full strategize execute validate cycle
So that subplan execution is end-to-end orchestrated
Background:
Given a parent plan configured for subplan spawning
And valid spawn entries for the parent plan
Scenario: Spawn creates child Plans with correct parent-child identity
When I spawn subplans via SubplanService
Then the spawn result should contain child Plan domain objects
And each child Plan should have parent_plan_id set to the parent
And each child Plan root_plan_id should trace to the root plan
Scenario: Child plans inherit project links from parent
When I spawn subplans via SubplanService
Then each child plan should inherit the parent project links
Scenario: Parent plan blocks when child plans are pending
When I spawn subplans via SubplanService
Then the parent plan should have pending subplan statuses
And the parent plan subplan_statuses count should equal spawn count
Scenario: Child plan failure marks parent subplan status as errored
When I spawn subplans via SubplanService
And a child plan fails with error "ChildExecError: timeout"
Then the corresponding parent subplan status should be errored
And the parent subplan status error should contain "ChildExecError"
Scenario: Child plan completion updates parent subplan status
When I spawn subplans via SubplanService
And a child plan completes successfully with changeset summary "Added tests"
Then the corresponding parent subplan status should be complete
And the parent subplan status changeset summary should be "Added tests"
Scenario: Parallel spawn sets execution mode on result
Given a parent plan configured for parallel subplan spawning
And valid spawn entries for the parent plan
When I spawn subplans via SubplanService
Then the spawn result execution mode should be parallel
And the spawn result child plan count should match entries