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
+11 -1
View File
@@ -165,8 +165,13 @@ impl RegistryClient {
}
}
_ = hb.tick() => {
// perimeter_id / private_addr are wired from daemon config
// in NAP-243; NAP-242 lands the protocol field only.
sink.send(Message::Text(serde_json::to_string(
&DaemonOutbound::Heartbeat,
&DaemonOutbound::Heartbeat {
perimeter_id: None,
private_addr: None,
},
)?)).await?;
}
}
@@ -208,6 +213,11 @@ impl RegistryClient {
)?))
.await?;
}
DaemonInbound::ResolveAttachResult { .. } | DaemonInbound::RelaySetup { .. } => {
// Wired by NAP-243 (broker mode). Lands here only so registries
// emitting these messages don't crash older daemons on parse.
tracing::debug!("broker message received but unhandled (NAP-243 pending)");
}
}
Ok(())
}