Work docs

suiss Work · Docs

State machines

Draft reference for Work state machines: commitment states and operations, revoke requests, assignment, summary categories, gates, stops and durability states.

This is a draft reference and may change before release.

All state on this page is derived from records by the Work kernel; none of it is stored as an editable field. Wire names use snake_case; concept names in prose use hyphens (promise-conditional is promise_conditional on the wire). For the meaning behind each machine, see Commitments, Responsibility and control and Waits, gates and attention.

Commitment

States

StateWire nameTerminal
RequestedrequestedNo
CounteredcounteredNo
Conditionally promisedconditionally_promisedNo
PromisedpromisedNo
StatedstatedNo
AcceptedacceptedYes
DeclineddeclinedYes
WithdrawnwithdrawnYes
CancelledcancelledYes
ReleasedreleasedYes
ObsoleteobsoleteYes
ExpiredexpiredYes
Closed administrativelyclosed_administrativelyYes

A commitment with line items derives state per item. If items are in different states, the commitment summary is mixed with a per-item breakdown. mixed is a summary only, not a value of the commitment axis.

A terminal state never changes. A missed due date is a breach signal from the clock and does not change the state.

Operations

Every operation is a typed Declaration (https://suiss.app/ns/work/declaration/<wire name>). The list is closed.

OperationWhoFromResultRequired content
requestObligee, or someone on its behalf—requestedMinimum fields
promiseCandidate obligorrequestedpromised—
promise_conditionalCandidate obligorrequestedconditionally_promisedPrecondition (a Condition) and its deadline
declineCandidate obligorrequesteddeclinedReason code
counterCandidate obligor (from requested) or obligee (from countered)requested, counteredCandidate's counter: countered. Obligee's counter: requested (new offer version)Changed terms
accept_counterObligeecounteredpromisedDigest of the accepted counter version
stateObligorpromisedstatedFulfillment references
acceptAcceptorstatedacceptedEvidence reference, if the acceptance criterion requires evidence
rejectAcceptorstatedpromisedReason
cancelObligorconditionally_promised, promised, statedcancelledReason code
releaseObligeeAny open statereleasedReason optional
delegateObligor (offer) plus new obligor (acceptance)promised, conditionally_promisedSame state, new obligor, on acceptanceHandover note in the offer
assignObligee (offer) plus new obligee (acceptance)Any open stateSame state, new obligee, on acceptance—
disputeThe party a reject or open revoke_acceptance is aimed at (the obligor)After a reject or an open revoke_acceptanceNo state change; a dispute markReference to the disputed record, and a reason
deferObligee or obligorrequested, countered, conditionally_promised, promisedNo state change; summary category deferredReason; optional return date or return event
resumeObligee or obligor; the Work service party when the return date arrivesAn open deferThe deferral closes; the category is derived againReference to the closed defer, in basis
revoke_request, revoke_promise, revoke_statement, revoke_acceptanceSee belowSee belowA revoke request opensReason
allow, refuseThe other side of a revoke requestAn open revoke requestSee belowReason, for refuse
amendSee amendmentsAny open stateA new versionsupersedes
noticeObligorAny open stateNo state change; attention and notificationnotice_type: at_risk, cannot_complete, obsolete_suggested
declare_obsoleteObligee or principalAny open stateobsoleteReference to the parent aim or commitment that went away
expireThe Work service partyrequested, countered, conditionally_promisedexpiredThe validity statement it rests on, in basis
administrative_closeA party with that authority in AccessAny open stateclosed_administrativelyReason; the parties are notified

delegate and assign are one logical operation but two records: the offer and the new party's acceptance. The old party stays in place until acceptance.

An operation is valid only if the author holds the role, the commitment's state allows it, and Access authorizes it. An invalid operation is rejected with a reason and recorded.

Revoke requests

RequestAsked byAsked ofOn allowOn refuse
revoke_requestObligeeCandidate or obligorwithdrawnContinues; the obligee can still release
revoke_promiseObligorObligeewithdrawn, not counted as a cancelContinues; the obligor can still cancel
revoke_statementObligorAcceptorpromisedStays stated
revoke_acceptanceAcceptorObligorThe terminal outcome stays; a linked reopening commitment startsA dispute mark

Reason codes

FieldValues
decline reasonno_capacity, no_authority, out_of_scope, missing_information, unacceptable_terms, other
cancel reasoncannot_complete, failed, abandoned, other
notice typeat_risk, cannot_complete, obsolete_suggested

Records written by the Work service

The Work service party writes a record only on the basis of a prior Declaration, and links to it in basis:

RecordWritten whenRests on
expireA declared validity period ends with no actionThe validity statement
accept (marked implicit)An implicit acceptance window ends with no explicit answerThe obligee's implicit_acceptance_terms
resumeA dated deferral reaches its return date, or its return event occursThe defer
unclaimAn ownership lease ends and the queue says to return to the poolThe queue's declared lease behaviour

Implicit acceptance is never written if required evidence is missing, if the four-eyes rule blocks acceptance, or if step-up is required.

Whose move it is

StateNext move
requestedCandidate obligor, or queue owner
counteredObligee
conditionally_promisedWhoever the precondition is addressed to
promisedObligor
statedAcceptor
Open revoke requestThe other side
Budget exhaustedAccountable party

Assignment

ValueWire nameMeaning
PooledpooledIn the pool; candidates exist; nobody has claimed it
OfferedofferedOffered or directly requested from a specific party
HeldheldThe obligor is known; the lease is valid if one is defined
Failed to assignfailed_to_assignThe start deadline passed, or the policy found no candidate
OperationWhoEffect on assignmentEffect on the commitment
claimA party in the candidate setheldrequested to promised; a promise record is produced
unclaimThe obligor who claimed itpooledpromised to requested; not a release
forwardQueue owner or the claiming obligorMoves to another queue or candidate set; the forward count risesNone
nominateQueue owner, obligee or accountable partyA candidate is proposedNone
offerQueue owner or distribution policyofferedNone; the party answers with a commitment operation
reassignQueue owner or accountable partyAn offer opens to a new partyNone; the obligation moves only through delegate
renew_leaseObligorThe lease is extendedNone

Summary category

One category is derived from the five state axes. When several apply, the first in this order wins:

closed > deferred > triage > awaiting_acceptance > waiting > unknown > active > ready
CategoryDerived fromChanged byCan move to
triageCommitment in the request phase; assignment pooledCandidate obligor, queue ownerready, waiting, closed
deferredAn open deferThe party that deferred or resumes; the Work service party on returnThe previous category, closed
readyPromised; execution not startedDoer (starting), executor reportactive, waiting, closed
activeExecution running; liveness live or not applicableExecutor reportwaiting, awaiting_acceptance, unknown, closed
waitingOpen Condition recordsThe addressed party (by satisfying), the Condition owner (by withdrawing)The previous category, closed
awaiting_acceptanceStated as doneAcceptorclosed, active (on rejection)
unknownLiveness stale or unknown; an external state that cannot be mappedExecutor (new signal), accountable party (handover, stop request)The previous category, waiting, closed
closedThe commitment reached a terminal stateNobody; reopening is a new recordNone

Flags: overdue, at_risk, contradiction, stale, taken_over, unevidenced. Flags never change the category. A wait with a stale executor is waiting plus stale. "Stated, not verified" is awaiting_acceptance plus unevidenced.

Other state axes

AxisValues
ExecutionNot started, running, paused, completed (reported), failed, cancelled (reported), unknown
Controlautomatic, intervened, manual; the control lease holder; or no control capability declared
LivenessLive, stale, unknown, left cleanly, not applicable

Execution, control and liveness come from executor or external Claims. "Stopped" appears on the execution axis only when the executor confirms it.

Conditions and gates

A Condition is opened with open_condition and withdrawn with withdraw_condition. A gate closes with gate_decision, or with accept or reject for delivery acceptance.

AnswerCounts as acceptance?
AcceptYes
RejectNo
Closed without an answerNo
Timed outNo

If the content bound to an approval changes after the answer, even by one parameter, the answer stops being valid and the gate waits again. A gate's kind is fixed when it is created; if it is wrong, the gate is withdrawn and a new one is opened.

Multi-party aggregation

PolicySatisfiedBecomes unsatisfiable
AllAll N acceptedAny rejection, timeout or close without an answer
AnyThe first acceptanceAll closed with something other than acceptance
K of NK acceptancesOpen participants can no longer reach K
SequentialThe current participant accepted and the sequence is finished; the next request opens only after the previous acceptanceAny non-acceptance in sequence
PercentageAcceptances ≥ ⌈N × p⌉The rest can no longer reach the threshold
Any rejection rejectsAdded to another policyAny rejection

The participant set and N are fixed at creation and change only through amend. When the result is decided early, the remaining open participant requests close as obsolete.

Stop requests

stop_request (immediate | finish_then_stop | pause)
        │
        ▼
   pending ──► stop_response: accept
          ├──► stop_response: finish_then_stop
          └──► stop_response: refuse (with reason) ──► attention for principal and requester

executor confirmation (an observation Claim) ──► execution axis shows stopped
no confirmation ──► execution axis stays unknown

Continuing after a stop is a separate resume_after_stop Declaration and never happens on its own.

Control handover

pause request → executor confirmation or checkpoint → control_lease → the person changes the work
   → hand back control + handoff_note → re-check assumptions → continue OR re-plan

Federation admission

Envelope ingestMeaning
admittedLinked to a local Work through an admission Declaration
["quarantined", code]Kept with no local effect; later closes as admitted or rejected
["rejected", code]Not accepted; the reason code is kept

Durability states

StateMeaning
receivedThe request was validated; no durability promise; not kept, only in the response
recordedThe ledger's durability class is met; the API can return success
includedThe record is in a checkpoint's Merkle tree
witnessedThe checkpoint was co-signed by an independent witness or anchored by an external timestamp
federatedThe other side's signed receipt arrived
admittedThe other side wrote a local admission record
quarantinedThe other side quarantined the record
rejectedThe other side rejected the record with a reason code
acted uponAn executor reported an Act based on this record