{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://quickiso.app/data-portability/tables/test_runs.schema.json",
  "title": "tables/test_runs.json",
  "description": "The rows of the table test_runs that belong to the workspace, one object per row, keyed by the database's column names.",
  "type": "array",
  "items": {
    "type": "object",
    "properties": {
      "id": {
        "type": "string",
        "format": "uuid"
      },
      "organization_id": {
        "type": "string",
        "format": "uuid"
      },
      "test_key": {
        "type": "string"
      },
      "source_key": {
        "type": "string"
      },
      "rule_version": {
        "type": "string"
      },
      "trigger": {
        "type": "string",
        "enum": [
          "nightly",
          "read",
          "action",
          "manual"
        ]
      },
      "evaluated_at": {
        "type": "string",
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "data_as_of": {
        "type": [
          "string",
          "null"
        ],
        "format": "date-time",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{3}Z$"
      },
      "status": {
        "type": "string",
        "enum": [
          "off",
          "not_applicable",
          "no_result",
          "no_data",
          "overdue",
          "needs_attention",
          "no_issues"
        ]
      },
      "status_reason": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "no_source",
          "module_off",
          "integrations_off",
          "sso_declared",
          "source_no_mfa",
          "source_no_privilege",
          "source_no_encryption",
          "source_not_mdm",
          "empty_population",
          "source_permission_missing",
          "source_license_missing",
          "plugin_off",
          "source_not_aws",
          "no_edr_source",
          "source_no_device_owner",
          "read_refused",
          "read_unavailable",
          "read_stale",
          "partial_read",
          "accounts_unmatched",
          "no_people",
          "people_stale",
          "people_held",
          "no_admins_read",
          "no_scanner",
          "all_excluded",
          "root_not_read",
          "edr_read_stale",
          "no_connected_scanner",
          "no_closed_pentest",
          "no_training_assigned",
          "no_sensitive_access_recorded",
          "evidence_checks_stale",
          "no_active_ai_systems",
          null
        ]
      },
      "effect": {
        "type": "string",
        "enum": [
          "contradicts",
          "informs",
          "none"
        ]
      },
      "effect_reason": {
        "type": [
          "string",
          "null"
        ],
        "enum": [
          "start_window",
          "unverified_source",
          "plugin_inactive",
          "claim_not_made",
          "limited_data",
          null
        ]
      },
      "counts": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      },
      "earliest_due_on": {
        "type": [
          "string",
          "null"
        ],
        "format": "date",
        "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
      },
      "parameters": {
        "type": [
          "object",
          "array",
          "string",
          "number",
          "boolean",
          "null"
        ]
      }
    },
    "required": [
      "id",
      "organization_id",
      "test_key",
      "source_key",
      "rule_version",
      "trigger",
      "evaluated_at",
      "data_as_of",
      "status",
      "status_reason",
      "effect",
      "effect_reason",
      "counts",
      "earliest_due_on",
      "parameters"
    ],
    "additionalProperties": false
  }
}
