Expand description
RFC-004 Tier-1 — connection health probing.
A wire ping sends a probe; the peer’s daemon auto-responds with a
probe_ack — no LLM / MCP in the loop (RFC-004 AC-HP2 kill criterion). Both
ride the existing kind=100 heartbeat carrier with a body t discriminator
(probe / probe_ack), NOT a new top-level kind — per the event-kind-carrier
rule (control signals discriminate on a registered generic kind’s body).
Probes are plaintext (they carry only a correlation nonce, no secret), so
the receiving daemon reads t directly without decrypting. They are
trust-neutral: a probe/ack never mutates a peer’s tier or relay state.
Constants§
- HEARTBEAT_
KIND - The heartbeat carrier kind (registered, special-cased Ephemeral in signing).
- HEARTBEAT_
TYPE - The event
typestring paired withHEARTBEAT_KIND.
Functions§
- is_
probe_ ack_ for - True iff
eventis a kind=100 probe_ack carryingnonce— the ack a waitingwire pingis looking for. - probe_
ack_ body - Body of a probe_ack answering the probe carrying
nonce. - probe_
body - Body of an outbound probe.
noncecorrelates the ack. - probe_
nonce - If
eventis a kind=100 probe, return its correlation nonce — the signal the daemon uses to decide whether to auto-respond. An event that is heartbeat-kind but carries an unknown/othert(or a sealed body) returnsNone: it is simply ignored, cursor advances, no reject (RFC-004 AC-HP4). - record_
ack_ within_ rate - Per-peer ack rate gate (RFC-004 AC-HP3 — a 100-probe flood must yield ≤ a
handful of acks, bounded responder CPU). Prunes
timesto the window, then:>= maxremaining → refuse the ack (false); else recordnowand allow (true). Same sliding-window shape as the relay’s intro gate. Pure → unit-tested. The daemon holdstimesper peer in a process-static map. - respond_
to_ probes - Daemon-side auto-respond to verified inbound probes (RFC-004 AC-HP2 — no LLM
in the loop). For each
(peer, nonce), build+sign a probe_ack and deliver it, rate-limited per peer (AC-HP3). Best-effort: one peer’s failure never aborts the rest, and never blocks the pull cycle. - send_
probe - Send a probe to
peer(synchronous delivery). The caller then waits for the matching probe_ack to land in the inbox.