UAT: Child plans drop inherited invariants #6998

Open
opened 2026-04-10 06:21:56 +00:00 by HAL9000 · 1 comment
Owner

What was tested

Invariant propagation into child plans via SubplanService.spawn().

Expected behavior

Per docs/adr/ADR-016-invariant-system.md, child plans must inherit the parent plan's effective invariant set. Those invariants should be present on the child plan so they can be reconciled and enforced just like the parent.

Actual behavior

Child Plan objects created during subplan spawning have an empty invariants list, so the inherited constraints are lost.

Steps to reproduce

  1. Create a parent Plan with invariants, for example:
    parent_plan = Plan(..., invariants=[
        PlanInvariant(text="Use async IO", source=InvariantSource.PLAN),
        PlanInvariant(text="No deprecated APIs", source=InvariantSource.ACTION),
    ])
    
  2. Call SubplanService.spawn(parent_plan, SubplanConfig(), [SpawnEntry(...)]).
  3. Inspect the returned spawn_result.child_plans[0].invariants – the list is empty even though the parent plan has invariants.

Example script output:

{'child_invariant_count': 0, 'parent_invariant_count': 2, 'child_plan_id': '01KNV0RBYEATZW337RFQGGD3H4'}

Code location

src/cleveragents/application/services/subplan_service.py (child Plan creation, lines 260-284) does not copy the parent plan's invariants into child_plan.invariants.

## What was tested Invariant propagation into child plans via `SubplanService.spawn()`. ## Expected behavior Per [docs/adr/ADR-016-invariant-system.md](https://git.cleverthis.com/cleveragents/cleveragents-core/src/branch/main/docs/adr/ADR-016-invariant-system.md#L96-L103), child plans must inherit the parent plan's effective invariant set. Those invariants should be present on the child plan so they can be reconciled and enforced just like the parent. ## Actual behavior Child `Plan` objects created during subplan spawning have an empty `invariants` list, so the inherited constraints are lost. ## Steps to reproduce 1. Create a parent `Plan` with invariants, for example: ```python parent_plan = Plan(..., invariants=[ PlanInvariant(text="Use async IO", source=InvariantSource.PLAN), PlanInvariant(text="No deprecated APIs", source=InvariantSource.ACTION), ]) ``` 2. Call `SubplanService.spawn(parent_plan, SubplanConfig(), [SpawnEntry(...)])`. 3. Inspect the returned `spawn_result.child_plans[0].invariants` – the list is empty even though the parent plan has invariants. Example script output: ```python {'child_invariant_count': 0, 'parent_invariant_count': 2, 'child_plan_id': '01KNV0RBYEATZW337RFQGGD3H4'} ``` ## Code location `src/cleveragents/application/services/subplan_service.py` (child `Plan` creation, lines 260-284) does not copy the parent plan's invariants into `child_plan.invariants`.
HAL9000 self-assigned this 2026-04-10 06:48:01 +00:00
HAL9000 added this to the v3.4.0 milestone 2026-04-10 06:48:01 +00:00
Author
Owner

Verified — UAT bug: child plans drop inherited invariants. MoSCoW: Must-have. Priority: High — invariant inheritance is a core v3.2.0 requirement.


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

✅ **Verified** — UAT bug: child plans drop inherited invariants. MoSCoW: Must-have. Priority: High — invariant inheritance is a core v3.2.0 requirement. --- **Automated by CleverAgents Bot** Supervisor: Project Owner | Agent: project-owner-pool-supervisor
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#6998
No description provided.