"""Closed value sets for the paged interactive-flow substrate.The substrate's flow engine, definition contracts, and frontends allroute on the small closed taxonomies below. They live in ``core`` perthe core-authority discipline: production code and frontends accept andemit these members, never raw strings.``FlowWidgetKind`` carries the input-primitive taxonomy forward from theone-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 forISO-8601 dates and Decimal amounts. Repeating groups are a structuralconstruct of the flow definition (asub-page group instantiated N times), not an input primitive, so they donot appear here."""from__future__importannotationsfromenumimportStrEnumDEFER_TOKEN="__defer__""""Canonical answer token a COMPARE_SELECT page stores when the operatorexplicitly defers the decision.Deferral is a distinct, never-silently-resolving review status, so thetoken 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 participatesindividually in validation, staleness, and review."""
[docs]classFlowWidgetKind(StrEnum):"""Closed taxonomy of input primitives a flow page may declare."""TEXT="text"SECRET="secret"CONFIRM="confirm"SELECT="select"CHECKBOX="checkbox"PATH="path"INTEGER="integer"DATE="date"DECIMAL="decimal"COMPARE_SELECT="compare_select"
[docs]classPageStatus(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="unanswered"ANSWERED="answered"INVALID="invalid"STALE="stale"DEFERRED="deferred"
[docs]classFlowMode(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="create"MODIFY="modify"
[docs]classCheckpointAvailability(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="available"UNAVAILABLE="unavailable"
[docs]classCopyRefKind(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="locale_key"SCHEMA_FIELD="schema_field"TERMINOLOGY_CONCEPT="terminology_concept"