cadrumo.application.flows.resume module

Resume: rebuild a live FlowState from persisted canonical answers.

The facts are the checkpoint, so resume is a projection, not a rehydration: every persisted answer re-validates against the current flow definition, visibility and instance counts recompute from scratch, and the cursor lands on the first unanswered visible page. A persisted answer that no longer validates, or whose page no longer exists in the definition, lands as stale on the review surface — a checkpoint is never blindly trusted and never blocks resume with an opaque failure.

Because nothing derived is stored, a definition change between save and resume needs no stored fingerprint to detect: the re-validation walk is the detection, and its output is reviewable state rather than an error.

resume_flow(definition, persisted, *, mode)[source]

Project persisted canonical answers into a fresh, re-validated state.

The walk mirrors an operator re-entering every persisted answer in sequence: answers commit only through the current definition’s validation, gates re-evaluate as answers land (so a persisted gate answer reveals its dependents for their persisted answers), and anything left over — an answer for a page the definition no longer declares, or one the current validators reject — is carried as stale, visible on review, never dropped and never silently kept as a committed answer.

Return type:

FlowState

Parameters: