{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "title": "Cortex Agent State Class Registry",
  "type": "object",
  "required": [
    "schema_version",
    "policies",
    "classes"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "policies": {
      "type": "array",
      "uniqueItems": true,
      "items": {
        "type": "string",
        "enum": [
          "tracked",
          "local",
          "derived",
          "evidence",
          "legacy",
          "ignored"
        ]
      }
    },
    "classes": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "id",
          "path",
          "kind",
          "authority",
          "sync_policy",
          "runtime_scope",
          "rebuildable"
        ],
        "properties": {
          "id": {
            "type": "string",
            "minLength": 1
          },
          "path": {
            "type": "string",
            "minLength": 1
          },
          "kind": {
            "type": "string",
            "enum": [
              "file",
              "directory"
            ]
          },
          "authority": {
            "type": "string",
            "minLength": 1
          },
          "sync_policy": {
            "type": "string",
            "enum": [
              "tracked",
              "local",
              "derived",
              "evidence",
              "legacy",
              "ignored"
            ]
          },
          "runtime_scope": {
            "type": "string",
            "enum": [
              "portable",
              "machine-local",
              "instance-local"
            ]
          },
          "rebuildable": {
            "type": "boolean"
          }
        },
        "additionalProperties": false
      }
    }
  },
  "additionalProperties": false
}
