aeat.domain.calculations.registry._legal module¶
Legal catalogue helpers.
- verify_legal_reference(reference, *, source_root=None)[source]¶
Verify one already parsed legal reference is filing-grade.
Type-system invariants enforced by the Pydantic schema (and thus NOT re-checked here):
review_statusisLiteral["reviewed"]— the type makes any other value unrepresentable, so a prior runtime checkif reference.review_status != "reviewed"was structurally unreachable dead code.evidence_tieronLegalReferenceisLiteral["legal_authority"]— same dead-branch reasoning.corpus_refmatches thepath#anchorshape — theLegalReferencemodel validator rejects malformed refs at parse time, so the defensivecorpus_ref.split("#", 1)[0]in_legal_corpus_text()will always find a non-empty path.
This function therefore only checks runtime invariants that the type system cannot express: known-bad citation patterns and required-text presence against the local corpus.
- Return type:
- Parameters:
reference (LegalReference)
source_root (Path | None)