cadrumo.domain.calculations.registry.static_inspection module

Typed non-filing projection of one registry revision.

Static generators inspect a reviewed source design against the declarations of one named revision. That work must not manufacture a filing context or obtain a RegistrySnapshot: a snapshot is the later, filing-instance authority. This model deliberately exposes only the immutable facts a static consumer may admit.

class GeneratedArtifactSource(*args, **kwargs)[source]

Bases: Protocol

The byte-authority fields a generated-artifact verifier consumes.

property id: SourceRefId

Return the source-reference identity.

property kind: RegistrySourceKind

Return the source kind.

property corpus_path: str

Return the bundled corpus path.

property sha256: str

Return the expected source digest.

property bytes: int

Return the expected source byte length.

property applies_from: date | None

Return the lower applicability bound.

property applies_to: date | None

Return the upper applicability bound.

property record_design_epoch: str | None

Return the record-design epoch, when declared.

property corpus_tier: _coerce, json_schema_input_type=PydanticUndefined)] | None

Return the corpus authority tier, when declared.

applies_across(span_from, span_to)[source]

Report whether this source’s applicability window overlaps one date span.

See SourceReference.applies_across() for the one definition of the overlap rule this Protocol member declares.

Return type:

bool

Parameters:
  • span_from (date)

  • span_to (date | None)

class StaticGeneratedArtifactSource(id, kind, corpus_path, sha256, bytes, applies_from, applies_to, record_design_epoch, corpus_tier)[source]

Bases: object

Immutable byte-authority facts copied for diagnostic verification.

Parameters:
  • id (SourceRefId)

  • kind (RegistrySourceKind)

  • corpus_path (str)

  • sha256 (str)

  • bytes (int)

  • applies_from (date | None)

  • applies_to (date | None)

  • record_design_epoch (str | None)

  • corpus_tier (Annotated[CorpusTier, BeforeValidator(func=~cadrumo.domain.calculations.registry.schema_base.coerce_enum_member.<locals>._coerce, json_schema_input_type=PydanticUndefined)] | None)

id: TypeAliasType
kind: RegistrySourceKind
corpus_path: str
sha256: str
bytes: int
applies_from: date | None
applies_to: date | None
record_design_epoch: str | None
corpus_tier: Optional[Annotated[CorpusTier]]
applies_across(span_from, span_to)[source]

Report whether this copied window overlaps one date span.

Delegates to the same rule the live SourceReference uses, so a diagnostic copy can never answer the applicability question differently from the source it was copied from. Without this method the generated provenance verifier raised on every probe, because it asks a copied source the question it asks a live one.

Return type:

bool

Parameters:
  • span_from (date)

  • span_to (date | None)

classmethod from_source(source)[source]

Copy the exact source fields used by generated-artifact verification.

Return type:

StaticGeneratedArtifactSource

Parameters:

source (SourceReference)

class StaticGeneratedArtifactInspection(modelo_id, revision_id, revision_source_refs, sources, legal_ref_ids, casilla_ids, binding_ids, projection_endpoints)[source]

Bases: object

Minimal immutable revision facts for diagnostic generated-artifact checks.

Parameters:
modelo_id: TypeAliasType
revision_id: TypeAliasType
revision_source_refs: tuple[TypeAliasType, ...]
sources: Mapping[TypeAliasType, StaticGeneratedArtifactSource]
legal_ref_ids: frozenset[TypeAliasType]
casilla_ids: frozenset[TypeAliasType]
binding_ids: frozenset[TypeAliasType]
projection_endpoints: tuple[ProjectionEndpointDeclaration, ...]
class RegistryRevisionInspection(**data)[source]

Bases: RegistryModel

The static admission facts for one explicit registry revision.

It intentionally carries neither a filing year nor a period. A caller must select revision_id explicitly, then use the retained source, casilla, binding, projection, and legal identifiers to validate generated static artefacts. It cannot calculate, render, or file anything.

modelo_id: ModeloId
revision_id: RevisionId
review_status: RevisionReviewStatus

The revision’s own governance stamp – not filing-grade content, so it stays in scope for a static inspection whose job is validating generated static artefacts against a revision it may or may not trust yet.

family_dispositions: Annotated[Mapping[str, SchemaFamilyDispositionDeclaration], FROZEN_MAPPING]

The revision’s declared not-applicable schema families and their grounding reason/legal_refs/source_refs – classification metadata, not filing-grade content, so it stays in scope for a static inspection.

source_root: Path | None

Development source root when the inspection was built by the compiler.

Published inspections intentionally carry no corpus root; runtime source consumers must request an explicit signed projection instead.

revision_source_refs: tuple[SourceRefId, ...]
sources: Annotated[Mapping[SourceRefId, SourceReference], FROZEN_MAPPING]

The exact source catalogue slice exercised by this model/revision.

source_ref_ids: frozenset[SourceRefId]
legal_ref_ids: frozenset[LegalRefId]

The exact legal-reference union exercised by this model/revision.

casilla_ids: frozenset[CasillaId]
casilla_sections: Annotated[Mapping[CasillaId, tuple[str, ...]], FROZEN_MAPPING]
casilla_localization_keys: Annotated[Mapping[CasillaId, tuple[str, ...]], FROZEN_MAPPING]

Each casilla’s ordered label key chain, as the loaded revision enrolled it.

A label is resolved through this chain, never through one derived key, so an inherited or lineage-keyed casilla reads the text its catalogue home holds.

binding_ids: frozenset[BindingId]
projection_endpoints: tuple[ProjectionEndpointDeclaration, ...]
formulas: tuple[FormulaDefinition, ...]
parameters: tuple[ParameterDefinition, ...]
bindings: tuple[BindingDefinition, ...]
workbook_parity_refs: tuple[WorkbookParityReference, ...]
live_cross_references: tuple[LiveCrossReferenceDecision, ...]
classmethod from_revision(*, modelo, revision, source_root, sources, legal_ref_ids)[source]

Project one loaded revision without creating a filing snapshot.

Core types: ModeloDefinition, ModeloRevision.

Return type:

RegistryRevisionInspection

Parameters: