cadrumo.domain.calculations.registry.schema module

Strict schema authority for AEAT registry definitions.

Each modelo revision carries an output_sensitivity field typed as SensitivityClass that governs the encryption tier applied to generated output envelopes.

class ContinuidadValidationMode(*values)[source]

Bases: StrEnum

How strictly casilla continuity is validated for a revision.

ADVISORY
STRICT
class ModeloCadence(*values)[source]

Bases: StrEnum

How often a modelo is filed.

PROFILE_BASED is not a period: it says the cadence is decided by the taxpayer’s own circumstances, which is why it cannot be compared against the others as a frequency.

MONTHLY
QUARTERLY
ANNUAL
AD_HOC
PROFILE_BASED
class BindingDefinition(**data)[source]

Bases: RegistryModel

Declare one typed source-to-casilla binding in a registry revision.

The declaration is a closed statement in four parts: provider names WHERE the value comes from as one member of the discriminated BindingProvider union, value states the typed contract the value honours, aggregation states how several source facts fold into one, and terminal_origins states the classes of terminal fact the resolved value is allowed to rest on – the authored half of the provenance audit.

The former source token and untyped selector mapping are gone: they were two fields that could disagree, and the union makes the tag part of the member. source survives as a read-only projection of the member’s discriminator for consumers that still key on the source kind alone.

Parameters:

data (Any)

id: BindingId
provider: BindingProvider
value: BindingValueContract
aggregation: BindingAggregation | None
applicability: BindingApplicability
terminal_origins: tuple[TerminalOriginExpectation, ...]
authorship: BindingAuthorship
aeat_prefilled: bool
legal_refs: LegalRefs
source_refs: SourceRefs
source_citations: tuple[SourceCitation, ...]
property source: BindingSourceKind

Return the provider member’s discriminator as its source kind.

A projection, never a stored field: the discriminator IS the source kind, so the two can no longer disagree the way the former sibling source column could.

class FormulaDefinition(**data)[source]

Bases: RegistryModel

Declare the grounded formula that produces one target casilla.

Parameters:

data (Any)

id: FormulaId
target_casilla_id: CasillaId
expression: FormulaExpression
rounding: RegistryRoundingCodeValue
legal_refs: LegalRefs
source_refs: SourceRefs
source_citations: tuple[SourceCitation, ...]
class SchemaFamilyDispositionDeclaration(**data)[source]

Bases: RegistryModel

A revision’s declared reason that one of its schema families does not apply.

The only way an empty family reads as anything but RegistrySchemaFamilyDisposition.BLOCKED_PENDING_EVIDENCE, and it is deliberately expensive to make: a substantive claim about what the law does not require of this modelo, so it carries a reason somebody wrote and the references it stands on.

The alternative — an allowlist of families permitted to be empty — was rejected as the shape of the problem rather than its solution. An allowlist entry records that somebody wanted the check quiet; this records what they claim and what backs it, which is the thing a later reviewer can disagree with.

Parameters:

data (Any)

reason: str
legal_refs: LegalRefs
source_refs: SourceRefs
class CasillaStorageSelector(**data)[source]

Bases: RegistryModel

Unambiguous address of one effective casilla in a declared predecessor.

This selector is storage identity only. It neither declares nor implies legal continuity between the selected member and the successor edition.

Parameters:

data (Any)

revision: RevisionId
id: CasillaId
class CasillaFieldOverride(**data)[source]

Bases: RegistryModel

Typed declaration of fields changed from one predecessor casilla.

Parameters:

data (Any)

selector: CasillaStorageSelector
fields: Annotated[Mapping[str, object], FROZEN_MAPPING]
removed_fields: tuple[str, ...]
restate_provenance: bool
class CasillaMemberRemoval(**data)[source]

Bases: RegistryModel

Explicitly remove one member inherited from the declared predecessor.

Parameters:

data (Any)

selector: CasillaStorageSelector
class CasillaMemberPosition(**data)[source]

Bases: RegistryModel

Place an effective casilla without restating its payload.

Parameters:

data (Any)

id: CasillaId
position: int
class FamilyStorageSelector(**data)[source]

