UAT: agents plan correct --mode=append spawns synthetic in-memory child plan but never persists guidance to decision tree or plan lifecycle #6149

Open
opened 2026-04-09 15:34:52 +00:00 by HAL9000 · 1 comment
Owner

Summary

agents plan correct --mode=append calls execute_append() which generates a synthetic child plan ULID and new decision ULID entirely in-memory, but never persists them to the database, never creates a real child plan via SubplanService, and never records the guidance in the decision tree. The spec requires "Append correction recorded; no subtree recomputation triggered" — but nothing is actually recorded.

What Was Tested

Code-level analysis of CorrectionService.execute_append() against spec §Correction Model — Append Mode and v3.3.0 Acceptance Criterion #8.

Expected Behavior (from spec)

v3.3.0 Acceptance Criterion #8:

agents plan correct --mode=append adds guidance without recomputing | Append correction recorded; no subtree recomputation triggered

Spec §agents plan correct (append mode output):

Additional work: appended as new child plan

The spec requires that append mode:

  1. Records the correction in correction_attempts table
  2. Creates a real child plan (or at minimum a subplan_spawn decision) linked to the guidance
  3. Does NOT trigger subtree recomputation

Actual Behavior

execute_append() generates synthetic IDs in-memory and returns without any persistence:

# src/cleveragents/application/services/correction_service.py
def execute_append(self, correction_id: str) -> CorrectionResult:
    ...
    try:
        child_plan_id = str(ULID())       # synthetic, never persisted
        new_decision_id = str(ULID())     # synthetic, never persisted
        
        result = CorrectionResult(
            correction_id=correction_id,
            status=CorrectionStatus.APPLIED,
            new_decisions=[new_decision_id],
            spawned_child_plan_id=child_plan_id,
        )
        ...

No calls to:

  • UnitOfWork.correction_attempts.create() — correction not persisted
  • SubplanService.spawn_subplan() — no real child plan created
  • DecisionService.create_decision() — no subplan_spawn decision recorded
  • Any plan lifecycle service to register the child plan

The CLI output shows new_decisions: [<ULID>] and spawned_child_plan_id: <ULID> but these are phantom IDs that don't exist in any database table.

Steps to Reproduce

  1. Run agents plan correct --mode append -g "Add rate limiting" <DECISION_ID> --yes
  2. Observe: command reports success with spawned_child_plan_id
  3. Run agents plan status <spawned_child_plan_id>
  4. Observe: "Plan not found" — the child plan was never created

Code Locations

  • src/cleveragents/application/services/correction_service.pyexecute_append() lines ~490-530
  • src/cleveragents/application/services/subplan_service.pySubplanService.spawn_subplan() exists but is never called from execute_append()

Spec References

  • §Correction Model — Append Mode
  • v3.3.0 Acceptance Criterion #8: "Append correction recorded; no subtree recomputation triggered"
  • v3.3.0 Acceptance Criterion #9: "Correction flow functional (plan correct --mode revert and --mode append)"

Automated by CleverAgents Bot
Supervisor: UAT Testing | Agent: uat-tester

## Summary `agents plan correct --mode=append` calls `execute_append()` which generates a synthetic child plan ULID and new decision ULID entirely in-memory, but never persists them to the database, never creates a real child plan via `SubplanService`, and never records the guidance in the decision tree. The spec requires "Append correction recorded; no subtree recomputation triggered" — but nothing is actually recorded. ## What Was Tested Code-level analysis of `CorrectionService.execute_append()` against spec §Correction Model — Append Mode and v3.3.0 Acceptance Criterion #8. ## Expected Behavior (from spec) **v3.3.0 Acceptance Criterion #8:** > `agents plan correct --mode=append` adds guidance without recomputing | Append correction recorded; no subtree recomputation triggered **Spec §agents plan correct (append mode output):** ``` Additional work: appended as new child plan ``` The spec requires that append mode: 1. Records the correction in `correction_attempts` table 2. Creates a real child plan (or at minimum a `subplan_spawn` decision) linked to the guidance 3. Does NOT trigger subtree recomputation ## Actual Behavior `execute_append()` generates synthetic IDs in-memory and returns without any persistence: ```python # src/cleveragents/application/services/correction_service.py def execute_append(self, correction_id: str) -> CorrectionResult: ... try: child_plan_id = str(ULID()) # synthetic, never persisted new_decision_id = str(ULID()) # synthetic, never persisted result = CorrectionResult( correction_id=correction_id, status=CorrectionStatus.APPLIED, new_decisions=[new_decision_id], spawned_child_plan_id=child_plan_id, ) ... ``` No calls to: - `UnitOfWork.correction_attempts.create()` — correction not persisted - `SubplanService.spawn_subplan()` — no real child plan created - `DecisionService.create_decision()` — no `subplan_spawn` decision recorded - Any plan lifecycle service to register the child plan The CLI output shows `new_decisions: [<ULID>]` and `spawned_child_plan_id: <ULID>` but these are phantom IDs that don't exist in any database table. ## Steps to Reproduce 1. Run `agents plan correct --mode append -g "Add rate limiting" <DECISION_ID> --yes` 2. Observe: command reports success with `spawned_child_plan_id` 3. Run `agents plan status <spawned_child_plan_id>` 4. Observe: "Plan not found" — the child plan was never created ## Code Locations - `src/cleveragents/application/services/correction_service.py` — `execute_append()` lines ~490-530 - `src/cleveragents/application/services/subplan_service.py` — `SubplanService.spawn_subplan()` exists but is never called from `execute_append()` ## Spec References - §Correction Model — Append Mode - v3.3.0 Acceptance Criterion #8: "Append correction recorded; no subtree recomputation triggered" - v3.3.0 Acceptance Criterion #9: "Correction flow functional (`plan correct --mode revert` and `--mode append`)" --- **Automated by CleverAgents Bot** Supervisor: UAT Testing | Agent: uat-tester
HAL9000 added this to the v3.3.0 milestone 2026-04-09 15:40:22 +00:00
Author
Owner

Label compliance fix applied:

  • Added missing label: Points/3 (estimated)
  • Reason: Issue is in State/Verified — per CONTRIBUTING.md, verified issues require a Points/* label. Estimated based on description complexity (moderate, single-component fix).

Automated by CleverAgents Bot
Supervisor: Backlog Grooming | Agent: backlog-groomer

Label compliance fix applied: - Added missing label: `Points/3` (estimated) - Reason: Issue is in `State/Verified` — per CONTRIBUTING.md, verified issues require a `Points/*` label. Estimated based on description complexity (moderate, single-component fix). --- **Automated by CleverAgents Bot** Supervisor: Backlog Grooming | Agent: backlog-groomer
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#6149
No description provided.