{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/mandala-computer/json-schema/mandala-computer-exec-status-schema.json",
  "title": "ExecStatus",
  "x-generated": "2026-11-17",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/mandala-computer-openapi.json#/components/schemas/ExecStatus",
  "type": "object",
  "properties": {
    "execution_id": {
      "type": "string",
      "description": "The stable ID originally returned by background exec."
    },
    "pid": {
      "type": "integer"
    },
    "command": {
      "type": "string",
      "description": "The command line, echoed back. On a command started before the daemon on the computer’s host restarted, the first part of it, at most 1 KiB (less when it is mostly characters JSON escapes), and empty if it was started before the platform kept command lines across a restart."
    },
    "command_truncated": {
      "type": "boolean",
      "description": "`true` when `command` is only the first part of the command line: only on a command started before the daemon on the computer’s host restarted, whose command line was longer than the platform keeps. Absent otherwise."
    },
    "running": {
      "type": "boolean"
    },
    "exited": {
      "type": "boolean"
    },
    "exit_code": {
      "type": "integer",
      "description": "Absent until it has exited — absent rather than `0`, which is the one value worth trusting."
    },
    "stdout_b64": {
      "type": "string",
      "description": "What it has printed since your previous read, base64. This read consumes it.\n\nAlways base64, on every response, for the reason `Exec` gives — and here there is a second one. A poll stops at a 1 MiB ceiling, and that cut lands on a byte offset: a multi-byte character sitting across it would have had BOTH of its halves replaced. Ordinary text output was being corrupted at every megabyte, not only binary output. Decoded, the two halves join back into the character they came from."
    },
    "stderr_b64": {
      "type": "string"
    },
    "stdout_offset": {
      "type": "integer",
      "description": "How far the daemon has now read. Reported, not a parameter — see the note above."
    },
    "stderr_offset": {
      "type": "integer"
    },
    "more": {
      "type": "boolean",
      "description": "There is further output waiting right now. This is the flag to poll on.\n\nABSENT rather than `false` when there is not, so `false` is a value this field never carries: code waiting for `more === false` waits for ever. Polling is safe either way — `!more` reads the same for absent and false — and no schema here marks it required, so an ordinary client simply sees `undefined`. What it is not safe to do is declare it a required boolean and put a strict runtime validator behind that, which rejects the ordinary response rather than the unusual one."
    },
    "killed": {
      "type": "boolean",
      "description": "A `DELETE /computers/{id}/exec/{pid}` reached this command while the platform still had it running. Absent rather than `false` otherwise, on the same terms as `more`.\n\nThat is weaker than “it did not finish on its own”, and the difference is a real one rather than a caution. Whether a command has exited is noticed by a poll, so a command that ended a moment before your DELETE arrived is still running as far as this platform knows: the stop is carried out against a process group that has already gone, which succeeds, and the flag is set. So `killed` tells you what YOU did, not how the command ended. `exit_code` is what says that, and a command stopped by a signal reports the code its shell gives for one."
    },
    "started_at": {
      "type": "string",
      "description": "RFC 3339 timestamp."
    },
    "output_unavailable": {
      "type": "string",
      "description": "Present when the two streams are empty because the platform cannot read them, not because the command printed nothing. Its one value today is `daemon_restarted`: the command was started before the daemon on the computer’s host restarted, which lost how far its output had been read, so no output is returned for it at all. `running`, `exited` and `exit_code` are still the guest agent’s answer. Absent otherwise; read a value you do not recognise as no output either."
    }
  },
  "required": [
    "execution_id",
    "pid",
    "command",
    "running",
    "exited",
    "stdout_b64",
    "stderr_b64",
    "stdout_offset",
    "stderr_offset",
    "started_at"
  ]
}