cadrumo.application.calculations.revision_carry_gate module¶
Single shared revision-carry gate.
Used by binding_prefill, cross_period_clean_state, and
relation_prefill: every cross-period or cross-year carry read shares
this gate.
The carry path is the one place a revision error compounds across years: a
prior filed under the wrong revision injects that revision’s norms into every
later filing that folds it in. The carry read therefore re-confirms each
carried observation’s stamped_revision_id against the law-determined
revision for its source context
(inspect_revision(),
which resolves the same law-determined revision selection without demanding
filing-grade admission – this gate answers “which revision does the law
select”, never “may this be filed”) before trusting the value.
This module is the single implementation of that gate: one law-determined re-confirmation, not three parallel copies that can drift across the carry sites that use it.
See also
resolve_bindings_from_local_store()Previous-filing binding reader that drops unreconfirmable carries.
resolve_relations_from_local_store()Relation-prefill reader that applies the same revision-stamp gate.
evaluate_cross_period_clean_state()Filing-grade dependency proof that maps the shared outcome to blockers.
- class RevisionCarryOutcome(refused, selected_revision_id, detail)[source]¶
Bases:
objectLaw-determined result of re-confirming one persisted revision stamp.
- revision_carry_outcome(snapshot_ref, *, operation)[source]¶
Return the single law-determined decision for a carried revision stamp.
Resolves through the caller-owned pinned operation. The operation must stay leased for the complete workflow so the re-confirmation cannot cross an authority-generation boundary.
Indeterminate (source context fails to resolve) → carry refused. Current observations must be re-confirmable against the law-determined revision; there is no legacy advisory bridge.
Divergent stamp → carry refused (caller drops the observation or raises
REGISTRY_REVISION_DIVERGENCE).Matching stamp → clean carry.
- Parameters:
snapshot_ref (
RegistrySnapshotRef) – Required complete registry coordinate persisted with the source value.operation (
PinnedAuthorityOperation) – Existing generation-pinned indexed operation owned by the enclosing workflow.
- Return type:
- Returns:
A typed outcome containing the selected revision when resolution succeeds, plus the refusal reason when the stamp diverges or cannot be re-confirmed.