base
base
¶
Base types and protocols for the validation system.
Defines the core abstractions: - ValidationSeverity: Error/Warning/Info classification - ValidationIssue: A single issue found during validation - ValidationCheck: Protocol for implementing validation checks
Classes¶
ValidationSeverity
¶
Bases: str, Enum
Severity level for validation issues.
- ERROR: Must fix before execution - job will fail
- WARNING: Should fix - may cause runtime failures
- INFO: Informational - consider reviewing
ValidationIssue
dataclass
¶
ValidationIssue(check_id, severity, message, line=None, column=None, context=None, suggestion=None, auto_fixable=False, metadata=dict())
A single validation issue found in the configuration.
Attributes:
| Name | Type | Description |
|---|---|---|
check_id |
str
|
Unique identifier for the check (e.g., V001, V101) |
severity |
ValidationSeverity
|
ERROR, WARNING, or INFO |
message |
str
|
Human-readable description of the issue |
line |
int | None
|
Line number in config file (if applicable) |
column |
int | None
|
Column number (if applicable) |
context |
str | None
|
Surrounding text for context |
suggestion |
str | None
|
How to fix the issue |
auto_fixable |
bool
|
Whether --self-healing can automatically fix this |
ValidationCheck
¶
Bases: Protocol
Protocol for configuration validation checks.
Each check examines a specific aspect of the configuration and returns a list of ValidationIssue objects (empty if check passes).
Checks should be: - Idempotent (safe to run multiple times) - Side-effect free (don't modify anything) - Fast (validation should complete quickly)
Attributes¶
Functions¶
check
¶
Run the validation check.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
config
|
JobConfig
|
Parsed JobConfig object (already validated by Pydantic) |
required |
config_path
|
Path
|
Path to the config file (for resolving relative paths) |
required |
raw_yaml
|
str
|
Raw YAML text (for line number extraction) |
required |
Returns:
| Type | Description |
|---|---|
list[ValidationIssue]
|
List of ValidationIssue objects (empty if check passes) |