aeat.application.modelo._semantic_role_resolution module¶
Single-casilla semantic-role resolution for modelo application services.
Snapshot-backed callers pass a RegistrySnapshot so semantic roles
resolve only to declared canonical casilla.id values for that revision.
Advisory helpers that already hold a revision object use the structural
revision resolver and get the same ambiguity guard.
See also
_calculate_inputWork-unit input shortcuts that resolve operator-facing semantic-role tokens through a registry snapshot.
_binding_resolutionDeclaration-period metadata binding path that only accepts informational semantic-role casillas.
_taxation_comparisonSnapshot-backed comparison surface that uses semantic roles for the Modelo 100 result and quota casillas.
- class SemanticRoleCasillaAmbiguity(semantic_role, modelo_id, revision_id, casilla_ids)[source]¶
Bases:
objectStructured detail for a semantic role that resolves to multiple casillas.
Attached to
AmbiguousSemanticRoleCasillaErrorso callers can relay the ambiguous role, modelo, revision, and candidate casillas without parsing the error message.- Parameters:
- exception AmbiguousSemanticRoleCasillaError(ambiguity)[source]¶
Bases:
ModeloError,ValueErrorRaised when a semantic-role resolver would emit an arbitrary casilla id.
The exception carries a
SemanticRoleCasillaAmbiguitypayload instead of selecting one candidate, preserving the canonicalcasilla.idcontract.- Parameters:
ambiguity (SemanticRoleCasillaAmbiguity)
- Return type:
None
- code: ClassVar[ErrorCode]¶
- casilla_id_for_unique_semantic_role(snapshot, semantic_role)[source]¶
Return the unique casilla id for
semantic_roleinsnapshot.Nonemeans the concrete revision does not declare the role. Multiple matches are refused because returning one would silently convert a non- canonical reference into an arbitrary canonicalcasilla.id.- Parameters:
snapshot (
RegistrySnapshot) – TheRegistrySnapshotwhose revision is inspected.semantic_role (
str) – Semantic role token to resolve.
- Return type:
TypeAliasType|None
- casilla_id_for_unique_revision_semantic_role(revision, semantic_role, *, modelo_id=None)[source]¶
Return the unique casilla id for
semantic_roleinrevision.This accepts a structural revision object so advisory helpers that only receive a revision can share the same ambiguity guard as snapshot-backed services. The object must expose
idandcasillasattributes compatible with the registryModeloRevisionshape.