Bases: RegistryModel

Address one keyed-family member in the immediate predecessor.

Parameters:

data (Any)

revision: RevisionId
id: str
class FamilyFieldOverride(**data)[source]

Bases: RegistryModel

Patch only the changed fields of one inherited keyed-family member.

Parameters:

data (Any)

family: str
selector: FamilyStorageSelector
fields: Annotated[Mapping[str, object], FROZEN_MAPPING]
removed_fields: tuple[str, ...]
sequence_additions: Annotated[Mapping[str, tuple[object, ...]], FROZEN_MAPPING]
sequence_removals: Annotated[Mapping[str, tuple[int, ...]], FROZEN_MAPPING]
sequence_order: Annotated[Mapping[str, tuple[int, ...]], FROZEN_MAPPING]
restate_identity: bool
replacement_id: str | None
class FamilyMemberRemoval(**data)[source]

Bases: RegistryModel

Explicitly remove one member inherited from a keyed family.

Parameters:

data (Any)

family: str
selector: FamilyStorageSelector
class FamilyMemberPosition(**data)[source]

Bases: RegistryModel

Place one effective keyed-family member without restating its payload.

Parameters:

data (Any)

family: str
id: str
position: int
class ModeloRevision(**data)[source]

Bases: RegistryRevisionDeclaration

A single versioned form layout and calculation ruleset for one modelo.

The orden_aplicabilidad field names the legal-catalogue LegalReference id(s) of the ordenes ministeriales that approve or amend this revision’s form for its declared applicability window (e.g. ["orden-hac-277-2026:art-3"] for M100 ejercicio 2025).

The field is mandatory at validation time: every revision must cite the Ordenes that approve or amend the form for its applicability window.

The governance stamp — engineered_by, review_status, reviewed_by, reviewed_at, reviewed_against — is the revision’s declared provenance, optional and fail-closed to RevisionReviewStatus.PENDING_REVIEW on absence. reviewed_against is the review’s scope on an edition that names a predecessor: the predecessor the stated rows were reviewed against, required on a reviewed delta edition and refused everywhere else. Like predecessor it is excluded from serialisation when absent, so a revision without it dumps exactly as it did before the key existed. Its rules and the reasoning behind them live in schema_governance, which the validators below delegate to.

authority_grade is the revision’s declared authority reach, a separate subject from the stamp: the stamp says who signed the revision off, the grade says how far the revision’s authority extends. It shares the stamp’s manifest-only placement guarantee — it is a claim about the whole revision, so it must be readable in revision.toml rather than merged in from a fragment thousands deep — and it shares the fail-closed shape, reading as UNDECLARED_REGISTRY_AUTHORITY_GRADE when absent. It is deliberately optional rather than defaulted on the field, so an ungraded revision stays distinguishable from one explicitly graded at that same floor; effective_authority_grade is the reading, and is_graded the distinction.

export_layouts is the AUTHORED form, not the one that ships. A record carrying binding_record is authored thin on purpose – its envelope constants only – and derive_export_layouts_from_bindings() materialises the real fields at snapshot build. Modelo 369’s t36904 is 9 authored fields and 161 derived ones against a design sheet requiring 161; modelo 390’s page-05 is 6 and 105. Any consumer comparing a layout against an official record design MUST resolve through that function, which is the stage the export-layout record-coverage validation measures when the authority is built. Reading this attribute for that purpose reports every materialised field as an unwritten position: it produced 22 confident false silent-data-loss findings across modelos 369, 390 and 131, twice, in trees that were already stamped and verified.

predecessor is the revision’s explicit declaration of the sibling edition it is authored relative to. A revision is delta-authored only when it declares one; nothing infers a predecessor from rows the revision leaves out, so a revision without the key is a full-copy revision stating every row itself. Absent reads as None and is excluded from serialisation, so a revision that does not declare the key dumps exactly as it did before the key existed. A NoPredecessor is the grounded statement that the revision chains to no sibling at all, which absence cannot say. Either declaration is a claim about the whole revision, so it is manifest-only: a section fragment declaring it is refused. The modelo validates the declared edges together as a forest through validate_predecessor_forest(), and each edge against the editions’ validity dates through validate_predecessor_date_agreement().

