aeat.domain.calculations.registry._support_matrix module

Typed per-modelo support-matrix registry.

ModeloEntry is the first-class typed roll-up of “what does modelo X actually support”, derived entirely from the loaded ModeloDefinition / ModeloRevision records — never hand-maintained. It composes existing registry primitives rather than re-implementing them:

  • calc-grade / manifest / export-format / extractor detection mirrors dev.registry.matrix (contributor-facing capability probe);

  • rename tracking reads the revision’s already-declared CasillaContinuidadEvolutionDefinition entries (the casilla_continuidad_evolutions field);

  • deprecation policy reads the revision’s already-declared SupportRemovalDecisionDefinition entries (the support_removal_decisions mapping);

  • portal-compatibility tracking reads the revision’s declared LiveCrossReferenceDecision entries (surface kind and evidence tier).

Coverage honesty (no-silent-under-declaration): a modelo missing a capability, rename record, deprecation decision, or portal cross-reference reports an explicit empty/False value, never a fabricated positive.

See also

build_support_matrix()

Pure builder that folds the ValidatedRegistryAuthority into typed rows.

ModeloSupportMatrixReport

Query-service envelope returned by support_matrix().

registry_support_matrix()

Application facade used by CLI discovery without re-reading registry authority directly.

class ModeloRenameRecord(**data)[source]

Bases: BaseModel

One declared per-ejercicio casilla continuity evolution.

Projects a CasillaContinuidadEvolutionDefinition already declared on the revision — this record never invents rename history; it surfaces what the registry already tracks per continuity chain (continuidad_id).

Variables:
  • continuidad_id – The stable continuity chain identifier a casilla’s number/label is tracked under across revisions.

  • from_revision – Revision id the evolution starts from.

  • to_revision – Revision id the evolution lands on.

  • evolution_kind – The declared nature of the change (e.g. "label_evolved", "repurposed", "retired").

Parameters:
  • continuidad_id (str)

  • from_revision (RevisionId)

  • to_revision (RevisionId)

  • evolution_kind (str)

continuidad_id: str
from_revision: RevisionId
to_revision: RevisionId
evolution_kind: str
class ModeloSupportRemovalRecord(**data)[source]

Bases: BaseModel

One declared deprecation decision for a modelo revision.

Projects a SupportRemovalDecisionDefinition already declared on the revision.

Variables:
  • subject_type – The kind of surface removed from filing-grade support (e.g. "export_layout", "live_cross_reference").

  • subject_id – The identifier of the removed surface.

  • reason – The declared regulatory/technical reason for removal.

  • evidence_note – Human-readable evidence backing the decision.

Parameters:
  • subject_type (str)

  • subject_id (str)

  • reason (str)

  • evidence_note (str)

subject_type: str
subject_id: str
reason: str
evidence_note: str
class ModeloPortalCompatibilityRef(**data)[source]

Bases: BaseModel

One declared AEAT-portal cross-reference for a modelo revision.

Projects a LiveCrossReferenceDecision already declared on the revision — the registry’s own record of which live AEAT surface the modelo has been cross-checked against and under what evidence tier.

Variables:
  • id – Stable registry identifier for the cross-reference decision.

  • surface – The live AEAT surface kind cross-checked (e.g. "public_read_surface", "integration_test_service").

  • evidence_tier – The declared evidence tier backing the cross-reference.

Parameters:
  • id (str)

  • surface (str)

  • evidence_tier (Literal['legal_authority', 'official_source_guidance', 'executable_parity_evidence', 'layout_authority'])

id: str
surface: str
evidence_tier: EvidenceTier
class ModeloEntry(**data)[source]

Bases: BaseModel

First-class typed support-matrix record for one modelo.

Derived entirely from the loaded registry authority — every field is a direct read or fold over the modelo’s latest revision, never a hand-maintained value. See build_support_matrix().

Variables:
  • modelo_id – The AEAT modelo identifier (e.g. "303").

  • title – Human-readable display name from the registry.

  • calculation_class – The modelo’s declared calculation role ("filing", "informative", or "summary").

  • revision_count – Number of registry revisions declared for this modelo.

  • latest_revision_id – The id of the revision this entry’s capabilities are probed against (the revision with the most recent valid_from).

  • latest_revision_valid_from – That revision’s applicability start date.

  • supported_revision_ids – Every declared revision id, oldest valid_from first.

  • calc_grade – Whether the latest revision’s calculation closure is non-empty (has at least one formula/binding/verification wiring the engine traverses).

  • has_completeness_manifest – Whether the latest revision declares a calculation-completeness manifest.

  • has_fixed_width_export – Whether the latest revision registers a fixed_width (fichero-BOE) export layout.

  • has_xml_dictionary_export – Whether the latest revision registers an xml_dictionary export layout.

  • has_extractor – Whether the latest revision registers at least one extraction profile.

  • extraction_profile_count – Count of extraction profiles on the latest revision.

  • renames – Declared per-ejercicio casilla continuity evolutions on the latest revision.

  • deprecations – Declared support-removal (deprecation) decisions on the latest revision.

  • portal_compatibility_refs – Declared AEAT-portal cross-references on the latest revision.

  • is_deprecatedTrue when the latest revision declares at least one support-removal decision.

Parameters:
modelo_id: ModeloId
title: str
calculation_class: CalculationClass
revision_count: int
latest_revision_id: RevisionId
latest_revision_valid_from: date
supported_revision_ids: tuple[RevisionId, ...]
calc_grade: bool
has_completeness_manifest: bool
has_fixed_width_export: bool
has_xml_dictionary_export: bool
has_extractor: bool
extraction_profile_count: int
renames: tuple[ModeloRenameRecord, ...]
deprecations: tuple[ModeloSupportRemovalRecord, ...]
portal_compatibility_refs: tuple[ModeloPortalCompatibilityRef, ...]
property is_deprecated: bool

Return whether the latest revision declares a support-removal decision.

build_support_matrix(authority)[source]

Probe every modelo in authority and return its typed support row.

Parameters:

authority (ValidatedRegistryAuthority) – The ValidatedRegistryAuthority to probe.

Return type:

tuple[ModeloEntry, ...]

Returns:

Every modelo’s ModeloEntry, sorted by modelo_id.