Concept 6 of 10
The agent tried to deploy on a red build. Did it actually get stopped? 'The model did something' is not an answer — but there's a line in the log that is. Flowgate emits one structured event per step, for free, because it's already in the loop on every move.
That second line is the receipt: your agent reached for deploy
before tests had run, and because deploy isn't a legal move yet,
flowgate refused it — recorded as transition.rejected. You ran
Claude Code or Cursor through the gateway and didn't write a line of logging;
every workflow start, transition, and executor attempt — including the
retries and the moves the agent tried and couldn't make — emits a
structured JSON event on its own. Route it to stdout, a file, or wherever you
keep logs. A correlationId threads a whole run together, so you
can reconstruct exactly what the agent did.
{ "type": "workflow.started", "definitionId": "fix_failing_test", "correlationId": "c_91a3" }
{ "type": "transition.rejected", "transition": "deploy", "reason": "INVALID_TRANSITION", "correlationId": "c_91a3" }
{ "type": "executor.retrying", "attempt": 2, "backoffMs": 400, "correlationId": "c_91a3" }
{ "type": "workflow.transitioned","transition": "run_tests", "to": "tests_green", "correlationId": "c_91a3" }
Because the record is structured and correlated, it answers the questions
you actually ask after a run: did tests really pass before it merged? How
many retries did that refactor cost you? Which move did it try first?
Filter by correlationId to pull a whole run in order; every
executor attempt carries the hash of the exact script it ran — a fingerprint
of the inputs — so you can reproduce the precise command that fired, not a
paraphrase of it. (Those same structured events
are also what feed dashboards and cost attribution later, if you grow into
wanting them.)
# every event for one logical run, in order
$ grep '"correlationId":"c_91a3"' audit.jsonl
{ "type": "workflow.started", "seq": 1, "correlationId": "c_91a3" }
{ "type": "executor.succeeded", "seq": 2, "scriptHash": "sha256:9f2c…", "correlationId": "c_91a3" }
{ "type": "workflow.transitioned","seq": 3, "to": "tests_green", "correlationId": "c_91a3" }