casilla_source_refs is the edition’s default source grounding for its casilla rows, declared once rather than restated on every row. It is a different fact from source_refs, which cites what the edition as a whole stands on. The loader fills it into every casilla row, and every row’s constraints table, that states no source_refs of its own. In the same pass orden_aplicabilidad fills the legal_refs of every row and constraints table that states none, because the edition’s approving ordenes are already declared there once and a second field would duplicate them. A row or constraints table stating its own value keeps it whole: the default replaces nothing and is never merged into a stated value, and an explicitly empty value is refused rather than defaulted. The defaults are applied after predecessor inheritance, so a row inherited from a predecessor and stating none takes this edition’s defaults, never the predecessor’s; source references are declared per edition. Like predecessor it is excluded from serialisation when absent, and manifest-only, since it grounds rows across every fragment of the edition.

A casilla row or its constraints table may instead state additional_source_refs: the procedure or form citations that belong to the box’s concept rather than to the edition’s design. Such a table’s source_refs is the edition’s casilla_source_refs followed by those additions, duplicates removed and the default first. The additions travel with the row, so an inherited row extends the default of the edition it now sits in. A table stating both keys, additions that are empty, or additions in an edition declaring no casilla_source_refs is refused. The key is consumed by the loader and never reaches this model.

binding_source_refs and formula_source_refs are the same fact for the binding and formula families, and carry the same member-side rule: a row stating no source_refs takes the edition default, a row stating additional_source_refs takes the default followed by its additions, and a row stating source_refs keeps them whole. application_link_source_refs, applicability_source_refs, filing_schedule_source_refs, live_cross_reference_source_refs, extraction_profile_source_refs, dependency_classification_source_refs, construct_source_refs and parameter_source_refs state the same fact, under the same rule, for the application_links, applicability, filing_schedules, live_cross_references, extraction_profiles, dependency_classifications, constructs and parameters families.

One field per family rather than one shared field because the families are grounded in different documents – a modelo’s casillas in its diseno de registros, its bindings in that design’s record layout, its formulas in the approving orden’s instructions, its filing schedules and applicability in the approving orden’s plazos and obligation articles – and one shared default would force an edition to restate on every other family whenever one of them differs. Each is independent: declaring one says nothing about the others, and an edition declaring none is exactly as it was before these keys existed. The pairing of family to field is declared once, in CANONICAL_FAMILY_SPECS, whose source_default_key is what the loader fills from, so no family can be defaulted from another’s grounding.

Whether a useful family source default can be derived is an optimization result calculated from the member declarations. It is not revision data.

Parameters:
  • valid_from (date)

  • valid_to (Annotated[date | None, ManifestOnlyMarker()])

  • period_selector (PeriodSelector)

  • predecessor (Annotated[Annotated[Annotated[DeclaredPredecessor, BeforeValidator(func=~cadrumo.domain.calculations.registry.revision_contracts._hydrate_declared_predecessor, json_schema_input_type=PydanticUndefined), Tag(tag=revision)] | Annotated[NoPredecessor, BeforeValidator(func=~cadrumo.domain.calculations.registry.revision_contracts._hydrate_no_predecessor, json_schema_input_type=PydanticUndefined), Tag(tag=none)], Discriminator(discriminator=~cadrumo.domain.calculations.registry.revision_contracts._predecessor_declaration_kind, custom_error_type=predecessor_kind, custom_error_message=predecessor must be the revision id of a sibling edition, or a single 'none' table grounding why no earlier sibling edition exists, custom_error_context=None)] | None, ManifestOnlyMarker()])

  • id (RevisionId)

