feat(orchestrator): sleeping-node interview via PendingQueue (closes #203)#228
Merged
Conversation
…203) A battery node advertises Wake Up (CC 0x84) and is awake only briefly after a WAKE_UP_NOTIFICATION, so sending the interview Gets live races it back to sleep. Instead, the InterviewOrchestrator now enqueues the whole {COMMAND_CLASS, *_GET} sequence into PendingQueue up front; WakeUpOrchestrator drains it on the next wake-up and the typed reports flow back during that window, driving advance()/completion exactly as for an always-on node. - Sleeping detection: NIF contains CC 0x84 -> Session.viaQueue. - beginInterview enqueues every step's Get payload (built from the same manifest constants the codecs' encodeGet() use) at PRIORITY_NORMAL; advance() then only tracks reports (it doesn't send the next Get live). - MVP limit: the Gets all drain in one wake window; an unanswered Get is not retried. - Test: a Wake-Up node queues all four Gets (none sent live) and the reports drive NodeInterviewComplete. This was the last #203 layer — identity (schema v4) + capabilities (schema v5) persistence and the InclusionOrchestrator policy-step gate already landed. Hardware verification remains under #189. 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.
Summary
The final #203 layer: interview sleeping (battery) nodes by enqueuing the Gets and running them on the next wake-up.
A battery node advertises Wake Up (CC
0x84) in its NIF and is awake only briefly after aWAKE_UP_NOTIFICATION. Sending the interview Gets live races the node back to sleep (WakeUpOrchestrator nudges it to sleep right after draining). So instead of sending live,InterviewOrchestratornow enqueues the whole{COMMAND_CLASS, *_GET}sequence intoPendingQueueup front;WakeUpOrchestratordrains it on the next wake-up and the typed reports flow back during that window, drivingadvance()/completion exactly as for an always-on node.Changes
0x84→Session.viaQueue.beginInterviewenqueues every step's Get payload (PRIORITY_NORMAL), built from the same generated manifest constants the codecs'encodeGet()use, so a queued payload matches exactly what ProtocolThread would have sent live.advance()for a queued session only tracks reports — it does not send the next Get live (they're all already queued).NodeSecurityStatus, then enqueue.MVP limit
The Gets all drain in one wake window (
PendingQueue::drainpops the lot); an unanswered Get is not retried. Documented in the source + CLAUDE.md, consistent with the orchestrator's existing "no inactivity timeout" stance.Tests
New
SleepingNodeQueuesGetsForWakeUp: a Wake-Up node queues all four Gets (none sent live), and the reports driveNodeInterviewComplete. Full suite 483/483 on bothgnuandllvm; clang-tidy + clang-format clean.#203 status
This closes #203 (bar hardware verification under #189): the orchestrator, the
InclusionOrchestratorpolicy-step gate onNodeInterviewComplete, and identity (schema v4) + capabilities (schema v5) persistence all landed in earlier PRs.🤖 Generated with Claude Code