Epic: Plan Correction Engine (v3.2.0) #8481

Open
opened 2026-04-13 20:06:03 +00:00 by HAL9000 · 1 comment
Owner

Metadata

  • Commit message: feat(plan-correction): implement plan correct --mode=revert|append, selective subtree recomputation, and flexible output validation
  • Branch name: feat/v3.2.0-plan-correction-engine

Background and Context

As part of the v3.2.0 milestone (M3: Decisions + Validations + Invariants), the agent system needs the ability to correct decisions after the fact. Currently, if a decision in a plan is wrong, the only option is to re-run the entire plan from scratch — a costly and time-consuming operation.

This Epic delivers the Plan Correction Engine: two correction modes (revert and append), selective subtree recomputation so only the affected portion of the decision tree is re-evaluated, and flexible output validation that checks structural components rather than exact character matching.

This Epic blocks the parent Legendary issue #8475.

Expected Behavior

  • agents plan correct <decision-id> --mode=revert re-executes the plan from the targeted decision point, recomputing only the affected subtree of decisions downstream of that point
  • agents plan correct <decision-id> --mode=append adds guidance or a correction note to the targeted decision without triggering recomputation — useful for annotating decisions without re-running
  • Selective subtree recomputation ensures that only decisions downstream of the corrected node are re-evaluated; upstream decisions are preserved
  • Output validation is flexible — it checks for the presence of structural components (e.g., required fields, expected sections) rather than requiring exact character-for-character matches

Acceptance Criteria

  • agents plan correct <id> --mode=revert re-executes from the targeted decision point
  • agents plan correct <id> --mode=revert recomputes only the affected subtree (upstream decisions are preserved)
  • agents plan correct <id> --mode=append adds guidance/correction note without triggering recomputation
  • Both correction modes persist their changes to the database
  • Output validation checks structural components, not exact character matching
  • Corrected decision history is preserved (original decision + correction are both recorded)
  • agents plan tree reflects corrections visually (e.g., marking corrected nodes)
  • Test coverage >= 97% for all new code in this Epic

Subtasks

  • Design the correction data model (how corrections are stored relative to original decisions)
  • Implement agents plan correct --mode=revert CLI command
  • Implement selective subtree recomputation logic (identify and re-execute only downstream decisions)
  • Implement agents plan correct --mode=append CLI command
  • Implement correction persistence to the database
  • Implement flexible output validation (structural component checks)
  • Update agents plan tree to visually reflect corrected nodes
  • Write unit tests for correction logic and subtree recomputation (>= 97% coverage)
  • Write integration tests for both correction modes end-to-end
  • Update documentation / help text for plan correct command

Child Issues / Child Epics

# Title Status
#8531 Implement correction data model & persistence 🔲 Open
#8533 Implement plan correct --mode=revert with subtree recomputation 🔲 Open
#8534 Implement plan correct --mode=append 🔲 Open
#8535 Implement flexible output validation 🔲 Open
#8537 Update plan tree to reflect corrections 🔲 Open

Definition of Done

This Epic should be closed when:

  1. All Acceptance Criteria above are verified and checked off
  2. All child implementation issues are closed
  3. Test coverage >= 97% is confirmed by CI for all new code
  4. Code has passed peer review and been merged to the main branch
  5. The parent Legendary issue #8475 has been updated to reflect this Epic's completion

Automated by CleverAgents Bot
Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor

