{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://loopxxi.com/downloads/loop-worklist-agent-v1.0.0.schema.json",
  "title": "Loop Worklist 1.0.0 local review output",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schema_version",
    "tool",
    "review_date",
    "input_sha256",
    "summary",
    "review_required",
    "actions_taken",
    "queue"
  ],
  "properties": {
    "schema_version": {
      "const": "1.0"
    },
    "tool": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "name",
        "version"
      ],
      "properties": {
        "name": {
          "const": "loop-worklist"
        },
        "version": {
          "const": "1.0.0"
        }
      }
    },
    "review_date": {
      "type": "string",
      "format": "date"
    },
    "input_sha256": {
      "type": "string",
      "pattern": "^[a-f0-9]{64}$"
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "total_records",
        "queue_records",
        "closed_excluded",
        "flagged_records"
      ],
      "properties": {
        "total_records": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000
        },
        "queue_records": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000
        },
        "closed_excluded": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000
        },
        "flagged_records": {
          "type": "integer",
          "minimum": 0,
          "maximum": 1000
        }
      }
    },
    "review_required": {
      "const": true
    },
    "actions_taken": {
      "type": "array",
      "maxItems": 0
    },
    "queue": {
      "type": "array",
      "maxItems": 1000,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "reference",
          "received_at",
          "status",
          "owner",
          "next_action",
          "due_date",
          "review_flags",
          "priority_score",
          "source_record"
        ],
        "properties": {
          "reference": {
            "type": "string"
          },
          "received_at": {
            "type": "string"
          },
          "status": {
            "type": "string"
          },
          "owner": {
            "type": "string"
          },
          "next_action": {
            "type": "string"
          },
          "due_date": {
            "type": "string"
          },
          "review_flags": {
            "type": "array",
            "minItems": 1,
            "items": {
              "type": "string"
            }
          },
          "priority_score": {
            "type": "integer",
            "minimum": 0
          },
          "source_record": {
            "type": "integer",
            "minimum": 1,
            "maximum": 1000
          }
        }
      }
    }
  }
}
