{
  "$schema": "https://json-schema.org/draft-07/schema#",
  "$id": "https://www.agentkind.org/protocol/settlement/v0.1/schemas/execution-evidence.schema.json",
  "title": "Agentkind Settlement Protocol v0.1 — Execution Evidence",
  "description": "LAYER 6 (TASK EXECUTION) and LAYER 7 (SUCCESSFUL BUSINESS OUTCOME) evidence. Execution evidence is SEPARATE from settlement. A settled payment does NOT by itself prove the deliverable was performed or that a successful business outcome occurred.",
  "type": "object",
  "required": [
    "protocol_version",
    "evidence_id",
    "request_id",
    "executor",
    "acceptance_status",
    "business_outcome_achieved"
  ],
  "additionalProperties": false,
  "properties": {
    "protocol_version": { "const": "0.1" },
    "evidence_id": { "type": "string", "pattern": "^akind-evid-[A-Za-z0-9._-]{4,64}$" },
    "request_id": { "type": "string", "pattern": "^akind-req-[A-Za-z0-9._-]{4,64}$" },
    "executor": {
      "type": "object",
      "required": ["kind", "id"],
      "additionalProperties": false,
      "properties": {
        "kind": { "enum": ["human", "agent"] },
        "id": { "type": "string", "minLength": 1, "maxLength": 128 }
      }
    },
    "performed_at": { "type": "string", "format": "date-time" },
    "deliverable_ref": { "type": "string", "maxLength": 1000 },
    "acceptance_status": { "enum": ["pending", "accepted", "rejected"] },
    "accepted_by": {
      "type": "object",
      "required": ["kind", "id"],
      "additionalProperties": false,
      "properties": {
        "kind": { "enum": ["human", "agent"] },
        "id": { "type": "string", "minLength": 1, "maxLength": 128 }
      }
    },
    "evidence_artifacts": {
      "type": "array",
      "items": { "type": "string", "maxLength": 512 },
      "description": "Order-sensitive array of evidence references. Order is preserved."
    },
    "business_outcome_achieved": { "type": "boolean", "description": "Whether the agreed business outcome was met. Independent of settlement." }
  }
}