## Metadata - **Commit message**: `feat(plan-correction): implement plan correct --mode=revert|append, selective subtree recomputation, and flexible output validation` - **Branch name**: `feat/v3.2.0-plan-correction-engine` ## Background and Context As part of the v3.2.0 milestone (M3: Decisions + Validations + Invariants), the agent system needs the ability to correct decisions after the fact. Currently, if a decision in a plan is wrong, the only option is to re-run the entire plan from scratch — a costly and time-consuming operation. This Epic delivers the Plan Correction Engine: two correction modes (`revert` and `append`), selective subtree recomputation so only the affected portion of the decision tree is re-evaluated, and flexible output validation that checks structural components rather than exact character matching. This Epic blocks the parent Legendary issue #8475. ## Expected Behavior - `agents plan correct <decision-id> --mode=revert` re-executes the plan from the targeted decision point, recomputing only the affected subtree of decisions downstream of that point - `agents plan correct <decision-id> --mode=append` adds guidance or a correction note to the targeted decision without triggering recomputation — useful for annotating decisions without re-running - Selective subtree recomputation ensures that only decisions downstream of the corrected node are re-evaluated; upstream decisions are preserved - Output validation is flexible — it checks for the presence of structural components (e.g., required fields, expected sections) rather than requiring exact character-for-character matches ## Acceptance Criteria - [ ] `agents plan correct <id> --mode=revert` re-executes from the targeted decision point - [ ] `agents plan correct <id> --mode=revert` recomputes only the affected subtree (upstream decisions are preserved) - [ ] `agents plan correct <id> --mode=append` adds guidance/correction note without triggering recomputation - [ ] Both correction modes persist their changes to the database - [ ] Output validation checks structural components, not exact character matching - [ ] Corrected decision history is preserved (original decision + correction are both recorded) - [ ] `agents plan tree` reflects corrections visually (e.g., marking corrected nodes) - [ ] Test coverage >= 97% for all new code in this Epic ## Subtasks - [ ] Design the correction data model (how corrections are stored relative to original decisions) - [ ] Implement `agents plan correct --mode=revert` CLI command - [ ] Implement selective subtree recomputation logic (identify and re-execute only downstream decisions) - [ ] Implement `agents plan correct --mode=append` CLI command - [ ] Implement correction persistence to the database - [ ] Implement flexible output validation (structural component checks) - [ ] Update `agents plan tree` to visually reflect corrected nodes - [ ] Write unit tests for correction logic and subtree recomputation (>= 97% coverage) - [ ] Write integration tests for both correction modes end-to-end - [ ] Update documentation / help text for `plan correct` command ## Child Issues / Child Epics | # | Title | Status | |---|-------|--------| | #8531 | Implement correction data model & persistence | 🔲 Open | | #8533 | Implement `plan correct --mode=revert` with subtree recomputation | 🔲 Open | | #8534 | Implement `plan correct --mode=append` | 🔲 Open | | #8535 | Implement flexible output validation | 🔲 Open | | #8537 | Update `plan tree` to reflect corrections | 🔲 Open | ## Definition of Done This Epic should be closed when: 1. All Acceptance Criteria above are verified and checked off 2. All child implementation issues are closed 3. Test coverage >= 97% is confirmed by CI for all new code 4. Code has passed peer review and been merged to the main branch 5. The parent Legendary issue #8475 has been updated to reflect this Epic's completion --- **Automated by CleverAgents Bot** Supervisor: Epic Planning | Agent: epic-planning-pool-supervisor
HAL9000 added this to the v3.2.0 milestone 2026-04-13 20:06:21 +00:00
Author
Owner

🤖 Child Issues Created — Plan Correction Engine (v3.2.0)

All 5 child implementation issues have been created and linked to this Epic. Each issue is assigned to milestone v3.2.0 (ID: 105) and labeled with Type/Feature, Priority/High, MoSCoW/Must have, and State/Verified.

# Issue Branch Prefix
#8531 feat(plan-correction): implement correction data model and persistence feat/v3.2.0-correction-data-model-persistence
#8533 feat(plan-correction): implement plan correct --mode=revert with selective subtree recomputation feat/v3.2.0-plan-correct-revert
#8534 feat(plan-correction): implement plan correct --mode=append feat/v3.2.0-plan-correct-append
#8535 feat(plan-correction): implement flexible output validation for structural component checks feat/v3.2.0-flexible-output-validation
#8537 feat(plan-correction): update agents plan tree to visually reflect corrected nodes feat/v3.2.0-plan-tree-corrections

Each child issue BLOCKS this Epic (#8481). The Epic body has been updated to replace TBD entries with the actual issue numbers above.


Automated by CleverAgents Bot
Agent: new-issue-creator

## 🤖 Child Issues Created — Plan Correction Engine (v3.2.0) All 5 child implementation issues have been created and linked to this Epic. Each issue is assigned to milestone **v3.2.0** (ID: 105) and labeled with `Type/Feature`, `Priority/High`, `MoSCoW/Must have`, and `State/Verified`. | # | Issue | Branch Prefix | |---|-------|---------------| | #8531 | [feat(plan-correction): implement correction data model and persistence](https://git.cleverthis.com/cleveragents/cleveragents-core/issues/8531) | `feat/v3.2.0-correction-data-model-persistence` | | #8533 | [feat(plan-correction): implement plan correct --mode=revert with selective subtree recomputation](https://git.cleverthis.com/cleveragents/cleveragents-core/issues/8533) | `feat/v3.2.0-plan-correct-revert` | | #8534 | [feat(plan-correction): implement plan correct --mode=append](https://git.cleverthis.com/cleveragents/cleveragents-core/issues/8534) | `feat/v3.2.0-plan-correct-append` | | #8535 | [feat(plan-correction): implement flexible output validation for structural component checks](https://git.cleverthis.com/cleveragents/cleveragents-core/issues/8535) | `feat/v3.2.0-flexible-output-validation` | | #8537 | [feat(plan-correction): update agents plan tree to visually reflect corrected nodes](https://git.cleverthis.com/cleveragents/cleveragents-core/issues/8537) | `feat/v3.2.0-plan-tree-corrections` | Each child issue BLOCKS this Epic (#8481). The Epic body has been updated to replace TBD entries with the actual issue numbers above. --- **Automated by CleverAgents Bot** Agent: new-issue-creator
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#8481
No description provided.