{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://evidence.agiscorecard.com/input.schema.json",
  "title": "Agent Evidence input structure",
  "description": "Structural contract. The engine additionally validates ranges, dates, amounts, uniqueness and cross-field constraints; passing this schema is not a complete validation.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "task",
    "version",
    "asOf",
    "maxAgeDays",
    "records"
  ],
  "properties": {
    "task": {
      "type": "string"
    },
    "version": {
      "type": "string"
    },
    "asOf": {
      "type": "string"
    },
    "maxAgeDays": {
      "type": "number"
    },
    "records": {
      "type": "array",
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "id",
          "provider",
          "task",
          "version",
          "sample",
          "reviewer",
          "date",
          "accepted",
          "relation"
        ],
        "properties": {
          "id": {
            "type": "string"
          },
          "provider": {
            "type": "string"
          },
          "task": {
            "type": "string"
          },
          "version": {
            "type": "string"
          },
          "sample": {
            "type": "string"
          },
          "reviewer": {
            "type": "string"
          },
          "date": {
            "type": "string"
          },
          "accepted": {
            "type": "boolean"
          },
          "relation": {
            "type": "string",
            "enum": [
              "independent",
              "self",
              "unknown"
            ]
          }
        }
      }
    }
  }
}
