Module agent_event

Module agent_event 

Source
Expand description

Wire-format types for POST /v1/agent/events (RFC-0005 §4.2).

Lives in nixfleet-proto so the agent (producer) and CP (consumer) share a single canonical definition. Prior to this lift the envelope was hand-built as serde_json::Map on the agent and re-defined as a Rust struct on the CP side; a casing mismatch on the outer rollout_id field was the surface defect that exposed the duplicated-definition shape. Lifted per RFC-0004 §2: any type that crosses the agent <-> CP boundary lives in nixfleet-proto, not in both sides simultaneously.

Wire convention pinned here:

  • Envelope: outer fields are camelCase (hostname, rolloutId, event, optional signature).
  • Inner event: tag = "kind" (PascalCase variants) + camelCase field names for the variant payloads.
  • Probe-status / probe-mode / on-health-failure: keep their historic wire shapes (lowercase, kebab-case, kebab-case).

Conversions to nixfleet_state_machine types live in that crate (orphan rule); this module defines the wire surface only.

Structs§

AgentEventEnvelope
Outer envelope agents POST to /v1/agent/events.
ProbeSubResultWire
ProbeTopologyEntryWire

Enums§

AgentEvent
Inbound agent events. Mirrors the wire side of nixfleet_state_machine::OutboundAgentEvent (same variant names, camelCase fields per RFC-0005 §4.2).
OnHealthFailureWire
ProbeModeWire
ProbeStatusWire