{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/rowattest-com/json-schema/rowattest-com-findings-schema.json",
  "title": "Findings",
  "description": "A complete run with a signed report answers from that report: verification is signed, with its report_id and verify_url. For a complete run with no signed report, while one can still be bought on the run page, the answer is the run's unverified result instead, as the run page shows it: verification is unverified, report_id and verify_url are null, url is the run page, each finding has only its verdict, surface, operation and principal, findings_lines carries the run page's Findings section line by line, counts.not_evaluated is null (the coverage lines state that number), and coverage and access_model come from the run's recorded result. The fields summary, clean_report_blocked, allowed_by_model, flags and blocking_findings come only with a signed report.",
  "x-generated": "2026-11-23",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/rowattest-com-openapi.json#/components/schemas/Findings",
  "type": "object",
  "required": [
    "run_id",
    "verification",
    "report_id",
    "verify_url",
    "counts",
    "findings"
  ],
  "properties": {
    "run_id": {
      "type": "string",
      "format": "uuid"
    },
    "verification": {
      "type": "string",
      "enum": [
        "signed",
        "unverified"
      ]
    },
    "report_id": {
      "type": [
        "string",
        "null"
      ]
    },
    "verify_url": {
      "type": [
        "string",
        "null"
      ],
      "format": "uri"
    },
    "url": {
      "type": "string",
      "format": "uri",
      "description": "Unverified only: the run page, where a signed report for the run can be bought."
    },
    "counts": {
      "type": "object",
      "required": [
        "pass",
        "fail",
        "provisional",
        "not_evaluated",
        "error",
        "allowed_by_model"
      ],
      "properties": {
        "pass": {
          "type": "integer"
        },
        "fail": {
          "type": "integer",
          "description": "leak + disagreement + model_divergence"
        },
        "provisional": {
          "type": "integer",
          "description": "layer_a_only + layer_b_corroborated"
        },
        "not_evaluated": {
          "type": [
            "integer",
            "null"
          ],
          "description": "null when verification is unverified"
        },
        "error": {
          "type": "integer"
        },
        "allowed_by_model": {
          "type": "integer",
          "description": "The number of cells in allowed_by_model."
        }
      }
    },
    "summary": {
      "type": "object",
      "description": "The report's differential summary, verbatim."
    },
    "clean_report_blocked": {},
    "findings": {
      "type": "array",
      "description": "Every cell whose verdict is not PASS.",
      "items": {
        "type": "object",
        "properties": {
          "cell_id": {
            "type": "string"
          },
          "verdict": {
            "type": "string"
          },
          "surface": {
            "type": "string",
            "description": "The surface the cell ran on: table:<schema>.<name> in a report 2.0, 2.1 or 2.2, table:<name> in a report 1.0, or bucket:<name>."
          },
          "operation": {
            "type": "string"
          },
          "boundary": {
            "type": "string"
          },
          "identity": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "principal": {
                "type": "string"
              },
              "role": {
                "type": "string"
              }
            }
          },
          "principal": {
            "type": "string",
            "description": "Unverified only: the test identity, as the run page names it."
          },
          "layer_a": {
            "type": "string"
          },
          "layer_b": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": "string"
          },
          "identifiers": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "scheme": {
                  "type": "string"
                },
                "id": {
                  "type": "string"
                },
                "name": {
                  "type": "string"
                }
              }
            }
          }
        }
      }
    },
    "findings_lines": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Unverified only: the run page's Findings section, line by line"
    },
    "coverage": {
      "type": "array",
      "items": {
        "type": "string"
      },
      "description": "Unverified only: the coverage lines, as the run page lists them."
    },
    "access_model": {
      "type": [
        "object",
        "null"
      ],
      "description": "Unverified only: the access model summary the run kept (null for a run without one).",
      "properties": {
        "sha256": {
          "type": "string"
        },
        "version": {
          "type": [
            "integer",
            "null"
          ]
        },
        "basis_counts": {
          "type": "object",
          "properties": {
            "detected": {
              "type": "integer"
            },
            "confirmed": {
              "type": "integer"
            },
            "declared": {
              "type": "integer"
            }
          }
        },
        "tables": {
          "type": "object",
          "properties": {
            "covered": {
              "type": "integer"
            },
            "declared_public": {
              "type": "integer"
            },
            "not_evaluated": {
              "type": "integer"
            },
            "total": {
              "type": "integer"
            }
          }
        }
      }
    },
    "allowed_by_model": {
      "type": "array",
      "description": "The report's cells whose access the access model allows, for example reads of a table detected as public. They are not PASS, so they are also in findings. Empty for a report without an access model.",
      "items": {
        "type": "object",
        "properties": {
          "cell_id": {
            "type": "string"
          },
          "surface": {
            "type": "string",
            "description": "The surface the cell ran on: table:<schema>.<name> in a report 2.0, 2.1 or 2.2, table:<name> in a report 1.0, or bucket:<name>."
          },
          "operation": {
            "type": "string"
          },
          "identity": {
            "type": "object",
            "properties": {
              "label": {
                "type": "string"
              },
              "principal": {
                "type": "string"
              },
              "role": {
                "type": "string"
              }
            }
          },
          "layer_a": {
            "type": "string"
          },
          "layer_b": {
            "type": [
              "string",
              "null"
            ]
          },
          "note": {
            "type": "string"
          }
        }
      }
    },
    "flags": {
      "type": "array",
      "description": "Schema-level flags (classes C1–C3).",
      "items": {
        "type": "object"
      }
    },
    "blocking_findings": {
      "type": "array",
      "description": "Verbatim from the report.",
      "items": {
        "type": "object"
      }
    },
    "hygiene": {
      "type": "object",
      "description": "Report 2.1 and later: the run's catalog hygiene block, verbatim (signed: from the signed report; unverified: as the run recorded it). Catalog observations read from the database's system tables, never verdicts: no cell, count or clean-report flag reads them. A report 2.0 or 1.0 has none, and the key is absent. A signed report 2.1's public summary (schema_version 1.3; 1.2 for a report 2.0) states only their counts: hygiene_checks_run and hygiene_findings_by_severity.",
      "required": [
        "version",
        "checks",
        "checks_not_run",
        "findings",
        "note"
      ],
      "properties": {
        "version": {
          "type": "string",
          "const": "1.0"
        },
        "checks": {
          "type": "array",
          "items": {
            "type": "string",
            "enum": [
              "security_definer_api_executable",
              "security_definer_no_search_path",
              "secret_shaped_column",
              "view_runs_as_owner"
            ]
          }
        },
        "checks_not_run": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "check",
              "reason"
            ],
            "properties": {
              "check": {
                "type": "string"
              },
              "reason": {
                "type": "string"
              }
            }
          }
        },
        "findings": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "check",
              "severity",
              "object",
              "detail",
              "hint"
            ],
            "properties": {
              "check": {
                "type": "string"
              },
              "severity": {
                "type": "string",
                "enum": [
                  "high",
                  "medium",
                  "review"
                ]
              },
              "object": {
                "type": "string"
              },
              "detail": {
                "type": "string"
              },
              "hint": {
                "type": "string"
              }
            }
          }
        },
        "note": {
          "type": "string"
        }
      }
    }
  }
}