cadrumo.domain.calculations.registry.governed_fact_scope module¶
The governed facts a registry validation resolves its vocabulary from.
Runtime resolves a governed fact through the published authority artifact. A registry validation runs before that artifact is available to it: compiling a candidate revision produces the indexed generation, and decoding its addressed components is how that generation becomes usable. A validator that reaches for ambient authority from inside either path would cross the candidate or pinned generation it is meant to validate.
So a validation scopes the facts it is validating against, the same way a compilation scopes its legal and source catalogues. Outside that scope nothing is supplied: a vocabulary check with no scoped facts refuses rather than falling back to the bundle it must not read.
- UNPUBLISHED_CANDIDATE_DIGEST: Final¶
The identity a candidate carries while it is being validated.
A candidate has no published identity digest yet – deriving one is what publication does – and a resolution taken from it is consumed by the validator and discarded, never retained as provenance. The constant makes that state explicit instead of borrowing the digest of the artifact being replaced.
- class GovernedFactSource(*args, **kwargs)[source]¶
Bases:
ProtocolAnything that can resolve one typed governed-fact query.
- resolve_governed_fact(query)[source]¶
Resolve one typed governed-fact query.
- Return type:
ResolvedScalarFact|ResolvedBracketFact|ResolvedMappingFact|ResolvedEntitySetFact|ResolvedOverrideFact|ResolvedEventFact|ResolvedMultiOutputFact- Parameters:
query (Annotated[ScalarFactQuery | BracketFactQuery | MappingFactQuery | EntitySetFactQuery | OverrideFactQuery | EventFactQuery | MultiOutputFactQuery, FieldInfo(annotation=NoneType, required=True, discriminator='family')])
- class CandidateFactAuthority(catalogue, support, authority_digest='0000000000000000000000000000000000000000000000000000000000000000')[source]¶
Bases:
objectResolve governed facts from the catalogue currently being validated.
- Parameters:
catalogue (GovernedFactCatalogue)
support (TemporalSupportEnvelope)
authority_digest (str)
-
catalogue:
GovernedFactCatalogue¶
-
support:
TemporalSupportEnvelope¶
- resolve_governed_fact(query)[source]¶
Resolve one query against the candidate, never against the bundle.
- Return type:
ResolvedScalarFact|ResolvedBracketFact|ResolvedMappingFact|ResolvedEntitySetFact|ResolvedOverrideFact|ResolvedEventFact|ResolvedMultiOutputFact- Parameters:
query (Annotated[ScalarFactQuery | BracketFactQuery | MappingFactQuery | EntitySetFactQuery | OverrideFactQuery | EventFactQuery | MultiOutputFactQuery, FieldInfo(annotation=NoneType, required=True, discriminator='family')])
- validating_governed_facts(authority)[source]¶
Scope registry validation to the governed facts it is validating.
- Return type:
- Parameters:
authority (GovernedFactSource)
- governed_facts_in_scope()[source]¶
Return the facts of the validation in progress, or
Noneoutside one.- Return type:
- cache_governed_projection(*, maxsize=64)[source]¶
Cache a projection by its authority incarnation and hashable arguments.
Weak ownership prevents the cache from retaining complete old generations. Candidate objects with the same unpublished digest remain distinct owners. The selected owner stays scoped throughout construction of a cache miss.