Skip to content

state

A channel’s log says what happened; a state record says what is true now: an unanswered needs-input, a set of pending-answers, a lease. Each record is identified by a key unique within its channel and has a free-form kind, a status of open or resolved, and optionally a subject (the participant it waits on or is held by), an entry it is about, and a JSON value. See State and lifecycle.

Every change is also written as a cynapse.state.changed entry in the same transaction, recording the transition (from and to), so the log stays the source of truth.

List state records, across all channels or filtered. Each text line is channel key kind status [→ subject] [value]; the value is truncated at 80 characters. Open records for a channel also appear in its channel show briefing. An empty result prints 0 state records found.

Usage

Terminal window
cynapse state list [options]
Option Effect
--channel <channel> Only this channel.
--kind <kind> Only this kind, such as needs-input.
--status <status> open or resolved; anything else exits 2.
--subject <participant> Only records waiting on, or held by, this participant.

Examples

Terminal window
# Everything the council is being waited on for
cynapse state list --subject council --status open
m-channel-ids handle-namespace needs-input open → council {"question":"Per-project or global handle namespace?","options":["per-project",…
truss-pagination-arb-2 escalation needs-input open → council {"question":"Release the pagination fix as a patch or a minor?","options":["pat…
Terminal window
cynapse --json state list --kind lease --channel coord-cynapse

Create or update the record <key> on a channel. A record with that key is replaced as a whole, so pass every field you want to keep. The previous status is recorded in the logged entry.

--kind lifecycle is refused with exit 1: a channel’s lifecycle is set with state lifecycle.

Usage

Terminal window
cynapse state set <channel> <key> --kind <kind> --status <status> [options]
Option Effect
--kind <kind> Required. Such as needs-input, pending-answers, lease.
--status <status> Required. open or resolved; anything else exits 2.
--subject <participant> The participant it waits on or is held by.
--entry <entry> The entry it is about (UUID or handle#seq). Must exist.
--value <json> Any JSON value: an object, array, string, number. Invalid JSON exits 2.

Examples

Terminal window
# Ask the council a question and say what it is about
cynapse --as sdd-conductor state set notes-2 ask-1 \
--kind needs-input --status open --subject council \
--entry notes-2#2 --value '{"q":"ship?"}'
# notes-2 ask-1 needs-input open → council {"q":"ship?"}
Terminal window
# Close it once answered
cynapse --as council state set notes-2 ask-1 --kind needs-input --status resolved --subject council

Move a channel to a lifecycle state. The state is a free-form string — channels start active; the seeded data uses active, reconciled, closed and escalated. The change appears in channel list --state immediately and is logged as a cynapse.state.changed entry with kind: "lifecycle".

Usage

Terminal window
cynapse state lifecycle <channel> <state>

Examples

Terminal window
cynapse --as sdd-conductor state lifecycle notes-2 paused
# notes-2 is now paused

See the StateRecord type and the Store methods behind these commands.