{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://artifacts.apis.io/nopaque-co-uk/json-schema/nopaque-co-uk-compliance-catalogue-response-schema.json",
  "title": "ComplianceCatalogueResponse",
  "description": "Response for `GET /testing/compliance-catalogue`. Single round-trip carries the filtered\ncatalogue plus the workspace's per-tier picker cap, available s2stest seconds, and tier\n— everything the picker UI needs.\n",
  "x-generated": "2026-11-29",
  "x-method": "derived",
  "x-generator": "derive-json-schema.py",
  "x-source": "openapi/nopaque-co-uk-compliance-api-openapi.yml#/components/schemas/ComplianceCatalogueResponse",
  "type": "object",
  "required": [
    "catalogue",
    "pickerLimit",
    "s2stestSecondsAvailable",
    "tier"
  ],
  "properties": {
    "catalogue": {
      "$ref": "#/$defs/ComplianceCatalogue"
    },
    "pickerLimit": {
      "type": "integer",
      "minimum": 0,
      "description": "Maximum number of tests the workspace's tier may dispatch in one batch."
    },
    "s2stestSecondsAvailable": {
      "type": "integer",
      "minimum": 0,
      "description": "Remaining s2stest seconds in the workspace's quota."
    },
    "tier": {
      "type": "string"
    }
  },
  "$defs": {
    "ComplianceCatalogue": {
      "type": "object",
      "description": "Bundled compliance catalogue. Filtered server-side to the workspace's sector\n(`all` always included; other sectors only when the query string `sector` matches).\nDeprecated tests are stripped.\n",
      "required": [
        "version",
        "regulations",
        "tests"
      ],
      "properties": {
        "version": {
          "type": "integer",
          "minimum": 1
        },
        "regulations": {
          "type": "object",
          "additionalProperties": {
            "$ref": "#/$defs/ComplianceRegulation"
          }
        },
        "tests": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/ComplianceTest"
          }
        }
      }
    },
    "ComplianceCoversEntry": {
      "type": "object",
      "description": "Mapping from a compliance test to clauses it covers in a named regulation.",
      "required": [
        "regulation",
        "clauses"
      ],
      "properties": {
        "regulation": {
          "type": "string"
        },
        "clauses": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        },
        "weight": {
          "type": "string",
          "enum": [
            "primary",
            "secondary",
            "adjacent"
          ]
        },
        "rationale": {
          "type": "string"
        }
      }
    },
    "ComplianceRegulation": {
      "type": "object",
      "description": "One regulation entry from the compliance catalogue.",
      "required": [
        "name",
        "jurisdiction",
        "url"
      ],
      "properties": {
        "name": {
          "type": "string"
        },
        "jurisdiction": {
          "type": "string",
          "description": "Free-form jurisdiction (e.g. `uk`, `eu`, `uk+eu`, `global`, `us`, or a US state as `us-ca`; several states join with `+`)."
        },
        "url": {
          "type": "string",
          "format": "uri"
        },
        "full_ref": {
          "type": "string"
        },
        "in_force": {
          "type": "string"
        },
        "in_force_phases": {
          "type": "array",
          "items": {
            "type": "object",
            "required": [
              "date",
              "scope"
            ],
            "properties": {
              "date": {
                "type": "string"
              },
              "scope": {
                "type": "string"
              }
            }
          }
        },
        "notes": {
          "type": "string"
        },
        "sectors": {
          "type": "array",
          "items": {
            "type": "string"
          }
        }
      }
    },
    "ComplianceTest": {
      "type": "object",
      "description": "Compliance catalogue test entry. Each test exercises one regulatory scenario; an\nagent calls the IVR with `mission`, and the LLM judge evaluates `pass`/`fail`.\n",
      "required": [
        "id",
        "name",
        "summary",
        "severity",
        "channels",
        "sectors",
        "jurisdictions",
        "mission",
        "pass",
        "fail",
        "covers"
      ],
      "properties": {
        "id": {
          "type": "string",
          "pattern": "^M-\\d{3}$"
        },
        "name": {
          "type": "string"
        },
        "summary": {
          "type": "string"
        },
        "severity": {
          "type": "string",
          "enum": [
            "critical",
            "major",
            "advisory"
          ]
        },
        "probes": {
          "type": "array",
          "description": "What the simulated customer says, in order. Present on every test\napplicable to a text channel.\n\nRequired to dispatch this test over chat. The digital worker drives\nthe whole transcript from these, so a run without them produces a\none-turn transcript containing only the bot's greeting, and the\njudge then scores it against conditions it had no chance to satisfy.\nAbsent on voice-only tests.\n",
          "items": {
            "type": "string"
          }
        },
        "channels": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "enum": [
              "voice",
              "chat",
              "sms",
              "email"
            ]
          }
        },
        "sectors": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "enum": [
              "all",
              "financial-services",
              "telco",
              "energy",
              "gambling",
              "healthcare",
              "retail",
              "public-sector"
            ]
          }
        },
        "jurisdictions": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string",
            "enum": [
              "uk",
              "eu",
              "us"
            ]
          }
        },
        "tags": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "setup": {
          "type": "string"
        },
        "mission": {
          "type": "string"
        },
        "pass": {
          "type": "array",
          "minItems": 1,
          "items": {
            "type": "string"
          }
        },
        "fail": {
          "type": "array",
          "items": {
            "type": "string"
          }
        },
        "covers": {
          "type": "array",
          "minItems": 1,
          "items": {
            "$ref": "#/$defs/ComplianceCoversEntry"
          }
        },
        "notes": {
          "type": "string"
        },
        "deprecated": {
          "type": "object",
          "properties": {
            "since": {
              "type": "string"
            },
            "replaced_by": {
              "type": "string"
            },
            "reason": {
              "type": "string"
            }
          }
        }
      }
    }
  }
}