Skip to main content
Turn the page on and the run binds a free port on the loopback address, folds the run’s own events into the state of each declared step, and serves that state as a page and as JSON. Nothing on the page starts, stops or edits the run. Its one control answers a question the run is waiting on, through the same callbacks client any router uses.
The address is written once as a monitor event, so it is in the record and in any onEvent sink. It is never printed. result.monitor carries the same url and a close().

When it is on

  • monitor: true turns it on for a plain run. The default is off.
  • Under supervise it is on unless you pass monitor: false.
The server does not keep the process alive. A script that finishes its run exits as it did before, and the page goes with it. A process that stays up keeps serving the final state until close() is called.

What the page shows

  • Each declared step, in order, with what it needs, its desc, and its phase: declared, running, done with its outcome, or skipped. A step that ran more than once says how many times.
  • Work sent back: which step sent it, to which step, why, and how much of that step’s budget is used.
  • Questions waiting for a person, each with a Yes, a No and a note.
  • The tail of the record, the last forty events.
The page polls once a second and stops when the run is done. Only the steps of the outermost graph appear; a graph nested inside a step shows through that step’s outcome.

The routes

Any other route is 404, any other method is 405, and a body that is not JSON is 400. A request whose Host is not the bound address is refused, and /answer takes only application/json, so a page from another origin cannot post to it.

Things that catch people out

  • Anyone on this machine can answer. The page carries no token. It is for the person at the machine the run is on, not for a shared host.
  • The page is not the record. It keeps the last two hundred events in memory and shows forty. The record file has all of them.
  • A run that never started still binds the port. If the environment fails to come up, the run fails, the page shows that final state, and result.monitor.close() releases the port.

Where to go

Supervised local runs for a run that survives a crash; how a run is recorded for the record the page is folded from.