cadrumo.domain.calculations.registry.authority_artifact module¶
Typed authority values and the indexed component codec.
Product runtime admits only the descriptor-selected SQLite generation and
decodes addressed immutable components from it. AuthorityArtifact is the
development compiler’s in-memory typed handoff into that database builder.
This module knows no registry root and provides no eager runtime loader.
Core types:
ModeloDefinition,
ModeloRevision.
- class AuthorityComponentKind(*values)[source]¶
Bases:
StrEnumClosed component families addressable in one authority generation.
- MODELO_REVISION¶
- MODELO_DIRECTORY¶
- GOVERNED_FACT¶
- PROFILE_SCHEMA¶
- RUNTIME_CATALOGUE¶
- LEGAL_REFERENCE¶
- SOURCE_REFERENCE¶
- LEGAL_EVIDENCE¶
- SOURCE_EVIDENCE¶
- EXPORT_LAYOUT¶
- SNAPSHOT_GLOBALS¶
- class AuthorityGenerationPin(logical_generation, reader_incarnation)[source]¶
Bases:
objectImmutable identity of the reader incarnation used by one operation.
- class ModeloRevisionComponentQuery(modelo_id, revision_id, kind=AuthorityComponentKind.MODELO_REVISION)[source]¶
Bases:
objectRetrieve one complete modelo revision by its canonical identity.
- Parameters:
modelo_id (str)
revision_id (str)
kind (Final[AuthorityComponentKind])
-
kind:
Final[AuthorityComponentKind]¶
- class ModeloDirectoryComponentQuery(modelo_id, kind=AuthorityComponentKind.MODELO_DIRECTORY)[source]¶
Bases:
objectRetrieve complete canonical selection metadata for one modelo.
- Parameters:
modelo_id (str)
kind (Final[AuthorityComponentKind])
-
kind:
Final[AuthorityComponentKind]¶
- class GovernedFactComponentQuery(fact_id, kind=AuthorityComponentKind.GOVERNED_FACT)[source]¶
Bases:
objectRetrieve one governed fact declaration and all its resolved variants.
- Parameters:
fact_id (str)
kind (Final[AuthorityComponentKind])
-
kind:
Final[AuthorityComponentKind]¶
- class ProfileSchemaComponentQuery(schema_id='cadrumo.user_profile', kind=AuthorityComponentKind.PROFILE_SCHEMA)[source]¶
Bases:
objectRetrieve the complete public profile declaration for a pinned operation.
- Parameters:
schema_id (str)
kind (Final[AuthorityComponentKind])
-
kind:
Final[AuthorityComponentKind]¶
- class RuntimeCatalogueComponentQuery(family, kind=AuthorityComponentKind.RUNTIME_CATALOGUE)[source]¶
Bases:
objectRetrieve one named runtime catalogue without hydrating sibling families.
- Parameters:
family (str)
kind (Final[AuthorityComponentKind])
-
kind:
Final[AuthorityComponentKind]¶
- class SnapshotGlobalsComponentQuery(key='snapshot', kind=AuthorityComponentKind.SNAPSHOT_GLOBALS)[source]¶
Bases:
objectRetrieve the small registry-wide values needed by point snapshots.
- Parameters:
kind (Final[AuthorityComponentKind])
-
kind:
Final[AuthorityComponentKind]¶
- class ReferenceComponentQuery(reference_id, kind)[source]¶
Bases:
objectRetrieve one legal or public-source declaration by canonical id.
- Parameters:
reference_id (str)
kind (AuthorityComponentKind)
-
kind:
AuthorityComponentKind¶
- class ExportLayoutComponentQuery(modelo_id, revision_id, layout_id, kind=AuthorityComponentKind.EXPORT_LAYOUT)[source]¶
Bases:
objectRetrieve one substantial export layout separated from its revision.
- Parameters:
modelo_id (str)
revision_id (str)
layout_id (str)
kind (Final[AuthorityComponentKind])
-
kind:
Final[AuthorityComponentKind]¶
- class EvidenceComponentQuery(reference_id, kind)[source]¶
Bases:
objectRetrieve one legal or public-source evidence projection by canonical id.
- Parameters:
reference_id (str)
kind (AuthorityComponentKind)
-
kind:
AuthorityComponentKind¶
- class AuthorityComponentReader(*args, **kwargs)[source]¶
Bases:
ProtocolGeneration-pinned typed component access used by runtime consumers.
- load(query, *, pin)[source]¶
Load one component from exactly
pinor refuse a stale/cross-reader pin.- Return type:
- Parameters:
query (AuthorityComponentQuery)
pin (AuthorityGenerationPin)
- class ProfileCreateContext(schema, generation)[source]¶
Bases:
objectSchema authority required when creating taxpayer profile values.
- Parameters:
schema (ProfileSchemaDefinition)
generation (AuthorityGenerationPin)
-
schema:
ProfileSchemaDefinition¶
-
generation:
AuthorityGenerationPin¶
- class ProfileDecodeContext(schema, generation)[source]¶
Bases:
objectSchema authority required when decoding encrypted persisted profile values.
- Parameters:
schema (ProfileSchemaDefinition)
generation (AuthorityGenerationPin)
-
schema:
ProfileSchemaDefinition¶
-
generation:
AuthorityGenerationPin¶
- exception AuthorityComponentCodecError(message=None, *, context=None, translated_message=None)[source]¶
Bases:
CadrumoErrorOne addressed component failed canonical encoding or strict decoding.
- Parameters:
- Return type:
None
- code¶
- encode_authority_component(query, value)[source]¶
Encode one typed component with the canonical authority value vocabulary.
- decode_authority_component(query, payload, *, dependencies=(), fact_query_observer=None)[source]¶
Strictly decode one addressed component using only declared dependencies.
- Return type:
- Parameters:
query (AuthorityComponentQuery)
payload (bytes)
fact_query_observer (Callable[[Annotated[ScalarFactQuery | BracketFactQuery | MappingFactQuery | EntitySetFactQuery | OverrideFactQuery | EventFactQuery | MultiOutputFactQuery, FieldInfo(annotation=NoneType, required=True, discriminator='family')]], None] | None)
- authority_component_identity(query)[source]¶
Return the stable database identity for one public typed query.
- Return type:
- Parameters:
query (AuthorityComponentQuery)
- authority_query_from_identity(kind, key)[source]¶
Reconstruct a public typed query from one validated component directory row.
- class PublishedLegalEvidence(legal_reference_id, anchored_text, text_sha256, provenance=NormativeCorpusProvenance.OUT_OF_SCOPE)[source]¶
Bases:
objectOne publisher-validated, anchor-scoped legal text projection.
This is deliberately text and identity, rather than a corpus filename or source root. The release artifact is the runtime evidence boundary.
- Parameters:
legal_reference_id (str)
anchored_text (str)
text_sha256 (str)
provenance (NormativeCorpusProvenance)
-
provenance:
NormativeCorpusProvenance¶
- class PublishedSourceEvidence(source_reference_id, payload, payload_sha256)[source]¶
Bases:
objectPublisher-validated source bytes required by a shipped workflow.
Corpus paths remain descriptive catalogue metadata. A runtime reader gets bytes only through this digest-checked projection, never by joining that path to a package or checkout root.
- class AuthorityEvidenceProjection(legal=(), sources=())[source]¶
Bases:
objectImmutable evidence needed by citation consumers after publication.
- Parameters:
legal (tuple[PublishedLegalEvidence, ...])
sources (tuple[PublishedSourceEvidence, ...])
-
legal:
tuple[PublishedLegalEvidence,...]¶
-
sources:
tuple[PublishedSourceEvidence,...]¶
- legal_text(legal_reference_id)[source]¶
Return publisher-validated text for one legal citation or refuse.
- quotation_is_grounded(legal_reference_id, quotation)[source]¶
Answer a citation query without opening any authoring corpus path.
- class AuthorityBuildIdentity(source_identity_digest, compiler_identity_digest, component_dependency_digest)[source]¶
Bases:
objectDistinct source, compiler, and whole-generation dependency receipts.
- Parameters:
- class AuthorityArtifact(modelos, catalogues, identity_digest, build_identity, profile_schema, evidence=AuthorityEvidenceProjection(legal=(), sources=()))[source]¶
Bases:
objectComplete typed authority payload emitted only after registry validation.
identity_digestis the content-addressed identity of the registry and source-evidence inputs development validated to produce this authority. The graph is deeply immutable: its models are frozen and its mappings are frozen mappings, so a consumer cannot change what any other holder of the same instance observes.- Parameters:
modelos (tuple[ModeloDefinition, ...])
catalogues (RegistryCatalogues)
identity_digest (str)
build_identity (AuthorityBuildIdentity)
profile_schema (ProfileSchemaDefinition)
evidence (AuthorityEvidenceProjection)
-
modelos:
tuple[ModeloDefinition,...]¶
-
catalogues:
RegistryCatalogues¶
-
build_identity:
AuthorityBuildIdentity¶
-
profile_schema:
ProfileSchemaDefinition¶
-
evidence:
AuthorityEvidenceProjection¶