cadrumo.domain.user_profile.registry_contract module¶
Cross-reference user-profile schema metadata against modelo registry use.
Validates every ModeloDefinition in the registry against the
user-profile schema, checking that each ModeloRevision binding
selector, filing schedule predicate, and deadline applicability condition
maps to a declared profile fact path.
- class UserProfileRegistryContractIssue(**data)[source]¶
Bases:
BaseModelOne unresolved cross-reference between user-profile schema and modelos.
- Parameters:
data (Any)
- severity: Literal[BaseSeverity.ERROR, BaseSeverity.WARNING]¶
- modelo_id: str¶
- revision_id: RevisionId¶
- surface: Literal['binding', 'filing_schedule', 'deadline_window', 'export_layout', 'cross_reference_applicability']¶
- construct_id: str¶
- selector: str¶
- message: str¶
- class UserProfileSelectorIndex(**data)[source]¶
Bases:
BaseModelSchema-owned selector namespaces consumed by modelo registry surfaces.
- Parameters:
data (Any)
- profile_selectors: frozenset[str]¶
- schedule_predicates: frozenset[str]¶
- field_paths: frozenset[str]¶
- derived_selectors: tuple[ProfileDerivedSelectorDefinition, ...]¶
Namespaces the engine owns and computes. Kept as typed models rather than folded into
profile_selectorsbecause a pattern carrying a placeholder is not a literal set member – set membership could never see it – and because a caller resolving a selector this way needs to know WHICH pattern matched, not merely that one did.
- class UserProfileRegistryContractReport(**data)[source]¶
Bases:
BaseModelTyped result for profile schema coverage against modelo registry usage.
- Parameters:
data (Any)
- schema_id: str¶
- schema_version: int¶
- checked_modelos: tuple[str, ...]¶
- issues: tuple[UserProfileRegistryContractIssue, ...]¶
- property errors: tuple[UserProfileRegistryContractIssue, ...]¶
Return blocking
UserProfileRegistryContractIssuefailures.
- property warnings: tuple[UserProfileRegistryContractIssue, ...]¶
Return non-blocking
UserProfileRegistryContractIssuecoverage gaps.
- build_user_profile_selector_index(schema)[source]¶
Build the profile selector namespaces declared by the TOML schema.
- Return type:
- Returns:
A
UserProfileSelectorIndexwith all declared selector namespaces.- Parameters:
schema (ProfileSchemaDefinition)
- validate_user_profile_registry_contract(modelos, schema)[source]¶
Validate all profile-facing modelo registry references against the schema.
Blocking errors are reserved for model calculation and schedule selectors that cannot be resolved from schema-declared profile facts. Export header gaps are warnings during the rollout because several committed layouts use non-profile operational headers that will move behind an export-context backend rather than a live taxpayer profile fact.
- Parameters:
modelos (
Iterable[ModeloDefinition]) – Iterable ofModeloDefinitioninstances to validate.schema (
ProfileSchemaDefinition) – The user-profile schema to validate registry references against.
- Return type:
- Returns:
A
UserProfileRegistryContractReportwith all issues found.
- profile_binding_selectors(provider)[source]¶
Return the declared user-profile paths selected by one binding provider.
Only a
ProfileProvidernames a profile path; every other union member’s shape carries none, so it yields the empty tuple.- Return type:
- Parameters:
provider (Annotated[ManualInputProvider | DesignConstantProvider | ProfileProvider | PreviousFilingProvider | RelationPrefillProvider | IvaCompensationAnnualPartitionProvider | M303RegimenSimplificadoAnnualSummaryProvider | ProrrataRegularizacionProvider | BienesInversionRegularizacionProvider | LedgerIvaProvider | LedgerOssProvider | LedgerRentaIncomeProvider | LedgerRentaGastosEstimacionDirectaProvider | LedgerRentaGastosPagoFraccionadoProvider | LedgerImpatriadoIncomeProvider | LedgerIrnrIncomeProvider | RetencionesAggregationProvider | WithholdingProvider | Withholding296Provider | LedgerTransactionProvider | PurchaseInvoiceEvidenceProvider | PayableInvoiceProvider | CollectibleInvoiceProvider | M347ThirdPartyOperationProvider | ForeignAssetProvider | RelatedPartyOperationProvider | AtribucionMemberProvider | RefundOperationProvider | DonativoDonorProvider | Gasto193ContributorProvider | InventoryProvider, FieldInfo(annotation=NoneType, required=True, discriminator='kind')])