feat(orchestrator): gate inclusion policy on NodeInterviewComplete (part of #203)#225
Merged
Merged
Conversation
…art of #203) The InclusionOrchestrator policy step now waits for the interview. Previously it applied effectivePolicy on NodeIncluded — but the device identity triple PolicyRegister keys device-level defaults on isn't known until the interview (#203) gathers it, so device defaults silently never matched. Split the orchestrator: - onNodeIncluded keeps the lifeline (the node needs the controller in group 1 early, before its reports) and caches the node's supported-CC set; - onNodeInterviewComplete runs the policy step — effectivePolicy (now with device identity known, so device defaults match) merged + applied, gated on the cached supported CCs — then InclusionPolicyApplied + InclusionComplete. Post-inclusion order is now SecurityBootstrap → Interview → Policy. Updated the 5 InclusionOrchestrator tests to publish NodeInterviewComplete after NodeIncluded; the emitted sequence is unchanged (dispatch is synchronous). 474/474 ctest green on gnu + llvm; clang-format + clang-tidy clean. Remaining #203: persist the gathered identity into node-registry; sleeping-node interview via PendingQueue. Co-Authored-By: Claude Opus 4.8 <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.
Turns "identity is now known" (from the interview, #224) into "device-default policy actually applies" — the original motivation for #203.
Problem
InclusionOrchestratorappliedeffectivePolicyonNodeIncluded, but the(manufacturerId, productTypeId, productId)triple thatPolicyRegisterkeys device-level defaults on isn't known until the interview gathers it. So device defaults silently never matched at inclusion — only per-node overrides did.Change
Split the orchestrator across the two events:
onNodeIncluded— keeps the lifeline (the node needs the controller in group 1 early, before it reports) and caches the supported-CC set.onNodeInterviewComplete— runs the policy step:effectivePolicy(now with device identity known → device defaults match) merged with the per-node override, applied gated on the cached supported CCs, thenInclusionPolicyApplied+InclusionComplete.Post-inclusion order is now explicit: SecurityBootstrap → Interview → Policy.
Tests
The 5 existing InclusionOrchestrator tests now publish
NodeInterviewCompleteafterNodeIncluded; the emitted command/event sequence is unchanged (bus dispatch is synchronous, so the policy events still land right after the lifeline). 474/474 ctest green on both gnu and llvm; clang-format + clang-tidy clean.Note / trade-off
Policy now waits for the interview to complete. A node that never answers the interview Gets won't get auto-policy (it's barely functional anyway) — the issue's accepted design. The interview runs for every included node (#224), so in the common case policy applies as before, just after identity is known.
Remaining #203
PendingQueue.Part of #203.
🤖 Generated with Claude Code