cadrumo.domain.calculations.registry.casilla_membership module¶
Registry-scoped casilla id membership helpers.
The helpers inspect one
ModeloRevision and return canonical
CasillaDefinition membership keyed
only by declared casilla.id values.
See also
core.casilla_idShape validation for
CasillaId.domain.calculations.registry.formula_runtime_opsRuntime input canonicalisation that rejects undeclared casillas through these helpers.
application.modelo._registry_helpersApplication boundary that refuses non-canonical casilla metadata tokens.
- duplicate_casilla_ids(casilla_ids)[source]¶
Return the ids appearing more than once in
casilla_ids, sorted.For a collection that must address each casilla exactly once — a revision’s
CasillaDefinitiondeclarations, a calculation result’s observation and unresolved rows — a repeated id makes the downstream mapping resolve by position and drop every row but the last. This is the one fold that names the repeats so such a collection can refuse the ambiguity at construction.Not every casilla-keyed collection is under that rule: multi-row informativas repeat a casilla once per declared item, and their ordered row tuple is the multiplicity carrier. Callers decide whether repetition is ambiguity or payload; this helper only reports it.
- casillas_by_id(revision)[source]¶
Return casilla definitions keyed by canonical
casilla.id.- Parameters:
revision (
ModeloRevision) – TheModeloRevisionwhoseCasillaDefinitiondeclarations are inspected.- Return type:
dict[TypeAliasType,CasillaDefinition]
- declared_casilla_ids(revision)[source]¶
Return canonical ids declared by a registry revision.
The returned
CasillaIdset is scoped to oneModeloRevision; it is stronger than shape validation alone.- Return type:
frozenset[TypeAliasType]- Parameters:
revision (ModeloRevision)
- row_template_casilla_ids(revision)[source]¶
Return the casillas that are one field of a record a row-set binding emits.
Such a casilla is written once per emitted row, never typed once as a scalar, so its completeness belongs to the row source. The record is named by the casilla’s leading section and by the row-set binding’s provider.
Core types:
ModeloRevision.- Return type:
frozenset[TypeAliasType]- Parameters:
revision (ModeloRevision)
- undeclared_casilla_ids(revision, casilla_ids)[source]¶
Return ids not declared by a registry revision.
The
revisionargument is aModeloRevision. Use this after raw keys have already been validated asCasillaIdshape-compatible.- Return type:
- Parameters:
revision (ModeloRevision)
- casilla_noncanonical_reference_tokens(revision)[source]¶
Return refused metadata tokens for a registry revision.
The
revisionargument is aModeloRevision. The keys are printed numbers, form numbers, and export refs that are not canonicalcasilla.idvalues. Values are the canonical candidateCasillaIdentries.- Return type:
- Parameters:
revision (ModeloRevision)
- casilla_noncanonical_reference_targets(revision, token)[source]¶
Return canonical ids whose revision metadata matches a token.
The
revisionargument is aModeloRevision. Callers use this to reject printed numbers, form numbers, and export refs while still naming the canonical casilla candidates in diagnostics.- Return type:
- Parameters:
revision (ModeloRevision)
token (str)
- format_noncanonical_casilla_reference(token, targets)[source]¶
Render a refused metadata token with its canonical casilla candidates.
targetscomes fromcasilla_noncanonical_reference_targets(). A single target is rendered as a correction while multiple targets are rendered as an ambiguity so every boundary explains why it cannot infer an id from a printed number, form number, or export reference.