You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
* WIP: single-patch reconcile model (source changes, tests pending)
Refactors both controllers to accumulate all status mutations in-memory
and flush with a single Status().Patch() at the end of Reconcile.
Executor changes:
- Removes Client field — executor is now a pure in-memory mutation engine
- Task loop: synchronous tasks advance in sequence without intermediate patches
- failTask is now a void function (in-memory mutations only)
Node controller changes:
- Single statusBase captured after ensureNodeFinalizer
- reconcilePeers returns (bool, error) dirty flag, mutates in-memory
- observeCurrentImage returns (bool, error), mutates in-memory
- Single Status().Patch() at end, gated on statusDirty
- Flushes before returning exec errors (preserves partial progress)
NodeDeployment controller changes:
- reconcilePlan no longer takes statusBase (in-memory mutations)
- completePlan/failPlan are now void (in-memory, no re-read)
- startPlan is now void (in-memory, caller flushes)
Tests need updating to match the new in-memory executor behavior.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* feat: single-patch reconcile model
Both controllers now accumulate all status mutations in-memory and flush
with a single Status().Patch() at the end of Reconcile. This eliminates
optimistic lock conflicts between tasks and the executor, and establishes
a clean ownership model: tasks mutate owned resources, the executor
mutates plan state in-memory, the reconciler flushes once.
Executor changes:
- Removes Client field — pure in-memory mutation engine
- Task loop: synchronous tasks advance in sequence without patches
- advanceTask returns ctrl.Result (no error — failures are in-memory)
- failTask is void (in-memory mutations only)
Node controller changes:
- Single statusBase captured after ensureNodeFinalizer
- reconcilePeers returns (bool, error) dirty flag, mutates in-memory
- observeCurrentImage returns (bool, error), mutates in-memory
- Single Status().Patch() at end, gated on statusDirty
- Flushes before returning exec errors (preserves partial progress)
NodeDeployment controller changes:
- reconcilePlan no longer takes statusBase
- completePlan/failPlan are void (in-memory, no re-read needed)
- startPlan is void (caller flushes)
Test updates:
- Executor unit tests assert against in-memory object (no API re-fetch)
- Integration tests use Reconcile (full pipeline with flush)
- peers_test, reconciler_test assert in-memory mutations
- nodedeployment plan_test asserts in-memory group status
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
* refactor: address PR comments
- Trim verbose strategy comment in Reconcile, add concise method doc
- Log exec error when status flush also fails (don't swallow silently)
- Remove "Task completed synchronously" comment from executor loop
- Use log.FromContext(ctx) instead of log.Log in failTask
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
---------
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
0 commit comments