{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/disk-clean-request.schema.json",
  "title": "Disk clean request",
  "description": "The body of POST /v1/disk-clean. With no other field it measures (the disk cleaner's dry run, no token). With categories it previews exactly those, each one from the cleaner's allow-list, and returns a confirm token; an opt-in category must also send its own flag as true. Step 2 sends only the confirmToken.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "categories": {
      "type": "array",
      "minItems": 1,
      "uniqueItems": true,
      "items": {
        "enum": [
          "derived-data",
          "repo-build",
          "xctest-devices",
          "xcode-caches",
          "archives",
          "device-support",
          "sim-unavailable",
          "sim-caches",
          "sim-device-caches",
          "sim-runtimes",
          "spm-cache",
          "pods-cache",
          "gradle-cache",
          "js-caches",
          "homebrew",
          "tmp-builds",
          "pipeline-scratch",
          "claude-scratch",
          "claude-jobs",
          "agent-worktrees",
          "dev-caches",
          "old-logs",
          "pipeline-logs",
          "ds-store",
          "trash",
          "transcripts",
          "test-artifacts"
        ]
      },
      "x-sensitivity": "none",
      "description": "The categories to preview, by the disk cleaner's category id (disk-cleaner.mjs --list)."
    },
    "trash": {
      "const": true,
      "x-sensitivity": "none",
      "description": "Required with the trash category: it holds files the user deleted, which cannot be recovered afterwards."
    },
    "transcripts": {
      "const": true,
      "x-sensitivity": "none",
      "description": "Required with the transcripts category: resume and past-session search read them."
    },
    "test-artifacts": {
      "const": true,
      "x-sensitivity": "none",
      "description": "Required with the test-artifacts category: a recording or a result bundle can be the only evidence of a failure anybody still has."
    },
    "confirmToken": {
      "type": "string",
      "pattern": "^[A-Za-z0-9_-]{16,128}$",
      "x-sensitivity": "none",
      "description": "The confirmToken the preview returned. Single use, bound to the route and the previewed categories."
    }
  }
}