localization_key: str
legal_refs: Annotated[LegalRefs, MANIFEST_ONLY]
source_refs: SourceRefs
orden_aplicabilidad: Annotated[tuple[LegalRefId, ...], MANIFEST_ONLY]
casilla_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
binding_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
formula_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
applicability_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
filing_schedule_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
live_cross_reference_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
extraction_profile_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
dependency_classification_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
construct_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
parameter_source_refs: Annotated[SourceRefs | None, MANIFEST_ONLY]
parameters: Annotated[tuple[ParameterDefinition, ...], SCHEMA_FAMILY]
casillas: Annotated[tuple[CasillaDefinition, ...], SCHEMA_FAMILY]
casilla_storage_baseline: Annotated[RevisionId | None, MANIFEST_ONLY]
casilla_overrides: Annotated[tuple[CasillaFieldOverride, ...], MANIFEST_ONLY]
casilla_removals: Annotated[tuple[CasillaMemberRemoval, ...], MANIFEST_ONLY]
casilla_positions: Annotated[tuple[CasillaMemberPosition, ...], MANIFEST_ONLY]
family_storage_baseline: Annotated[RevisionId | None, MANIFEST_ONLY]
cleared_families: Annotated[tuple[ClearedFamilyDeclaration, ...], MANIFEST_ONLY]
scoped_families: Annotated[tuple[str, ...], MANIFEST_ONLY]
family_overrides: Annotated[tuple[FamilyFieldOverride, ...], MANIFEST_ONLY]
family_removals: Annotated[tuple[FamilyMemberRemoval, ...], MANIFEST_ONLY]
family_positions: Annotated[tuple[FamilyMemberPosition, ...], MANIFEST_ONLY]
formulas: Annotated[tuple[FormulaDefinition, ...], SCHEMA_FAMILY]
bindings: Annotated[tuple[BindingDefinition, ...], SCHEMA_FAMILY]
projection_endpoints: Annotated[tuple[ProjectionEndpointDeclaration, ...], SCHEMA_FAMILY]
export_layouts: Annotated[tuple[ExportLayoutDefinition, ...], SCHEMA_FAMILY]
extraction_profiles: Annotated[tuple[ExtractionProfileDefinition, ...], SCHEMA_FAMILY]
live_cross_references: Annotated[tuple[LiveCrossReferenceDecision, ...], SCHEMA_FAMILY]
workbook_parity_refs: Annotated[tuple[WorkbookParityReference, ...], SCHEMA_FAMILY]
verification_expectations: Annotated[tuple[VerificationExpectationDefinition, ...], SCHEMA_FAMILY]
deadline_windows: Annotated[tuple[_DeadlineWindowDefinition, ...], SCHEMA_FAMILY]
filing_schedules: Annotated[tuple[_ModeloScheduleDefinition, ...], SCHEMA_FAMILY]
constructs: Annotated[tuple[_ConstructDefinition, ...], SCHEMA_FAMILY]
dependency_classifications: Annotated[tuple[_DependencyClassificationDefinition, ...], SCHEMA_FAMILY]
applicability: Annotated[tuple[_ApplicabilityRuleDefinition, ...], SCHEMA_FAMILY]
completeness_manifest: CalculationCompletenessManifest | None
verification_predicates: Annotated[tuple[VerificationPredicateDefinition, ...], SCHEMA_FAMILY]
continuidad_validation: ContinuidadValidationModeField
casilla_continuidad_evolutions: Annotated[tuple[CasillaContinuidadEvolutionDefinition, ...], CHAIN_FAMILY]
casilla_structural_successions: Annotated[tuple[CasillaStructuralSuccession, ...], CHAIN_FAMILY]
identifier_evolutions: Annotated[tuple[IdentifierEvolution, ...], CHAIN_FAMILY]
lineage_attestations: Annotated[tuple[LineageAttestation, ...], MANIFEST_ONLY]
authority_grade: Annotated[RegistryAuthorityGradeField | None, MANIFEST_ONLY]
family_dispositions: Annotated[Mapping[str, SchemaFamilyDispositionDeclaration], MANIFEST_ONLY, FROZEN_MAPPING]
restated_families: Annotated[tuple[RestatedFamilyDeclaration, ...], MANIFEST_ONLY]
engineered_by: Annotated[str | None, GOVERNANCE_STAMP]
review_status: Annotated[RevisionReviewStatusField, GOVERNANCE_STAMP]
reviewed_by: Annotated[str | None, GOVERNANCE_STAMP]
reviewed_at: Annotated[date | None, GOVERNANCE_STAMP]
reviewed_against: Annotated[RevisionId | None, GOVERNANCE_STAMP]
property is_graded: bool

