models
models
¶
Validation result models and data structures.
Contains the core result types used by the validation engine and consumed by the runner, prompts, and escalation layers.
Classes¶
ValidationResult
dataclass
¶
ValidationResult(rule, passed, actual_value=None, expected_value=None, error_message=None, checked_at=utc_now(), check_duration_ms=0.0, confidence=1.0, confidence_factors=dict(), failure_reason=None, failure_category=None, suggested_fix=None, error_type=None)
Result of a single validation check.
Attributes¶
confidence
class-attribute
instance-attribute
¶
Confidence in this validation result (0.0-1.0). Default 1.0 = fully confident.
confidence_factors
class-attribute
instance-attribute
¶
Factors affecting confidence, e.g., {'file_age': 0.9, 'pattern_specificity': 0.8}.
failure_reason
class-attribute
instance-attribute
¶
Semantic explanation of why validation failed.
failure_category
class-attribute
instance-attribute
¶
Category of failure: 'missing', 'malformed', 'incomplete', 'stale', 'error'.
suggested_fix
class-attribute
instance-attribute
¶
Hint for how to fix the issue.
error_type
class-attribute
instance-attribute
¶
Distinguishes validation failures from validation crashes. None or 'validation_failure' = output didn't meet the rule. 'internal_error' = the validation check itself crashed.
Functions¶
to_dict
¶
Convert to serializable dictionary.
Source code in src/marianne/execution/validation/models.py
format_failure_summary
¶
Format failure information for prompt injection.
Source code in src/marianne/execution/validation/models.py
SheetValidationResult
dataclass
¶
Aggregate result of all validations for a sheet.
Attributes¶
executed_pass_percentage
property
¶
Percentage of EXECUTED validations that passed.
aggregate_confidence
property
¶
Calculate weighted aggregate confidence across all validation results.
Functions¶
get_passed_rules
¶
get_failed_rules
¶
get_passed_results
¶
get_failed_results
¶
to_dict_list
¶
get_semantic_summary
¶
Aggregate semantic information from failed validations.
Source code in src/marianne/execution/validation/models.py
get_actionable_hints
¶
Extract actionable hints from failed validations.
Source code in src/marianne/execution/validation/models.py
FileModificationTracker
¶
Tracks file mtimes before sheet execution for file_modified checks.
Source code in src/marianne/execution/validation/models.py
Functions¶
snapshot
¶
Capture mtimes of files before sheet execution.
Source code in src/marianne/execution/validation/models.py
was_modified
¶
Check if file was modified (or created) after snapshot.