Transform Validation Reference (DEPRECATED)
Transform Pipeline Validation (DEPRECATED)
⚠️ DEPRECATED: This document describes validation for the old registry-based transform system that was removed on December 16, 2025.
The new fixed transform pipeline uses explicit ordering and does not require dependency validation. See ADR-003: Fixed Transform Pipeline for current architecture.
Historical Documentation
Validation Features
1. Missing Dependency Detection
The validator checks that all transforms referenced in MustRunAfter and MustRunBefore declarations actually exist in the registry.
Example Error:
2. Circular Dependency Detection
The validator detects circular dependencies that would prevent the pipeline from establishing a valid execution order.
Example Error:
3. Invalid Stage Validation
Transforms must declare one of the seven valid stages. Unknown stages are rejected.
Valid stages: parse, build, enrich, merge, transform, finalize, serialize
Example Error:
4. Cross-Stage Dependency Warnings
The validator warns when a transform depends on another transform in a later stage, as this dependency cannot be enforced.
Example Warning:
5. Unused Transform Detection
Transforms that are not referenced by any other transform’s dependencies receive a warning (informational only).
Example Warning:
API Reference
ValidatePipeline()
Performs comprehensive validation of the entire transform pipeline.
Returns: *ValidationResult with Valid flag, Errors slice, and Warnings slice.
GetPipelineInfo()
Returns a human-readable description of the current pipeline configuration.
Output Example:
PrintValidationResult()
Formats a validation result for display.
Output Example:
or with errors:
ValidatePipelineWithSuggestions()
Returns validation results along with helpful suggestions for fixing issues.
ListTransformNames()
Returns a sorted list of all registered transform names.
Integration
Automatic Validation
Validation runs automatically in Generator.copyContentFiles() before transform execution:
Manual Validation
You can validate the pipeline programmatically:
Error Handling
Validation errors are fatal and will prevent the build from proceeding. This is intentional - a malformed pipeline would produce incorrect or incomplete output.
Warnings are informational and logged but do not prevent execution. They indicate potential issues that should be reviewed but may be intentional.
Best Practices
-
Test New Transforms: Always run validation after adding new transforms to catch missing dependencies early.
-
Review Warnings: Don’t ignore warnings - they often indicate configuration issues even if they’re not fatal.
-
Use Descriptive Names: Clear transform names make validation messages easier to understand.
-
Document Dependencies: Comment why specific dependencies exist, especially for non-obvious orderings.
-
Validate Before Commit: Run validation as part of your pre-commit hooks or CI pipeline.
Debugging Pipeline Issues
View Current Pipeline
Check Specific Transform
Validate Before Build
Testing
The validation system includes comprehensive test coverage:
TestValidatePipeline_Valid- Valid pipeline passesTestValidatePipeline_MissingDependency- Detects missing dependenciesTestValidatePipeline_CircularDependency- Detects cyclesTestValidatePipeline_InvalidStage- Rejects invalid stagesTestValidatePipeline_CrossStageWarning- Warns about cross-stage depsTestValidatePipeline_EmptyRegistry- Handles empty registry- Plus 6 more tests for helper functions
Run validation tests:
Performance
Validation is fast and runs only once at the start of content copying. The overhead is negligible (microseconds for typical pipelines with <20 transforms).
Results are not cached because the registry can change between builds, but within a single build, validation runs exactly once.