cadrumo.application.flows.checkpoint module¶
The per-mode checkpoint port.
The substrate defines the port; the domain flow supplies the
implementation, and every implementation routes through the owning
domain’s existing encrypted persistence authority — never a bespoke
store, never flow-owned crypto. The facts are the checkpoint: the port
persists the canonical answer map only, and resume rebuilds everything
derived (cursor, staleness, validation) from the current definition
(resume).
Availability is a per-mode declaration on the
FlowDefinition (checkpoint
field). UNAVAILABLE is the declared no-op arm: save_checkpoint()
refuses rather than silently dropping, and frontends read
checkpoint_available() to disable the save-and-exit affordance
with an explicit message — an interrupted run in a no-op mode discards
staged answers loudly, never silently.
- class CheckpointStore(*args, **kwargs)[source]¶
Bases:
ProtocolDomain-supplied persistence port for in-progress flow answers.
Implementations MUST write through the owning domain’s mutation authority (for the profile domain: effective-dated fact writes via the profile lifecycle service) and MUST NOT persist plaintext anywhere.
loadreturns the persisted canonical answer map orNonewhen no in-progress run exists;discarderases through the same authority.
- checkpoint_available(definition, mode)[source]¶
Whether the definition declares checkpointing for
mode.- Return type:
- Parameters:
definition (FlowDefinition)
mode (FlowMode)
- save_checkpoint(definition, state, store)[source]¶
Persist the state’s committed answers through the domain store.
Refuses in a mode whose declaration is the no-op arm — the frontend should never have offered the affordance; reaching this refusal means a frontend honesty bug, and the refusal (counts only, never answer values) makes it loud.
- Return type:
- Parameters:
definition (FlowDefinition)
state (FlowState)
store (CheckpointStore)
- discard_checkpoint(definition, store)[source]¶
Erase the in-progress run through the domain store.
- Return type:
- Parameters:
definition (FlowDefinition)
store (CheckpointStore)