plexus.linting.rules module
Domain-specific validation rules for YAML DSL linter.
Provides a flexible rule engine for implementing custom validation logic.
- class plexus.linting.rules.AllowedValuesRule(field_path: str, allowed_values: List[Any], rule_id: str | None = None)
Bases:
ValidationRuleRule that validates field values are from allowed set.
Initialize the allowed values rule.
- Args:
field_path: Dot-separated path to the field allowed_values: List of allowed values rule_id: Optional custom rule ID
- __init__(field_path: str, allowed_values: List[Any], rule_id: str | None = None)
Initialize the allowed values rule.
- Args:
field_path: Dot-separated path to the field allowed_values: List of allowed values rule_id: Optional custom rule ID
- validate(data: Dict[str, Any]) List[LintMessage]
Validate the data against this rule.
- Args:
data: Parsed YAML data to validate
- Returns:
List of LintMessage objects for any violations
- class plexus.linting.rules.ConfidenceConfigurationRule
Bases:
ValidationRuleRule that validates confidence configuration requirements.
- __init__()
- validate(data: Dict[str, Any]) List[LintMessage]
Validate the data against this rule.
- Args:
data: Parsed YAML data to validate
- Returns:
List of LintMessage objects for any violations
- class plexus.linting.rules.DeepgramInputSourcePlacementRule
Bases:
ValidationRuleRule that detects item processor/input-source configuration placed in the wrong location.
Item processors and input sources (DeepgramInputSource, processors: lists, input_source: keys, etc.) must live in the top-level item: section, NOT nested under data: or any other section.
Correct structure:
- data:
class: CallCriteriaDBCache searches: … # dataset config only — no input_source, no processors here
- item: # ← all item config lives here at the top level
class: DeepgramInputSource options:
pattern: “.*deepgram.*.json$”
- processors:
class: DeepgramFormatProcessor parameters:
format: words speaker_labels: true include_timestamps: true
- Common mistakes:
Placing input_source: as a nested key inside data:
Placing a processors: list inside data: or any other non-item: section
Using a known processor class name (DeepgramFormatProcessor, RelevantWindowsTranscriptFilter, etc.) as class: inside data: or other wrong sections
- __init__()
- validate(data: Dict[str, Any]) List[LintMessage]
Validate the data against this rule.
- Args:
data: Parsed YAML data to validate
- Returns:
List of LintMessage objects for any violations
- class plexus.linting.rules.ProcessorValidationRule
Bases:
ValidationRuleRule that validates item.processors entries reference known classes with required parameters.
- __init__()
- validate(data: Dict[str, Any]) List[LintMessage]
Validate the data against this rule.
- Args:
data: Parsed YAML data to validate
- Returns:
List of LintMessage objects for any violations
- class plexus.linting.rules.RequiredFieldRule(field_path: str, rule_id: str | None = None)
Bases:
ValidationRuleRule that validates required fields exist.
Initialize the required field rule.
- Args:
field_path: Dot-separated path to the required field (e.g., ‘config.name’) rule_id: Optional custom rule ID
- __init__(field_path: str, rule_id: str | None = None)
Initialize the required field rule.
- Args:
field_path: Dot-separated path to the required field (e.g., ‘config.name’) rule_id: Optional custom rule ID
- validate(data: Dict[str, Any]) List[LintMessage]
Validate the data against this rule.
- Args:
data: Parsed YAML data to validate
- Returns:
List of LintMessage objects for any violations
- class plexus.linting.rules.RuleEngine(rules: List[ValidationRule])
Bases:
objectEngine for running validation rules against YAML data.
Initialize the rule engine.
- Args:
rules: List of validation rules to apply
- __init__(rules: List[ValidationRule])
Initialize the rule engine.
- Args:
rules: List of validation rules to apply
- validate(data: Dict[str, Any]) List[LintMessage]
Run all rules against the provided data.
- Args:
data: Parsed YAML data to validate
- Returns:
List of all LintMessage objects from rule violations
- class plexus.linting.rules.TypeValidationRule(field_path: str, expected_type: type, rule_id: str | None = None)
Bases:
ValidationRuleRule that validates field types.
Initialize the type validation rule.
- Args:
field_path: Dot-separated path to the field expected_type: Expected Python type rule_id: Optional custom rule ID
- __init__(field_path: str, expected_type: type, rule_id: str | None = None)
Initialize the type validation rule.
- Args:
field_path: Dot-separated path to the field expected_type: Expected Python type rule_id: Optional custom rule ID
- validate(data: Dict[str, Any]) List[LintMessage]
Validate the data against this rule.
- Args:
data: Parsed YAML data to validate
- Returns:
List of LintMessage objects for any violations
- class plexus.linting.rules.ValidationRule(rule_id: str, description: str, severity: str = 'error')
Bases:
ABCAbstract base class for validation rules.
- __init__(rule_id: str, description: str, severity: str = 'error') None
- description: str
- rule_id: str
- severity: str = 'error'
- abstractmethod validate(data: Dict[str, Any]) List[LintMessage]
Validate the data against this rule.
- Args:
data: Parsed YAML data to validate
- Returns:
List of LintMessage objects for any violations