aeat.application.modelo._verification_cross_period module

Cross-period clean-state findings for modelo verification gates.

This module adapts evaluate_cross_period_clean_state() into ModeloVerificationFinding rows. It can inspect the target CalculationRevision for explicit zero previous-filing binding overrides before deciding whether a prior-year carry requires upstream filing evidence.

cross_period_expected_member_sets_from_profile(profile, explicit_member_sets=())

Project durable profile rosters into the clean-state proof contract.

Explicit caller-provided sets are appended last so they retain the existing override semantics inside evaluate_cross_period_clean_state when both sources carry the same (modelo, year, period) key.

Return type:

tuple[CrossPeriodExpectedMemberSet, ...]

Parameters:
derive_taxpayer_files_economic_activity(profile)[source]

Whether the taxpayer files actividad-económica pagos fraccionados (130/131).

Reads the TaxpayerProfile income-category declarations. True when the profile declares actividad-económica income; False when it declares income categories that exclude it (a salaried/rental-only filer never files 130/131); None when income categories are undeclared (fail-closed: the 130/131 dependency stays enforced). LIRPF art. 99 / RIRPF art. 109.

Return type:

bool | None

Parameters:

profile (TaxpayerProfile)

derive_not_applicable_source_modelos(profile, modelos)[source]

Return source modelos positively known not applicable for profile.

The clean-state gate is fail-closed: if applicability derivation raises or returns an incomplete/undetermined verdict for any queried modelo, callers receive None and suppress nothing. A positive NOT_APPLICABLE result is grounded in the same deadline/applicability rules that decide whether the TaxpayerProfile files M130 vs M131.

Return type:

frozenset[str] | None

Parameters: