pub struct ResultSchemaV1 {
pub ok: bool,
pub status: String,
pub latency_ms: u64,
pub bytes: u64,
pub capability_digest: String,
pub commit: String,
pub layer: String,
pub name: String,
pub mode: String,
pub exp_id: String,
pub idem_key: String,
pub x_meta: HashMap<String, Value>,
}Expand description
Locked Result Schema v1 - These fields are immutable
Any changes to these fields require a MAJOR version bump.
New fields can only be added to x_meta for extensibility.
Fields§
§ok: boolExecution success indicator - LOCKED FIELD
status: StringHuman-readable status description - LOCKED FIELD
latency_ms: u64Execution latency in milliseconds - LOCKED FIELD
bytes: u64Number of bytes processed/returned - LOCKED FIELD
capability_digest: StringCapability bundle digest used for execution - LOCKED FIELD
commit: StringGit commit hash of executor version - LOCKED FIELD
layer: StringExecution layer (atom/macro/playbook) - LOCKED FIELD
name: StringCapability or component name - LOCKED FIELD
mode: StringExecution mode (strict/explore/shadow) - LOCKED FIELD
exp_id: StringExperiment ID for A/B testing - LOCKED FIELD
idem_key: StringIdempotency key for duplicate prevention - LOCKED FIELD
x_meta: HashMap<String, Value>Extension metadata - ONLY place for new fields - LOCKED FIELD New fields MUST be added here, not as top-level fields
Implementations§
Source§impl ResultSchemaV1
impl ResultSchemaV1
Sourcepub fn new(
ok: bool,
status: String,
latency_ms: u64,
bytes: u64,
capability_digest: String,
commit: String,
layer: String,
name: String,
mode: String,
exp_id: String,
idem_key: String,
) -> Self
pub fn new( ok: bool, status: String, latency_ms: u64, bytes: u64, capability_digest: String, commit: String, layer: String, name: String, mode: String, exp_id: String, idem_key: String, ) -> Self
Create a new result with required fields
Sourcepub fn with_meta(self, key: String, value: Value) -> Self
pub fn with_meta(self, key: String, value: Value) -> Self
Add extension metadata (only way to extend schema)
Sourcepub fn validate(&self) -> Result<(), ResultSchemaError>
pub fn validate(&self) -> Result<(), ResultSchemaError>
Validate schema compliance
Trait Implementations§
Source§impl Clone for ResultSchemaV1
impl Clone for ResultSchemaV1
Source§fn clone(&self) -> ResultSchemaV1
fn clone(&self) -> ResultSchemaV1
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more