{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/mu-crew/mu/schemas/plugin-protocol-v1.json",
  "title": "mu plugin protocol, version 1",
  "description": "JSON-RPC 2.0, one message per line on the plugin's stdin and stdout, UTF-8, at most 1 MiB per message. docs/reference/plugin-protocol.md is the normative prose; the handshake's `schema` is the sha256 of this file's exact bytes.",
  "$defs": {
    "fromPlugin": {
      "description": "Every message a plugin may write on stdout.",
      "oneOf": [
        { "$ref": "#/$defs/resultMessage" },
        { "$ref": "#/$defs/errorMessage" },
        { "$ref": "#/$defs/notification" }
      ]
    },
    "fromMu": {
      "description": "Every message mu writes on the plugin's stdin.",
      "oneOf": [{ "$ref": "#/$defs/request" }, { "$ref": "#/$defs/cancel" }]
    },
    "id": { "type": "integer", "minimum": 1 },
    "request": {
      "type": "object",
      "required": ["jsonrpc", "id", "method", "params"],
      "additionalProperties": false,
      "properties": {
        "jsonrpc": { "const": "2.0" },
        "id": { "$ref": "#/$defs/id" },
        "method": { "type": "string", "minLength": 1 },
        "params": {}
      }
    },
    "cancel": {
      "description": "$/cancel {id}: a request still awaiting its reply; $/cancel {watchId}: end a watch.",
      "type": "object",
      "required": ["jsonrpc", "method", "params"],
      "additionalProperties": false,
      "properties": {
        "jsonrpc": { "const": "2.0" },
        "method": { "const": "$/cancel" },
        "params": {
          "type": "object",
          "additionalProperties": false,
          "properties": { "id": { "$ref": "#/$defs/id" }, "watchId": { "type": "string", "minLength": 1 } }
        }
      }
    },
    "resultMessage": {
      "description": "A reply always carries `result`; an absent result is null.",
      "type": "object",
      "required": ["jsonrpc", "id", "result"],
      "additionalProperties": false,
      "properties": { "jsonrpc": { "const": "2.0" }, "id": { "$ref": "#/$defs/id" }, "result": {} }
    },
    "errorMessage": {
      "type": "object",
      "required": ["jsonrpc", "id", "error"],
      "additionalProperties": false,
      "properties": {
        "jsonrpc": { "const": "2.0" },
        "id": { "oneOf": [{ "$ref": "#/$defs/id" }, { "type": "null" }] },
        "error": {
          "type": "object",
          "required": ["code", "message", "data"],
          "additionalProperties": false,
          "properties": {
            "code": { "type": "integer" },
            "message": { "type": "string" },
            "data": {
              "type": "object",
              "required": ["kind"],
              "additionalProperties": false,
              "properties": {
                "kind": { "enum": ["retryable", "permanent", "human", "unknown-outcome"] },
                "remedy": { "type": "string", "minLength": 1, "maxLength": 4096 }
              }
            }
          }
        }
      }
    },
    "notification": {
      "description": "A plugin sends no request to mu. Its only notifications end a watch.",
      "type": "object",
      "required": ["jsonrpc", "method", "params"],
      "additionalProperties": false,
      "properties": {
        "jsonrpc": { "const": "2.0" },
        "method": { "enum": ["watch/settled", "watch/restarted"] },
        "params": { "type": "object" }
      }
    },
    "initializeParams": {
      "type": "object",
      "required": ["protocol", "mu"],
      "additionalProperties": false,
      "properties": {
        "protocol": {
          "type": "object",
          "required": ["min", "max"],
          "additionalProperties": false,
          "properties": { "min": { "type": "integer", "minimum": 0 }, "max": { "type": "integer", "minimum": 0 } }
        },
        "mu": { "type": "string" }
      }
    },
    "initializeResult": {
      "type": "object",
      "required": ["protocol", "plugin", "instance", "schema", "seams"],
      "additionalProperties": false,
      "properties": {
        "protocol": { "type": "integer", "minimum": 0 },
        "plugin": {
          "type": "object",
          "required": ["name", "version"],
          "additionalProperties": false,
          "properties": {
            "name": { "type": "string", "minLength": 1, "maxLength": 64 },
            "version": { "type": "string", "minLength": 1, "maxLength": 64 }
          }
        },
        "instance": { "type": "string", "minLength": 1, "maxLength": 128 },
        "schema": { "type": "string", "minLength": 1, "maxLength": 128 },
        "seams": { "$ref": "#/$defs/seams" }
      }
    },
    "seams": {
      "type": "object",
      "additionalProperties": false,
      "properties": {
        "host": {
          "type": "object",
          "required": ["acquire"],
          "additionalProperties": false,
          "properties": { "acquire": { "$ref": "#/$defs/keyCaps" } }
        },
        "link": { "$ref": "#/$defs/linkCaps" },
        "job": { "$ref": "#/$defs/jobCaps" },
        "channel": {
          "type": "object",
          "required": ["name", "caps"],
          "additionalProperties": false,
          "properties": {
            "name": { "type": "string", "minLength": 1, "maxLength": 64 },
            "caps": { "$ref": "#/$defs/channelCaps" }
          }
        }
      }
    },
    "checks": { "type": "array", "items": { "enum": ["template", "reach", "agent"] } },
    "dedupe": {
      "type": "object",
      "required": ["exact", "windowMs"],
      "additionalProperties": false,
      "properties": { "exact": { "const": true }, "windowMs": { "type": "integer", "minimum": 1 } }
    },
    "keyCaps": {
      "type": "object",
      "required": ["lookup", "fenceKey"],
      "additionalProperties": false,
      "properties": {
        "lookup": { "type": "boolean" },
        "dedupe": { "$ref": "#/$defs/dedupe" },
        "fenceKey": { "type": "boolean" },
        "inFlightMs": { "type": "integer", "minimum": 0 }
      }
    },
    "linkCaps": {
      "type": "object",
      "required": ["fetch", "slots", "remoteOnTimeout", "quiescence", "maxScriptBytes"],
      "additionalProperties": false,
      "properties": {
        "fetch": { "type": "boolean" },
        "push": { "type": "boolean", "description": "Can seed a host's repo with a local commit (link.push). Absent: false." },
        "slots": { "enum": ["mu", "self"] },
        "remoteOnTimeout": { "enum": ["stopped", "stopping", "unknown"], "description": "After a timed-out run: stopped before the reply, stopping (stopped within one grace after it), or unknown." },
        "quiescence": { "enum": ["provable", "unprovable"] },
        "maxScriptBytes": { "type": "integer", "minimum": 1 },
        "checks": { "$ref": "#/$defs/checks" }
      }
    },
    "jobCaps": {
      "type": "object",
      "required": ["kind", "view", "handle", "start"],
      "additionalProperties": false,
      "properties": {
        "kind": { "type": "string", "minLength": 1, "maxLength": 64 },
        "view": { "enum": ["bound", "detached"] },
        "handle": { "enum": ["pane", "file", "reply"] },
        "start": { "$ref": "#/$defs/keyCaps" },
        "channel": { "type": "string", "minLength": 1, "maxLength": 64 },
        "checks": { "$ref": "#/$defs/checks" },
        "firstTurn": { "enum": ["on-send", "at-start"], "description": "at-start: job.start carries the first prompt and begins its turn (needs handle reply). Absent: on-send." },
        "outlivesHost": { "type": "boolean", "description": "The job may survive its machine: a host's gone does not prove it gone. Absent: false." },
        "honours": { "$ref": "#/$defs/honours" }
      }
    },
    "honours": {
      "description": "The JobSpec fields the kind enforces; mu refuses a spawn requesting any other. Absent: env only, and only full-access.",
      "type": "object",
      "required": ["command", "env", "sockets", "roles"],
      "additionalProperties": false,
      "properties": {
        "command": { "type": "boolean" },
        "env": { "type": "boolean" },
        "sockets": { "type": "boolean" },
        "roles": { "type": "array", "uniqueItems": true, "items": { "enum": ["full-access", "read-only"] } }
      }
    },
    "channelCaps": {
      "type": "object",
      "required": ["fence", "receipt", "steer", "interrupt", "fresh", "answer", "command", "watch", "settleText"],
      "additionalProperties": false,
      "properties": {
        "fence": { "enum": ["sync", "none"] },
        "receipt": { "enum": ["exact", "acknowledged", "none"] },
        "dedupe": {
          "type": "object",
          "additionalProperties": false,
          "properties": {
            "send": { "$ref": "#/$defs/dedupe" },
            "fresh": { "$ref": "#/$defs/dedupe" },
            "interrupt": { "$ref": "#/$defs/dedupe" },
            "answer": { "$ref": "#/$defs/dedupe" },
            "command": { "$ref": "#/$defs/dedupe" }
          }
        },
        "steer": { "enum": ["mid-turn", "as-send", "none"] },
        "interrupt": { "enum": ["exact", "unconfirmed", "none"] },
        "fresh": { "enum": ["in-place", "new-job", "none"] },
        "answer": { "type": "boolean" },
        "command": { "type": "boolean" },
        "watch": { "enum": ["stream", "poll"] },
        "settleText": { "enum": ["tied", "untied", "none"] }
      }
    },
    "target": {
      "description": "Who a call is about. HostView stays inside mu.",
      "type": "object",
      "required": ["host"],
      "additionalProperties": false,
      "properties": {
        "agent": {
          "type": "object",
          "required": ["workstream", "name", "incarnation"],
          "additionalProperties": false,
          "properties": {
            "workstream": { "type": "string" },
            "name": { "type": "string" },
            "incarnation": { "type": "integer" }
          }
        },
        "job": {
          "type": "object",
          "required": ["kind", "key"],
          "additionalProperties": false,
          "properties": { "kind": { "type": "string" }, "key": { "type": "string" }, "handle": { "type": "string" } }
        },
        "host": {
          "type": "object",
          "required": ["name"],
          "additionalProperties": false,
          "properties": {
            "name": { "type": "string", "minLength": 1 },
            "handle": { "type": "string" },
            "instance": { "type": "string" }
          }
        }
      }
    },
    "deadline": { "description": "Epoch ms; past it mu cancels.", "type": "integer", "minimum": 0 },
    "linkExecParams": {
      "type": "object",
      "required": ["target", "deadline", "script", "cwd", "timeoutMs"],
      "additionalProperties": false,
      "properties": {
        "target": { "$ref": "#/$defs/target" },
        "deadline": { "$ref": "#/$defs/deadline" },
        "script": { "type": "string", "description": "A POSIX sh script." },
        "cwd": { "type": "string", "description": "The remote directory; `.` is the login directory." },
        "timeoutMs": { "type": "integer", "minimum": 1 }
      }
    },
    "linkFetchParams": {
      "type": "object",
      "required": ["target", "deadline", "remoteCwd", "localRepo", "timeoutMs"],
      "additionalProperties": false,
      "properties": {
        "target": { "$ref": "#/$defs/target" },
        "deadline": { "$ref": "#/$defs/deadline" },
        "remoteCwd": { "type": "string" },
        "localRepo": { "type": "string" },
        "timeoutMs": { "type": "integer", "minimum": 1 }
      }
    },
    "linkPushParams": {
      "description": "link.push, declared by push: true. Make remoteRepo hold commit rev (a full sha) from localRepo, creating it as a git repository if absent. Idempotent: a repo that already holds rev succeeds untouched. Not an effect: a timed-out push is re-run. Result: linkRun.",
      "type": "object",
      "required": ["target", "deadline", "localRepo", "remoteRepo", "rev", "timeoutMs"],
      "additionalProperties": false,
      "properties": {
        "target": { "$ref": "#/$defs/target" },
        "deadline": { "$ref": "#/$defs/deadline" },
        "localRepo": { "type": "string" },
        "remoteRepo": { "type": "string" },
        "rev": { "type": "string", "minLength": 40, "maxLength": 64 },
        "timeoutMs": { "type": "integer", "minimum": 1 }
      }
    },
    "linkRun": {
      "type": "object",
      "required": ["exitCode", "stdout", "stderr", "partial"],
      "additionalProperties": false,
      "properties": {
        "exitCode": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] },
        "stdout": { "type": "string" },
        "stderr": { "type": "string" },
        "partial": { "type": "boolean" }
      }
    },
    "linkCheckStepsParams": {
      "type": "object",
      "required": ["target", "deadline", "phase"],
      "additionalProperties": false,
      "properties": {
        "target": { "$ref": "#/$defs/target" },
        "deadline": { "$ref": "#/$defs/deadline" },
        "phase": { "enum": ["template", "reach", "agent"] },
        "root": { "type": "string" },
        "agent": {
          "type": "object",
          "required": ["name", "workstream"],
          "additionalProperties": false,
          "properties": { "name": { "type": "string" }, "workstream": { "type": "string" } }
        }
      }
    },
    "checkSteps": {
      "type": "array",
      "items": {
        "type": "object",
        "required": ["step", "ok", "detail"],
        "additionalProperties": false,
        "properties": {
          "step": { "type": "string", "minLength": 1, "maxLength": 64 },
          "ok": { "oneOf": [{ "type": "boolean" }, { "type": "null" }, { "const": "warn" }], "description": "true passed, false failed, null skipped, \"warn\" passed with a warning." },
          "detail": { "type": "string" }
        }
      }
    },
    "handle": { "description": "Opaque to mu: one line of these bytes.", "type": "string", "pattern": "^[A-Za-z0-9._:@-]{1,128}$" },
    "key": { "description": "An effect's idempotency key, mu-generated and persisted before the call.", "type": "string", "minLength": 1 },
    "paneCommand": {
      "description": "What a job's view pane runs.",
      "type": "object",
      "required": ["command", "env"],
      "additionalProperties": false,
      "properties": {
        "command": { "type": "string", "minLength": 1, "maxLength": 65536 },
        "env": { "type": "object", "additionalProperties": { "type": "string" } },
        "cwd": { "type": "string", "minLength": 1, "maxLength": 4096 }
      }
    },
    "jobSpec": {
      "type": "object",
      "required": ["workstream", "name", "harness", "role", "cmd", "commandSource", "cwd", "env"],
      "additionalProperties": false,
      "properties": {
        "workstream": { "type": "string" },
        "name": { "type": "string" },
        "harness": { "type": "string" },
        "role": { "enum": ["full-access", "read-only"] },
        "model": { "type": "string" },
        "cmd": { "type": "string" },
        "commandSource": { "enum": ["cli-key", "env", "explicit"] },
        "cwd": { "type": "string" },
        "env": { "type": "object", "additionalProperties": { "type": "string" } },
        "sockets": {
          "type": "object",
          "required": ["local", "remote"],
          "additionalProperties": false,
          "properties": { "local": { "type": "string" }, "remote": { "type": "string" } }
        },
        "firstPrompt": {
          "type": "object",
          "required": ["text", "msgId"],
          "additionalProperties": false,
          "properties": { "text": { "type": "string" }, "msgId": { "type": "string", "minLength": 1 } }
        }
      }
    },
    "jobStartParams": {
      "description": "job.start, an effect: the whole JobSpec under its key (the job record's token).",
      "type": "object",
      "required": ["target", "deadline", "key", "spec"],
      "additionalProperties": false,
      "properties": {
        "target": { "$ref": "#/$defs/target" },
        "deadline": { "$ref": "#/$defs/deadline" },
        "key": { "$ref": "#/$defs/key" },
        "spec": { "$ref": "#/$defs/jobSpec" }
      }
    },
    "jobStopParams": {
      "description": "job.stop, an idempotent effect: resolves only on proof the job is gone.",
      "type": "object",
      "required": ["target", "deadline", "key"],
      "additionalProperties": false,
      "properties": {
        "target": { "$ref": "#/$defs/target" },
        "deadline": { "$ref": "#/$defs/deadline" },
        "key": { "$ref": "#/$defs/key" }
      }
    },
    "lookupParams": {
      "description": "job.lookup and host.lookup, reads. fence: make the key unusable for a late request (fenceKey).",
      "type": "object",
      "required": ["target", "deadline", "key", "fence"],
      "additionalProperties": false,
      "properties": {
        "target": { "$ref": "#/$defs/target" },
        "deadline": { "$ref": "#/$defs/deadline" },
        "key": { "$ref": "#/$defs/key" },
        "fence": { "type": "boolean" }
      }
    },
    "targetParams": {
      "description": "job.status and job.attach, reads.",
      "type": "object",
      "required": ["target", "deadline"],
      "additionalProperties": false,
      "properties": { "target": { "$ref": "#/$defs/target" }, "deadline": { "$ref": "#/$defs/deadline" } }
    },
    "jobStart": {
      "description": "job.start's result, and job.lookup's found.",
      "type": "object",
      "required": ["view"],
      "additionalProperties": false,
      "properties": {
        "view": { "$ref": "#/$defs/paneCommand" },
        "handle": { "$ref": "#/$defs/handle" },
        "baseline": { "$ref": "#/$defs/baseline" }
      }
    },
    "baseline": {
      "description": "An at-start kind's first turn: runs 0 and the channel incarnation.",
      "type": "object",
      "required": ["runs"],
      "additionalProperties": false,
      "properties": {
        "runs": { "type": "integer", "minimum": 0 },
        "incarnation": { "type": "string", "minLength": 1, "maxLength": 256 }
      }
    },
    "jobLookup": {
      "description": "job.lookup's result: exactly one of found (jobFound), pending, none, unknown.",
      "oneOf": [
        { "type": "object", "required": ["found"], "additionalProperties": false, "properties": { "found": { "$ref": "#/$defs/jobFound" } } },
        { "$ref": "#/$defs/lookupPending" },
        { "$ref": "#/$defs/lookupNone" },
        { "$ref": "#/$defs/lookupUnknown" }
      ]
    },
    "jobFound": {
      "description": "job.lookup's found: the handle, and for a handle reply kind the whole start reply (view, baseline). A handle file kind's is the handle alone.",
      "type": "object",
      "required": ["handle"],
      "additionalProperties": false,
      "properties": {
        "view": { "$ref": "#/$defs/paneCommand" },
        "handle": { "$ref": "#/$defs/handle" },
        "baseline": { "$ref": "#/$defs/baseline" }
      }
    },
    "hostFacts": {
      "type": "object",
      "required": ["handle"],
      "additionalProperties": false,
      "properties": {
        "handle": { "$ref": "#/$defs/handle" },
        "deadlineAt": { "type": "integer", "minimum": 0 },
        "idleReclaimMs": { "type": "integer", "minimum": 0 },
        "maxJobs": { "type": "integer", "minimum": 1 }
      }
    },
    "hostLookup": {
      "oneOf": [
        { "type": "object", "required": ["found"], "additionalProperties": false, "properties": { "found": { "$ref": "#/$defs/hostFacts" } } },
        { "$ref": "#/$defs/lookupPending" },
        { "$ref": "#/$defs/lookupNone" },
        { "$ref": "#/$defs/lookupUnknown" }
      ]
    },
    "lookupPending": { "type": "object", "required": ["pending"], "additionalProperties": false, "properties": { "pending": { "const": true } } },
    "lookupNone": { "type": "object", "required": ["none"], "additionalProperties": false, "properties": { "none": { "const": true } } },
    "lookupUnknown": { "type": "object", "required": ["unknown"], "additionalProperties": false, "properties": { "unknown": { "type": "string", "minLength": 1, "maxLength": 4096 } } },
    "jobLiveness": {
      "description": "job.status's result. unknown is an honest answer, never a death.",
      "oneOf": [
        { "type": "object", "required": ["state"], "additionalProperties": false, "properties": { "state": { "const": "running" } } },
        {
          "type": "object",
          "required": ["state", "exit"],
          "additionalProperties": false,
          "properties": { "state": { "const": "ended" }, "exit": { "oneOf": [{ "type": "integer", "minimum": 0 }, { "type": "null" }] } }
        },
        {
          "type": "object",
          "required": ["state", "reason"],
          "additionalProperties": false,
          "properties": { "state": { "enum": ["lost", "unknown"] }, "reason": { "type": "string", "minLength": 1, "maxLength": 4096 } }
        }
      ]
    },
    "messageCheck": {
      "description": "channel.receipt's result: whether the message that carried msgId was accepted.",
      "oneOf": [
        {
          "type": "object",
          "required": ["state", "id"],
          "additionalProperties": false,
          "properties": {
            "state": { "const": "accepted" },
            "id": { "type": "string", "minLength": 1, "maxLength": 256 },
            "runs": { "type": "integer", "minimum": 0 },
            "at": { "type": "integer", "minimum": 0 },
            "incarnation": { "type": "string", "minLength": 1, "maxLength": 256 }
          }
        },
        {
          "type": "object",
          "required": ["state", "id"],
          "additionalProperties": false,
          "properties": { "state": { "const": "not-accepted" }, "id": { "type": "string", "minLength": 1, "maxLength": 256 } }
        },
        {
          "type": "object",
          "required": ["state", "id", "reason"],
          "additionalProperties": false,
          "properties": {
            "state": { "const": "unreachable" },
            "id": { "type": "string", "minLength": 1, "maxLength": 256 },
            "reason": { "type": "string", "minLength": 1, "maxLength": 4096 }
          }
        }
      ]
    },
    "turnState": {
      "description": "A plugin's turn state: blocked is a pending dialog. A plugin never reports a death: mu reads the job's liveness.",
      "enum": ["idle", "busy", "blocked", "unknown"]
    },
    "reading": {
      "description": "One agent's reading: its turn state, its dense turn count (0 before any settle, one more per settled turn) and its channel incarnation.",
      "type": "object",
      "required": ["state", "since", "runs", "incarnation"],
      "additionalProperties": false,
      "properties": {
        "state": { "$ref": "#/$defs/turnState" },
        "since": { "oneOf": [{ "type": "null" }, { "type": "integer", "minimum": 0 }] },
        "runs": { "type": "integer", "minimum": 0 },
        "incarnation": { "type": "string", "minLength": 1, "maxLength": 256 },
        "reason": { "type": "string", "minLength": 1, "maxLength": 4096 },
        "pending": { "type": "boolean" }
      }
    },
    "readStates": {
      "description": "channel.readStates's result: readings keyed <workstream>/<name>; only the asked agent's is read.",
      "type": "object",
      "additionalProperties": { "$ref": "#/$defs/reading" }
    },
    "observation": {
      "description": "A watch's or a last run's observation, without the identity fields mu adds from its row.",
      "type": "object",
      "required": ["status", "settled", "since", "runs", "incarnation"],
      "additionalProperties": false,
      "properties": {
        "status": { "$ref": "#/$defs/turnState" },
        "settled": { "type": "boolean" },
        "since": { "oneOf": [{ "type": "null" }, { "type": "integer", "minimum": 0 }] },
        "runs": { "type": "integer", "minimum": 0 },
        "incarnation": { "type": "string", "minLength": 1, "maxLength": 256 },
        "reason": { "type": "string", "minLength": 1, "maxLength": 4096 },
        "pending": { "type": "boolean" },
        "lastText": { "type": "string", "maxLength": 65536 },
        "lastTextTruncated": { "type": "boolean" },
        "lastError": { "type": "string", "maxLength": 4096 }
      }
    },
    "channelBaseline": {
      "description": "channel.baseline's result: the turn count a wait counts from, or null.",
      "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/baseline" }]
    },
    "lastRun": {
      "description": "channel.lastRun's result: the settled turn past afterRuns, or null.",
      "oneOf": [{ "type": "null" }, { "$ref": "#/$defs/observation" }]
    },
    "watchResult": {
      "description": "channel.watch's result. One notification (watch/settled or watch/restarted) ends the watch; mu ends it early with $/cancel {watchId}.",
      "type": "object",
      "required": ["watchId", "initial"],
      "additionalProperties": false,
      "properties": {
        "watchId": { "type": "string", "minLength": 1, "maxLength": 256 },
        "initial": { "$ref": "#/$defs/observation" },
        "afterRuns": { "type": "integer", "minimum": 0 }
      }
    },
    "watchSettled": {
      "description": "watch/settled's params.",
      "type": "object",
      "required": ["watchId", "observation"],
      "additionalProperties": false,
      "properties": {
        "watchId": { "type": "string", "minLength": 1, "maxLength": 256 },
        "observation": { "$ref": "#/$defs/observation" }
      }
    },
    "watchRestarted": {
      "description": "watch/restarted's params: the agent's channel restarted under another incarnation.",
      "type": "object",
      "required": ["watchId", "incarnation"],
      "additionalProperties": false,
      "properties": {
        "watchId": { "type": "string", "minLength": 1, "maxLength": 256 },
        "incarnation": { "type": "string", "minLength": 1, "maxLength": 256 }
      }
    },
    "sendReply": {
      "description": "channel.send, fresh and command's result (ChannelSendReply): channel is the seam's name, msgId the sent one.",
      "type": "object",
      "required": ["channel", "ack"],
      "additionalProperties": false,
      "properties": {
        "channel": { "type": "string", "minLength": 1, "maxLength": 64 },
        "ack": { "enum": ["exact", "acknowledged", "none"] },
        "baseline": { "$ref": "#/$defs/baseline" },
        "msgId": { "type": "string", "minLength": 1, "maxLength": 256 }
      }
    },
    "interruptResult": {
      "description": "channel.interrupt's result.",
      "type": "object",
      "required": ["wasBusy", "pending"],
      "additionalProperties": false,
      "properties": {
        "wasBusy": { "type": "boolean" },
        "pending": { "type": "boolean" },
        "runs": { "type": "integer", "minimum": 0 },
        "msgId": { "type": "string", "minLength": 1, "maxLength": 256 },
        "incarnation": { "type": "string", "minLength": 1, "maxLength": 256 }
      }
    },
    "abortOutcome": {
      "description": "channel.abort's result.",
      "type": "object",
      "required": ["before", "after", "settled", "aborted", "pending"],
      "additionalProperties": false,
      "properties": {
        "before": { "enum": ["idle", "busy"] },
        "after": { "enum": ["idle", "busy"] },
        "settled": { "type": "boolean" },
        "aborted": { "type": "boolean" },
        "pending": { "type": "boolean" }
      }
    },
    "answerResult": {
      "description": "channel.answer's result.",
      "type": "object",
      "required": ["keys", "ack"],
      "additionalProperties": false,
      "properties": {
        "keys": { "type": "array", "items": { "type": "string", "minLength": 1, "maxLength": 64 } },
        "ack": { "enum": ["confirmed", "unknown"] }
      }
    },
    "null": { "description": "job.stop's and host.release's result.", "type": "null" }
  }
}
