aeat.domain.calculations.registry._workbook_parity_models module

Workbook parity data contracts exposed through the parity facade.

class WorkbookParityModel(**data)[source]

Bases: BaseModel

Strict frozen base for workbook parity records.

class WorkbookCellRef(**data)[source]

Bases: WorkbookParityModel

A cell participating in official workbook parity evidence.

Parameters:
  • sheet (str)

  • coordinate (str)

  • formula (str | None)

sheet: str
coordinate: str
formula: str | None
class WorkbookArtefactReport(**data)[source]

Bases: WorkbookParityModel

Discovery report for one AEAT workbook artefact.

Parameters:
path: str
modelo: str | None
extension: _WorkbookExtension
bytes: int
sha256: str
sheets: tuple[str, ...]
formula_cells: int
input_candidates: tuple[WorkbookCellRef, ...]
output_candidates: tuple[WorkbookCellRef, ...]
workbook_kind: WorkbookKind
evidence_tier: EvidenceTier | None
not_evidence_for: tuple[EvidenceTier, ...]
scan_status: WorkbookScanStatus
error: str | None
elapsed_seconds: Decimal
class WorkbookConversionReport(**data)[source]

Bases: WorkbookParityModel

Safe isolated conversion report for one binary XLS artefact.

Parameters:
  • path (str)

  • modelo (str | None)

  • bytes (int)

  • sha256 (str)

  • converted_extension (Literal['.xlsx'] | None)

  • sheets (tuple[str, ...])

  • formula_cells (int)

  • input_candidates (tuple[WorkbookCellRef, ...])

  • output_candidates (tuple[WorkbookCellRef, ...])

  • workbook_kind (WorkbookKind)

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

  • not_evidence_for (tuple[Literal['legal_authority', 'official_source_guidance', 'executable_parity_evidence', 'layout_authority'], ...])

  • conversion_status (Literal['converted', 'failed'])

  • error (str | None)

  • elapsed_seconds (Decimal)

path: str
modelo: str | None
bytes: int
sha256: str
converted_extension: _ConvertedExtension | None
sheets: tuple[str, ...]
formula_cells: int
input_candidates: tuple[WorkbookCellRef, ...]
output_candidates: tuple[WorkbookCellRef, ...]
workbook_kind: WorkbookKind
evidence_tier: EvidenceTier | None
not_evidence_for: tuple[EvidenceTier, ...]
conversion_status: WorkbookConversionStatus
error: str | None
elapsed_seconds: Decimal
class SyntheticInputValue(**data)[source]

Bases: WorkbookParityModel

One synthetic value shared by registry and workbook parity execution.

Parameters:
id: str
value: Decimal | int | str | bool
workbook_cell: WorkbookCellRef | None
registry_binding: BindingId | CasillaId | None
class SyntheticInputSet(**data)[source]

Bases: WorkbookParityModel

Synthetic parity fixture applied to both registry and workbook execution.

Parameters:
id: str
modelo: str
revision: str
values: tuple[SyntheticInputValue, ...]
class WorkbookRunnerAvailability(**data)[source]

Bases: WorkbookParityModel

Availability of a local workbook recalculation runner.

Parameters:
  • status (Literal['available'])

  • engine (Literal['libreoffice-headless', 'excel-com'] | None)

  • executable (str | None)

  • detail (str)

status: WorkbookRunnerStatus
engine: WorkbookRunnerEngine | None
executable: str | None
detail: str
class WorkbookParityComparison(**data)[source]

Bases: WorkbookParityModel

One registry-vs-workbook output comparison.

Parameters:
output_id: WorkbookOutputId
workbook_cell: WorkbookCellRef
expected_workbook_value: Decimal | int | str | bool | None
actual_registry_value: Decimal | int | str | bool | None
status: ParityStatus
tolerance: Decimal
legal_refs: tuple[LegalRefId, ...]
source_refs: tuple[SourceRefId, ...]
detail: str | None
class WorkbookParityRunReport(**data)[source]

Bases: WorkbookParityModel

Trace report for one parity execution attempt.

Parameters:
synthetic_input_id: str
registry_snapshot_id: str | None
workbook: WorkbookArtefactReport
runner: WorkbookRunnerAvailability
comparisons: tuple[WorkbookParityComparison, ...]
status: ParityStatus
class WorkbookModeloCoverage(**data)[source]

Bases: WorkbookParityModel

Per-modelo workbook coverage summary for model-law ledgers.

Parameters:
  • modelo (str)

  • workbook_count (int)

  • formula_workbook_count (int)

  • unsupported_xls_count (int)

  • failed_count (int)

modelo: str
workbook_count: int
formula_workbook_count: int
unsupported_xls_count: int
failed_count: int
property passed: bool

Return True if all workbooks are supported and scanned successfully.

class WorkbookBackendVerificationReport(**data)[source]

Bases: WorkbookParityModel

Backend-level verification report for workbook calculation coverage.

Parameters:
root: str
workbook_count: int
scanned_count: int
formula_workbook_count: int
unsupported_xls_count: int
failed_count: int
runner: WorkbookRunnerAvailability
reports: tuple[WorkbookArtefactReport, ...]
modelo_coverage: tuple[WorkbookModeloCoverage, ...]
property backend_exists: bool

Return whether discovery and guardable reports exist.

property passed: bool

Return True if all workbooks are supported and scanned successfully.