Step protocol
Step protocol
The contract a step process speaks with the factory: handshake, request, events, result, and environment variables.
Step protocol
The contract a step process speaks with the factory: handshake, request, events, result, and environment variables.
Versions
Newest first. A step may advertise several versions; the factory picks the newest one it accepts.
| Version | Status |
|---|---|
| 2 | accepted |
How a step starts
- Handshake. The factory starts the command with
KUSAW_HANDSHAKE=1and the otherKUSAW_*names set empty. The step prints one handshake line on stdout and exits. - Request. The factory starts the real attempt. A non-interactive step receives the request JSON on stdin. An interactive step reads it from
KUSAW_REQUEST. - Events. While it runs, the step prints one JSON object per stdout line (or appends to
KUSAW_EVENTSwhen interactive). - Result. The last line is a result object (or
KUSAW_RESULTwhen interactive). The factory then waits for the process to exit.
Timeouts
| Limit | Duration |
|---|---|
| Handshake | 5s |
| Kill grace after SIGTERM | 10s |
| Stdout drain after exit | 2s |
| Step deadline | The step's timeout key in kusaw.yaml (default 10m). |
Outcomes
| Outcome | Description |
|---|---|
ok | The step finished successfully. |
fail | The step failed. |
retry | The step asked to be tried again. |
reject | The step rejected the work. |
skipped | The step did not run. |
killed | The factory stopped the step. |