Return whether this revision declares an authority grade at all.

The distinction effective_authority_grade deliberately erases: an ungraded revision and one declared at the floor read as the same scope but are not the same claim, and only one of them is a backlog entry.

property effective_authority_grade: RegistryAuthorityGrade

Return the authority reach to act on, reading absence fail-closed.

An undeclared grade reads as UNDECLARED_REGISTRY_AUTHORITY_GRADE — the lowest rung — so a revision nobody has graded confers scheduling reach and nothing more. Consumers read the reach here rather than each deciding for itself what a missing declaration means.

get_label(locale)[source]

Resolve the optional revision label from the shared catalogue.

Return type:

str | None

Parameters:

locale (str)

property label: str | None

Return the optional official-Spanish revision label.

projection_endpoint_index()[source]

Index declared projection endpoints without concealing duplicates.

Generated layouts deliberately do not participate in this authority: their fields must later prove an exact bijection with this revision-owned declaration index.

Return type:

Mapping[M303ProrrataActivityProjectionRef | M303DifferentiatedDeductionProjectionRef | M303RegimenSimplificadoActivityProjectionRef | M303RegimenSimplificadoFactProjectionRef | M303RegimenSimplificadoModuleProjectionRef | M303Exonerado390ActivityProjectionRef | M303Exonerado390OperacionesTercerosProjectionRef | M390ActivityProjectionRef | M390RepresentativeProjectionRef | M390RegimenSimplificadoActivityProjectionRef | M390RegimenSimplificadoModuleProjectionRef | M390ProrrataActivityProjectionRef | M390DifferentiatedDeductionProjectionRef | M200EstablecimientoPermanenteProjectionRef | M200SocioSicavDisolucionProjectionRef | M200EntidadMenorDependienteProjectionRef | M200IncnGrupoSociedadProjectionRef | M200IncnEstablecimientoPermanenteProjectionRef | M200OperacionReestructuracionProjectionRef | M200ParticipeAieUteProjectionRef | M200TransparenciaFiscalInternacionalProjectionRef | M200AdministradorProjectionRef | M200EntidadParticipadaProjectionRef | M200ParticipacionDirectaProjectionRef | M200ParticipacionSocioProjectionRef | M200SecretarioConsejoProjectionRef | M200RepresentanteLegalProjectionRef | M296PerceptorProjectionRef | M296PerceptorInteresesProjectionRef | M296AnexoPagoProjectionRef | M296AnexoCertificadoProjectionRef, tuple[ProjectionEndpointDeclaration, ...]]

REVISION_GOVERNANCE_FIELDS: frozenset[str]

The ModeloRevision fields that make up the declared governance stamp.

Derived from the GOVERNANCE_STAMP marker on the field declarations rather than hand-listed, and the sole input to the loader’s placement refusal. See schema_governance for why the stamp must be readable in the manifest alone and why marking the field is the whole of enrolling it.

This set is the stamp VOCABULARY, narrower than REVISION_MANIFEST_ONLY_FIELDS: it is what the conformance tooling reads as declared provenance and what the stamp writer emits, so a field pinned to the manifest for legal-grounding reasons must not appear here.

REVISION_SCHEMA_FAMILY_FIELDS: frozenset[str]

Every ModeloRevision field whose emptiness is a coverage question.

The revision’s declared content collections, read back off the SCHEMA_FAMILY markers rather than hand-listed. This is the denominator of the per-revision coverage manifest: one disposition row per member, always, so a family nobody has built is a row saying so rather than an absence.

Gated against the collection-shaped fields derived from the model annotations.

REVISION_MANIFEST_ONLY_FIELDS: frozenset[str]

Every ModeloRevision field that may be declared only in revision.toml.

