feat(maestro): registry relays Forward{Create,Kill} RPC for cross-daemon ops (NAP-327)

Adds the home-daemon → registry control-link RPC that brokers a cross-daemon
session create/kill without putting any session bytes on the registry: the
owning daemon still does the tmux spawn, the registry just relays request and
reply.

- protocol: `DaemonOutbound::{ForwardCreate,ForwardKill}` +
  `DaemonInbound::{ForwardCreateResult,ForwardKillResult}` (+ round-trip tests).
- registry: `Registry::{forward_create,forward_kill}` reuse the existing
  `create_session`/`kill_session` R→D machinery and route the reply back to the
  home daemon; transport faults map to stable `ErrorInfo` codes. Wired into the
  `WS /daemon` dispatch.

Next: daemon-side broker handle + local_api wiring.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-06-15 16:21:11 +00:00
co-authored by Claude Opus 4.8
parent f11c75a4fd
commit daeacc750f
3 changed files with 298 additions and 0 deletions
+14
View File
@@ -211,6 +211,20 @@ async fn dispatch_text(
.resolve_attach(daemon_id, reply_to, session_id, shared_secret)
.await;
}
DaemonOutbound::ForwardCreate { reply_to, request } => {
// Relay the create to its owning daemon and route the reply back to
// this (home) daemon — control-plane only (NAP-327).
registry.forward_create(daemon_id, reply_to, request).await;
}
DaemonOutbound::ForwardKill {
reply_to,
daemon_id: target,
id,
} => {
registry
.forward_kill(daemon_id, reply_to, &target, id)
.await;
}
DaemonOutbound::RelayAck { reply_to, .. } => {
// T3 (relay) is gated on NAP-238. Land the variant so newer daemons
// don't crash the connection; the registry doesn't act on it yet.