Schema: template-abi-inventory

{
  "$defs": {
    "block": {
      "additionalProperties": false,
      "properties": {
        "line": {
          "$ref": "#/$defs/line"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "name",
        "line"
      ],
      "type": "object"
    },
    "call": {
      "additionalProperties": false,
      "properties": {
        "count": {
          "minimum": 1,
          "type": "integer"
        },
        "kind": {
          "enum": [
            "global",
            "local_macro",
            "imported_macro",
            "method"
          ],
          "type": "string"
        },
        "lines": {
          "$ref": "#/$defs/lines"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "kind",
        "name",
        "count",
        "lines"
      ],
      "type": "object"
    },
    "countMap": {
      "additionalProperties": {
        "minimum": 1,
        "type": "integer"
      },
      "type": "object"
    },
    "dependency": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "extends",
            "include",
            "import",
            "from_import"
          ],
          "type": "string"
        },
        "line": {
          "$ref": "#/$defs/line"
        },
        "manifested": {
          "type": "boolean"
        },
        "target": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "kind",
        "target",
        "line",
        "manifested"
      ],
      "type": "object"
    },
    "line": {
      "minimum": 1,
      "type": "integer"
    },
    "lines": {
      "items": {
        "$ref": "#/$defs/line"
      },
      "minItems": 1,
      "type": "array",
      "uniqueItems": true
    },
    "macro": {
      "additionalProperties": false,
      "properties": {
        "default_parameters": {
          "minimum": 0,
          "type": "integer"
        },
        "line": {
          "$ref": "#/$defs/line"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        },
        "parameters": {
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        },
        "required_parameters": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "name",
        "line",
        "parameters",
        "required_parameters",
        "default_parameters"
      ],
      "type": "object"
    },
    "nonTemplateHtml": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "minLength": 1,
          "type": "string"
        },
        "path": {
          "minLength": 1,
          "type": "string"
        },
        "source_digest": {
          "$ref": "#/$defs/sha256"
        }
      },
      "required": [
        "path",
        "kind",
        "source_digest"
      ],
      "type": "object"
    },
    "sha256": {
      "pattern": "^[a-f0-9]{64}$",
      "type": "string"
    },
    "summary": {
      "additionalProperties": false,
      "properties": {
        "call_counts": {
          "additionalProperties": false,
          "properties": {
            "global": {
              "$ref": "#/$defs/countMap"
            },
            "imported_macro": {
              "$ref": "#/$defs/countMap"
            },
            "local_macro": {
              "$ref": "#/$defs/countMap"
            },
            "method": {
              "$ref": "#/$defs/countMap"
            }
          },
          "type": "object"
        },
        "filter_counts": {
          "$ref": "#/$defs/countMap"
        },
        "kind_counts": {
          "$ref": "#/$defs/countMap"
        },
        "non_template_html_count": {
          "minimum": 0,
          "type": "integer"
        },
        "tag_counts": {
          "$ref": "#/$defs/countMap"
        },
        "template_count": {
          "minimum": 0,
          "type": "integer"
        },
        "test_counts": {
          "$ref": "#/$defs/countMap"
        },
        "unresolved_dependency_count": {
          "minimum": 0,
          "type": "integer"
        },
        "variable_counts": {
          "$ref": "#/$defs/countMap"
        }
      },
      "required": [
        "template_count",
        "non_template_html_count",
        "kind_counts",
        "tag_counts",
        "filter_counts",
        "test_counts",
        "call_counts",
        "variable_counts",
        "unresolved_dependency_count"
      ],
      "type": "object"
    },
    "template": {
      "additionalProperties": false,
      "properties": {
        "blocks": {
          "items": {
            "$ref": "#/$defs/block"
          },
          "type": "array"
        },
        "calls": {
          "items": {
            "$ref": "#/$defs/call"
          },
          "type": "array"
        },
        "dependencies": {
          "items": {
            "$ref": "#/$defs/dependency"
          },
          "type": "array"
        },
        "filters": {
          "items": {
            "$ref": "#/$defs/usage"
          },
          "type": "array"
        },
        "kind": {
          "enum": [
            "LAYOUT",
            "MACRO",
            "FRAGMENT",
            "INTERACTIVE_COMPONENT",
            "PARTIAL",
            "ROUTE_PAGE"
          ],
          "type": "string"
        },
        "macros": {
          "items": {
            "$ref": "#/$defs/macro"
          },
          "type": "array"
        },
        "path": {
          "minLength": 1,
          "type": "string"
        },
        "source_digest": {
          "$ref": "#/$defs/sha256"
        },
        "tags": {
          "items": {
            "$ref": "#/$defs/usage"
          },
          "type": "array"
        },
        "tests": {
          "items": {
            "$ref": "#/$defs/usage"
          },
          "type": "array"
        },
        "variables": {
          "items": {
            "minLength": 1,
            "type": "string"
          },
          "type": "array",
          "uniqueItems": true
        }
      },
      "required": [
        "path",
        "kind",
        "source_digest",
        "tags",
        "filters",
        "tests",
        "calls",
        "variables",
        "blocks",
        "macros",
        "dependencies"
      ],
      "type": "object"
    },
    "unresolvedDependency": {
      "additionalProperties": false,
      "properties": {
        "kind": {
          "enum": [
            "extends",
            "include",
            "import",
            "from_import"
          ],
          "type": "string"
        },
        "line": {
          "$ref": "#/$defs/line"
        },
        "manifested": {
          "const": false
        },
        "path": {
          "minLength": 1,
          "type": "string"
        },
        "target": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "path",
        "kind",
        "target",
        "line",
        "manifested"
      ],
      "type": "object"
    },
    "usage": {
      "additionalProperties": false,
      "properties": {
        "count": {
          "minimum": 1,
          "type": "integer"
        },
        "lines": {
          "$ref": "#/$defs/lines"
        },
        "name": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "name",
        "count",
        "lines"
      ],
      "type": "object"
    }
  },
  "$id": "https://australis.systems/schemas/htmx-ui-template-scaffold/template-abi-inventory.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "description": "Deterministic Jinja ABI evidence for manifest-selected canonical templates.",
  "properties": {
    "corpus_revision": {
      "minLength": 1,
      "type": "string"
    },
    "manifest_path": {
      "minLength": 1,
      "type": "string"
    },
    "manifest_sha256": {
      "$ref": "#/$defs/sha256"
    },
    "non_template_html_entries": {
      "items": {
        "$ref": "#/$defs/nonTemplateHtml"
      },
      "type": "array"
    },
    "schema_version": {
      "const": "1.0.0",
      "type": "string"
    },
    "summary": {
      "$ref": "#/$defs/summary"
    },
    "templates": {
      "items": {
        "$ref": "#/$defs/template"
      },
      "type": "array"
    },
    "unresolved_dependencies": {
      "items": {
        "$ref": "#/$defs/unresolvedDependency"
      },
      "type": "array"
    }
  },
  "required": [
    "schema_version",
    "corpus_revision",
    "manifest_path",
    "manifest_sha256",
    "summary",
    "unresolved_dependencies",
    "non_template_html_entries",
    "templates"
  ],
  "title": "Template ABI Inventory",
  "type": "object"
}