A superset of REVISION_GOVERNANCE_FIELDS by construction, since GovernanceStampMarker is a ManifestOnlyMarker. Beyond the governance stamp it carries the legally load-bearing scalars legal_refs, orden_aplicabilidad and valid_to, which share the stamp’s readability hazard and raise its stakes, casilla_source_refs, binding_source_refs and formula_source_refs, which ground rows in every fragment of the edition, and authority_grade, which is a claim about how far the whole revision’s authority reaches and so belongs in the one file a reviewer opens; schema_governance records how a deep fragment can otherwise supply a revision’s legal grounding while revision.toml reads as though it did not.

MODELO_REVISION_IDS_CONTEXT: Final

Validation-context key naming every revision of the modelo a selected view was taken from.

class ModeloDefinition(**data)[source]

Bases: RegistryModel

Declare a modelo and its complete collection of revision authorities.

Parameters:

data (Any)

id: ModeloId
title_localization_key: str
official_name_localization_key: str
tax_domain: Annotated[TaxDomain, BeforeValidator(lambda v: TaxDomain(v) if isinstance(v, str) else v)]
cadence: ModeloCadenceField
jurisdiction: Literal['ES-AEAT']
calculation_class: CalculationClassField
output_sensitivity: SensitivityClassField
capabilities: ModeloFilingCapabilities
legal_refs: LegalRefs
source_refs: SourceRefs
inception: Annotated[ModeloInceptionField | None, MANIFEST_ONLY]
pending_ejercicio_ordenes: PendingEjercicioOrdenes
revisions: Annotated[Mapping[RevisionId, ModeloRevision], FROZEN_MAPPING]
get_title(locale)[source]

Resolve the Modelo title from the shared catalogue.

Return type:

str

Parameters:

locale (str)

get_official_name(locale)[source]

Resolve the official Modelo name from the shared catalogue.

Return type:

str

Parameters:

locale (str)

property title: str

Return the strict official-Spanish Modelo title.

property official_name: str

Return the strict official-Spanish Modelo name.

has_capability(name)[source]

Return whether this modelo declares the given capability.

Return type:

bool

Parameters:

name (Literal['borrador', 'renta_ledger_default'])

class SupportedFilingYearsCatalogue(**data)[source]

Bases: TemporalSupportEnvelope

The registry’s sole declaration of the filing years the product supports.

Authored as bounds rather than an enumeration, because the two ends of the span do not carry the same force. floor is a hard gate: nothing resolves below it. horizon is the last globally authored coordinate, not a gate; when hard_ceiling is absent the supported range remains open above it. Missing modelo editions inside that range are projected from an eligible authored anchor.

The span is contiguous by construction. A product that supports 2022 and 2024 but not 2023 is not a state the law produces; the enumerated form could express it only by accident, and nothing ever did.

TemporalSupportEnvelope.years still enumerates the span, derived now rather than authored, so a consumer asking which years are supported keeps asking the same way. It is a plain property rather than a computed field on purpose: the published artifact is re-validated against this model on every read, and a serialised derivation would be refused there as an unexpected member.

Parameters:
  • floor (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=2000), Le(le=2099)])])

  • horizon (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=2000), Le(le=2099)])])

  • hard_ceiling (Annotated[int, FieldInfo(annotation=NoneType, required=True, metadata=[Ge(ge=2000), Le(le=2099)])] | None)

admits_filing_year(filing_year)[source]

Return whether a filing year is inside the product’s hard gates.

Return type:

bool

Parameters:

filing_year (int)

class SociedadesAnnualManualCoverageStatus(*values)[source]

Bases: StrEnum

The independently auditable availability state of one annual manual.

AVAILABLE
UNACQUIRED
UNPUBLISHED
class SociedadesAnnualManualCoverageDisposition(**data)[source]

Bases: RegistryModel

One exact-year outcome for the annual Sociedades manual corpus.

This is documentary availability only. It is intentionally separate from Modelo 200 revision selection and filing capability.

Parameters:

data (Any)

year: int
status: SociedadesAnnualManualCoverageStatusField
source_ref: SourceRefId | None
official_locator: RegistryExternalLink
observed_at: date
acquisition_condition_key: str | None
class SociedadesAnnualManualCoverageCatalogue(**data)[source]

