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:
@@ -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(())
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user