Validation Ownership
Shared validation owns reusable invariants for consolidated seams.
Rules:
- Shared validation decides canonical pass/fail for reusable input invariants.
- Workflow-local code may do convenience preprocessing before validation.
- Workflow-local checks stay local only when they are specific to execution or output handling.
- strict=True escalates shared warnings to failures.
- strict=False preserves warnings as observable issues, but workflows must not reinterpret shared invariants.
- Shared validation is also the canonical source for human-readable schema metadata used by CLI help and onboarding requirement tables.
- Non-DataFrame governance and workflow metadata validation belongs in src/cranalytics/governance_models.py; it must not replace Pandera or workflow contract seams for tabular inputs.
Applied seams: - Loan history: loan_history_contract.py - Loan snapshot: loan_snapshot_contract.py - Rollforward: rollforward_contract.py - Predictive: predictive_contract.py - Vintage: vintage_contract.py
Examples of shared invariants: - required columns and alias resolution - target leakage checks - binary-target shape checks - missing split periods - selected-vintage structural validity
Examples of workflow-local checks: - output/artifact handling - CLI flag combinations - ranking and promotion logic - rendering shared schema metadata into workflow-specific prose or starter templates