cadrumo.core.flows module

Closed value sets for the paged interactive-flow substrate.

The substrate’s flow engine, definition contracts, and frontends all route on the small closed taxonomies below. They live in core per the core-authority discipline: production code and frontends accept and emit these members, never raw strings.

FlowWidgetKind carries the input-primitive taxonomy forward from the one-shot wizard’s widget set unchanged (token-identical values) and adds COMPARE_SELECT, the substrate-generic candidate-comparison page, plus DATE and DECIMAL, the shape-validated single-line inputs for ISO-8601 dates and Decimal amounts. Repeating groups are a structural construct of the flow definition (a sub-page group instantiated N times), not an input primitive, so they do not appear here.

DEFER_TOKEN

Canonical answer token a COMPARE_SELECT page stores when the operator explicitly defers the decision.

Deferral is a distinct, never-silently-resolving review status, so the token is reserved: no flow definition may declare it as a choice value.

REPEATING_INSTANCE_SEPARATOR

Separator between a repeating-group instance prefix and a page id.

Instance-scoped answers key the canonical answer map as <group-id>#<index>.<page-id> so each instance participates individually in validation, staleness, and review.

class FlowWidgetKind(*values)[source]

Bases: StrEnum

Closed taxonomy of input primitives a flow page may declare.

TEXT
SECRET
CONFIRM
SELECT
CHECKBOX
PATH
INTEGER
DATE
DECIMAL
COMPARE_SELECT
class PageStatus(*values)[source]

Bases: StrEnum

Review-surface status of one flow page.

UNANSWERED on an optional page renders as the legitimate optional-skipped state; on a required page it blocks submission. STALE marks an answer whose gating parent changed after it was given; DEFERRED marks an explicit COMPARE_SELECT deferral. Neither ever resolves silently: both block submission until the operator revisits the page.

UNANSWERED
ANSWERED
INVALID
STALE
DEFERRED
class FlowMode(*values)[source]

Bases: StrEnum

Which persistence posture a flow run was started under.

CREATE runs against a record registered in an explicitly incomplete state, so incremental checkpoint writes are shielded from consumers. MODIFY edits a live record and therefore stages every answer in memory, committing once from review.

CREATE
MODIFY
class CheckpointAvailability(*values)[source]

Bases: StrEnum

Per-mode checkpoint declaration on a flow definition.

UNAVAILABLE is the declared no-op arm: the frontend MUST surface that mid-flow save/resume does not exist in that mode and that an interrupted run discards staged answers loudly.

AVAILABLE
UNAVAILABLE
class CopyRefKind(*values)[source]

Bases: StrEnum

Closed set of sources a page copy reference may resolve against.

Copy is assembled at render time from the bundled authoritative sources; a flow definition never carries literal prose. The legal corpus is deliberately not a member: no mechanism assembles question text from it.

LOCALE_KEY
SCHEMA_FIELD
TERMINOLOGY_CONCEPT