Skip to content
misoto22 design

Diagrams

LifecycleFigure

A state machine: what something can be, and what moves it between states.

Ships from@misoto22/design/diagrams

When to reach for it

The one figure that spends colour, and it spends exactly the two tokens the system reserves for state. Every other distinction is shape, so a greyscale print keeps six of the eight.

Examples

default

A job run

The only figure that spends colour, on the two outcomes.
A job run6 elements and 3 relationships. The only figure that spends colour, on the two outcomes.01Queuedaccepted02Runningtool calls03Reviewquality gate04Completedfinal answerBlockedmissing inputFailedtimed out

6 elements and 3 relationships. The only figure that spends colour, on the two outcomes.

  • Queued (start) — accepted
  • Running (active) — tool calls
  • Review (decision) — quality gate
  • Completed (success) — final answer
  • Blocked (waiting) — missing input
  • Failed (failure) — timed out
  • ReviewBlocked: needs input
  • BlockedFailed: expired — after 24h
  • BlockedRunning: answered
Key
  • Entry
  • Working
  • Decision
  • Succeeded
  • Waiting
  • Failed

Notes

A state machine: what something can BE, and what moves it.

The one figure here that spends colour, and it spends exactly the two tokens this system reserves for state: --success on a terminal success, --danger on a terminal failure. Nothing else in the package is allowed those two, and a lifecycle diagram is the case they were reserved for — the whole point of the picture is which end a run came out of.

The other six kinds are carried by shape, so a greyscale print loses the two outcomes' hue and keeps every other distinction: a start is a filled cap, a decision is a diamond, a wait is a dashed frame, an external is a plate with a cut corner.

A RECOVERABLE FAILURE IS A FAILURE WITH A WAY BACK. type: "failure" says how a state is drawn; a transition OUT of it is what says whether the run is over. A retryable error and a terminal one look identical until you follow the arrows, which is correct — the difference between them is a real edge in the machine, not an adjective on a box.

Props

LifecycleFigure props
PropTypeDefaultDescription
specrequiredLifecycleSpec

Also accepts everything in FigureChrome. Those are forwarded to the underlying element and are not listed row by row.

Accessibility

  • success and failure are the only coloured marks in the package’s diagrams, and each is also a distinct plate shape — colour is never the only carrier.
  • The main rail is drawn between consecutive states in the first lane even when the specification does not list those transitions, because they are the diagram’s spine rather than its exceptions.