Task layer Increment 2b: capacity admission + RemoveNodeFromGroup - #4038
Merged
Conversation
…roup on many endpoints
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…o invariant Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Prettier import ordering regressed when relative harness imports were repointed to @matter/node/testing during the main->node-manager merge. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…he, not fallback Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ssion GroupMembershipItemKind.capacity counts distinct groups (groupTable length) against maxGroupsPerFabric, but admission counts per-endpoint membership keys (groupId:endpoint). Joining an already-mapped group on a new endpoint at the group-count limit would false-reject a valid operation. The group slot is already gated by GroupKeyMapItemKind; add ItemKind.excludeFromAdmission so a kind whose capacity counts a coarser resource opts out of admission while still serving the reconciler. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Contributor
|
Tick the box to add this pull request to the merge queue (same as
|
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.
Sub-PR into
node-manager(umbrella PR #3948 carries CI). Increment 2b of the imperative Task layer — capacity admission + removal. Completes Increment 2 (2a = rollback-safety core, merged via #3997).Spec:
docs/superpowers/specs/2026-06-26-node-manager-task-layer-2-design.md(sections C, D, membership key).What lands
endpointGroupMembershipintent key becomesgroupId:endpoint(via a sharedmembershipKey()helper), andAddNodeToGroup.idForgains:endpoint, so one peer can join a group on multiple endpoints.GroupMembershipItemKindandgroupKeyMap.isReferencedread the intent body (not the key), so the shared-entry refcount cascade is unaffected.Task.plannedChanges()declares the intents a task will create;TaskManagerBehavior.#admitruns before any node is touched and rejects the whole task withTaskCapacityExceededErrorif any(node, kind)would overflow. A rejected task endsfailedwith an empty changeset (no revert).RemoveNodeFromGroup— the inverse task: removes membership, then the group→key-set map, then the key set, each only while no other group still references it (removeIntentIfUnreferenced, dependents-first). Records its own changeset so a cancel restores the group.ItemKind.excludeFromAdmission— a kind whosecapacitycounts a coarser resource than its per-item key (per-endpoint membership vs per-group limit) opts out of admission so it is not double-counted; the group slot is gated bygroupKeyMap.capacitystill serves the reconciler.@matter/node/testingduring the main→node-manager merge (fixes thecheck-and-lintfailure on [WIP] Node Manager: desired-state, reconciliation & multi-step tasks #3948).Tests / gate
maxGroupsPerFabric: 4, saturated, extra add rejected).build --clean✓ ·format-verify✓ ·lint✓ · node-manager 126/126 · node 1329/1329.Follow-ups (non-blocking)
isMember/itemState/awaitState) into one module (currently duplicated across Add/Remove integration files).PlannedChange.intentis unused at branch scope (kept for forward use); dedupe the intent literals betweenplannedChanges()and the provision phase.revertOfinto the task at creation; narrow aReconcilerSurfaceinterface to drop test casts.🤖 Generated with Claude Code