Validate Command
Relevant source files
The following files were used as context for generating this wiki page:
The validate command checks the integrity of the Orcastrate configuration and workflow templates. It ensures that the orchestrator.toml file contains valid repository definitions and that all template files in the specified directory load correctly. This command serves as a pre-flight check to prevent runtime errors during Sync operations.
Sources: src/main.rs:94-108, README.md:104-104, AGENTS.md:27-27
Command Execution Flow
When you execute orcastrate validate, the application performs a sequential check of the local environment. It first loads and validates the global configuration, then initializes the template engine to verify the syntax of all available YAML templates.
The diagram shows the validation logic from configuration parsing to template syntax verification.
Sources: src/main.rs:94-108, src/template/render.rs:14-25
Configuration Validation
The command invokes Config::load, which performs structural and semantic checks on the orchestrator.toml file.
- File Existence: The command reads the configuration file from the path specified by the
--configflag or the defaultorchestrator.toml. - Repository Format: Every repository entry in the
[[repos]]list must follow theowner/nameformat. - Minimal Requirements: The configuration must define at least one repository in
[[repos]]or provide a[discovery]section for organization-wide scanning.
Sources: src/config.rs:51-73, src/main.rs:95-95
| Validation Check | Description | File Reference |
|---|---|---|
| Config Loading | Ensures orchestrator.toml is valid TOML and readable. | src/config.rs:51-56 |
| Repo Format | Validates that repo names contain exactly one forward slash. | src/config.rs:64-72 |
| Logic Check | Confirms at least one source of repositories (static or discovery) exists. | src/config.rs:60-63 |
Template Validation
The validate command initializes a TemplateRenderer using the directory path defined in the configuration. It uses the tera engine to load templates.
Loading and Syntax Checks
The renderer attempts to load all files matching the **/*.yml glob pattern within the templates directory. If any file contains invalid Tera syntax or cannot be read, the validation fails.
Sources: src/template/render.rs:14-25, src/main.rs:98-100
Template Discovery
After loading, the command retrieves a list of all successfully parsed templates and logs them to the console. This allows you to verify that the orchestrator recognizes your custom templates.
This sequence diagram illustrates the interaction between the CLI entry point and the template rendering engine during validation.
Sources: src/main.rs:94-100, src/template/render.rs:14-25
Summary of Validated Components
The validate command acts as a static analysis tool for the local orchestrator repository. It ensures that the system is ready to perform remote operations without being interrupted by local configuration or syntax issues. Note that while it validates template syntax, it does not validate every possible parameter combination that might be passed during a sync.
Sources: src/main.rs:107-108, README.md:113-115