API Reference
interfaces
Flowstate

@coasys/ad4m / Exports / FlowState

Interface: FlowState

Flow State definition Represents a single state in the flow state machine

Table of contents

Properties

Properties

consensusRule

• Optional consensusRule: ConsensusRule

Per-state consensus rule override. When present, transitions INTO this state require the specified number of distinct qualifying DIDs (see ConsensusRule). Overrides the flow-level consensusRule if both are set; when neither is set, the runtime engine's default of { n: 1 } applies (any single agent's action fires the transition).

Design doc §4.1 (v3) — per-state override enables mixed-consensus flows where e.g. "Perspective" states need only one voice but the "Resolution" state requires a quorum.

Defined in

core/src/shacl/SHACLFlow.ts:251 (opens in a new tab)


interpretationHint

• Optional interpretationHint: string

Natural-language description of what puts a flow instance IN this state. Used by AI-driven state suggestion (suggestFlowState) — the same pattern subject classes use for interpretationHint. When set, the LLM reads it alongside conversation content to suggest transitions.

Example (Deliberation Flow, "Tension" state): "Participants have voiced opposing views or objections — there is a clear disagreement or unresolved conflict on the table."

Defined in

core/src/shacl/SHACLFlow.ts:214 (opens in a new tab)


name

• name: string

State name (e.g., "ready", "doing", "done")

Defined in

core/src/shacl/SHACLFlow.ts:201 (opens in a new tab)


requires

• Optional requires: ModelQuery[]

Model-level guard: the state is satisfied when every ModelQuery in the array returns at least one match on committed graph state (overlays do NOT count as evidence — design §3 principle 5).

Array semantics: AND — every entry must match. Empty / unset = no model-level guard.

Design doc §4.1: "an array of queries, ALL must match; each query's matches become evidence."

Defined in

core/src/shacl/SHACLFlow.ts:226 (opens in a new tab)


semanticCheck

• Optional semanticCheck: string

Optional English hint for a targeted LLM confirmation before the engine declares the state entered. Distinct from interpretationHint, which frames the state semantically for the up-front extraction pass — semanticCheck is the "am I still confident?" pass the engine runs after requires matches, for states where structural presence isn't enough (e.g. tension resolution).

Design doc §5 covers the LLM confirmation pass shape. Unset = no confirmation, requires matches directly imply state entered.

Defined in

core/src/shacl/SHACLFlow.ts:239 (opens in a new tab)


value

• value: number

Numeric state value for ordering (e.g., 0, 0.5, 1)

Defined in

core/src/shacl/SHACLFlow.ts:203 (opens in a new tab)