{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "schema_version": "excel-xray-rules/2.0",
  "id": "excel-xray-rules/2.0",
  "version": "2.0",
  "published": "2026-08-16",
  "description": "Public scoring and coverage contract for the Excel-Röntgenblick structural analyzer.",
  "interpretation": "The score counts detected structural signals. It is not a probability, quality grade, security verdict, or statement that a workbook is migration-ready.",
  "risk_model": {
    "id": "structural-signals/2.0",
    "cap": 100,
    "thresholds": {
      "low": { "minimum": 0, "maximum": 21 },
      "medium": { "minimum": 22, "maximum": 49 },
      "high": { "minimum": 50, "maximum": 100 }
    },
    "rules": [
      { "id": "XRAY-VBA-001", "version": "2.0", "label": "VBA project present", "severity": "high", "calculation": "25 points when at least one vbaProject.bin package part exists", "maximum_points": 25 },
      { "id": "XRAY-EXT-001", "version": "2.0", "label": "External sources", "severity": "high", "calculation": "5 points per deduplicated external source", "maximum_points": 25 },
      { "id": "XRAY-HID-002", "version": "2.0", "label": "Very-hidden sheets", "severity": "medium", "calculation": "6 points per veryHidden sheet", "maximum_points": 15 },
      { "id": "XRAY-HID-001", "version": "2.0", "label": "Hidden sheets", "severity": "medium", "calculation": "3 points per hidden sheet", "maximum_points": 9 },
      { "id": "XRAY-VOL-001", "version": "2.0", "label": "Volatile formulas", "severity": "medium", "calculation": "2 points per formula containing a declared volatile function", "maximum_points": 15 },
      { "id": "XRAY-ERR-001", "version": "2.0", "label": "Cached error cells", "severity": "medium", "calculation": "3 points per cell stored with the error type", "maximum_points": 15 },
      { "id": "XRAY-CPLX-001", "version": "2.0", "label": "Structurally complex formulas", "severity": "medium", "calculation": "3 points per started group of five formulas over the declared length, nesting, or function-count threshold", "maximum_points": 15 },
      { "id": "XRAY-CON-001", "version": "2.0", "label": "Connection package parts", "severity": "medium", "calculation": "4 points per connection or query-table package part", "maximum_points": 12 },
      { "id": "XRAY-VOLM-001", "version": "2.0", "label": "Formula volume", "severity": "medium", "calculation": "10 points above 500 formulas, 20 points above 2000 formulas", "maximum_points": 20 },
      { "id": "XRAY-OK-001", "version": "2.0", "label": "No declared signal detected", "severity": "ok", "calculation": "0 points", "maximum_points": 0 }
    ]
  },
  "coverage_contract": {
    "id": "structural-contract/2.0",
    "scoring": "Each of ten checks has equal weight: completed=1, partial=0.5, skipped=0.",
    "checks": [
      "package-integrity",
      "sheet-inventory",
      "sheet-visibility",
      "formula-inventory",
      "dependency-extraction",
      "volatile-formulas",
      "external-links",
      "vba-presence",
      "cached-errors",
      "connection-parts"
    ],
    "exclusions": [
      "formula-correctness",
      "vba-semantics",
      "power-query-semantics",
      "data-model-pivot-semantics",
      "visual-format-semantics"
    ]
  },
  "privacy": {
    "formula_execution": false,
    "general_cell_values_exported": false,
    "evidence_exports": ["sheet names", "cell addresses", "package-part paths", "counts"],
    "maximum_evidence_items_per_finding": 50
  }
}
