{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/mmerterden/multi-agent-pipeline/pipeline/schemas/launch-plan.schema.json",
  "title": "Launch plan",
  "description": "What `launch-request.mjs plan` prints, and POST /v1/launch and POST /v1/runs/{id}/resume return: the command a client runs to start a validated launch request unattended, with launch.json's placeholders filled. Neither carrier runs it. argv is an argument vector for a process spawned without a shell (shell is always false): the input is one element, never a string to be split or interpreted. `verified` repeats launch.json's flag; until it is true the shape is provisional. Under redact every x-sensitivity local field is dropped, leaving the session id a client tracks the run by.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion", "valid", "verified", "host", "mode", "sessionId", "bin", "shell"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "valid": { "const": true, "x-sensitivity": "none" },
    "verified": { "type": "boolean", "x-sensitivity": "none" },
    "host": { "enum": ["claude"], "x-sensitivity": "none" },
    "mode": {
      "enum": ["autopilot", "background", "resume"],
      "x-sensitivity": "none",
      "description": "autopilot and background start a run from a request; resume re-enters a run recorded under the unattended log root (POST /v1/runs/{id}/resume), and carries no request file."
    },
    "kind": {
      "enum": ["analysis", "development"],
      "x-sensitivity": "none",
      "description": "Present with mode background: the request's kind."
    },
    "sessionId": {
      "type": "string",
      "pattern": "^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$",
      "x-sensitivity": "none",
      "description": "Phase 0 records it as sessionId; the runs index carries it, which is how the client finds this run."
    },
    "requestFile": {
      "type": "string",
      "x-sensitivity": "local",
      "description": "The request file, mode 0600, named for the session."
    },
    "bin": { "type": "string", "x-sensitivity": "none" },
    "cwd": { "type": "string", "x-sensitivity": "local" },
    "argv": {
      "type": "array",
      "x-sensitivity": "local",
      "items": { "type": "string" },
      "description": "Carries the request's input, which is local."
    },
    "env": {
      "type": "object",
      "x-sensitivity": "local",
      "additionalProperties": { "type": "string" },
      "description": "Variables to add to the client's own environment for the launched process."
    },
    "shell": { "const": false, "x-sensitivity": "none" }
  }
}
