aeat.application.modelo._borrador_binding module¶
Application-owned borrador binding resolution.
The CLI may parse a snapshot id, but the decision to consume values from
a captured borrador belongs here: the application layer checks the
work-unit axis, snapshot state, registry eligibility, and precedence
against caller-supplied binding overrides before the calculation engine
receives any values. Eligibility is determined by inspecting the
RegistrySnapshot for the "borrador" capability declaration.
Only modelos that declare the "borrador" capability in their registry
manifest are eligible. Adding support for a new modelo requires only a
TOML edit — no code change.
See also
aeat.application.modelo._binding_resolution.resolve_borrador_source_tier()Binding-resolution tier that inserts this resolver before backend mesh and caller-value overlay.
aeat.application.aggregation._source_mesh.CalculationSourceResolutionTyped source-resolution envelope carrying the resolved borrador values.
aeat.application.aggregation._source_mesh.BorradorSourceProvenanceSnapshot id and sourced-binding trace persisted onto the calculation revision.
aeat.application.live._borrador_100.Borrador100SnapshotRepositorySecure snapshot repository used to load the explicitly selected borrador capture.
- exception Modelo100BorradorBindingError(message=None, *, context=None, suggestion=None, translated_message=None)[source]¶
Bases:
ModeloErrorRaised when borrador values cannot be consumed for a calculation.
- Parameters:
- Return type:
None
- code: ClassVar[ErrorCode]¶
- class Modelo100BorradorBindingCommand(**data)[source]¶
Bases:
BaseModelCommand contract for resolving one optional borrador snapshot.
The typed
Periodand bucket/modelo axes are checked against both the selectedRegistrySnapshotand the loaded live borrador snapshot before any binding values are emitted.- Parameters:
- bucket_id: BucketId¶
- modelo: str¶
- filing_year: int¶
- period: Period¶
- borrador_snapshot_id: str | None¶
- caller_binding_values: Mapping[BindingId, Decimal]¶
- caller_enum_binding_values: Mapping[BindingId, str]¶
- resolve_modelo_100_borrador_bindings(command, *, registry_snapshot, snapshot_repository=None)[source]¶
Resolve eligible borrador values into a
CalculationSourceResolutionfor one Modelo 100 calculation.- Parameters:
command (
Modelo100BorradorBindingCommand) – The borrador binding command carrying the modelo and bucket axes.registry_snapshot (
RegistrySnapshot) – TheRegistrySnapshotused to verify the borrador capability and selectaeat_prefilledbindings.snapshot_repository (
Borrador100SnapshotRepository|None) – Optional borrador snapshot repository override.
- Return type:
The function is deliberately inert when no snapshot is supplied: borrador values are never consumed implicitly. When a snapshot is supplied, caller values take precedence and the snapshot may only contribute bindings explicitly marked
aeat_prefilledby the registry revision passed to the service.- Return type:
- Returns:
A
CalculationSourceResolutionwithowned_sourcesset toborradorand, when values participate, typedBorradorSourceProvenanceplus genericCalculationSourceProvenancerows for each sourced binding.- Parameters:
command (Modelo100BorradorBindingCommand)
registry_snapshot (RegistrySnapshot)
snapshot_repository (Borrador100SnapshotRepository | None)
- class Modelo100BorradorSourceResolver(*, borrador_snapshot_id, caller_binding_values, caller_enum_binding_values, registry_snapshot=None, snapshot_repository=None)[source]¶
Bases:
objectSource mesh adapter for explicitly selected Modelo 100 borrador snapshots.
The adapter lets the general source mesh call
resolve_modelo_100_borrador_bindings()with aCalculationSourceContext. When noRegistrySnapshotwas supplied at construction, the context selects one from the registry authority.- Parameters:
borrador_snapshot_id (str | None)
caller_binding_values (Mapping[BindingId, Decimal])
caller_enum_binding_values (Mapping[BindingId, str])
registry_snapshot (RegistrySnapshot | None)
snapshot_repository (Borrador100SnapshotRepository | None)
- resolver_id¶
-
owned_sources:
tuple[BindingSourceKind,...]¶
- resolve(context)[source]¶
Resolve the optional borrador tier for
context.Secure-storage degradation while loading the selected borrador snapshot returns an empty
CalculationSourceResolutioncarrying diagnostics instead of raising, matching the source-mesh resolver contract.- Return type:
- Parameters:
context (CalculationSourceContext)