{
  "components": {
    "schemas": {
      "AnswerRequest": {
        "additionalProperties": false,
        "properties": {
          "as_of": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "entity_profile": {
            "type": "string"
          },
          "filters": {
            "additionalProperties": false,
            "properties": {
              "eids": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "entity_profile": {
                "type": "string"
              },
              "entity_types": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "exclude_jurisdictions": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "exclude_regimes": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "jurisdictions": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "languages": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "regimes": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "type": "object"
          },
          "matches": {
            "minimum": 1,
            "type": "integer"
          },
          "mode": {
            "type": "string"
          },
          "query": {
            "minLength": 1,
            "type": "string"
          },
          "release": {
            "type": "string"
          }
        },
        "required": [
          "query"
        ],
        "type": "object"
      },
      "AnswerResponse": {
        "properties": {
          "applicability": {
            "properties": {
              "as_of": {
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "type": "string"
              },
              "atoms": {
                "items": {
                  "properties": {
                    "applicable": {
                      "type": [
                        "boolean",
                        "null"
                      ]
                    },
                    "atom": {
                      "type": "string"
                    },
                    "basis": {
                      "type": "string"
                    },
                    "citation": {
                      "properties": {
                        "as_of": {
                          "type": "string"
                        },
                        "atom": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "eid": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "expression_iri": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "node": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "release": {
                          "type": "string"
                        },
                        "valid_from": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "valid_to": {
                          "type": [
                            "string",
                            "null"
                          ]
                        },
                        "work_iri": {
                          "type": [
                            "string",
                            "null"
                          ]
                        }
                      },
                      "required": [
                        "release",
                        "as_of"
                      ],
                      "type": "object"
                    },
                    "derogation": {
                      "oneOf": [
                        {
                          "properties": {
                            "derogating_eid": {
                              "type": "string"
                            },
                            "derogating_node": {
                              "type": "string"
                            },
                            "disapplied_eid": {
                              "type": "string"
                            },
                            "disapplied_node": {
                              "type": "string"
                            },
                            "exempted_types": {
                              "items": {
                                "type": "string"
                              },
                              "type": "array"
                            }
                          },
                          "required": [
                            "derogating_eid",
                            "derogating_node",
                            "disapplied_eid",
                            "disapplied_node",
                            "exempted_types"
                          ],
                          "type": "object"
                        },
                        {
                          "type": "null"
                        }
                      ]
                    },
                    "note": {
                      "type": "string"
                    },
                    "retrieved": {
                      "type": "boolean"
                    },
                    "unit_eid": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "atom",
                    "unit_eid",
                    "applicable",
                    "basis",
                    "note",
                    "retrieved",
                    "citation"
                  ],
                  "type": "object"
                },
                "type": "array"
              },
              "binds": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "decided": {
                "type": "boolean"
              },
              "disapplied": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "entity_profile": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "entity_type": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "release": {
                "type": "string"
              }
            },
            "required": [
              "entity_profile",
              "entity_type",
              "decided",
              "binds",
              "as_of",
              "release",
              "atoms",
              "disapplied"
            ],
            "type": "object"
          },
          "as_of": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "blocks": {
            "items": {
              "properties": {
                "attached_to": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "citation": {
                  "properties": {
                    "as_of": {
                      "type": "string"
                    },
                    "atom": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "eid": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "expression_iri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "node": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "release": {
                      "type": "string"
                    },
                    "valid_from": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "valid_to": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "work_iri": {
                      "type": [
                        "string",
                        "null"
                      ]
                    }
                  },
                  "required": [
                    "release",
                    "as_of"
                  ],
                  "type": "object"
                },
                "detail": {
                  "type": "object"
                },
                "id": {
                  "type": "string"
                },
                "role": {
                  "type": "string"
                },
                "text": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "role",
                "text",
                "citation"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "corpus": {
            "properties": {
              "commit": {
                "type": "string"
              },
              "first_in_force": {
                "type": "string"
              },
              "last_in_force": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "regime": {
                "type": "string"
              },
              "release": {
                "type": "string"
              },
              "release_as_of": {
                "type": "string"
              },
              "release_meta_sha256": {
                "description": "sha256 of this release's `release-meta.yaml`, over the file's own bytes — lowercase hex, no algorithm prefix. That manifest declares a digest for every artifact in the release and the server held the bytes to those declarations before answering, so this one value names every byte the answer was read out of. `release` and `commit` say which release these words came from; this says that they are that release's words. `openregs verify` takes an answer and checks it.",
                "pattern": "^[0-9a-f]{64}$",
                "type": "string"
              },
              "schema_version": {
                "type": "string"
              },
              "tag": {
                "type": "string"
              },
              "units": {
                "type": "integer"
              }
            },
            "required": [
              "release",
              "regime",
              "tag",
              "commit",
              "release_meta_sha256",
              "release_as_of",
              "schema_version",
              "first_in_force",
              "last_in_force",
              "units"
            ],
            "type": "object"
          },
          "disclaimer": {
            "$ref": "#/components/schemas/Disclaimer"
          },
          "in_force": {
            "type": "boolean"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "out_of_scope": {
            "description": "Instruments the query named that this release does not hold, as the query named them. Empty for a question wholly inside the corpus; the whole question where `status` is `out-of-scope`; the foreign half for a question that reaches both — so 'I answered part of this' is a fact of the payload rather than something a reader has to infer from the notes.",
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "query": {
            "type": "string"
          },
          "release": {
            "type": "string"
          },
          "request": {
            "properties": {
              "as_of": {
                "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
                "type": "string"
              },
              "as_of_defaulted": {
                "type": "boolean"
              },
              "filters": {
                "properties": {
                  "eids": {
                    "oneOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "entity_profile": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "entity_types": {
                    "oneOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "exclude_jurisdictions": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "exclude_regimes": {
                    "items": {
                      "type": "string"
                    },
                    "type": "array"
                  },
                  "jurisdictions": {
                    "oneOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "languages": {
                    "oneOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  },
                  "regimes": {
                    "oneOf": [
                      {
                        "items": {
                          "type": "string"
                        },
                        "type": "array"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "entity_profile",
                  "regimes",
                  "exclude_regimes",
                  "jurisdictions",
                  "exclude_jurisdictions",
                  "languages",
                  "eids",
                  "entity_types"
                ],
                "type": "object"
              },
              "matches": {
                "type": "integer"
              },
              "mode": {
                "type": "string"
              },
              "query": {
                "type": "string"
              },
              "release": {
                "type": "string"
              },
              "release_defaulted": {
                "type": "boolean"
              }
            },
            "required": [
              "query",
              "as_of",
              "release",
              "matches",
              "mode",
              "filters",
              "as_of_defaulted",
              "release_defaulted"
            ],
            "type": "object"
          },
          "retrieval": {
            "properties": {
              "admitted": {
                "type": "integer"
              },
              "considered": {
                "type": "integer"
              },
              "matches": {
                "type": "integer"
              },
              "mode": {
                "type": "string"
              },
              "requested": {
                "type": "integer"
              }
            },
            "required": [
              "mode",
              "matches",
              "requested",
              "considered",
              "admitted"
            ],
            "type": "object"
          },
          "sections": {
            "properties": {
              "amended": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "amendment": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "ancestor": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "definition": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "derogation": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "match": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "obligation": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              }
            },
            "required": [
              "match",
              "ancestor",
              "definition",
              "obligation",
              "amendment",
              "amended",
              "derogation"
            ],
            "type": "object"
          },
          "status": {
            "type": "string"
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          }
        },
        "required": [
          "applicability",
          "as_of",
          "blocks",
          "corpus",
          "disclaimer",
          "in_force",
          "notes",
          "out_of_scope",
          "query",
          "release",
          "request",
          "retrieval",
          "sections",
          "status",
          "verification"
        ],
        "type": "object"
      },
      "AtomRequest": {
        "additionalProperties": false,
        "properties": {
          "as_of": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "atom_id": {
            "minLength": 1,
            "type": "string"
          },
          "release": {
            "type": "string"
          }
        },
        "required": [
          "atom_id"
        ],
        "type": "object"
      },
      "AtomResponse": {
        "properties": {
          "as_of": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "atom": {
            "properties": {
              "action": {
                "type": "string"
              },
              "actor": {
                "type": "string"
              },
              "applies_to": {
                "items": {
                  "type": "string"
                },
                "type": "array"
              },
              "citation": {
                "properties": {
                  "as_of": {
                    "type": "string"
                  },
                  "char_end": {
                    "type": "integer"
                  },
                  "char_start": {
                    "type": "integer"
                  },
                  "executable": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "quoted_text": {
                    "type": "string"
                  },
                  "release": {
                    "type": "string"
                  },
                  "source": {
                    "type": "string"
                  },
                  "unit_eid": {
                    "type": "string"
                  }
                },
                "required": [
                  "release",
                  "as_of",
                  "unit_eid",
                  "quoted_text",
                  "char_start",
                  "char_end"
                ],
                "type": "object"
              },
              "effective": {
                "type": "string"
              },
              "executable_name": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "executable_unit": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "executable_value": {
                "description": "The atom's executable constant — a number where the provision states a quantity, a string where it states an enumerated term, null where the duty has no machine-actionable value. Never a boolean: whether a duty exists is its modality. `executable_name` names it for generated code and `executable_unit` gives its unit.",
                "type": [
                  "number",
                  "string",
                  "null"
                ]
              },
              "expires": {
                "type": [
                  "string",
                  "null"
                ]
              },
              "id": {
                "type": "string"
              },
              "modality": {
                "type": "string"
              },
              "quoted_text": {
                "type": "string"
              },
              "source": {
                "type": "string"
              },
              "status": {
                "type": "string"
              },
              "unit_eid": {
                "type": "string"
              }
            },
            "required": [
              "id",
              "unit_eid",
              "modality",
              "actor",
              "action",
              "status",
              "citation"
            ],
            "type": "object"
          },
          "disclaimer": {
            "$ref": "#/components/schemas/Disclaimer"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "release": {
            "type": "string"
          },
          "unit": {
            "oneOf": [
              {
                "properties": {
                  "celex": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "citation": {
                    "properties": {
                      "as_of": {
                        "type": "string"
                      },
                      "atom": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "eid": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "expression_iri": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "node": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "release": {
                        "type": "string"
                      },
                      "valid_from": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "valid_to": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "work_iri": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "release",
                      "as_of"
                    ],
                    "type": "object"
                  },
                  "eid": {
                    "type": "string"
                  },
                  "expression_iri": {
                    "type": "string"
                  },
                  "jurisdiction": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  },
                  "nested": {
                    "type": "boolean"
                  },
                  "node": {
                    "type": "string"
                  },
                  "own_text": {
                    "type": "string"
                  },
                  "provision": {
                    "type": "string"
                  },
                  "shown": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "valid_from": {
                    "type": "string"
                  },
                  "valid_to": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "work_iri": {
                    "type": "string"
                  }
                },
                "required": [
                  "node",
                  "eid",
                  "provision",
                  "text",
                  "own_text",
                  "shown",
                  "citation"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          }
        },
        "required": [
          "as_of",
          "atom",
          "disclaimer",
          "release",
          "unit",
          "verification"
        ],
        "type": "object"
      },
      "Disclaimer": {
        "description": "Both fields name the release rather than the instance, which is what lets a hosted deployment and an air-gapped one answer one question with identical bytes.",
        "properties": {
          "release": {
            "description": "The corpus release tag the statement is scoped to.",
            "type": "string"
          },
          "text": {
            "description": "The project's informational-not-legal-advice statement, read from DISCLAIMER.md at startup. The serving layer holds no copy of it.",
            "type": "string"
          }
        },
        "required": [
          "release",
          "text"
        ],
        "type": "object"
      },
      "Error": {
        "description": "The one error shape, on every failure path. The stamp is present on a refusal the application made and absent on one the gateway made before a release was loaded — there is nothing truthful to scope it to yet.",
        "properties": {
          "disclaimer": {
            "$ref": "#/components/schemas/Disclaimer"
          },
          "error": {
            "properties": {
              "code": {
                "enum": [
                  "internal",
                  "invalid_request",
                  "method_not_allowed",
                  "not_found",
                  "not_ready",
                  "payload_too_large",
                  "rate_limited",
                  "release_mismatch",
                  "unauthorized",
                  "unknown_profile"
                ],
                "type": "string"
              },
              "message": {
                "description": "What went wrong, in words a caller can act on.",
                "type": "string"
              },
              "request_id": {
                "description": "The id on the X-Request-Id header of this response, and in the server's log record for it.",
                "type": "string"
              }
            },
            "required": [
              "code",
              "message",
              "request_id"
            ],
            "type": "object"
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          }
        },
        "required": [
          "error"
        ],
        "type": "object"
      },
      "Liveness": {
        "description": "The stamp is present once a release is loaded and absent before then: a probe answered before there is a release has no release to scope a statement to.",
        "properties": {
          "alive": {
            "description": "True: the socket answered.",
            "type": "boolean"
          },
          "disclaimer": {
            "$ref": "#/components/schemas/Disclaimer"
          },
          "draining": {
            "description": "Whether a shutdown has begun refusing new work.",
            "type": "boolean"
          },
          "ready": {
            "description": "Whether a release is loaded.",
            "type": "boolean"
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          }
        },
        "required": [
          "alive",
          "draining",
          "ready"
        ],
        "type": "object"
      },
      "ObligationsRequest": {
        "additionalProperties": false,
        "properties": {
          "as_of": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "entity_profile": {
            "minLength": 1,
            "type": "string"
          },
          "release": {
            "type": "string"
          }
        },
        "required": [
          "entity_profile"
        ],
        "type": "object"
      },
      "ObligationsResponse": {
        "properties": {
          "as_of": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "binds": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "counts": {
            "properties": {
              "applicable": {
                "type": "integer"
              },
              "excluded": {
                "type": "integer"
              }
            },
            "required": [
              "applicable",
              "excluded"
            ],
            "type": "object"
          },
          "disclaimer": {
            "$ref": "#/components/schemas/Disclaimer"
          },
          "entity_profile": {
            "type": "string"
          },
          "entity_type": {
            "type": "string"
          },
          "excluded": {
            "items": {
              "properties": {
                "action": {
                  "type": "string"
                },
                "actor": {
                  "type": "string"
                },
                "applicable": {
                  "type": "boolean"
                },
                "applies_to": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "basis": {
                  "type": "string"
                },
                "citation": {
                  "properties": {
                    "as_of": {
                      "type": "string"
                    },
                    "char_end": {
                      "type": "integer"
                    },
                    "char_start": {
                      "type": "integer"
                    },
                    "executable": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "quoted_text": {
                      "type": "string"
                    },
                    "release": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "unit_eid": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "release",
                    "as_of",
                    "unit_eid",
                    "quoted_text",
                    "char_start",
                    "char_end"
                  ],
                  "type": "object"
                },
                "derogation": {
                  "oneOf": [
                    {
                      "properties": {
                        "derogating_eid": {
                          "type": "string"
                        },
                        "derogating_node": {
                          "type": "string"
                        },
                        "disapplied_eid": {
                          "type": "string"
                        },
                        "disapplied_node": {
                          "type": "string"
                        },
                        "exempted_types": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "derogating_eid",
                        "derogating_node",
                        "disapplied_eid",
                        "disapplied_node",
                        "exempted_types"
                      ],
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "effective": {
                  "type": "string"
                },
                "executable_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "executable_unit": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "executable_value": {
                  "description": "The atom's executable constant — a number where the provision states a quantity, a string where it states an enumerated term, null where the duty has no machine-actionable value. Never a boolean: whether a duty exists is its modality. `executable_name` names it for generated code and `executable_unit` gives its unit.",
                  "type": [
                    "number",
                    "string",
                    "null"
                  ]
                },
                "expires": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "type": "string"
                },
                "modality": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "quoted_text": {
                  "type": "string"
                },
                "unit_eid": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "unit_eid",
                "applicable",
                "basis",
                "note",
                "citation"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "obligations": {
            "items": {
              "properties": {
                "action": {
                  "type": "string"
                },
                "actor": {
                  "type": "string"
                },
                "applicable": {
                  "type": "boolean"
                },
                "applies_to": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "basis": {
                  "type": "string"
                },
                "citation": {
                  "properties": {
                    "as_of": {
                      "type": "string"
                    },
                    "char_end": {
                      "type": "integer"
                    },
                    "char_start": {
                      "type": "integer"
                    },
                    "executable": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "quoted_text": {
                      "type": "string"
                    },
                    "release": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "unit_eid": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "release",
                    "as_of",
                    "unit_eid",
                    "quoted_text",
                    "char_start",
                    "char_end"
                  ],
                  "type": "object"
                },
                "derogation": {
                  "oneOf": [
                    {
                      "properties": {
                        "derogating_eid": {
                          "type": "string"
                        },
                        "derogating_node": {
                          "type": "string"
                        },
                        "disapplied_eid": {
                          "type": "string"
                        },
                        "disapplied_node": {
                          "type": "string"
                        },
                        "exempted_types": {
                          "items": {
                            "type": "string"
                          },
                          "type": "array"
                        }
                      },
                      "required": [
                        "derogating_eid",
                        "derogating_node",
                        "disapplied_eid",
                        "disapplied_node",
                        "exempted_types"
                      ],
                      "type": "object"
                    },
                    {
                      "type": "null"
                    }
                  ]
                },
                "effective": {
                  "type": "string"
                },
                "executable_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "executable_unit": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "executable_value": {
                  "description": "The atom's executable constant — a number where the provision states a quantity, a string where it states an enumerated term, null where the duty has no machine-actionable value. Never a boolean: whether a duty exists is its modality. `executable_name` names it for generated code and `executable_unit` gives its unit.",
                  "type": [
                    "number",
                    "string",
                    "null"
                  ]
                },
                "expires": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "type": "string"
                },
                "modality": {
                  "type": "string"
                },
                "note": {
                  "type": "string"
                },
                "quoted_text": {
                  "type": "string"
                },
                "unit_eid": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "unit_eid",
                "applicable",
                "basis",
                "note",
                "citation"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "release": {
            "type": "string"
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          }
        },
        "required": [
          "as_of",
          "binds",
          "counts",
          "disclaimer",
          "entity_profile",
          "entity_type",
          "excluded",
          "notes",
          "obligations",
          "release",
          "verification"
        ],
        "type": "object"
      },
      "PrometheusExposition": {
        "description": "The metric registry in the Prometheus text exposition format: one HELP line, one TYPE line and the samples, per metric.",
        "type": "string"
      },
      "Readiness": {
        "properties": {
          "commit": {
            "description": "The canon commit that release was built from.",
            "type": "string"
          },
          "disclaimer": {
            "$ref": "#/components/schemas/Disclaimer"
          },
          "ready": {
            "type": "boolean"
          },
          "release": {
            "description": "The release tag this instance answers from.",
            "type": "string"
          },
          "units": {
            "description": "How many units of text it holds.",
            "type": "integer"
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          }
        },
        "required": [
          "commit",
          "disclaimer",
          "ready",
          "release",
          "units",
          "verification"
        ],
        "type": "object"
      },
      "UnitRequest": {
        "additionalProperties": false,
        "properties": {
          "as_of": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "eid": {
            "minLength": 1,
            "type": "string"
          },
          "release": {
            "type": "string"
          },
          "work_iri": {
            "type": "string"
          }
        },
        "required": [
          "eid"
        ],
        "type": "object"
      },
      "UnitResponse": {
        "properties": {
          "as_of": {
            "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}$",
            "type": "string"
          },
          "atoms": {
            "items": {
              "properties": {
                "action": {
                  "type": "string"
                },
                "actor": {
                  "type": "string"
                },
                "applies_to": {
                  "items": {
                    "type": "string"
                  },
                  "type": "array"
                },
                "citation": {
                  "properties": {
                    "as_of": {
                      "type": "string"
                    },
                    "char_end": {
                      "type": "integer"
                    },
                    "char_start": {
                      "type": "integer"
                    },
                    "executable": {
                      "type": [
                        "string",
                        "null"
                      ]
                    },
                    "quoted_text": {
                      "type": "string"
                    },
                    "release": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string"
                    },
                    "unit_eid": {
                      "type": "string"
                    }
                  },
                  "required": [
                    "release",
                    "as_of",
                    "unit_eid",
                    "quoted_text",
                    "char_start",
                    "char_end"
                  ],
                  "type": "object"
                },
                "effective": {
                  "type": "string"
                },
                "executable_name": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "executable_unit": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "executable_value": {
                  "description": "The atom's executable constant — a number where the provision states a quantity, a string where it states an enumerated term, null where the duty has no machine-actionable value. Never a boolean: whether a duty exists is its modality. `executable_name` names it for generated code and `executable_unit` gives its unit.",
                  "type": [
                    "number",
                    "string",
                    "null"
                  ]
                },
                "expires": {
                  "type": [
                    "string",
                    "null"
                  ]
                },
                "id": {
                  "type": "string"
                },
                "modality": {
                  "type": "string"
                },
                "quoted_text": {
                  "type": "string"
                },
                "source": {
                  "type": "string"
                },
                "status": {
                  "type": "string"
                },
                "unit_eid": {
                  "type": "string"
                }
              },
              "required": [
                "id",
                "unit_eid",
                "modality",
                "actor",
                "action",
                "status",
                "citation"
              ],
              "type": "object"
            },
            "type": "array"
          },
          "disclaimer": {
            "$ref": "#/components/schemas/Disclaimer"
          },
          "eid": {
            "type": "string"
          },
          "in_force": {
            "type": "boolean"
          },
          "notes": {
            "items": {
              "type": "string"
            },
            "type": "array"
          },
          "release": {
            "type": "string"
          },
          "unit": {
            "oneOf": [
              {
                "properties": {
                  "celex": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "citation": {
                    "properties": {
                      "as_of": {
                        "type": "string"
                      },
                      "atom": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "eid": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "expression_iri": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "node": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "release": {
                        "type": "string"
                      },
                      "valid_from": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "valid_to": {
                        "type": [
                          "string",
                          "null"
                        ]
                      },
                      "work_iri": {
                        "type": [
                          "string",
                          "null"
                        ]
                      }
                    },
                    "required": [
                      "release",
                      "as_of"
                    ],
                    "type": "object"
                  },
                  "eid": {
                    "type": "string"
                  },
                  "expression_iri": {
                    "type": "string"
                  },
                  "jurisdiction": {
                    "type": "string"
                  },
                  "language": {
                    "type": "string"
                  },
                  "nested": {
                    "type": "boolean"
                  },
                  "node": {
                    "type": "string"
                  },
                  "own_text": {
                    "type": "string"
                  },
                  "provision": {
                    "type": "string"
                  },
                  "shown": {
                    "type": "string"
                  },
                  "text": {
                    "type": "string"
                  },
                  "valid_from": {
                    "type": "string"
                  },
                  "valid_to": {
                    "type": [
                      "string",
                      "null"
                    ]
                  },
                  "work_iri": {
                    "type": "string"
                  }
                },
                "required": [
                  "node",
                  "eid",
                  "provision",
                  "text",
                  "own_text",
                  "shown",
                  "citation"
                ],
                "type": "object"
              },
              {
                "type": "null"
              }
            ]
          },
          "verification": {
            "$ref": "#/components/schemas/Verification"
          },
          "versions": {
            "items": {
              "properties": {
                "in_force": {
                  "type": "boolean"
                },
                "node": {
                  "type": "string"
                },
                "valid_from": {
                  "type": "string"
                },
                "valid_to": {
                  "type": [
                    "string",
                    "null"
                  ]
                }
              },
              "required": [
                "node",
                "valid_from",
                "valid_to",
                "in_force"
              ],
              "type": "object"
            },
            "type": "array"
          }
        },
        "required": [
          "as_of",
          "atoms",
          "disclaimer",
          "eid",
          "in_force",
          "notes",
          "release",
          "unit",
          "verification",
          "versions"
        ],
        "type": "object"
      },
      "Verification": {
        "description": "What was checked before this release was served. `verified` — the release carried an attestation and all five checks passed. `digests` — the release is the serving checkout's own unsigned build, so its digests and its own provenance were checked and the signature chain was not. `skipped` — the operator passed --insecure-skip-verify and nothing was checked at all.",
        "enum": [
          "verified",
          "digests",
          "skipped"
        ],
        "type": "string"
      }
    },
    "securitySchemes": {
      "bearerAuth": {
        "description": "`Authorization: Bearer <token>`. The deployment configuration lists the credentials it accepts as sha256 digests and gives each one its own per-minute limit; whether a request with no token is answered at all is stated in that file and never inferred.",
        "scheme": "bearer",
        "type": "http"
      }
    }
  },
  "info": {
    "description": "Serving is a projection of a release artifact and nothing else: an instance reads the released corpus, graph and chunk index, and never a canon, a git commit or the network. An answer given inside a consumer's own network is therefore the answer the hosted deployment gives, byte for byte, and both carry citations into the canonical text.\n\n**Every response is stamped.** `verification` says what was checked before this release was served, and `disclaimer` carries the project's non-advice statement beside the release tag — so a document read long after the request still says which corpus it came from and that it was not advice.\n\n**Every failure has one shape**: an `error` object of `code`, `message` and `request_id`, whether it came from the application, from the policy layer in front of it, or from an exception nobody expected.\n\n**Two protocols, one implementation.** The same service answers the Model Context Protocol, where it exposes 5 tools; 4 of them have a REST route here — `search_regulation`, `get_unit`, `get_atom`, `list_obligations` — and each operation names its twin in `x-openregs-mcp-tool`. The payload is one document produced once, not two documents compared afterwards.\n\n**`diff_releases` has no REST route, and that is a decision rather than a gap.** A served instance can answer exactly one range: the manifest its own release ships, from the tag that manifest names. Every other pair of tags is a refusal, so a REST route would be an operation whose domain is a single value per deployment, and a generated client would carry a method it can call correctly once. That is not the shape of the gap, though — it is the symptom. A diff manifest is a release artifact, and a consumer acting on a change has to verify the release the change is in before acting: `openregs pull` checks the signature chain, the digests and the provenance, and an HTTP hop from one instance checks none of them. Serving the manifest over REST would offer the evidence-shaped thing on the notification-shaped path, which is precisely the split https://docs.openregs.io/overview/ keeps deliberate. The three readers of the manifest already read the artifact: `openregs diff` aggregates a multi-release range one published tag at a time, `openregs impact` intersects one with a control mapping, and `openregs feed` pushes entries and expects the handler to pull. The tool stays on MCP because an agent holding a session is asking about the release in that session and has the answer in front of it; a client library integrating against a deployment is not, and would be better served by the release than by this.\n\n**A method a path does not declare is refused** with 405 `method_not_allowed`, in that same shape. It is listed under no operation here because an operation is a path and a method, and no method answers 405 to itself.\n\n**CORS.** A preflight `OPTIONS` is answered on every path when the deployment allows the calling origin. It belongs to no route and so appears under none of them.\n\nThe engine is Apache-2.0; the corpus an instance serves is CC-BY-4.0.",
    "license": {
      "identifier": "Apache-2.0",
      "name": "Apache-2.0"
    },
    "summary": "One pinned, verified release of regulation, answered with citations.",
    "title": "OpenRegs serving API",
    "version": "0.1.0"
  },
  "jsonSchemaDialect": "https://json-schema.org/draft/2020-12/schema",
  "openapi": "3.1.0",
  "paths": {
    "/healthz": {
      "get": {
        "description": "200 from the moment the socket is bound, whether or not a release has been loaded — a container runtime's health check must not be answered 'no' during a boot that has not finished. The body says separately whether the process is ready and whether it is draining. Answered without a token.",
        "operationId": "checkLiveness",
        "parameters": [
          {
            "description": "A correlation id to answer under. A value the server cannot log safely — too long, or carrying anything outside its id alphabet — is discarded and a fresh id minted, because a log line is read by a human and must not be forgeable by a header.",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Liveness"
                }
              }
            },
            "description": "The process is alive; whether it is ready is a separate field.",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [],
        "summary": "Whether this process is alive",
        "tags": [
          "operations"
        ]
      }
    },
    "/metrics": {
      "get": {
        "description": "Answered from the moment the socket is bound — a process that is still loading is exactly what an operator wants numbers about — and never rate limited, because throttling a scraper blinds the only thing that could see the throttling. It is not a probe: where the deployment requires a bearer token to be asked a question, it requires one to be measured.",
        "operationId": "readMetrics",
        "parameters": [
          {
            "description": "A correlation id to answer under. A value the server cannot log safely — too long, or carrying anything outside its id alphabet — is discarded and a fresh id minted, because a log line is read by a human and must not be forgeable by a header.",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "text/plain": {
                "schema": {
                  "$ref": "#/components/schemas/PrometheusExposition"
                }
              }
            },
            "description": "The registry as a Prometheus scraper reads it.",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`unauthorized` — no bearer token was presented, or the one presented is not a credential this deployment accepts. A request with no token is answered only where the deployment configuration says anonymous access is allowed",
            "headers": {
              "WWW-Authenticate": {
                "description": "The challenge, naming the one scheme this server accepts.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "summary": "The metric registry, in the Prometheus text exposition format",
        "tags": [
          "operations"
        ]
      }
    },
    "/readyz": {
      "get": {
        "description": "200 once a verified release is loaded and 503 until then, which is the question an orchestrator asks before it routes traffic. It is also 503 again from the moment a shutdown begins draining, so a rolling deploy stops receiving new work before the listener closes. Answered without a token.",
        "operationId": "checkReadiness",
        "parameters": [
          {
            "description": "A correlation id to answer under. A value the server cannot log safely — too long, or carrying anything outside its id alphabet — is discarded and a fresh id minted, because a log line is read by a human and must not be forgeable by a header.",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Readiness"
                }
              }
            },
            "description": "A verified release is loaded, and which one.",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`not_ready` — no verified release is loaded yet, or the process has begun draining. The socket binds before the release is verified, so a listener that is not ready answers the probes and serves no regulation at all",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [],
        "summary": "Whether this instance may be sent traffic",
        "tags": [
          "operations"
        ]
      }
    },
    "/v1/answer": {
      "post": {
        "description": "The retrieval closure for one question, as of one date: the units that matched, the article each sits in, the definitions in force on that date, whatever amends or disapplies them, and the obligation atoms written into them. Every block carries an eId or an atom id together with the release tag, so any sentence in the answer can be followed back to the canonical text it came from. Naming an entity profile has applicability decided as well; it never removes content from the answer.\n\nThe response is a function of the release and the request alone — no timestamp, no duration, no request id — so two instances started from one release answer one question with identical bytes. `as_of` is the single exception a caller controls: omitting it means today, which is the one thing about an answer that is not reproducible tomorrow, and the response echoes the date that was resolved.",
        "operationId": "searchRegulation",
        "parameters": [
          {
            "description": "A correlation id to answer under. A value the server cannot log safely — too long, or carrying anything outside its id alphabet — is discarded and a fresh id minted, because a log line is read by a human and must not be forgeable by a header.",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "as_of": "2025-06-01",
                "entity_profile": "operator",
                "query": "do operators have to keep a register of critical services"
              },
              "schema": {
                "$ref": "#/components/schemas/AnswerRequest"
              }
            }
          },
          "description": "A JSON object, at most 65536 bytes. Unknown properties are refused rather than ignored.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AnswerResponse"
                }
              }
            },
            "description": "The closure, every block carrying a citation.",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`invalid_request` — the body is not JSON, is not an object, or states a field this route does not take — an unknown field is refused rather than ignored, because a caller who misspells `as_of` and is silently answered for today has been given a wrong answer with no way to tell; `release_mismatch` — the request names a release this instance does not serve; a response echoes the release it answered from, and an echo that lied would be worse than a refusal; `unknown_profile` — no entity profile of that id is in the release",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`unauthorized` — no bearer token was presented, or the one presented is not a credential this deployment accepts. A request with no token is answered only where the deployment configuration says anonymous access is allowed",
            "headers": {
              "WWW-Authenticate": {
                "description": "The challenge, naming the one scheme this server accepts.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`payload_too_large` — the body is larger than this server reads",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`rate_limited` — the caller is over its per-minute allowance; `Retry-After` says when the rolling window will admit it again. A refused request does not consume budget, so retrying cannot make the throttling worse",
            "headers": {
              "Retry-After": {
                "description": "Seconds until the rolling window admits this caller again.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`not_ready` — no verified release is loaded yet, or the process has begun draining. The socket binds before the release is verified, so a listener that is not ready answers the probes and serves no regulation at all",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "summary": "Answer a question over the pinned release, with citations",
        "tags": [
          "regulation"
        ],
        "x-openregs-mcp-tool": "search_regulation"
      }
    },
    "/v1/atom": {
      "post": {
        "description": "The duty an atom id names, as it stood on `as_of`: its modality, actor and action, the entity types it is written for, its executable constant where it has one, and the provenance span its quoted text was taken from — together with the unit the duty is written into, as that unit read on the same date.\n\nThis is a lookup on the id space consumers already hold. `controls.yaml` maps atom ids to a consuming organisation's own controls, and a diff manifest reports changes under them, so an atom id is what arrives from a control mapping or a change notification. `POST /v1/unit` reaches the same duties, but only from an eId — and an atom id is not an eId in disguise: ids are permanent and are never reused, so deriving a provision from the shape of an id is a guess this corpus does not license. Without this route an id from `controls.yaml` had no way into the corpus over HTTP at all.\n\nRefused with 404 when no atom of that id was in force on the date. An id that exists in the release but states no duty that day is the same answer: an atom names one duty on one day.",
        "operationId": "getAtom",
        "parameters": [
          {
            "description": "A correlation id to answer under. A value the server cannot log safely — too long, or carrying anything outside its id alphabet — is discarded and a fresh id minted, because a log line is read by a human and must not be forgeable by a header.",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "as_of": "2025-06-01",
                "atom_id": "FIXREG-Art5.3-Ob1"
              },
              "schema": {
                "$ref": "#/components/schemas/AtomRequest"
              }
            }
          },
          "description": "A JSON object, at most 65536 bytes. Unknown properties are refused rather than ignored.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/AtomResponse"
                }
              }
            },
            "description": "The duty, and the provision it is written into.",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`invalid_request` — the body is not JSON, is not an object, or states a field this route does not take — an unknown field is refused rather than ignored, because a caller who misspells `as_of` and is silently answered for today has been given a wrong answer with no way to tell; `release_mismatch` — the request names a release this instance does not serve; a response echoes the release it answered from, and an echo that lied would be worse than a refusal",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`unauthorized` — no bearer token was presented, or the one presented is not a credential this deployment accepts. A request with no token is answered only where the deployment configuration says anonymous access is allowed",
            "headers": {
              "WWW-Authenticate": {
                "description": "The challenge, naming the one scheme this server accepts.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`not_found` — no unit, atom or route of that name",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`payload_too_large` — the body is larger than this server reads",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`rate_limited` — the caller is over its per-minute allowance; `Retry-After` says when the rolling window will admit it again. A refused request does not consume budget, so retrying cannot make the throttling worse",
            "headers": {
              "Retry-After": {
                "description": "Seconds until the rolling window admits this caller again.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`not_ready` — no verified release is loaded yet, or the process has begun draining. The socket binds before the release is verified, so a listener that is not ready answers the probes and serves no regulation at all",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "summary": "One obligation atom's own record, by id, as of a date",
        "tags": [
          "regulation"
        ],
        "x-openregs-mcp-tool": "get_atom"
      }
    },
    "/v1/obligations": {
      "post": {
        "description": "The whole disposition of one described entity on one day: every obligation atom that binds it, and every one that would bind it but for a derogation in force — the second list each naming the provision that disapplies it and the entity types that provision reaches. Decided by the engine `openregs coverage` reports from, so the answer here and the answer in an offline coverage report are one computation.\n\nAn enumeration rather than a question. `POST /v1/answer` also decides applicability, and decides it over the profile's whole disposition rather than over what retrieval surfaced — but it is reached through a query, it reports each duty as a verdict on an id, and what the duty *says* arrives only in the blocks a ranking chose. Here every duty carries its own modality, actor, action and quoted words, and no query is asked, so 'what binds me' does not have to be posed as 'what is the answer to this question'.\n\nComplete or nothing: an enumeration that dropped a duty because a score came third is a duty the caller never learns about.",
        "operationId": "listObligations",
        "parameters": [
          {
            "description": "A correlation id to answer under. A value the server cannot log safely — too long, or carrying anything outside its id alphabet — is discarded and a fresh id minted, because a log line is read by a human and must not be forgeable by a header.",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "as_of": "2025-06-01",
                "entity_profile": "small_operator"
              },
              "schema": {
                "$ref": "#/components/schemas/ObligationsRequest"
              }
            }
          },
          "description": "A JSON object, at most 65536 bytes. Unknown properties are refused rather than ignored.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ObligationsResponse"
                }
              }
            },
            "description": "What binds this entity on this date, and what does not, and why.",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`invalid_request` — the body is not JSON, is not an object, or states a field this route does not take — an unknown field is refused rather than ignored, because a caller who misspells `as_of` and is silently answered for today has been given a wrong answer with no way to tell; `release_mismatch` — the request names a release this instance does not serve; a response echoes the release it answered from, and an echo that lied would be worse than a refusal; `unknown_profile` — no entity profile of that id is in the release",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`unauthorized` — no bearer token was presented, or the one presented is not a credential this deployment accepts. A request with no token is answered only where the deployment configuration says anonymous access is allowed",
            "headers": {
              "WWW-Authenticate": {
                "description": "The challenge, naming the one scheme this server accepts.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`payload_too_large` — the body is larger than this server reads",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`rate_limited` — the caller is over its per-minute allowance; `Retry-After` says when the rolling window will admit it again. A refused request does not consume budget, so retrying cannot make the throttling worse",
            "headers": {
              "Retry-After": {
                "description": "Seconds until the rolling window admits this caller again.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`not_ready` — no verified release is loaded yet, or the process has begun draining. The socket binds before the release is verified, so a listener that is not ready answers the probes and serves no regulation at all",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "summary": "Every duty binding one entity profile on one date",
        "tags": [
          "regulation"
        ],
        "x-openregs-mcp-tool": "list_obligations"
      }
    },
    "/v1/unit": {
      "post": {
        "description": "The version of a provision in force on `as_of`, its citation, every version of it the release holds, and the obligation atoms anchored to it. An eId that names units of more than one act on that date is refused rather than resolved by picking: pass `work_iri` to say which act is meant.\n\nThis is the REST twin of the `get_unit` MCP tool, and not a second implementation of it — one service builds the payload and the two protocols carry it, so the documents cannot drift apart.",
        "operationId": "getUnit",
        "parameters": [
          {
            "description": "A correlation id to answer under. A value the server cannot log safely — too long, or carrying anything outside its id alphabet — is discarded and a fresh id minted, because a log line is read by a human and must not be forgeable by a header.",
            "in": "header",
            "name": "X-Request-Id",
            "required": false,
            "schema": {
              "type": "string"
            }
          }
        ],
        "requestBody": {
          "content": {
            "application/json": {
              "example": {
                "as_of": "2025-06-01",
                "eid": "art_5__para_2"
              },
              "schema": {
                "$ref": "#/components/schemas/UnitRequest"
              }
            }
          },
          "description": "A JSON object, at most 65536 bytes. Unknown properties are refused rather than ignored.",
          "required": true
        },
        "responses": {
          "200": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/UnitResponse"
                }
              }
            },
            "description": "The unit as it read on the date, and what is anchored to it.",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "400": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`invalid_request` — the body is not JSON, is not an object, or states a field this route does not take — an unknown field is refused rather than ignored, because a caller who misspells `as_of` and is silently answered for today has been given a wrong answer with no way to tell; `release_mismatch` — the request names a release this instance does not serve; a response echoes the release it answered from, and an echo that lied would be worse than a refusal",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "401": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`unauthorized` — no bearer token was presented, or the one presented is not a credential this deployment accepts. A request with no token is answered only where the deployment configuration says anonymous access is allowed",
            "headers": {
              "WWW-Authenticate": {
                "description": "The challenge, naming the one scheme this server accepts.",
                "schema": {
                  "type": "string"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "404": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`not_found` — no unit, atom or route of that name",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "413": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`payload_too_large` — the body is larger than this server reads",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "429": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`rate_limited` — the caller is over its per-minute allowance; `Retry-After` says when the rolling window will admit it again. A refused request does not consume budget, so retrying cannot make the throttling worse",
            "headers": {
              "Retry-After": {
                "description": "Seconds until the rolling window admits this caller again.",
                "schema": {
                  "type": "integer"
                }
              },
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          },
          "503": {
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            },
            "description": "`not_ready` — no verified release is loaded yet, or the process has begun draining. The socket binds before the release is verified, so a listener that is not ready answers the probes and serves no regulation at all",
            "headers": {
              "X-Request-Id": {
                "description": "The correlation id this request was answered under. It is on every response, in the server's log record for the request, and inside the error object of every refusal.",
                "schema": {
                  "type": "string"
                }
              }
            }
          }
        },
        "security": [
          {
            "bearerAuth": []
          },
          {}
        ],
        "summary": "One unit's text and metadata, by eId, as of a date",
        "tags": [
          "regulation"
        ],
        "x-openregs-mcp-tool": "get_unit"
      }
    }
  },
  "servers": [
    {
      "description": "Where `openregs serve` binds unless it is told otherwise: loopback, because a server that binds every interface by default is a server somebody deploys by accident. A hosted instance answers on its own name.",
      "url": "http://127.0.0.1:8080"
    }
  ],
  "tags": [
    {
      "description": "Reading the pinned release. Every answer carries citations.",
      "name": "regulation"
    },
    {
      "description": "Running the process: liveness, readiness, and the metrics scrape.",
      "name": "operations"
    }
  ],
  "x-openregs-generator": "tooling/ci/dump_openapi.py",
  "x-openregs-mcp-only": {
    "diff_releases": "A served instance can answer exactly one range: the manifest its own release ships, from the tag that manifest names. Every other pair of tags is a refusal, so a REST route would be an operation whose domain is a single value per deployment, and a generated client would carry a method it can call correctly once. That is not the shape of the gap, though — it is the symptom. A diff manifest is a release artifact, and a consumer acting on a change has to verify the release the change is in before acting: `openregs pull` checks the signature chain, the digests and the provenance, and an HTTP hop from one instance checks none of them. Serving the manifest over REST would offer the evidence-shaped thing on the notification-shaped path, which is precisely the split https://docs.openregs.io/overview/ keeps deliberate. The three readers of the manifest already read the artifact: `openregs diff` aggregates a multi-release range one published tag at a time, `openregs impact` intersects one with a control mapping, and `openregs feed` pushes entries and expects the handler to pull. The tool stays on MCP because an agent holding a session is asking about the release in that session and has the answer in front of it; a client library integrating against a deployment is not, and would be better served by the release than by this."
  },
  "x-openregs-source": "tooling/openregs/serve/routes.py"
}
