{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://ggaction.github.io/ggaction/schemas/llms-manifest.schema.json",
  "title": "ggaction full LLM documentation manifest",
  "type": "object",
  "additionalProperties": false,
  "required": [
    "schemaVersion",
    "packageVersion",
    "sourceStatus",
    "bundle",
    "sectionCount",
    "sections"
  ],
  "properties": {
    "schemaVersion": {
      "const": 1
    },
    "packageVersion": {
      "type": "string",
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+(?:-[0-9A-Za-z.-]+)?(?:\\+[0-9A-Za-z.-]+)?$"
    },
    "sourceStatus": {
      "const": "checked-out-repository-documentation"
    },
    "bundle": {
      "const": "llms-full.txt"
    },
    "sectionCount": {
      "type": "integer",
      "minimum": 1
    },
    "sections": {
      "type": "array",
      "minItems": 1,
      "items": {
        "type": "object",
        "additionalProperties": false,
        "required": [
          "order",
          "title",
          "route",
          "source",
          "headings",
          "bytes",
          "sha256"
        ],
        "properties": {
          "order": {
            "type": "integer",
            "minimum": 1
          },
          "title": {
            "type": "string",
            "minLength": 1
          },
          "route": {
            "type": "string",
            "pattern": "^/"
          },
          "source": {
            "type": "string",
            "pattern": "^[A-Za-z0-9_./-]+\\.md$"
          },
          "headings": {
            "type": "array",
            "minItems": 1,
            "uniqueItems": true,
            "items": {
              "type": "string",
              "minLength": 1
            }
          },
          "bytes": {
            "type": "integer",
            "minimum": 1
          },
          "sha256": {
            "type": "string",
            "pattern": "^[a-f0-9]{64}$"
          }
        }
      }
    },
    "provenance": {
      "type": "object",
      "additionalProperties": false,
      "required": [
        "status",
        "contractId",
        "sourceCommit",
        "baseline",
        "manifest"
      ],
      "properties": {
        "status": {
          "enum": [
            "development",
            "published-release"
          ]
        },
        "contractId": {
          "type": "string",
          "pattern": "^sha256:[a-f0-9]{64}$"
        },
        "sourceCommit": {
          "type": [
            "string",
            "null"
          ]
        },
        "baseline": {
          "type": "object",
          "required": [
            "tag",
            "commit",
            "actionCount"
          ],
          "properties": {
            "tag": {
              "type": "string"
            },
            "commit": {
              "type": "string"
            },
            "actionCount": {
              "type": "integer"
            }
          }
        },
        "manifest": {
          "const": "doc-provenance.json"
        }
      }
    }
  }
}
