refactor(node): read Reconcile as a step list; extract hold predicates#494
refactor(node): read Reconcile as a step list; extract hold predicates#494bdchatham wants to merge 1 commit into
Conversation
Behavior-preserving readability refactor of SeiNodeReconciler.Reconcile so the body reads as a sequence of named steps instead of prose-annotated orchestration. The two inline hold predicates become named methods that carry their rationale as doc comments: - holdInitialSTS RHS -> shouldHoldInitialStatefulSet(node) (statefulset.go) - holdForWorkflow RHS -> adoptedWorkflowIsExecuting(node) (workflow.go) The StateSyncReady-ordering invariant is kept (trimmed) at its call site; the status-snapshot bundle and the two flush-and-return exits are left inline by design. No control-flow change; node+planner tests pass unchanged. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
PR SummaryLow Risk Overview
The StateSyncReady ordering note at the gate call site is shortened; no sequencing or control-flow change. Reviewed by Cursor Bugbot for commit 3d34a68. Bugbot is set up for automated code reviews on this repo. Configure here. |
Behavior-preserving readability refactor of
SeiNodeReconciler.Reconcile— it now reads as a sequence of named steps rather than prose-annotated orchestration.What changed (structure + comment placement only)
holdInitialSTSRHS →shouldHoldInitialStatefulSet(node)(statefulset.go, next toreconcileStatefulSet)holdForWorkflowRHS →adoptedWorkflowIsExecuting(node)(workflow.go, next toadoptedWorkflowParkedFailed)StateSyncReady-ordering invariant at its call site (trimmed 7→4 lines) — it's a sequencing dependency not visible from call order.reconcileWorkflow's existing signature for zero gain) and the two flush-and-return exits (distinct error-wrap strings a shared helper would blur).Behavior
No control-flow change. The
if !holdInitialSTS && !holdForWorkflowguard is byte-identical (the locals are kept as the readable step names). Existinginternal/controller/node+internal/plannertests pass unchanged — the behavior-preservation proof.gofmt/vet/buildclean.🤖 Generated with Claude Code