feat(node-manager): Task runtime core + AddNodeToGroup (Task layer increment 1)#3984
Merged
Conversation
…, driver) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…letion Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
… park/resume) Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
…uccess Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Add the AddNodeToGroup task that provisions a peer endpoint into a group (groupKey + groupKeyMap + endpointGroupMembership), registered as a builtin. Fix the gate to park (not fail) when a peer is unreachable at gate entry: TaskContextImpl#evaluate now skips the unguarded reconcile for unreachable peers so the predicate stays unsatisfied and the gate waits for the reachability wake. Defer the persisted-task resume pass until the node is online so a builtin task resuming on a fresh node does not act before initialization completes. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
…tImpl->RunningTaskContext Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
First increment of the imperative, persisted, resumable Task layer on top of the reconciler. A Task orchestrates a multi-step, multi-node change by writing tier-1 desired-state intent and waiting on convergence gates — it never touches nodes directly; only the Reconciler does. Durable state is minimal, so tasks are restart-safe and offline-tolerant.
What
TaskManagerBehavior— opt-in on the ServerNode root, attached via dynamicbehaviors.require(ReconcilerBehavior)(no static.with; TaskManager pulls the Reconciler in itself). Registry (type → Taskctor),run(type, params, {externalId?})(synchronous handle, internal deterministic id → idempotent re-issue),get/tasks/cancel, nonvolatile persistence ({type, params, phaseIndex, state, externalId?, addLog}), startup + on-register + on-online resume.TaskContext— two node-affecting verbs (setIntent/removeIntent, creates recorded into an add-log) +awaitGate(nodes, until)/awaitCommitted(items). Gates verify-reconcile the targeted peers, evaluate a predicate over theirDesiredStateBehavioritems, and suspend via per-gateObserverGroupsubscriptions (cross-peer →ObserverGroup, notreactTo) until it holds — parking while a node is unreachable, resuming on the reachability wake. Coalesced, abort-safe, no voided promises.phaseIndex, re-run (phases re-entrant:setIntentupserts, gates re-read).deletePending, gate on removal →cancelled; offline peer ⇒ parks; terminal revert error ⇒cancelFailed(reserved). Aborts an in-flight gate cleanly (cancelled, notfailed).AddNodeToGroup— concrete task: provisionsgroupKey+groupKeyMap+endpointGroupMembershipintents (converge; priority bands order keyset→group→membership), gates until all committed.Scope
Increment 1 of 3. Add-log only — the full prior-state changeset + automatic hard-failure rollback + multi-node pre-flight admission +
RemoveNodeFromGroupare increment 2;ipkkind +RotateGroupKey+ 2-node rotation harness are increment 3.Tests
OnOffLightSwitchDevice.with(GroupsServer)): happy → member; park/resume; cancel → removed; restart-resume (real close + recreate-by-id → resumes to completed). All assert real devicegroupTablestate.Gates
build --clean ✓ · format ✓ · lint ✓ · node-manager 92/92 · node 1231/1231 (no regression). Per-task + whole-branch review: zero Critical/Important.
Base =
node-manager(sub-PR; CI runs on umbrella #3948 → main).🤖 Generated with Claude Code