aeat.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 UserProfileRegistryContractSeverity(*values)[source]

Bases: StrEnum

Severity of a user-profile to modelo-registry contract issue.

ERROR
WARNING
class UserProfileRegistryContractIssue(**data)[source]

Bases: BaseModel

One unresolved cross-reference between user-profile schema and modelos.

Parameters:
severity: UserProfileRegistryContractSeverity
modelo_id: str
revision_id: str
surface: Literal['binding', 'filing_schedule', 'deadline_window', 'export_layout', 'cross_reference_applicability']
construct_id: str
selector: str
message: str
class UserProfileSelectorIndex(**data)[source]

Bases: BaseModel

Schema-owned selector namespaces consumed by modelo registry surfaces.

Parameters:
profile_selectors: frozenset[str]
schedule_predicates: frozenset[str]
export_headers: frozenset[str]
field_paths: frozenset[str]
class UserProfileRegistryContractReport(**data)[source]

Bases: BaseModel

Typed result for profile schema coverage against modelo registry usage.

Parameters:
schema_id: str
schema_version: int
checked_modelos: tuple[str, ...]
issues: tuple[UserProfileRegistryContractIssue, ...]
property errors: tuple[UserProfileRegistryContractIssue, ...]

Return blocking UserProfileRegistryContractIssue failures.

property warnings: tuple[UserProfileRegistryContractIssue, ...]

Return non-blocking UserProfileRegistryContractIssue coverage gaps.

property valid: bool

Return whether all blocking selector references resolve.

build_user_profile_selector_index(schema)[source]

Build the profile selector namespaces declared by the TOML schema.

Return type:

UserProfileSelectorIndex

Returns:

A UserProfileSelectorIndex with 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:
Return type:

UserProfileRegistryContractReport

Returns:

A UserProfileRegistryContractReport with all issues found.

profile_binding_selectors(selector)[source]
Return type:

tuple[str, ...]

Parameters:

selector (Mapping[str, object] | BaseModel)