Bases: RegistryModel

One declarative coverage ledger for annual Sociedades manuals.

Parameters:

dispositions (tuple[SociedadesAnnualManualCoverageDisposition, ...])

dispositions: tuple[SociedadesAnnualManualCoverageDisposition, ...]
class RegistryCatalogues(**data)[source]

Bases: RegistryModel

Collect the registry-wide legal, source, fact, and support catalogues.

Parameters:
legal: Annotated[Mapping[LegalRefId, LegalReference], FROZEN_MAPPING]
sources: Annotated[Mapping[SourceRefId, SourceReference], FROZEN_MAPPING]
facts: GovernedFactCatalogue
convenio: ConvenioAuthority
supplementary_ordenes: Annotated[Mapping[Modelo, M303AnnualOrdenAuthority], FROZEN_MAPPING]
supported_filing_years: SupportedFilingYearsCatalogue | None
sociedades_annual_manual_coverage: SociedadesAnnualManualCoverageCatalogue | None
runtime: RuntimeRegistryCatalogues
require_supported_filing_years()[source]

Return the registry’s single support envelope, refusing a catalogue set without it.

Return type:

SupportedFilingYearsCatalogue

class SnapshotGlobalCatalogues(**data)[source]

Bases: RegistryModel

Small registry-wide values required while assembling a point snapshot.

Parameters:
convenio: ConvenioAuthority
supplementary_ordenes: Annotated[Mapping[Modelo, M303AnnualOrdenAuthority], FROZEN_MAPPING]
supported_filing_years: SupportedFilingYearsCatalogue
classmethod from_catalogues(catalogues)[source]

Project only globals consumed by snapshot construction and fact resolution.

Return type:

SnapshotGlobalCatalogues

Parameters:

catalogues (RegistryCatalogues)

class RegistrySnapshot(**data)[source]

Bases: RegistryModel

Represent the resolved immutable authority for one modelo filing coordinate.

Parameters:

data (Any)

modelo: ModeloDefinition
revision: ModeloRevision
filing_period: Period | None
filing_year: FilingYear
authored_filing_year: FilingYear | None
supported_filing_years: SupportedFilingYearsCatalogue | None
revision_projection_direction: TemporalProjectionDirection
period: RegistrySelectorPeriodCode
legal: Annotated[Mapping[LegalRefId, LegalReference], FROZEN_MAPPING]
sources: Annotated[Mapping[SourceRefId, SourceReference], FROZEN_MAPPING]
extraction_profiles: Annotated[Mapping[ExtractionProfileId, ExtractionProfileDefinition], FROZEN_MAPPING]
live_cross_references: Annotated[Mapping[CrossReferenceId, LiveCrossReferenceDecision], FROZEN_MAPPING]
workbook_parity_refs: Annotated[Mapping[WorkbookParityRefId, WorkbookParityReference], FROZEN_MAPPING]
verification_expectations: Annotated[Mapping[VerificationExpectationId, VerificationExpectationDefinition], FROZEN_MAPPING]
deadline_windows: Annotated[Mapping[DeadlineWindowId, _DeadlineWindowDefinition], FROZEN_MAPPING]
filing_schedules: Annotated[Mapping[str, _ModeloScheduleDefinition], FROZEN_MAPPING]
constructs: Annotated[Mapping[ConstructId, _ConstructDefinition], FROZEN_MAPPING]
dependency_classifications: Annotated[Mapping[DependencyClassificationId, _DependencyClassificationDefinition], FROZEN_MAPPING]
convenio: ConvenioAuthority
supplementary_ordenes: Annotated[Mapping[Modelo, M303AnnualOrdenAuthority], FROZEN_MAPPING]
property snapshot_ref: RegistrySnapshotRef

Return this validated snapshot’s canonical persisted coordinate.

verification_policy()[source]

Fold this snapshot’s verification expectations into one policy.

Returns the registry-grounded RegistryVerificationPolicy (union of computed casilla ids, strictest tolerance, strictest coverage floor).

Raises:

RegistryValidationError – When the snapshot declares no verification expectations.

Return type:

RegistryVerificationPolicy