{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://www.cuddler.dev/standards/document-role/process/v1.0.0/implementation-record.schema.json",
  "title": "Cuddler Process Implementation Record Schema",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "$schema",
    "specVersion",
    "implementationName",
    "implementationVersion",
    "implementationUrl",
    "implementationType",
    "conformanceClassesTested",
    "testManifest",
    "results",
    "summary"
  ],
  "properties": {
    "$schema": {
      "type": "string",
      "const": "https://www.cuddler.dev/standards/document-role/process/v1.0.0/implementation-record.schema.json",
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Instance schema identifier for this implementation record."
        }
      ]
    },
    "specVersion": {
      "type": "string",
      "const": "1.0.0",
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Specification release version against which the implementation record was produced."
        }
      ]
    },
    "implementationName": {
      "type": "string",
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Human-readable implementation name."
        }
      ]
    },
    "implementationVersion": {
      "type": "string",
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Human-readable implementation version."
        }
      ]
    },
    "implementationUrl": {
      "type": "string",
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Implementation home page or repository URL."
        }
      ]
    },
    "implementationType": {
      "type": "string",
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Short implementation type label such as validator, publisher, or combined toolchain."
        }
      ]
    },
    "conformanceClassesTested": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "artifact-specification-authoring-implementation",
          "validator",
          "publisher"
        ]
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Formal conformance classes covered by the implementation record."
        }
      ]
    },
    "profilesTested": {
      "type": "array",
      "items": {
        "type": "string",
        "enum": [
          "ai-executor-read-only-v1",
          "adjunct-aware"
        ]
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Informative profiles additionally exercised by the implementation record."
        }
      ]
    },
    "testManifest": {
      "type": "string",
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "URL of the tests manifest used by the implementation."
        }
      ]
    },
    "results": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/result"
      },
      "for-ai": [
        {
          "instruction": "Use this guidance when preparing a valid value for this schema node.",
          "input": "",
          "output": "Per-fixture conformance results."
        }
      ]
    },
    "summary": {
      "$ref": "#/$defs/summary"
    }
  },
  "$defs": {
    "result": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "fixtureId",
        "status",
        "observedRuleIds",
        "notes"
      ],
      "properties": {
        "fixtureId": {
          "type": "string",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Fixture identifier from the tests manifest."
            }
          ]
        },
        "status": {
          "type": "string",
          "enum": [
            "pass",
            "fail",
            "warning"
          ],
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Observed fixture result."
            }
          ]
        },
        "observedRuleIds": {
          "type": "array",
          "items": {
            "type": "string",
            "pattern": "^AUT-(?:SCHEMA|SEM)-\\d{3}$"
          },
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Rule identifiers observed during evaluation."
            }
          ]
        },
        "notes": {
          "type": "string",
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Implementation note for the fixture."
            }
          ]
        }
      }
    },
    "summary": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "passed",
        "failed",
        "warnings"
      ],
      "properties": {
        "passed": {
          "type": "integer",
          "minimum": 0,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Number of passed fixtures."
            }
          ]
        },
        "failed": {
          "type": "integer",
          "minimum": 0,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Number of failed fixtures."
            }
          ]
        },
        "warnings": {
          "type": "integer",
          "minimum": 0,
          "for-ai": [
            {
              "instruction": "Use this guidance when preparing a valid value for this schema node.",
              "input": "",
              "output": "Number of warning fixtures."
            }
          ]
        }
      }
    }
  },
  "for-ai": [
    {
      "instruction": "Use this guidance when preparing a valid value for this schema node.",
      "input": "",
      "output": "JSON Schema for implementation records produced against the Cuddler Process v1.0.0 conformance suite."
    }
  ]
}
