Skip to main content

Module validation

Module validation 

Source
Expand description

Configuration validation engine.

§Responsibility

Validate semantic constraints on a parsed PipelineConfig that cannot be expressed through the type system alone (e.g., range checks, cross-field invariants).

§Guarantees

  • Every validation rule has at least one test that triggers it
  • Validation collects all errors before returning (no short-circuit)
  • Error messages include the field path and the invalid value

§NOT Responsible For

  • Parsing TOML (that belongs to loader)
  • File I/O (that belongs to loader)

§Validation Rules

Field pathRuleError variant
resilience.retry_base_msMust be ≤ retry_max_msInvalidField
resilience.retry_attemptsMust be ≥ 1InvalidField
resilience.circuit_breaker_success_rateMust be in [0.0, 1.0]InvalidField
resilience.circuit_breaker_thresholdMust be ≥ 1InvalidField
resilience.circuit_breaker_timeout_sMust be ≥ 1InvalidField
stages.inference.temperatureIf set, must be in [0.0, 2.0]InvalidField
stages.inference.modelMust not be blank/whitespace-onlyInvalidField
pipeline.nameMust not be blank/whitespace-onlyInvalidField
pipeline.versionMust not be blank/whitespace-onlyInvalidField
stages.rag.timeout_msMust be ≥ 1 when stages.rag.enabled = trueInvalidField
stages.rag.max_context_tokensMust be ≥ 1 when stages.rag.enabled = trueInvalidField
stages.rag.channel_capacityIf set, must be ≥ 1InvalidField
stages.assemble.channel_capacityMust be ≥ 1InvalidField
stages.post_process.channel_capacityMust be ≥ 1InvalidField
stages.stream.channel_capacityMust be ≥ 1InvalidField
deduplication.window_sMust be ≥ 1 when deduplication.enabled = trueInvalidField
deduplication.max_entriesMust be ≥ 1 when deduplication.enabled = trueInvalidField
observability.metrics_portIf set, must be ≥ 1InvalidField

Enums§

ConfigError
Errors arising from configuration parsing, validation, or I/O.

Functions§

validate
Validate all semantic constraints on a PipelineConfig.