Repository navigation
✨ hub: heartbeat feature negotiation - #19239
Conversation
A spoke may send protocol: {version, features} in its heartbeat; with
HIVE_HUB_HEARTBEAT_PROTOCOL on the hub answers with the accepted and
ignored features. Additive and default off: a heartbeat without protocol
is answered exactly as before.
Refs #19056
Closes #19237
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: scanner <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Open PR overlap checkBase branch: Conflicts are checked with every PR merged onto the current tip of
|
Mutation testinggremlins found 2 surviving mutant(s) in changed files: the code ran under tests, but changing it did not fail any test.
13 mutant(s) in changed files are not reached by any test (NOT COVERED). A maintainer may apply the
Verdict: |
There was a problem hiding this comment.
Decision needed: @clubanderson should confirm that adding Protocol to the heartbeat response fence as heartbeatFieldAllowed is acceptable, since that map is the self-service credential fence.
The negotiation code reads correct to me; the only open item is the fence allowlist entry, which is a trust-surface file a person should sign off.
Read heartbeat_protocol.go and the call site at server.go:2898. heartbeatProtocolAckFor returns nil when the flag is off or no offer is sent, so the response is unchanged in both cases. Feature names are validated (charset, 64 bytes) and capped at 32 echoed, so malformed input is dropped rather than echoed. The ack carries only a version and names from a fixed three-entry map, no secret or instruction, which matches the "allowed" classification at heartbeat_selfservice_fence.go:66. The tests cover accepted/ignored, version below 1, newer version, bounds and malformed names.
-- hive: agent=reviewer backend=claude model=claude-sonnet-5-5 claude=2.1.328
A spoke has no way to learn which optional heartbeat features a hub honours except by inferring from the hub's version, which breaks as soon as hubs and spokes roll out independently. This is step 5 of the registration protocol rollout (#19056): the spoke may offer
protocol: {version, features}and, withHIVE_HUB_HEARTBEAT_PROTOCOLon (default off, read per request), the hub answersprotocol: {version, accepted, ignored}.It is additive and informational: a heartbeat without
protocol, or any heartbeat while the flag is off, gets exactly today's response, and an accepted feature is only one the hub already serves (activity_digest,activity_events,host_aliases). A version below 1 is still accepted, with every feature ignored andunsupported_versionechoed; a newer version is answered with the hub's version so the spoke can fall back. Feature names are bounded (32 per beat, 64 bytes, restricted charset) and malformed ones are not echoed. The ack is classified as allowed in the self-service credential fence since it carries no secret or instruction.Tests cover accepted vs ignored features, an absent field leaving the response unchanged, the flag off, unknown and newer versions, and bounds. The spoke-side sender is left for a follow-up so this PR stays hub-only.
Closes #19237
🤖 Generated with Claude Code
-- hive: agent=scanner backend=claude model=claude-sonnet-5-5 claude=2.1.328