pub enum BrokerMessage {
Status {
agent_id: String,
payload: StatusPayload,
},
Artifact {
agent_id: String,
payload: ArtifactPayload,
},
Blocked {
agent_id: String,
payload: BlockedPayload,
},
Verified {
agent_id: String,
payload: VerifiedPayload,
},
Feedback {
agent_id: String,
payload: FeedbackPayload,
},
Question {
agent_id: String,
payload: QuestionPayload,
},
Intent {
agent_id: String,
payload: IntentPayload,
},
AdvancedMain {
payload: AdvancedMainPayload,
},
Learning {
payload: LearningPayload,
},
VerifyNow {
branch_id: String,
},
}Expand description
Envelope for all inter-agent messages.
The wire format uses JSON with an internally tagged "type" discriminator
whose values are "agent.status", "agent.artifact", "agent.blocked",
"agent.verified", "agent.feedback", "agent.question", "agent.intent",
"agent.advanced-main", "agent.learning", and "supervisor.verify-now".
The last is broker-emitted rather than agent-published; see
BrokerMessage::VerifyNow.
Eq is intentionally not derived: the agent.learning payload carries a
serde_json::Value body, which is PartialEq but not Eq.
Variants§
Status
Status heartbeat – not routed to inboxes.
Fields
payload: StatusPayloadStatus payload.
Artifact
Artifact announcement – broadcast to all peers.
Blocked
Blocked notification – sent to the target agent.
Fields
payload: BlockedPayloadBlocked payload (contains from – the unblocking agent).
Verified
Verification acknowledgement – broadcast to all peers.
Fields
payload: VerifiedPayloadVerified payload (contains verified_by – the sender).
Feedback
Feedback from a verifier – delivered to the target agent only.
Fields
payload: FeedbackPayloadFeedback payload (contains from – the sender).
Question
Agent question – delivered to the "supervisor" inbox for human reply.
Fields
payload: QuestionPayloadQuestion payload.
Intent
Intent announcement – broadcast to every other registered agent’s inbox.
Lets peers (and the broker conflict detector) see which files an agent is about to modify before any commit lands.
Fields
payload: IntentPayloadIntent payload.
AdvancedMain
Main-advanced notification – published by the supervisor after a successful merge to the default branch, broadcast to every registered agent’s inbox so dependents learn the base moved.
The payload is flattened into the envelope (its fields sit at the top
level alongside "type", not nested under a payload key) so the
wire shape matches the curl example the supervisor skill teaches. The
sender identity is the payload’s from field (typically
"supervisor"), surfaced through BrokerMessage::agent_id.
Fields
payload: AdvancedMainPayloadFlattened advanced-main payload (from, merged_branch,
new_main_sha, base, merged_at, optional summary).
Learning
Structured learning record – published by the broker’s learnings
aggregator when [supervisor] learnings = true and broker publish is
active (see crate::broker::learnings). Carries a deterministic
dedup id so consumers can collapse re-emissions. Routed to the
scoped branch_id inbox when present, otherwise the supervisor inbox;
always retained in the broker message log. The variant is additive –
existing consumers ignore unknown types per the broker-messages
contract.
Fields
payload: LearningPayloadLearning payload (carries its own agent_id).
VerifyNow
Supervisor verification nudge – emitted by the broker (not by an
agent) when an agent.artifact { status: "committed" } arrives and
[supervisor].verify_on_commit_nudge is enabled. Delivered to the
"supervisor" inbox so per-commit verification is triggered by an
explicit event rather than relying on the supervisor’s sweep cadence
to notice the commit.
Unlike the agent.* variants this carries a branch_id directly
(the committing branch) rather than a sender agent_id plus a payload
– the message originates from the broker itself, so there is no
publishing agent.
Implementations§
Source§impl BrokerMessage
impl BrokerMessage
Sourcepub fn from_json(input: &str) -> Result<Self, MessageError>
pub fn from_json(input: &str) -> Result<Self, MessageError>
Deserializes and validates a broker message from a JSON string.
Returns MessageError if the JSON is malformed or the agent_id is
invalid.
Sourcepub fn status_label(&self) -> &str
pub fn status_label(&self) -> &str
Returns a short status label for the message.
Statusreturnspayload.status(e.g."working")Artifactreturnspayload.status(e.g."done")Blockedreturns"blocked"Verifiedreturns"verified"Feedbackreturns"feedback"Questionreturns"question"Intentreturns"intent"AdvancedMainreturns"advanced-main"VerifyNowreturns"verify-now"
Trait Implementations§
Source§impl Clone for BrokerMessage
impl Clone for BrokerMessage
Source§fn clone(&self) -> BrokerMessage
fn clone(&self) -> BrokerMessage
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for BrokerMessage
impl Debug for BrokerMessage
Source§impl<'de> Deserialize<'de> for BrokerMessage
impl<'de> Deserialize<'de> for BrokerMessage
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Display for BrokerMessage
impl Display for BrokerMessage
Source§impl From<&LearningRecord> for BrokerMessage
impl From<&LearningRecord> for BrokerMessage
Source§fn from(record: &LearningRecord) -> Self
fn from(record: &LearningRecord) -> Self
Source§impl PartialEq for BrokerMessage
impl PartialEq for BrokerMessage
Source§fn eq(&self, other: &BrokerMessage) -> bool
fn eq(&self, other: &BrokerMessage) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for BrokerMessage
impl Serialize for BrokerMessage
impl StructuralPartialEq for BrokerMessage
Auto Trait Implementations§
impl Freeze for BrokerMessage
impl RefUnwindSafe for BrokerMessage
impl Send for BrokerMessage
impl Sync for BrokerMessage
impl Unpin for BrokerMessage
impl UnsafeUnpin for BrokerMessage
impl UnwindSafe for BrokerMessage
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<A, B, T> HttpServerConnExec<A, B> for Twhere
B: Body,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§impl<T> ToCompactString for Twhere
T: Display,
impl<T> ToCompactString for Twhere
T: Display,
Source§fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
fn try_to_compact_string(&self) -> Result<CompactString, ToCompactStringError>
ToCompactString::to_compact_string() Read moreSource§fn to_compact_string(&self) -> CompactString
fn to_compact_string(&self) -> CompactString
CompactString. Read more