Schema: corpus-source-plan

{
  "$defs": {
    "baseDisposition": {
      "properties": {
        "classification": {
          "type": "string"
        },
        "disposition": {
          "type": "string"
        },
        "owner": {
          "minLength": 1,
          "type": "string"
        },
        "path": {
          "minLength": 1,
          "pattern": "^[^\\\\/](?:[^\\\\]*[^\\\\/])?$",
          "type": "string"
        },
        "reason": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "path",
        "disposition",
        "owner",
        "classification",
        "reason"
      ],
      "type": "object"
    },
    "entry": {
      "allOf": [
        {
          "$ref": "#/$defs/baseDisposition"
        },
        {
          "additionalProperties": false,
          "properties": {
            "classification": {
              "const": "DEPLOYABLE_RUNTIME"
            },
            "disposition": {
              "const": "ENTRY"
            },
            "kind": {
              "enum": [
                "LAYOUT",
                "MACRO",
                "FRAGMENT",
                "INTERACTIVE_COMPONENT",
                "STATIC",
                "PARTIAL",
                "ROUTE_PAGE"
              ],
              "type": "string"
            },
            "owner": true,
            "path": true,
            "reason": true,
            "source_digest": {
              "pattern": "^[a-f0-9]{64}$",
              "type": "string"
            }
          },
          "required": [
            "path",
            "disposition",
            "owner",
            "classification",
            "reason",
            "source_digest",
            "kind"
          ],
          "type": "object"
        }
      ]
    },
    "exclusion": {
      "allOf": [
        {
          "$ref": "#/$defs/baseDisposition"
        },
        {
          "additionalProperties": false,
          "properties": {
            "classification": {
              "enum": [
                "ALTERNATE_RUNTIME_MIRROR",
                "BUILD_INPUT",
                "DOCUMENTATION",
                "GENERATED_METADATA",
                "GENERATED_OUTPUT",
                "GOVERNANCE_METADATA",
                "NON_DEPLOYABLE_SOURCE",
                "PLACEHOLDER",
                "REFERENCE_ONLY",
                "RUNTIME_DATA"
              ]
            },
            "disposition": {
              "const": "EXCLUSION"
            },
            "owner": true,
            "path": true,
            "reason": true
          },
          "required": [
            "path",
            "disposition",
            "owner",
            "classification",
            "reason"
          ],
          "type": "object"
        }
      ]
    }
  },
  "$id": "https://australis.systems/schemas/htmx-ui-template-scaffold/corpus-source-plan.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Complete deterministic disposition plan for every physical file beneath one corpus source root.",
  "properties": {
    "candidate_count": {
      "minimum": 1,
      "type": "integer"
    },
    "compatibility_profiles": {
      "items": {
        "minLength": 1,
        "type": "string"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "corpus_revision": {
      "minLength": 1,
      "type": "string"
    },
    "dispositions": {
      "items": {
        "oneOf": [
          {
            "$ref": "#/$defs/entry"
          },
          {
            "$ref": "#/$defs/exclusion"
          }
        ]
      },
      "minItems": 1,
      "type": "array"
    },
    "entry_count": {
      "minimum": 0,
      "type": "integer"
    },
    "exclusion_count": {
      "minimum": 0,
      "type": "integer"
    },
    "plan_id": {
      "const": "canonical-corpus-source-plan",
      "type": "string"
    },
    "plan_version": {
      "pattern": "^[0-9]+\\.[0-9]+\\.[0-9]+$",
      "type": "string"
    },
    "schema_version": {
      "const": "1.0.0",
      "type": "string"
    },
    "source_root": {
      "minLength": 1,
      "pattern": "^[^\\\\/](?:[^\\\\]*[^\\\\/])?$",
      "type": "string"
    }
  },
  "required": [
    "schema_version",
    "plan_id",
    "plan_version",
    "source_root",
    "corpus_revision",
    "compatibility_profiles",
    "candidate_count",
    "entry_count",
    "exclusion_count",
    "dispositions"
  ],
  "title": "Corpus Source Plan",
  "type": "object"
}