{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/checker-lazynext/json-schema/checker-lazynext-stored-report-schema.json",
  "title": "StoredReport",
  "description": "The object persisted under `report:{id}` (30-day TTL), returned by `/report/{id}.json`. ScanResult fields plus `url`/`ts`; the `issues` list reflects any `level`/`rule` filters applied server-side.",
  "x-generated": "2026-11-08",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/checker-lazynext-openapi.json#/components/schemas/StoredReport",
  "type": "object",
  "properties": {
    "url": {
      "type": [
        "string",
        "null"
      ],
      "description": "Scanned URL, or null for pasted-HTML scans"
    },
    "ts": {
      "type": "number",
      "description": "Persist time, epoch ms"
    },
    "score": {
      "type": "number",
      "minimum": 0,
      "maximum": 100
    },
    "score_model": {
      "type": "string",
      "enum": [
        "weighted-v1"
      ]
    },
    "issues": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/Issue"
      }
    },
    "rendered": {
      "type": "boolean"
    },
    "plan": {
      "type": "string",
      "enum": [
        "free",
        "pro"
      ]
    },
    "render_error": {
      "type": "string"
    },
    "site": {
      "type": "boolean"
    },
    "pages": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "url": {
            "type": "string"
          },
          "score": {
            "type": "number"
          },
          "count": {
            "type": "number"
          }
        }
      }
    },
    "section508": {
      "$ref": "#/$defs/Section508"
    },
    "benchmark": {
      "type": "object",
      "properties": {
        "pct": {
          "type": "number"
        },
        "sites": {
          "type": "number"
        }
      }
    }
  },
  "required": [
    "url",
    "ts",
    "score",
    "score_model",
    "issues",
    "rendered",
    "plan",
    "section508"
  ],
  "$defs": {
    "Issue": {
      "type": "object",
      "properties": {
        "rule": {
          "type": "string",
          "description": "Emitted rule id — `wcag-N.N.N`, `sec508-*`, or `bp-*` (best practice, not a numbered criterion)"
        },
        "level": {
          "type": "string",
          "enum": [
            "A",
            "AA",
            "AAA",
            "BP"
          ]
        },
        "message": {
          "type": "string"
        },
        "url": {
          "type": "string",
          "description": "Per-page attribution on site scans"
        },
        "recommendation": {
          "type": "string",
          "description": "Fix guidance joined from the ruleset"
        }
      }
    },
    "Section508": {
      "type": "object",
      "properties": {
        "basis": {
          "type": "string",
          "description": "Incorporation basis — 508 defines no web test rules of its own; E205.4 incorporates WCAG 2.0 AA by reference"
        },
        "conforms": {
          "type": "boolean",
          "description": "true when no WCAG criterion fired"
        },
        "criteria_failed": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Sorted `wcag-*` rule ids that fired"
        },
        "clauses_implicated": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "Chapter 3 Functional Performance Criteria (302.x) the failures map onto — the language a VPAT/procurement review cites"
        },
        "clause_count": {
          "type": "number"
        }
      },
      "required": [
        "basis",
        "conforms",
        "criteria_failed",
        "clauses_implicated",
        "clause_count"
      ],
      "description": "36 CFR 1194 clause mapping derived from the WCAG findings"
    }
  }
}