{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "dd-flow/project-summary@1",
  "title": "dd-flow project summary",
  "type": "object",
  "additionalProperties": true,
  "required": [
    "schema_id",
    "schema_version",
    "generated_at",
    "project_id",
    "name",
    "root",
    "root_exists",
    "status",
    "memorybank_version",
    "cli_version",
    "engine_version",
    "summary_path",
    "protocol_counts",
    "active_protocols",
    "waiting_items",
    "resource_summary",
    "warnings",
    "last_activity_at"
  ],
  "properties": {
    "schema_id": { "const": "dd-flow/project-summary@1" },
    "schema_version": { "const": "1.0.0" },
    "generated_at": { "type": "string", "minLength": 1 },
    "project_id": { "type": "string", "minLength": 1 },
    "name": { "type": "string", "minLength": 1 },
    "root": { "type": "string", "minLength": 1 },
    "root_exists": { "type": "boolean" },
    "status": { "type": "string", "minLength": 1 },
    "memorybank_version": { "type": ["string", "null"] },
    "memorybank_status": { "type": "string" },
    "flow_pack_status": { "type": "string" },
    "required_engine_range": { "type": ["string", "null"] },
    "cli_version": { "type": "string", "minLength": 1 },
    "engine_version": { "type": ["string", "null"] },
    "engine_status": { "type": "string" },
    "summary_path": { "type": "string", "minLength": 1 },
    "dashboard_path": { "type": "string" },
    "protocol_counts": {
      "type": "object",
      "required": ["active", "waiting", "done", "total"],
      "additionalProperties": true,
      "properties": {
        "active": { "type": "integer", "minimum": 0 },
        "waiting": { "type": "integer", "minimum": 0 },
        "done": { "type": "integer", "minimum": 0 },
        "total": { "type": "integer", "minimum": 0 }
      }
    },
    "active_protocols": { "type": "array" },
    "waiting_items": { "type": "array" },
    "resource_summary": {
      "type": "object",
      "required": ["queue", "locks", "waiters", "sessions", "open_defs"],
      "additionalProperties": true,
      "properties": {
        "queue": { "type": "integer", "minimum": 0 },
        "locks": { "type": "integer", "minimum": 0 },
        "waiters": { "type": "integer", "minimum": 0 },
        "sessions": { "type": "integer", "minimum": 0 },
        "open_defs": { "type": "integer", "minimum": 0 }
      }
    },
    "warnings": { "type": "array" },
    "last_activity_at": { "type": "string", "minLength": 1 }
  }
}
