Skip to main content

Module validate

Module validate 

Source
Expand description

Shape validators for WorkloadSpec.

Called by clients (desktop, agent, CLI) before sending a spec over RPC. Sync, no I/O. Returns Ok(warnings) on pass or Err(ShapeError) on the first hard constraint violation.

Layers: shape (this file, no I/O) → semantic (yubaba-side, R090-F3) → environment (deploy-time, R090-F4).

Structs§

ContextError
Transient error from a ValidationContext lookup.
ShapeWarning
A soft check that passed but may indicate misconfiguration.

Enums§

FieldPath
Identifies the field that caused a shape error or warning.
MeshError
Failure surface for MeshResolver lookups.
SemanticError
A semantic constraint violation: the spec references a resource that is not known to the cluster at validation time.
ShapeError
A hard constraint violation that makes a spec impossible to deploy.
WorkloadValidationError
Top-level validation error spanning both shape and semantic layers.

Constants§

DEFAULT_PORT_NAME
The port name a peer’s sole/default listener carries. Agrees with kamaji::DEFAULT_PORT_NAME by convention rather than by import: kamaji sits above workload-spec in the publish DAG (yah-base <- {qed,kamaji} <- yubaba), so depending on it here would invert the graph. The two are pinned together by default_port_name_agrees_with_the_supervisor in this file’s tests.

Traits§

MeshResolver
Resolve crate::EnvValue::FromMesh references to literal env values.
ValidationContext
Read-only view of yubaba state used for semantic validation.

Functions§

all
Run shape then semantic validation in the correct order.
resolve_env_from_mesh
Render every EnvValue::FromMesh entry in env to a EnvValue::Literal using resolver; pass through Literal and FromSecret values unchanged.
select_mesh_port
Pick the port a MeshLookup refers to out of a peer’s name -> port map (R844-B22) — the one place the rule lives, so every resolver answers the same way.
semantic
Run semantic validation — requires yubaba state via ValidationContext.
shape
Run shape validation — sync, no I/O.
shape_static_asset
Shape-validate a kind = "static-asset" workload.