{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.html-docs.com/research/html-artifact-collaboration-audit-schema-2026.json",
  "title": "HTML Artifact Collaboration Audit",
  "description": "A machine-validatable result record for version 1.8 of the HTML Artifact Collaboration Checklist 2026.",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "checklist_version",
    "canonical_checklist_url",
    "platform",
    "artifact",
    "audit",
    "results",
    "summary"
  ],
  "properties": {
    "checklist_version": {
      "const": "1.8"
    },
    "canonical_checklist_url": {
      "const": "https://www.html-docs.com/guides/html-artifact-collaboration-checklist"
    },
    "platform": {
      "type": "string",
      "minLength": 1
    },
    "artifact": {
      "type": "object",
      "additionalProperties": false,
      "required": ["title", "url", "access_mode"],
      "properties": {
        "title": { "type": "string", "minLength": 1 },
        "url": { "type": "string", "format": "uri", "pattern": "^https://" },
        "access_mode": {
          "type": "string",
          "enum": ["public", "unlisted", "restricted", "other"]
        }
      }
    },
    "audit": {
      "type": "object",
      "additionalProperties": false,
      "required": ["auditor", "tested_at", "browser", "agent_client"],
      "properties": {
        "auditor": { "type": "string", "minLength": 1 },
        "tested_at": { "type": "string", "format": "date" },
        "browser": { "type": "string", "minLength": 1 },
        "agent_client": { "type": "string", "minLength": 1 }
      }
    },
    "results": {
      "type": "array",
      "minItems": 15,
      "maxItems": 15,
      "uniqueItems": true,
      "items": { "$ref": "#/$defs/result" },
      "allOf": [
        { "contains": { "type": "object", "properties": { "id": { "const": "A1" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "A2" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "A3" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "R1" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "R2" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "R3" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "G1" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "G2" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "G3" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "G4" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "P1" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "T1" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "T2" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "T3" } }, "required": ["id"] } },
        { "contains": { "type": "object", "properties": { "id": { "const": "T4" } }, "required": ["id"] } }
      ]
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "total_score",
        "interpretation",
        "strongest_capability",
        "largest_gap",
        "next_test"
      ],
      "properties": {
        "total_score": { "type": "integer", "minimum": 0, "maximum": 30 },
        "interpretation": {
          "type": "string",
          "enum": ["Collaboration-ready", "Shareable with gaps", "Fragile handoff"]
        },
        "strongest_capability": { "type": "string", "minLength": 1 },
        "largest_gap": { "type": "string", "minLength": 1 },
        "next_test": { "type": "string", "minLength": 1 }
      }
    }
  },
  "$defs": {
    "result": {
      "type": "object",
      "additionalProperties": false,
      "required": ["id", "score", "status", "evidence", "finding"],
      "properties": {
        "id": {
          "type": "string",
          "enum": ["A1", "A2", "A3", "R1", "R2", "R3", "G1", "G2", "G3", "G4", "P1", "T1", "T2", "T3", "T4"]
        },
        "score": { "type": "integer", "minimum": 0, "maximum": 2 },
        "status": {
          "type": "string",
          "enum": ["pass", "workaround", "unverified"]
        },
        "evidence": {
          "type": "array",
          "items": { "type": "string", "minLength": 1 },
          "uniqueItems": true
        },
        "finding": { "type": "string", "minLength": 1 }
      },
      "oneOf": [
        {
          "title": "Reproducible pass",
          "properties": {
            "score": { "const": 2 },
            "status": { "const": "pass" },
            "evidence": { "type": "array", "minItems": 1 }
          }
        },
        {
          "title": "Documented workaround",
          "properties": {
            "score": { "const": 1 },
            "status": { "const": "workaround" },
            "evidence": { "type": "array", "minItems": 1 }
          }
        },
        {
          "title": "Missing or unverified",
          "properties": {
            "score": { "const": 0 },
            "status": { "const": "unverified" }
          }
        }
      ]
    }
  }
}
