feat(maestro): extend Heartbeat with perimeter_id + private_addr (NAP-242)

Convert DaemonOutbound::Heartbeat from unit to struct variant with two
optional fields advertising the daemon's T2 reachability. Old payloads
({"type":"Heartbeat"} with no fields) still parse — both fields default
to None — and a new daemon that doesn't populate them serializes back to
the same minimal shape.

Update the daemon's heartbeat ticker and the registry's match arm to the
new shape. Population from daemon config + registry persistence lands
with the broker logic in NAP-243.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-05-26 17:46:05 +00:00
co-authored by Claude Opus 4.7
parent f0510a5996
commit 9a8109559b
3 changed files with 81 additions and 4 deletions
+9 -1
View File
@@ -139,8 +139,10 @@ async fn dispatch_text(registry: &Registry, daemon_id: &str, text: &str) -> bool
DaemonOutbound::SessionUpdated { session } => {
registry.update_session(daemon_id, session).await;
}
DaemonOutbound::Heartbeat => {
DaemonOutbound::Heartbeat { .. } => {
// Per-read timeout above is the heartbeat watchdog; no extra work.
// perimeter_id / private_addr advertised here are persisted by
// NAP-243 for the T2 transport.
}
DaemonOutbound::CreateSessionResult { reply_to, result } => {
registry.complete_create(reply_to, result).await;
@@ -148,6 +150,12 @@ async fn dispatch_text(registry: &Registry, daemon_id: &str, text: &str) -> bool
DaemonOutbound::KillSessionResult { reply_to, result } => {
registry.complete_kill(reply_to, result).await;
}
DaemonOutbound::ResolveAttach { reply_to, .. }
| DaemonOutbound::RelayAck { reply_to, .. } => {
// Handled by NAP-243 (broker mode); type already lands here so old
// daemons sending it don't kill the connection on parse failure.
tracing::debug!(%daemon_id, ?reply_to, "broker message received but unhandled (NAP-243 pending)");
}
}
true
}