Skip to main content

validate

Function validate 

Source
pub fn validate(config: &PipelineConfig) -> Result<(), Vec<ConfigError>>
Expand description

Validate all semantic constraints on a PipelineConfig.

Collects every violation before returning so the caller sees the full scope of issues at once.

§Arguments

  • config — The parsed config to validate.

§Returns

  • Ok(()) if all constraints pass.
  • Err(Vec<ConfigError>) with every violation found.

§Errors

Returns Err(Vec<ConfigError>) containing one ConfigError::InvalidField entry per violated rule. The possible violations are:

  • resilience.retry_base_ms > resilience.retry_max_ms
  • resilience.retry_attempts == 0
  • resilience.circuit_breaker_success_rate outside [0.0, 1.0]
  • resilience.circuit_breaker_threshold == 0
  • resilience.circuit_breaker_timeout_s == 0
  • stages.inference.temperature outside [0.0, 2.0] (when Some)
  • stages.inference.model is blank or whitespace-only
  • pipeline.name is blank or whitespace-only
  • pipeline.version is blank or whitespace-only
  • stages.rag.timeout_ms == 0 when RAG is enabled
  • stages.rag.max_context_tokens == 0 when RAG is enabled
  • stages.rag.channel_capacity == Some(0)
  • stages.assemble.channel_capacity == 0
  • stages.post_process.channel_capacity == 0
  • stages.stream.channel_capacity == 0
  • deduplication.window_s == 0 when deduplication is enabled
  • deduplication.max_entries == 0 when deduplication is enabled
  • observability.metrics_port == Some(0)

§Panics

This function never panics.