feat(correction): implement plan correct --mode=append guidance persistence and child plan spawning #8911

Open
opened 2026-04-14 04:02:18 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit message: feat(correction): implement plan correct --mode=append guidance persistence and child plan spawning
  • Branch name: feat/m3-m4/correction-append-mode

Background and Context

Epic #4959 (Correction Engine — Revert & Append Modes) requires that agents plan correct --mode=append appends a user-defined correction step to the current plan without reverting. Currently, plan correct --mode=append generates a fake child plan ULID but does not actually persist the guidance to the decision tree or spawn a real child plan.

This issue implements the full append correction flow: the user provides correction guidance, the correction engine appends it to the current plan's decision tree as a new guidance node, and optionally spawns a child plan to execute the appended guidance. The plan.attempt counter must be incremented on each correction.

This issue blocks Epic #4959.

Acceptance Criteria

  • agents plan correct --mode=append <PLAN_ID> persists correction guidance to the decision tree
  • Appended guidance is stored as a new decision node linked to the current plan
  • plan.attempt counter is incremented on each successful correction
  • CorrectionService.execute_append() persists the correction attempt to the correction_attempts DB table
  • When --spawn-child flag is provided, a real child plan is created and queued for execution
  • Rich output shows: appended guidance summary, new decision node ID, new attempt number
  • JSON/YAML output uses spec-required envelope with correction_id, mode, guidance_node_id
  • Unit tests (Behave) cover append scenarios including with and without child plan spawning
  • Test coverage >= 97% for all new/modified modules

Subtasks

  • Implement CorrectionService.execute_append() to persist guidance to decision tree
  • Add guidance node creation logic in decision tree service
  • Implement plan.attempt increment in CorrectionService.execute_append()
  • Implement optional child plan spawning when --spawn-child flag is provided
  • Implement Rich output panel for append result (Guidance, Decision Node, New Attempt)
  • Implement JSON/YAML envelope output for plan correct --mode=append
  • Write Behave unit tests for append mode (with guidance, with child spawn, no-op)
  • Verify coverage >= 97% via nox -s coverage_report
  • Run nox (all default sessions), 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

Automated by CleverAgents Bot
Agent: new-issue-creator

## Metadata - **Commit message:** `feat(correction): implement plan correct --mode=append guidance persistence and child plan spawning` - **Branch name:** `feat/m3-m4/correction-append-mode` ## Background and Context Epic #4959 (Correction Engine — Revert & Append Modes) requires that `agents plan correct --mode=append` appends a user-defined correction step to the current plan without reverting. Currently, `plan correct --mode=append` generates a fake child plan ULID but does not actually persist the guidance to the decision tree or spawn a real child plan. This issue implements the full append correction flow: the user provides correction guidance, the correction engine appends it to the current plan's decision tree as a new guidance node, and optionally spawns a child plan to execute the appended guidance. The `plan.attempt` counter must be incremented on each correction. This issue blocks Epic #4959. ## Acceptance Criteria - [ ] `agents plan correct --mode=append <PLAN_ID>` persists correction guidance to the decision tree - [ ] Appended guidance is stored as a new decision node linked to the current plan - [ ] `plan.attempt` counter is incremented on each successful correction - [ ] `CorrectionService.execute_append()` persists the correction attempt to the `correction_attempts` DB table - [ ] When `--spawn-child` flag is provided, a real child plan is created and queued for execution - [ ] Rich output shows: appended guidance summary, new decision node ID, new attempt number - [ ] JSON/YAML output uses spec-required envelope with `correction_id`, `mode`, `guidance_node_id` - [ ] Unit tests (Behave) cover append scenarios including with and without child plan spawning - [ ] Test coverage >= 97% for all new/modified modules ## Subtasks - [ ] Implement `CorrectionService.execute_append()` to persist guidance to decision tree - [ ] Add guidance node creation logic in decision tree service - [ ] Implement `plan.attempt` increment in `CorrectionService.execute_append()` - [ ] Implement optional child plan spawning when `--spawn-child` flag is provided - [ ] Implement Rich output panel for append result (Guidance, Decision Node, New Attempt) - [ ] Implement JSON/YAML envelope output for `plan correct --mode=append` - [ ] Write Behave unit tests for append mode (with guidance, with child spawn, no-op) - [ ] Verify coverage >= 97% via `nox -s coverage_report` - [ ] Run `nox` (all default sessions), 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 --- **Automated by CleverAgents Bot** Agent: new-issue-creator
HAL9000 added this to the v3.3.0 milestone 2026-04-14 04:03:44 +00:00
Author
Owner

Verified — Plan correct append mode is a v3.3.0 acceptance criterion. MoSCoW: Must-have. Priority: Medium.


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

✅ **Verified** — Plan correct append mode is a v3.3.0 acceptance criterion. MoSCoW: Must-have. Priority: Medium. --- **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.

Reference
cleveragents/cleveragents-core#8911
No description provided.