{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://github.com/multi-agent-ecosystem/multi-agent-pipeline/pipeline/schemas/prune-logs.schema.json",
  "title": "Prune old run logs",
  "description": "What POST /v1/prune-logs returns. The preview (body {olderThanDays}) is prune-logs.sh's dry run for that age with a confirm token; the confirmation (body {confirmToken}) runs it again with the same age and --yes. The audit trail, the metrics corpus and task counters are never removed, and a folder written in the last minutes is spared.",
  "type": "object",
  "additionalProperties": false,
  "required": ["contractVersion", "olderThanDays", "applied", "count", "freedMb", "folders"],
  "properties": {
    "contractVersion": {
      "type": "string",
      "pattern": "^1\\.[0-9]+\\.[0-9]+$",
      "x-sensitivity": "none"
    },
    "olderThanDays": {
      "enum": [7, 30, 90],
      "x-sensitivity": "none"
    },
    "applied": {
      "type": "boolean",
      "x-sensitivity": "none"
    },
    "count": {
      "type": "integer",
      "minimum": 0,
      "x-sensitivity": "none"
    },
    "freedMb": {
      "type": "number",
      "minimum": 0,
      "x-sensitivity": "none"
    },
    "folders": {
      "type": "array",
      "maxItems": 200,
      "items": {
        "type": "string"
      },
      "x-sensitivity": "local",
      "description": "project/task folders, at most 200 listed."
    },
    "confirmToken": {
      "type": "string",
      "x-sensitivity": "local"
    },
    "expiresAt": {
      "type": "string",
      "format": "date-time",
      "x-sensitivity": "none"
    }
  }
}
