aeat.core._casilla_id module¶
Canonical casilla-id primitive shared across architecture layers.
The CasillaId alias is the shared key for registry casillas,
CLI --casilla inputs, parser observations, and calculation payloads.
It is re-exported by domain.calculations.registry and anchors
CasillaDefinition,
CalculationCompletenessCasilla,
and filing snapshot facts such as
ManualFactBasisEntry.
Use validated_casilla_id() or validated_casilla_id_map()
at boundaries so display numbers, labels, and export metadata do not
masquerade as canonical registry identifiers. Registry membership helpers
such as casillas_by_id() and
declared_casilla_ids() then compare
only declared casilla.id values.
The alias is a structural token, not a registry lookup. It can prove that a
string is shaped like a canonical casilla.id; only a selected
ModeloRevision can prove that the id
is declared for a filing context.
- validated_casilla_id(value, *, surface='casilla.id')[source]¶
Return
valueas a canonicalCasillaId, failing at the declaring surface.This validates the token shape only. Callers that need revision membership must also compare against
declared_casilla_ids()orundeclared_casilla_ids().- Parameters:
- Raises:
ValueError – When
valueis not a string or fails the canonicalcasilla.idshape.- Return type:
TypeAliasType
- validated_casilla_id_map(values, *, surface='casilla.id map')[source]¶
Return
valueskeyed by validatedCasillaIddeclarations.Mapping validators feed registry and filing surfaces that accept
dict[CasillaId, T]inputs, including calculation-revision snapshots and registry filing test helpers. Likevalidated_casilla_id(), this checks key shape only; the caller remains responsible for validating membership against the selectedModeloRevision.