pub struct ArtifactContract {
pub kind: String,
pub max_bytes: Option<u64>,
pub schema: Option<Value>,
}Expand description
The artifact contract of a TaskEnvelope: what the recipient is
expected to produce and the sender to consume.
v1 carries a kind identifier and an optional size bound only — enough
for the recipient to know it is producing the right shape of artifact
and for the queue to refuse to store an out-of-contract result. R0.7
(Agent Fabric wave 1) adds the optional schema field — additive with a
serde default, omitted from the wire when unset, so pre-R0.7 contracts
and readers see no shape change.
Fields§
§kind: StringArtifact kind identifier — a media type (application/json), a
schema URI, or an application-defined kind name. Interpreted by the
sender and recipient; the queue treats it as opaque.
max_bytes: Option<u64>Upper bound on the serialized artifact size in bytes. None means
unbounded within the queue’s own storage limits.
schema: Option<Value>Optional JSON Schema (draft 2020-12, per the design’s open-questions
default) the artifact payload must validate against (R0.7). Declared
on the contract so an unacceptable message can fail fast as
ErrorClass::InvalidInput at submission — never retried — instead
of dead-lettering after the attempt budget is spent. None means
kind-and-size checking only, exactly the pre-R0.7 semantics.
Wave 1 pins the field’s shape (stored and golden-tested); payload validation against it is wired at the mailbox submission path in a later wave — the schema dialect constraint (design open question 5) settles first.