Schema: csp-inventory

{
  "$defs": {
    "counts": {
      "additionalProperties": {
        "minimum": 0,
        "type": "integer"
      },
      "type": "object"
    },
    "coverage": {
      "additionalProperties": false,
      "properties": {
        "classification": {
          "enum": [
            "HTML_TEMPLATE",
            "STATIC_HTML",
            "NON_HTML"
          ]
        },
        "finding_count": {
          "minimum": 0,
          "type": "integer"
        },
        "kind": {
          "minLength": 1,
          "type": "string"
        },
        "path": {
          "minLength": 1,
          "type": "string"
        },
        "reason": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "path",
        "kind",
        "classification",
        "reason",
        "finding_count"
      ],
      "type": "object"
    },
    "finding": {
      "additionalProperties": false,
      "properties": {
        "classification": {
          "enum": [
            "ALLOWED",
            "NON_RUNTIME",
            "PROHIBITED",
            "UNCLASSIFIED"
          ]
        },
        "details": {
          "additionalProperties": {
            "type": "string"
          },
          "type": "object"
        },
        "evidence": {
          "type": "string"
        },
        "line": {
          "minimum": 1,
          "type": "integer"
        },
        "path": {
          "minLength": 1,
          "type": "string"
        },
        "reason": {
          "minLength": 1,
          "type": "string"
        },
        "type": {
          "minLength": 1,
          "type": "string"
        }
      },
      "required": [
        "path",
        "line",
        "type",
        "classification",
        "reason",
        "evidence",
        "details"
      ],
      "type": "object"
    },
    "sha256": {
      "pattern": "^[a-f0-9]{64}$",
      "type": "string"
    },
    "summary": {
      "additionalProperties": false,
      "properties": {
        "classification_counts": {
          "$ref": "#/$defs/counts"
        },
        "covered_entry_count": {
          "minimum": 0,
          "type": "integer"
        },
        "finding_count": {
          "minimum": 0,
          "type": "integer"
        },
        "html_template_count": {
          "minimum": 0,
          "type": "integer"
        },
        "non_html_count": {
          "minimum": 0,
          "type": "integer"
        },
        "policy_failure_count": {
          "minimum": 0,
          "type": "integer"
        },
        "prohibited_count": {
          "minimum": 0,
          "type": "integer"
        },
        "selected_entry_count": {
          "minimum": 0,
          "type": "integer"
        },
        "static_html_count": {
          "minimum": 0,
          "type": "integer"
        },
        "type_counts": {
          "$ref": "#/$defs/counts"
        },
        "unclassified_count": {
          "minimum": 0,
          "type": "integer"
        }
      },
      "required": [
        "selected_entry_count",
        "covered_entry_count",
        "html_template_count",
        "static_html_count",
        "non_html_count",
        "finding_count",
        "classification_counts",
        "type_counts",
        "prohibited_count",
        "unclassified_count",
        "policy_failure_count"
      ],
      "type": "object"
    }
  },
  "$id": "https://australis.systems/schemas/htmx-ui-template-scaffold/csp-inventory.schema.json",
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "additionalProperties": false,
  "properties": {
    "corpus_revision": {
      "minLength": 1,
      "type": "string"
    },
    "coverage": {
      "items": {
        "$ref": "#/$defs/coverage"
      },
      "type": "array"
    },
    "findings": {
      "items": {
        "$ref": "#/$defs/finding"
      },
      "type": "array"
    },
    "manifest_path": {
      "minLength": 1,
      "type": "string"
    },
    "manifest_sha256": {
      "$ref": "#/$defs/sha256"
    },
    "parser_engines": {
      "additionalProperties": false,
      "properties": {
        "html": {
          "const": "html.parser.HTMLParser"
        },
        "jinja": {
          "const": "jinja2.Environment.parse"
        },
        "rendered_html": {
          "const": "html.parser.HTMLParser"
        }
      },
      "required": [
        "html",
        "jinja",
        "rendered_html"
      ],
      "type": "object"
    },
    "schema_version": {
      "const": "1.0.0"
    },
    "status": {
      "enum": [
        "PASS",
        "NON_COMPLIANT"
      ]
    },
    "summary": {
      "$ref": "#/$defs/summary"
    }
  },
  "required": [
    "schema_version",
    "corpus_revision",
    "manifest_path",
    "manifest_sha256",
    "parser_engines",
    "status",
    "summary",
    "coverage",
    "findings"
  ],
  "title": "CSP Inventory",
  "type": "object"
}