Skip to content

feat(orchestrator): sleeping-node interview via PendingQueue (closes #203)#228

Merged
Assar63 merged 1 commit into
masterfrom
feat/sleeping-node-interview
Jun 27, 2026
Merged

feat(orchestrator): sleeping-node interview via PendingQueue (closes #203)#228
Assar63 merged 1 commit into
masterfrom
feat/sleeping-node-interview

Conversation

@Assar63

@Assar63 Assar63 commented Jun 27, 2026

Copy link
Copy Markdown
Owner

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 a WAKE_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, 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.

Changes

  • Sleeping detection: NIF contains CC 0x84Session.viaQueue.
  • beginInterview enqueues 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).
  • Secure sleeping nodes still defer until NodeSecurityStatus, then enqueue.

MVP limit

The Gets all drain in one wake window (PendingQueue::drain pops 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 drive NodeInterviewComplete. Full suite 483/483 on both gnu and llvm; clang-tidy + clang-format clean.

#203 status

This closes #203 (bar hardware verification under #189): the orchestrator, the InclusionOrchestrator policy-step gate on NodeInterviewComplete, and identity (schema v4) + capabilities (schema v5) persistence all landed in earlier PRs.

🤖 Generated with Claude Code

…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>
@Assar63 Assar63 merged commit 19cc0ce into master Jun 27, 2026
4 checks passed
@Assar63 Assar63 deleted the feat/sleeping-node-interview branch June 27, 2026 19:01
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.

Node interview (introspection) orchestrator

1 participant