Skip to content

refactor: planner owns condition management, not executor#92

Merged
bdchatham merged 1 commit intomainfrom
refactor/planner-owns-conditions
Apr 16, 2026
Merged

refactor: planner owns condition management, not executor#92
bdchatham merged 1 commit intomainfrom
refactor/planner-owns-conditions

Conversation

@bdchatham
Copy link
Copy Markdown
Collaborator

Summary

Moves condition ownership from the executor to the planner. This is a strategy shift in preparation for NodeUpdate plans — the planner is the component that understands what plans mean, so it should own the conditions that signal plan state to external observers.

  • Executor: No longer sets any conditions. Only mutates plan/task state and phase transitions. Removed setPlanFailedCondition, ConditionPlanFailed.
  • Planner: Will set conditions when creating plans (e.g., NodeUpdateInProgress=True) and when observing terminal plans on the next reconcile (e.g., NodeUpdateInProgress=False, Reason=UpdateComplete or Reason=UpdateFailed).
  • Documentation: Updated doc.go and CLAUDE.md with condition ownership, atomic plan creation, and single-patch model patterns.

Ownership model

Component Owns
Planner Conditions, plan creation, drift detection
Executor Plan/task state, phase transitions
Tasks Owned resource mutations (StatefulSets, Services, PVCs, sidecar)
Reconciler Single status flush

Test plan

  • make build && make test && make lint — all green

🤖 Generated with Claude Code

Move condition ownership from the executor to the planner. The executor
now only mutates plan/task state and phase transitions. The planner sets
conditions when creating plans and when observing terminal plans on the
next reconcile.

- Remove setPlanFailedCondition from executor
- Remove ConditionPlanFailed constant from executor
- Update failTask doc to clarify planner handles conditions
- Update planner doc.go with condition ownership section
- Update CLAUDE.md Key Patterns with condition ownership, atomic plan
  creation, and single-patch model documentation
- Update test to assert plan failure details instead of condition

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@bdchatham bdchatham merged commit c771542 into main Apr 16, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant