Skip to content

About

Browser-only state-machine studio: approvals, simulated retries, idempotency keys, event ledger, replay. Simulation only.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

Workflow Observatory: State Machine Studio

A browser-only studio for approval-and-retry workflows: design a state machine, run it on a deterministic runtime, push it into human-approval gates, inject simulated worker failures, retry with the same idempotency key, then replay, step through, fork and compare the execution paths.

A run of the lead workflow after a simulated crash and a retry with the same key

Status: v0.1, published. Try the demo or run it locally (below). Everything that looks like infrastructure is simulated in the page: jobs, workers, delays, failures, retries and side effects run on a simulated clock. There is no queue, broker, Redis, Temporal, worker lease or distributed persistence, and nothing is sent anywhere.

What it does

  • Designer: edit states (task, human approval, simulated job, final), allowed transitions, preconditions (field set, artifact version), approver roles, retry policies (attempts, backoff, multiplier) and failure destinations. A live validator lists every structural problem; invalid definitions cannot be saved. Saving creates a new revision; runs keep the revision they started on and can be moved to a newer one only when their current state still fits.
  • Runtime: a pure function from a versioned definition and a command log to an event ledger (execute). The same commands always give the same ledger, timestamps included.
  • Guards: forbidden transitions and advances past an approval gate are refused and recorded as transition.rejected events; approvals require the approver role; every command carries an idempotency key (a repeated key repeats nothing, a reused key with a different payload is refused); an optional expected state and visit reject stale commands, which is how two simultaneous approvals resolve, including a decision made before a rejection loop.
  • Simulation: a controllable clock; scripted faults (fail, crash-after-effect, delay); retries with backoff under the same job key; a simulated side-effect store that idempotent jobs key by that job key, so a retry after a crash does not repeat the effect.
  • Ledger and artifacts: an inspectable, filterable event timeline with simulated timestamps, artifact versions and the side-effect store.
  • Replay, step-through, fork, compare: replay re-executes the command log and checks the ledger exactly; a slider shows the snapshot after any command; fork continues from a snapshot as a new run; compare aligns two ledgers, reports the first divergence and diffs the final states.
  • Invariant checker on every run: forbidden transitions prevented, approval not bypassed, duplicate keys cause no duplicate side effects, replay reproducible (each with event evidence). Turning a job's idempotency off makes the checker report the duplicate effect.
  • Two example workflows: topic → research → editorial approval → publication review, and lead → enrichment → qualification → sales approval → proposal. Two synthetic sample runs are labelled Sample data.
  • Export and import runs and workflows as JSON (strict schema, 2 MB cap, other format versions refused, an imported run must replay to its own ledger); the workspace persists in localStorage with recovery for unreadable copies.

Quick start

Needs Node.js 20.19 or newer.

npm ci
npm run dev        # http://localhost:5181/workflow-observatory/
npm run verify     # format, lint, types, unit tests, build, secret scan, e2e

scripts\verify.ps1 and scripts/verify.sh run the same steps from a clean install and stop on the first failure. See docs/demo.md for the two guided journeys.

Honest limits

Single browser tab, single user, no authentication: roles are labels you pick, not identities. The clock is simulated; nothing measures real time or real failures. See docs/known-limitations.md.

Documentation

docs/spec, docs/architecture.md, docs/demo.md, docs/test-report.md, docs/handoff.md, docs/backlog.md, SECURITY.md, CONTRIBUTING.md, AI_ASSISTANCE.md.

License

MIT, see LICENSE. Example workflows and sample data are synthetic; names are invented.

About

Browser-only state-machine studio: approvals, simulated retries, idempotency keys, event ledger, replay. Simulation only.

Topics

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages