{
  "$schema": "http://json-schema.org/draft-07/schema#",
  "$id": "https://litlfred.github.io/folio-assistant/cat-harness/skills/wireframe-viewport-check/output.schema.json",
  "title": "Wireframe Viewport Check Output",
  "description": "Per candidate, per viewport (web 1280x800, mobile 390x844), a pass or fail entry for each mechanical criterion (renders, no-overflow, no-placeholder) with a note, and a screenshot per viewport. Pass/fail entries only, never a score (the wiregen methodology).",
  "type": "object",
  "required": [
    "report",
    "candidates"
  ],
  "properties": {
    "report": {
      "type": "string",
      "description": "The report.json path; the screenshots are beside it."
    },
    "candidates": {
      "type": "array",
      "items": {
        "type": "object",
        "required": [
          "source",
          "screenshots",
          "entries"
        ],
        "properties": {
          "source": {
            "type": "string",
            "description": "The candidate's HTML path."
          },
          "screenshots": {
            "type": "object",
            "required": [
              "web",
              "mobile"
            ],
            "properties": {
              "web": {
                "type": "string"
              },
              "mobile": {
                "type": "string"
              }
            }
          },
          "entries": {
            "type": "array",
            "items": {
              "$ref": "#/definitions/criterionEntry"
            }
          }
        }
      }
    },
    "stagingLinks": {
      "$ref": "#/definitions/stagingLinks"
    }
  },
  "definitions": {
    "criterionEntry": {
      "type": "object",
      "required": [
        "criterion",
        "status"
      ],
      "properties": {
        "criterion": {
          "type": "string",
          "description": "renders, no-overflow, no-placeholder (script entries from wireframe-check); intent-fit, web-usability, mobile-usability, accessibility, alternatives (review entries)."
        },
        "status": {
          "type": "string",
          "enum": [
            "pass",
            "warn",
            "fail"
          ]
        },
        "by": {
          "type": "string",
          "description": "`script` for a wireframe-check entry; the reviewer otherwise."
        },
        "note": {
          "type": "string",
          "description": "The reason. Required in substance for every warn and fail."
        }
      }
    },
    "stagingLinks": {
      "title": "Staging links",
      "description": "The staging preview of the work a request for feedback is about: one deep link per changed page (the page and the anchor where the change sits) with the same page on main as `before`. Mirrors StagingComparison in schemas/sdlc/staging.ts. The rule is skills/authoring/content-lifecycle/feedback-deep-links.md. Copied inline as `definitions.stagingLinks` into every skill contract that carries it; schemas/staging.test.ts fails when a copy drifts.",
      "type": "object",
      "required": [
        "branch",
        "slug",
        "branchUrl",
        "mainBaseUrl",
        "stagingBaseUrl",
        "pages"
      ],
      "properties": {
        "branch": {
          "type": "string",
          "description": "Feature branch name."
        },
        "slug": {
          "type": "string",
          "description": "Branch slug used in the staging URL path."
        },
        "branchUrl": {
          "type": "string",
          "format": "uri"
        },
        "pr": {
          "type": "integer",
          "minimum": 1
        },
        "mainBaseUrl": {
          "type": "string",
          "format": "uri"
        },
        "stagingBaseUrl": {
          "type": "string",
          "format": "uri"
        },
        "pages": {
          "type": "array",
          "description": "One entry per changed page, deep-linked; from the change's rendered-impact list, never chosen by judgement.",
          "items": {
            "type": "object",
            "required": [
              "title"
            ],
            "properties": {
              "title": {
                "type": "string"
              },
              "before": {
                "type": "string",
                "format": "uri",
                "description": "Same page on main; absent for a new page."
              },
              "after": {
                "type": "string",
                "format": "uri",
                "description": "The page on the staging preview, with the anchor where the change sits; absent for a deleted page."
              },
              "summary": {
                "type": "string",
                "description": "What to look at on this page."
              }
            }
          }
        },
        "missing": {
          "type": "array",
          "items": {
            "type": "string"
          },
          "description": "What could not be linked, said rather than hidden: no preview yet (and when it will exist), no page list computed, or a changed page the publish ref does not hold."
        }
      },
      "$comment": "Copy of cat-harness schemas/staging-comparison.schema.json; cat-harness schemas/staging.test.ts fails when a copy drifts."
    }
  }
}
