{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://zhctprompt.local/schemas/task-v1.schema.json",
  "title": "Zhctprompt Harness Task Contract v1",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "task_id",
    "title",
    "project_id",
    "owner",
    "goal",
    "scope",
    "acceptance_criteria",
    "risk_level",
    "evidence_path"
  ],
  "properties": {
    "schema_version": {
      "const": "task-v1"
    },
    "task_id": {
      "type": "string",
      "pattern": "^[A-Z0-9][A-Z0-9._-]{2,63}$"
    },
    "title": {
      "type": "string",
      "minLength": 1
    },
    "project_id": {
      "type": "string",
      "minLength": 1
    },
    "owner": {
      "type": "string",
      "minLength": 1
    },
    "goal": {
      "type": "string",
      "minLength": 1
    },
    "scope": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "allowed_paths",
        "forbidden_paths"
      ],
      "properties": {
        "allowed_paths": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "minLength": 1
          }
        },
        "forbidden_paths": {
          "type": "array",
          "items": {
            "type": "string",
            "minLength": 1
          }
        }
      }
    },
    "acceptance_criteria": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "string",
        "minLength": 1
      }
    },
    "risk_level": {
      "enum": [
        "low",
        "medium",
        "high"
      ]
    },
    "evidence_path": {
      "type": "string",
      "minLength": 1
    }
  }
}
