{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.samirac.com/schemas/agent-task-contract.schema.json",
  "title": "SAQ Agent Task Contract",
  "description": "Machine-readable bounded agent identity and task contract introduced in SAQ Execution Contract Specification Public Draft v0.2.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "agent_profile_id",
    "profile_version",
    "role",
    "objective",
    "in_scope",
    "out_of_scope",
    "required_state_profile",
    "completion_policy"
  ],
  "properties": {
    "agent_profile_id": {
      "type": "string",
      "minLength": 1
    },
    "profile_version": {
      "type": "string",
      "minLength": 1
    },
    "role": {
      "type": "string",
      "minLength": 1
    },
    "objective": {
      "type": "string",
      "minLength": 1
    },
    "in_scope": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "out_of_scope": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "uniqueItems": true
    },
    "required_state_profile": {
      "type": "string",
      "minLength": 1
    },
    "completion_policy": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "complete",
        "needs_clarification",
        "blocked",
        "out_of_scope"
      ],
      "properties": {
        "complete": {
          "type": "string"
        },
        "needs_clarification": {
          "type": "string"
        },
        "blocked": {
          "type": "string"
        },
        "out_of_scope": {
          "type": "string"
        },
        "escalated": {
          "type": "string"
        }
      }
    },
    "extensions": {
      "type": "object",
      "additionalProperties": true
    }
  }
}
