Concepts
Observing a simulator
Every simulator records what it holds, what it was asked and what it would have sent. The examples use the Stripe simulator with one request made; every simulator serves the same routes.
rystic pull stripe-twin
PORT=$(rystic run stripe-twin -d --name observe --port 0 --scenario design_studio --json | jq -r .data.port)
curl -s localhost:$PORT/v1/customers -u sk_test_twin: -d email=ada@example.com | jq -r .id
# -> cus_lllllllllllllc
| Want | Read |
|---|---|
| The whole state | GET /_rystic/inspect |
| Every request your code made | GET /_rystic/calls |
| A live feed of requests, effects and control calls | GET /_rystic/events, rystic tail |
| What it would have sent out | GET /_rystic/egress |
| Whether your app is done reacting | GET /_rystic/settle, rystic settle |
| All of it in a browser | /_rystic/ui |
| The API in a browser | /_rystic/swagger |
State
GET /_rystic/inspect returns every register that holds a record, keyed by register, then by record key. An empty simulator returns {}.
curl -s localhost:$PORT/_rystic/inspect | jq -c 'map_values(length)'
# -> {..."state_charge":269,"state_customer":31,..."state_payment_intent":276,...}
- The dump posts back as a seed (How a seed lands).
?view=identitiesfolds the alias keys a scenario files a user under, such asmemberon Slack and GitHub, into the user they name. Read with it; seed from the default dump, which keeps the aliases.GET /_rystic/registersdescribes each register (Registers).
Requests
GET /_rystic/calls lists every API request since the last reset, oldest first. Control-plane calls are not in it.
curl -s localhost:$PORT/_rystic/calls | jq -c '.calls[0] | del(.duration_ms)'
# -> {"actor":"member","args":{"email":"ada@example.com"},"at":"2026-03-01T00:00:00.001Z","method":"POST","ok":true,"path":"/v1/customers","principal":"","seq":1,"status":200,"template":"/v1/customers"}
actoris the identity the request acted as, andprincipalthe scenario user that actor maps to, or empty.templateis the route it matched,argsthe arguments it carried,okwhether it succeeded andatthe simulator’s clock.duration_msis wall time, so it varies and the example leaves it out.totalcounts every call since the last reset.- It keeps as many calls as the egress log keeps events (below).
Live feed
GET /_rystic/events is a Server-Sent Events stream of this simulator’s own requests, effects and control calls. It is not Kalshi’s Live feed, where the book tracks the exchange. Each event is an id: line and a data: line, of kind request, effect or control.
curl -sN localhost:$PORT/_rystic/events
# -> id: 1
# -> data: {"seq":1,"kind":"control","at":"2026-01-01T00:00:00Z","data":{"detail":null,"op":"reset"}}
# -> id: 2
# -> data: {"seq":2,"kind":"control","at":"2026-03-01T00:00:00Z","data":{"detail":{"frames":0,"name":"design_studio"},"op":"scenario"}}
# -> …
- On connect it sends up to the last 1,000 events since the last reset, then streams live.
seqkeeps counting across resets. Reconnect withLast-Event-ID: <seq>or?cursor=<seq>to get only what came after.- Not every write emits an
effectevent, and which ones do varies by simulator. Each simulator’s page lists the writes that do in its Coverage section, under Feed effects. Gmail emits one only when it sends mail (message.sent). Notion emits none, so watch itsrequestevents and read the record back. - Some effects come from the simulator’s own activity rather than from one call, such as a scheduled Slack message or a Stripe test-clock advance.
rystic tail prints the same feed, one line per event, stamped with the simulator’s time of day:
rystic tail --addr http://localhost:$PORT
# -> 00:00:00.000 CTL reset
# -> 00:00:00.000 CTL scenario frames=0 name=design_studio
# -> 00:00:00.001 REQ POST /v1/customers -> 200 (0ms)
- The default shows writes and control calls.
--events alladds reads (REQ GET …) and effects (FX customer.created …). CLI flag reference → tail lists the scopes. - A detached simulator writes the same lines to its log:
rystic logs -f observe. rystic tail -f rystic.yamlfollows every simulator of a stack as one feed: Observing a project.
Egress
GET /_rystic/egress returns what the simulator would have sent out, in order: Stripe’s webhooks, Resend’s emails, Kalshi’s WebSocket frames. Webhooks covers them.
curl -s localhost:$PORT/_rystic/egress | jq -c '{total, dropped, types: [.events[].type]}'
# -> {"total":1,"dropped":0,"types":["customer.created"]}
- Each event carries
seq,effect,typeandpayload.?tail=Nreturns the last N. totalcounts everything emitted since the last reset;eventsmay hold fewer.
Retention
- The log keeps 100,000 events by default. Beyond that the oldest drop, and
droppedcounts them: check it before trusting the log as complete. RYSTIC_EGRESS_RETAIN(rystic run --egress-retain) sets the bound at boot;POST /_rystic/egress-retainwith{"retain":N}sets it at runtime.0removes it.GET /_rystic/versionshows the bound asegress_retain. A reset empties both logs and keeps the bound.
Wait for your app to finish
Before you assert, wait until your app is done reacting. rystic settle <instance> asks GET /_rystic/settle once, prints the answer and exits 0 when settled, 1 when not:
rystic settle observe --quiet 1s
# -> settled: last call seq 1, idle ...ms
- Settled means no webhook or interaction delivery awaits your app’s acknowledgment, and no call, acknowledgment or reset has come for
--quiet(quiet_ms, default 500 ms). At--timeout(timeout_ms, default 30 s) it returns not settled, naming what is still open. Both go up to 60 s. - Calls made as the vendor’s own client (
X-Rystic-Surface: client), from the state UI or by a timeline event never count.--principalwatches only the calls of the actors or principals it names; repeat it for several. - The answer’s
last_call_seqis the lastseqin/_rystic/calls. Settle before and after an action, and the calls between the two are your app’s turn.
The state UI
Open http://localhost:$PORT/_rystic/ui in a browser. Its cards:
- Activity: the live feed.
- Store: the state, register by register.
- Effects: the egress log.
- Network: the network profile, which it switches on and off and edits per endpoint (Network profiles → In the state UI).
- Reset, in the header, wipes the simulator as
POST /_rystic/resetdoes.
A simulator with its own view of the vendor’s app, such as Stripe, Lob and PayPal, adds its cards above these; the simulator’s page describes them.
API explorers
/_rystic/swagger, linked from the state UI’s header, is Swagger UI over the vendor API specs the simulator ships, cut to the operations it serves. Every simulator adds the Rystic control plane’s spec of its /_rystic/ routes. Try it out sends each request to the simulator.
GET /_rystic/versionnames the explorers a simulator serves underexplorer. Linear also serves GraphiQL at/_rystic/graphiql.- Both need the
uifeature.
Done with the example: rystic stop observe.