Skip to main content

validate_spec_output_from_log

Function validate_spec_output_from_log 

Source
pub fn validate_spec_output_from_log(
    spec_id: &str,
    schema_path: &Path,
    logs_dir: &Path,
) -> Result<Option<ValidationResult>>
Expand description

Read the agent log file for a spec and validate its output against the schema.

This is useful for batch validation (e.g., in chant lint).

§Arguments

  • spec_id - The spec ID
  • schema_path - Path to the JSON schema file
  • logs_dir - Path to the logs directory (typically .chant/logs)

§Returns

  • Ok(Some(ValidationResult)) if log exists and validation was attempted
  • Ok(None) if no log file exists for this spec
  • Err if there was an error reading the log or schema