Skip to content

feat(orchestrator): gate inclusion policy on NodeInterviewComplete (part of #203)#225

Merged
Assar63 merged 1 commit into
masterfrom
feat/inclusion-policy-after-interview
Jun 18, 2026
Merged

feat(orchestrator): gate inclusion policy on NodeInterviewComplete (part of #203)#225
Assar63 merged 1 commit into
masterfrom
feat/inclusion-policy-after-interview

Conversation

@Assar63

@Assar63 Assar63 commented Jun 18, 2026

Copy link
Copy Markdown
Owner

Turns "identity is now known" (from the interview, #224) into "device-default policy actually applies" — the original motivation for #203.

Problem

InclusionOrchestrator applied effectivePolicy on NodeIncluded, but the (manufacturerId, productTypeId, productId) triple that PolicyRegister keys 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, then InclusionPolicyApplied + InclusionComplete.

Post-inclusion order is now explicit: SecurityBootstrap → Interview → Policy.

Tests

The 5 existing InclusionOrchestrator tests now publish NodeInterviewComplete after NodeIncluded; 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

  • persist the gathered identity into node-registry (console / Node info window #45 display);
  • sleeping-node interview via PendingQueue.

Part of #203.

🤖 Generated with Claude Code

…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>
@Assar63 Assar63 merged commit a7f43fc into master Jun 18, 2026
3 checks passed
@Assar63 Assar63 deleted the feat/inclusion-policy-after-interview branch June 18, 2026 05:46
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant