{
  "openapi": "3.1.1",
  "info": {
    "title": "montaye",
    "version": "0.1.0",
    "summary": "What the law says, with its source, and what it means for a business.",
    "description": "Agent-first compliance API. Discovery: https://montaye.com/llms.txt, https://montaye.com/.well-known/api-catalog, MCP at https://montaye.com/mcp."
  },
  "servers": [
    {
      "url": "https://montaye.com"
    }
  ],
  "paths": {
    "/v1/payroll/calculate": {
      "post": {
        "operationId": "payroll_calculate",
        "summary": "Compute withholding for one paycheck",
        "description": "Federal income tax (IRS Pub 15-T, Worksheet 1A) and California PIT (EDD Method B) withholding for one pay period. Every line names the fact revisions it read and the official document and page they come from. The employee data is not stored.",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "pay_date": {
                    "type": "string",
                    "format": "date"
                  },
                  "pay_frequency": {
                    "enum": [
                      "daily",
                      "weekly",
                      "biweekly",
                      "semimonthly",
                      "monthly",
                      "quarterly",
                      "semiannual",
                      "annual"
                    ],
                    "type": "string"
                  },
                  "gross": {
                    "type": "string",
                    "pattern": "^\\d+(\\.\\d{1,2})?$"
                  },
                  "taxes": {
                    "type": "array",
                    "items": {
                      "oneOf": [
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "const": "us_fit"
                            },
                            "w4": {
                              "type": "object",
                              "properties": {
                                "filing_status": {
                                  "enum": [
                                    "single",
                                    "married_filing_jointly",
                                    "head_of_household"
                                  ],
                                  "type": "string"
                                },
                                "step2_checkbox": {
                                  "type": "boolean",
                                  "default": false
                                },
                                "step3_credits": {
                                  "type": "string",
                                  "pattern": "^\\d+(\\.\\d{1,2})?$",
                                  "default": "0"
                                },
                                "step4a_other_income": {
                                  "type": "string",
                                  "pattern": "^\\d+(\\.\\d{1,2})?$",
                                  "default": "0"
                                },
                                "step4b_deductions": {
                                  "type": "string",
                                  "pattern": "^\\d+(\\.\\d{1,2})?$",
                                  "default": "0"
                                },
                                "step4c_extra_withholding": {
                                  "type": "string",
                                  "pattern": "^\\d+(\\.\\d{1,2})?$",
                                  "default": "0"
                                },
                                "exempt": {
                                  "type": "boolean",
                                  "default": false
                                }
                              },
                              "required": [
                                "filing_status"
                              ]
                            }
                          },
                          "required": [
                            "kind"
                          ]
                        },
                        {
                          "type": "object",
                          "properties": {
                            "kind": {
                              "const": "us_ca_pit"
                            },
                            "de4": {
                              "type": "object",
                              "properties": {
                                "filing_status": {
                                  "enum": [
                                    "single",
                                    "married",
                                    "head_of_household"
                                  ],
                                  "type": "string"
                                },
                                "regular_allowances": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 99,
                                  "default": 0
                                },
                                "estimated_deduction_allowances": {
                                  "type": "integer",
                                  "minimum": 0,
                                  "maximum": 99,
                                  "default": 0
                                },
                                "additional_withholding": {
                                  "type": "string",
                                  "pattern": "^\\d+(\\.\\d{1,2})?$",
                                  "default": "0"
                                },
                                "exempt": {
                                  "type": "boolean",
                                  "default": false
                                }
                              },
                              "required": [
                                "filing_status"
                              ]
                            },
                            "method": {
                              "enum": [
                                "annualized",
                                "period_table"
                              ],
                              "type": "string",
                              "default": "annualized"
                            }
                          },
                          "required": [
                            "kind"
                          ]
                        }
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 10
                  }
                },
                "required": [
                  "pay_date",
                  "pay_frequency",
                  "gross",
                  "taxes"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, and what the call used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "result",
                    "usage"
                  ],
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "pay_date": {
                          "type": "string",
                          "format": "date"
                        },
                        "pay_frequency": {
                          "enum": [
                            "daily",
                            "weekly",
                            "biweekly",
                            "semimonthly",
                            "monthly",
                            "quarterly",
                            "semiannual",
                            "annual"
                          ],
                          "type": "string"
                        },
                        "gross": {
                          "type": "string",
                          "pattern": "^\\d+(\\.\\d{1,2})?$"
                        },
                        "total_withholding": {
                          "type": "string",
                          "pattern": "^\\d+(\\.\\d{1,2})?$"
                        },
                        "lines": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string"
                              },
                              "amount": {
                                "type": "string",
                                "pattern": "^\\d+(\\.\\d{1,2})?$"
                              },
                              "method": {
                                "type": "string"
                              },
                              "defaulted": {
                                "type": "boolean"
                              },
                              "facts": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "revision_id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "revision_id"
                                  ]
                                }
                              },
                              "source_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              },
                              "steps": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    }
                                  },
                                  "required": [
                                    "label",
                                    "value"
                                  ]
                                }
                              }
                            },
                            "required": [
                              "kind",
                              "amount",
                              "method",
                              "defaulted",
                              "facts",
                              "source_ids",
                              "steps"
                            ]
                          }
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "title": {
                                "type": "string"
                              },
                              "publisher": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string"
                              },
                              "page_url": {
                                "type": "string"
                              },
                              "sha256": {
                                "type": "string"
                              },
                              "retrieved_on": {
                                "type": "string",
                                "format": "date"
                              },
                              "locators": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "title",
                              "publisher",
                              "url",
                              "sha256",
                              "retrieved_on",
                              "locators"
                            ]
                          }
                        },
                        "snapshot_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "pay_date",
                        "pay_frequency",
                        "gross",
                        "total_withholding",
                        "lines",
                        "sources",
                        "snapshot_id"
                      ]
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`input_invalid`: The request does not match the action’s input schema. `parameter_missing`: A parameter the computation needs was not given.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "`key_missing`: This action needs an API key (Authorization: Bearer <key>). `key_invalid`: The API key is unknown, revoked or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`trial_exhausted`: The trial key has used all of its included calls. `quota_exhausted`: The plan’s calls for this month are used; a larger plan or the next month opens more.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`plan_excludes_action`: The account’s plan does not include this action.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`jurisdiction_unsupported`: This tax or jurisdiction is not covered yet. `table_not_effective`: No reviewed fact is in force for this pay date.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests from this client; slow down.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/facts": {
      "get": {
        "operationId": "fact_read",
        "summary": "Read a fact with its source and history",
        "description": "One fact as montaye’s computations read it: the revision in force on a day (or the one a calculation line names by revision_id), its values (amounts, bracket tables, lookup grids), the official document with the page and words it was read from, and every span of the same fact the published facts hold, earliest first. Values are decimal strings; ratios are fractions (0.062), never percents. GET /v1/status lists the codes. Fields are only ever added.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "code",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "pattern": "^[a-z0-9_.-]+$"
            }
          },
          {
            "name": "on",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "date"
            }
          },
          {
            "name": "revision_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "format": "uuid"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, and what the call used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "result",
                    "usage"
                  ],
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "snapshot_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "fact": {
                          "oneOf": [
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "revision_id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "jurisdiction": {
                                  "type": "string",
                                  "pattern": "^[a-z]{2}(_[a-z0-9]+)*$"
                                },
                                "levy": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "valid_from": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "valid_until": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "evidence": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "source_id",
                                      "locator"
                                    ]
                                  },
                                  "minItems": 1
                                },
                                "shape": {
                                  "const": "amount"
                                },
                                "amounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9_]+$"
                                  },
                                  "additionalProperties": {
                                    "type": "string",
                                    "pattern": "^-?\\d+(\\.\\d+)?$"
                                  }
                                },
                                "counts": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9_]+$"
                                  }
                                },
                                "ratios": {
                                  "type": "array",
                                  "items": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9_]+$"
                                  }
                                },
                                "per": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9_]+$"
                                  },
                                  "additionalProperties": {
                                    "type": "object",
                                    "properties": {
                                      "unit": {
                                        "enum": [
                                          "day",
                                          "week",
                                          "month",
                                          "year"
                                        ],
                                        "type": "string"
                                      },
                                      "every": {
                                        "type": "integer",
                                        "minimum": 1
                                      }
                                    },
                                    "required": [
                                      "unit",
                                      "every"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "code",
                                "revision_id",
                                "jurisdiction",
                                "levy",
                                "valid_from",
                                "valid_until",
                                "evidence",
                                "shape",
                                "amounts"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "revision_id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "jurisdiction": {
                                  "type": "string",
                                  "pattern": "^[a-z]{2}(_[a-z0-9]+)*$"
                                },
                                "levy": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "valid_from": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "valid_until": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "evidence": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "source_id",
                                      "locator"
                                    ]
                                  },
                                  "minItems": 1
                                },
                                "shape": {
                                  "const": "bracket"
                                },
                                "variants": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9_]+$"
                                  },
                                  "additionalProperties": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "lower": {
                                          "type": "string",
                                          "pattern": "^-?\\d+(\\.\\d+)?$"
                                        },
                                        "upper": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "pattern": "^-?\\d+(\\.\\d+)?$"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "rate": {
                                          "type": "string",
                                          "pattern": "^-?\\d+(\\.\\d+)?$"
                                        },
                                        "amount": {
                                          "type": "string",
                                          "pattern": "^-?\\d+(\\.\\d+)?$"
                                        }
                                      },
                                      "required": [
                                        "lower",
                                        "upper",
                                        "rate",
                                        "amount"
                                      ]
                                    }
                                  }
                                }
                              },
                              "required": [
                                "code",
                                "revision_id",
                                "jurisdiction",
                                "levy",
                                "valid_from",
                                "valid_until",
                                "evidence",
                                "shape",
                                "variants"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "revision_id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "jurisdiction": {
                                  "type": "string",
                                  "pattern": "^[a-z]{2}(_[a-z0-9]+)*$"
                                },
                                "levy": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "valid_from": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "valid_until": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "evidence": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "source_id",
                                      "locator"
                                    ]
                                  },
                                  "minItems": 1
                                },
                                "shape": {
                                  "const": "grid"
                                },
                                "cells": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "column": {
                                        "type": "string"
                                      },
                                      "row_lower": {
                                        "type": "string",
                                        "pattern": "^-?\\d+(\\.\\d+)?$"
                                      },
                                      "row_upper": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "pattern": "^-?\\d+(\\.\\d+)?$"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "value": {
                                        "type": "string",
                                        "pattern": "^-?\\d+(\\.\\d+)?$"
                                      }
                                    },
                                    "required": [
                                      "column",
                                      "row_lower",
                                      "row_upper",
                                      "value"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "code",
                                "revision_id",
                                "jurisdiction",
                                "levy",
                                "valid_from",
                                "valid_until",
                                "evidence",
                                "shape",
                                "cells"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "revision_id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "jurisdiction": {
                                  "type": "string",
                                  "pattern": "^[a-z]{2}(_[a-z0-9]+)*$"
                                },
                                "levy": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "valid_from": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "valid_until": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "evidence": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "source_id",
                                      "locator"
                                    ]
                                  },
                                  "minItems": 1
                                },
                                "shape": {
                                  "const": "requirement"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "kind": {
                                  "type": "string",
                                  "pattern": "^[a-z_]+$"
                                },
                                "authority": {
                                  "type": "string"
                                },
                                "applies_by": {
                                  "enum": [
                                    "home",
                                    "presence"
                                  ],
                                  "type": "string"
                                },
                                "audience": {
                                  "anyOf": [
                                    {
                                      "$ref": "#/$defs/0"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "period": {
                                  "type": "object",
                                  "properties": {
                                    "unit": {
                                      "enum": [
                                        "year",
                                        "fiscal_year"
                                      ],
                                      "type": "string"
                                    },
                                    "every": {
                                      "type": "integer",
                                      "minimum": 1
                                    },
                                    "first_month": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 12
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "first_day": {
                                      "anyOf": [
                                        {
                                          "type": "integer",
                                          "minimum": 1,
                                          "maximum": 31
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "evidence": {
                                      "type": "object",
                                      "properties": {
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "locator": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "source_id",
                                        "locator"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "unit",
                                    "every",
                                    "first_month",
                                    "first_day",
                                    "evidence"
                                  ]
                                },
                                "deadline": {
                                  "type": "object",
                                  "properties": {
                                    "calendar": {
                                      "type": "string"
                                    },
                                    "roll": {
                                      "enum": [
                                        "none",
                                        "forward"
                                      ],
                                      "type": "string"
                                    },
                                    "combine": {
                                      "enum": [
                                        "single",
                                        "earliest",
                                        "latest"
                                      ],
                                      "type": "string"
                                    },
                                    "terms": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "anchor": {
                                            "enum": [
                                              "period_end",
                                              "period_start"
                                            ],
                                            "type": "string"
                                          },
                                          "offset_months": {
                                            "type": "integer"
                                          },
                                          "offset_days": {
                                            "type": "integer"
                                          },
                                          "day_pick": {
                                            "enum": [
                                              "offset_only",
                                              "day_of_month",
                                              "last_day_of_month"
                                            ],
                                            "type": "string"
                                          },
                                          "day_value": {
                                            "anyOf": [
                                              {
                                                "type": "integer",
                                                "minimum": 1,
                                                "maximum": 31
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "applies": {
                                            "anyOf": [
                                              {
                                                "$ref": "#/$defs/0"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "anchor",
                                          "offset_months",
                                          "offset_days",
                                          "day_pick",
                                          "day_value",
                                          "applies"
                                        ]
                                      },
                                      "minItems": 1
                                    },
                                    "evidence": {
                                      "type": "object",
                                      "properties": {
                                        "source_id": {
                                          "type": "string"
                                        },
                                        "locator": {
                                          "type": "string"
                                        }
                                      },
                                      "required": [
                                        "source_id",
                                        "locator"
                                      ]
                                    }
                                  },
                                  "required": [
                                    "calendar",
                                    "roll",
                                    "combine",
                                    "terms",
                                    "evidence"
                                  ]
                                },
                                "fee": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "penalty": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "interest": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "satisfies": {
                                  "type": "array",
                                  "items": {
                                    "type": "string"
                                  }
                                }
                              },
                              "required": [
                                "code",
                                "revision_id",
                                "jurisdiction",
                                "levy",
                                "valid_from",
                                "valid_until",
                                "evidence",
                                "shape",
                                "title",
                                "kind",
                                "authority",
                                "applies_by",
                                "audience",
                                "period",
                                "deadline",
                                "fee",
                                "penalty",
                                "interest"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "revision_id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "jurisdiction": {
                                  "type": "string",
                                  "pattern": "^[a-z]{2}(_[a-z0-9]+)*$"
                                },
                                "levy": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "valid_from": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "valid_until": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "evidence": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "source_id",
                                      "locator"
                                    ]
                                  },
                                  "minItems": 1
                                },
                                "shape": {
                                  "const": "standard"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "standard": {
                                  "type": "object",
                                  "properties": {
                                    "decides": {
                                      "type": "string",
                                      "pattern": "^[a-z0-9_.]+$"
                                    },
                                    "subject": {
                                      "enum": [
                                        "business",
                                        "party",
                                        "relation"
                                      ],
                                      "type": "string"
                                    },
                                    "unsettled": {
                                      "enum": [
                                        "holds",
                                        "does_not_hold",
                                        "pending"
                                      ],
                                      "type": "string"
                                    },
                                    "unsettled_evidence": {
                                      "anyOf": [
                                        {
                                          "type": "object",
                                          "properties": {
                                            "source_id": {
                                              "type": "string"
                                            },
                                            "locator": {
                                              "type": "string"
                                            }
                                          },
                                          "required": [
                                            "source_id",
                                            "locator"
                                          ]
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "parts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "code": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "parent": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "structure": {
                                            "enum": [
                                              "line",
                                              "conjunction",
                                              "disjunction",
                                              "cascade",
                                              "presumption",
                                              "weighing",
                                              "by_reference",
                                              "none"
                                            ],
                                            "type": "string"
                                          },
                                          "decider": {
                                            "enum": [
                                              "law",
                                              "business",
                                              "authority",
                                              "court",
                                              "parties"
                                            ],
                                            "type": "string"
                                          },
                                          "title": {
                                            "type": "string"
                                          },
                                          "tree": {
                                            "anyOf": [
                                              {
                                                "$ref": "#/$defs/0"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "burden": {
                                            "type": "object",
                                            "properties": {
                                              "production": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              },
                                              "persuasion": {
                                                "anyOf": [
                                                  {
                                                    "type": "string"
                                                  },
                                                  {
                                                    "type": "null"
                                                  }
                                                ]
                                              }
                                            },
                                            "required": [
                                              "production",
                                              "persuasion"
                                            ]
                                          },
                                          "reference": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "weight": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^-?\\d+(\\.\\d+)?$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "evidence": {
                                            "type": "object",
                                            "properties": {
                                              "source_id": {
                                                "type": "string"
                                              },
                                              "locator": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "source_id",
                                              "locator"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "code",
                                          "parent",
                                          "structure",
                                          "decider",
                                          "title",
                                          "tree",
                                          "burden",
                                          "reference",
                                          "weight",
                                          "evidence"
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "decides",
                                    "subject",
                                    "unsettled",
                                    "unsettled_evidence",
                                    "parts"
                                  ]
                                }
                              },
                              "required": [
                                "code",
                                "revision_id",
                                "jurisdiction",
                                "levy",
                                "valid_from",
                                "valid_until",
                                "evidence",
                                "shape",
                                "title",
                                "standard"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "revision_id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "jurisdiction": {
                                  "type": "string",
                                  "pattern": "^[a-z]{2}(_[a-z0-9]+)*$"
                                },
                                "levy": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "valid_from": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "valid_until": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "evidence": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "source_id",
                                      "locator"
                                    ]
                                  },
                                  "minItems": 1
                                },
                                "shape": {
                                  "const": "attribution"
                                },
                                "title": {
                                  "type": "string"
                                },
                                "attribution": {
                                  "type": "object",
                                  "properties": {
                                    "rules": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "code": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "relation": {
                                            "enum": [
                                              "family",
                                              "to_owner",
                                              "to_entity"
                                            ],
                                            "type": "string"
                                          },
                                          "classifications": {
                                            "anyOf": [
                                              {
                                                "type": "array",
                                                "items": {
                                                  "type": "string"
                                                }
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "share": {
                                            "enum": [
                                              "full",
                                              "proportional"
                                            ],
                                            "type": "string"
                                          },
                                          "threshold": {
                                            "anyOf": [
                                              {
                                                "type": "object",
                                                "properties": {
                                                  "fact_code": {
                                                    "type": "string",
                                                    "pattern": "^[a-z0-9_.-]+$"
                                                  },
                                                  "amount": {
                                                    "type": "string"
                                                  }
                                                },
                                                "required": [
                                                  "fact_code",
                                                  "amount"
                                                ]
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "family": {
                                            "anyOf": [
                                              {
                                                "type": "array",
                                                "items": {
                                                  "enum": [
                                                    "spouse",
                                                    "child",
                                                    "grandchild",
                                                    "parent"
                                                  ],
                                                  "type": "string"
                                                }
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "evidence": {
                                            "type": "object",
                                            "properties": {
                                              "source_id": {
                                                "type": "string"
                                              },
                                              "locator": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "source_id",
                                              "locator"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "code",
                                          "relation",
                                          "classifications",
                                          "share",
                                          "threshold",
                                          "family",
                                          "evidence"
                                        ]
                                      },
                                      "minItems": 1
                                    },
                                    "limits": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "code": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "by": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "not_again": {
                                            "type": "array",
                                            "items": {
                                              "type": "string"
                                            }
                                          },
                                          "evidence": {
                                            "type": "object",
                                            "properties": {
                                              "source_id": {
                                                "type": "string"
                                              },
                                              "locator": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "source_id",
                                              "locator"
                                            ]
                                          }
                                        },
                                        "required": [
                                          "code",
                                          "by",
                                          "not_again",
                                          "evidence"
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "rules",
                                    "limits"
                                  ]
                                }
                              },
                              "required": [
                                "code",
                                "revision_id",
                                "jurisdiction",
                                "levy",
                                "valid_from",
                                "valid_until",
                                "evidence",
                                "shape",
                                "title",
                                "attribution"
                              ]
                            }
                          ]
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9-]+$"
                              },
                              "title": {
                                "type": "string"
                              },
                              "publisher": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "page_url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "sha256": {
                                "type": "string",
                                "pattern": "^[0-9a-f]{64}$"
                              },
                              "retrieved_on": {
                                "type": "string",
                                "format": "date"
                              },
                              "locators": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "title",
                              "publisher",
                              "url",
                              "sha256",
                              "retrieved_on",
                              "locators"
                            ]
                          }
                        },
                        "revisions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "revision_id": {
                                "type": "string",
                                "format": "uuid"
                              },
                              "valid_from": {
                                "type": "string",
                                "format": "date"
                              },
                              "valid_until": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "revision_id",
                              "valid_from",
                              "valid_until"
                            ]
                          }
                        },
                        "fee": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "on": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "revision_id": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "amounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9_]+$"
                                  },
                                  "additionalProperties": {
                                    "type": "string",
                                    "pattern": "^-?\\d+(\\.\\d+)?$"
                                  }
                                },
                                "table": {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "value": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^-?\\d+(\\.\\d+)?$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "steps": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "lower": {
                                            "type": "string",
                                            "pattern": "^-?\\d+(\\.\\d+)?$"
                                          },
                                          "upper": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^-?\\d+(\\.\\d+)?$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "amount": {
                                            "type": "string",
                                            "pattern": "^-?\\d+(\\.\\d+)?$"
                                          }
                                        },
                                        "required": [
                                          "lower",
                                          "upper",
                                          "amount"
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "value",
                                    "steps"
                                  ]
                                }
                              },
                              "required": [
                                "code",
                                "on",
                                "revision_id",
                                "amounts"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "penalty": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "on": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "revision_id": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "amounts": {
                                  "type": "object",
                                  "propertyNames": {
                                    "type": "string",
                                    "pattern": "^[a-z0-9_]+$"
                                  },
                                  "additionalProperties": {
                                    "type": "string",
                                    "pattern": "^-?\\d+(\\.\\d+)?$"
                                  }
                                },
                                "table": {
                                  "type": "object",
                                  "properties": {
                                    "field": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "value": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "pattern": "^-?\\d+(\\.\\d+)?$"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "steps": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "lower": {
                                            "type": "string",
                                            "pattern": "^-?\\d+(\\.\\d+)?$"
                                          },
                                          "upper": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^-?\\d+(\\.\\d+)?$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "amount": {
                                            "type": "string",
                                            "pattern": "^-?\\d+(\\.\\d+)?$"
                                          }
                                        },
                                        "required": [
                                          "lower",
                                          "upper",
                                          "amount"
                                        ]
                                      }
                                    }
                                  },
                                  "required": [
                                    "field",
                                    "value",
                                    "steps"
                                  ]
                                }
                              },
                              "required": [
                                "code",
                                "on",
                                "revision_id",
                                "amounts"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "interest": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "on": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "revision_id": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "uuid"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "rate": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "per": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "unit": {
                                          "enum": [
                                            "day",
                                            "week",
                                            "month",
                                            "year"
                                          ],
                                          "type": "string"
                                        },
                                        "every": {
                                          "type": "integer",
                                          "minimum": 1
                                        }
                                      },
                                      "required": [
                                        "unit",
                                        "every"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "code",
                                "on",
                                "revision_id",
                                "rate",
                                "per"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "snapshot_id",
                        "fact",
                        "sources",
                        "revisions",
                        "fee",
                        "penalty",
                        "interest"
                      ],
                      "$defs": {
                        "0": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "combinator": {
                                  "enum": [
                                    "all",
                                    "any"
                                  ],
                                  "type": "string"
                                },
                                "rules": {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/$defs/0"
                                  }
                                }
                              },
                              "required": [
                                "combinator",
                                "rules"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.]+$"
                                },
                                "read": {
                                  "type": "object",
                                  "properties": {
                                    "back": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 10
                                    },
                                    "over": {
                                      "enum": [
                                        "on",
                                        "any",
                                        "all"
                                      ],
                                      "type": "string"
                                    },
                                    "of": {
                                      "enum": [
                                        "owner"
                                      ],
                                      "type": "string"
                                    },
                                    "across": {
                                      "enum": [
                                        "held_by"
                                      ],
                                      "type": "string"
                                    },
                                    "through": {
                                      "type": "object",
                                      "properties": {
                                        "attribution": {
                                          "type": "string",
                                          "pattern": "^[a-z0-9_.]+$"
                                        },
                                        "lines": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "additionalProperties": {
                                            "type": "object",
                                            "properties": {
                                              "fact_code": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_.]+$"
                                              },
                                              "amount": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              }
                                            },
                                            "required": [
                                              "fact_code",
                                              "amount"
                                            ]
                                          }
                                        },
                                        "skip": {
                                          "type": "object",
                                          "properties": {
                                            "rules": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              },
                                              "minItems": 1
                                            },
                                            "from": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            },
                                            "to": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "rules",
                                            "from",
                                            "to"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "attribution"
                                      ]
                                    }
                                  },
                                  "required": []
                                },
                                "operator": {
                                  "enum": [
                                    "eq",
                                    "neq",
                                    "in",
                                    "not_in",
                                    "is_true",
                                    "is_false"
                                  ],
                                  "type": "string"
                                },
                                "value_kind": {
                                  "const": "literal"
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    },
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "array",
                                      "items": {
                                        "type": "string"
                                      }
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "operator",
                                "value_kind"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.]+$"
                                },
                                "read": {
                                  "type": "object",
                                  "properties": {
                                    "back": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 10
                                    },
                                    "over": {
                                      "enum": [
                                        "on",
                                        "any",
                                        "all"
                                      ],
                                      "type": "string"
                                    },
                                    "of": {
                                      "enum": [
                                        "owner"
                                      ],
                                      "type": "string"
                                    },
                                    "across": {
                                      "enum": [
                                        "held_by"
                                      ],
                                      "type": "string"
                                    },
                                    "through": {
                                      "type": "object",
                                      "properties": {
                                        "attribution": {
                                          "type": "string",
                                          "pattern": "^[a-z0-9_.]+$"
                                        },
                                        "lines": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "additionalProperties": {
                                            "type": "object",
                                            "properties": {
                                              "fact_code": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_.]+$"
                                              },
                                              "amount": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              }
                                            },
                                            "required": [
                                              "fact_code",
                                              "amount"
                                            ]
                                          }
                                        },
                                        "skip": {
                                          "type": "object",
                                          "properties": {
                                            "rules": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              },
                                              "minItems": 1
                                            },
                                            "from": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            },
                                            "to": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "rules",
                                            "from",
                                            "to"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "attribution"
                                      ]
                                    }
                                  },
                                  "required": []
                                },
                                "operator": {
                                  "enum": [
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte"
                                  ],
                                  "type": "string"
                                },
                                "value_kind": {
                                  "const": "literal"
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    },
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "operator",
                                "value_kind",
                                "value"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.]+$"
                                },
                                "read": {
                                  "type": "object",
                                  "properties": {
                                    "back": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 10
                                    },
                                    "over": {
                                      "enum": [
                                        "on",
                                        "any",
                                        "all"
                                      ],
                                      "type": "string"
                                    },
                                    "of": {
                                      "enum": [
                                        "owner"
                                      ],
                                      "type": "string"
                                    },
                                    "across": {
                                      "enum": [
                                        "held_by"
                                      ],
                                      "type": "string"
                                    },
                                    "through": {
                                      "type": "object",
                                      "properties": {
                                        "attribution": {
                                          "type": "string",
                                          "pattern": "^[a-z0-9_.]+$"
                                        },
                                        "lines": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "additionalProperties": {
                                            "type": "object",
                                            "properties": {
                                              "fact_code": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_.]+$"
                                              },
                                              "amount": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              }
                                            },
                                            "required": [
                                              "fact_code",
                                              "amount"
                                            ]
                                          }
                                        },
                                        "skip": {
                                          "type": "object",
                                          "properties": {
                                            "rules": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              },
                                              "minItems": 1
                                            },
                                            "from": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            },
                                            "to": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "rules",
                                            "from",
                                            "to"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "attribution"
                                      ]
                                    }
                                  },
                                  "required": []
                                },
                                "operator": {
                                  "enum": [
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte"
                                  ],
                                  "type": "string"
                                },
                                "value_kind": {
                                  "const": "fact"
                                },
                                "fact_code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "amount": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_]+$"
                                }
                              },
                              "required": [
                                "field",
                                "operator",
                                "value_kind",
                                "fact_code",
                                "amount"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "expression": {
                                  "$ref": "#/$defs/1"
                                },
                                "operator": {
                                  "enum": [
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte"
                                  ],
                                  "type": "string"
                                },
                                "value_kind": {
                                  "const": "literal"
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    },
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "expression",
                                "operator",
                                "value_kind",
                                "value"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "expression": {
                                  "$ref": "#/$defs/1"
                                },
                                "operator": {
                                  "enum": [
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte"
                                  ],
                                  "type": "string"
                                },
                                "value_kind": {
                                  "const": "fact"
                                },
                                "fact_code": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.-]+$"
                                },
                                "amount": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_]+$"
                                }
                              },
                              "required": [
                                "expression",
                                "operator",
                                "value_kind",
                                "fact_code",
                                "amount"
                              ]
                            }
                          ]
                        },
                        "1": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.]+$"
                                },
                                "read": {
                                  "type": "object",
                                  "properties": {
                                    "back": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 10
                                    },
                                    "over": {
                                      "enum": [
                                        "on",
                                        "any",
                                        "all"
                                      ],
                                      "type": "string"
                                    },
                                    "of": {
                                      "enum": [
                                        "owner"
                                      ],
                                      "type": "string"
                                    },
                                    "across": {
                                      "enum": [
                                        "held_by"
                                      ],
                                      "type": "string"
                                    },
                                    "through": {
                                      "type": "object",
                                      "properties": {
                                        "attribution": {
                                          "type": "string",
                                          "pattern": "^[a-z0-9_.]+$"
                                        },
                                        "lines": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "additionalProperties": {
                                            "type": "object",
                                            "properties": {
                                              "fact_code": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_.]+$"
                                              },
                                              "amount": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              }
                                            },
                                            "required": [
                                              "fact_code",
                                              "amount"
                                            ]
                                          }
                                        },
                                        "skip": {
                                          "type": "object",
                                          "properties": {
                                            "rules": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              },
                                              "minItems": 1
                                            },
                                            "from": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            },
                                            "to": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "rules",
                                            "from",
                                            "to"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "attribution"
                                      ]
                                    }
                                  },
                                  "required": []
                                }
                              },
                              "required": [
                                "field"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "arithmetic": {
                                  "enum": [
                                    "add",
                                    "multiply",
                                    "divide"
                                  ],
                                  "type": "string"
                                },
                                "terms": {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/$defs/1"
                                  },
                                  "minItems": 2
                                }
                              },
                              "required": [
                                "arithmetic",
                                "terms"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    },
                                    {
                                      "type": "integer",
                                      "minimum": -9007199254740991,
                                      "maximum": 9007199254740991
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "value"
                              ]
                            }
                          ]
                        }
                      }
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`input_invalid`: The request does not match the action’s input schema. `parameter_missing`: A parameter the computation needs was not given.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "`key_missing`: This action needs an API key (Authorization: Bearer <key>). `key_invalid`: The API key is unknown, revoked or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`plan_excludes_action`: The account’s plan does not include this action.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: No such action or document.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`table_not_effective`: No reviewed fact is in force for this pay date.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests from this client; slow down.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/rules/evaluate": {
      "post": {
        "operationId": "rule_evaluate",
        "summary": "Judge a rule from root facts, with its reasoning",
        "description": "One of montaye’s own rules, read from an official document and checked against the worked examples it prints, judged for the fields you give: us.resident_alien takes us.citizen, us.lawful_permanent_resident, the days present in the United States this year and the two before (IRS Pub 519’s green card and substantial presence tests) and us.closer_connection_exception (its closer connection exception). Not given, a standard of the law settles that one: as the days alone make it when the law draws the line (present 183 days or more this year, it does not hold), else as the standard says while nobody has judged the rest (not claimed on Form 8840, it does not hold), its reasoning on the step that reads it. The answer is true, false or unknown with the fields it waits on, each step of the reasoning with its arithmetic done exactly and how far it is from the line, the documents and pages it is read from, and what the rule leaves to a person (days that do not count, the first-year choice). Nothing you send is stored. GET /v1/status lists the rules. Fields are only ever added.",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "code": {
                    "type": "string",
                    "pattern": "^[a-z0-9_.-]+$"
                  },
                  "on": {
                    "type": "string",
                    "format": "date"
                  },
                  "fields": {
                    "type": "object",
                    "propertyNames": {
                      "type": "string",
                      "pattern": "^[a-z0-9_.]+$"
                    },
                    "additionalProperties": {
                      "anyOf": [
                        {
                          "type": "string"
                        },
                        {
                          "type": "integer",
                          "minimum": -9007199254740991,
                          "maximum": 9007199254740991
                        },
                        {
                          "type": "boolean"
                        },
                        {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "from": {
                                "type": "string",
                                "format": "date"
                              },
                              "until": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "value": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "integer",
                                    "minimum": -9007199254740991,
                                    "maximum": 9007199254740991
                                  },
                                  {
                                    "type": "boolean"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "from",
                              "until",
                              "value"
                            ]
                          }
                        }
                      ]
                    }
                  }
                },
                "required": [
                  "code",
                  "fields"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, and what the call used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "result",
                    "usage"
                  ],
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "snapshot_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "rule": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string",
                              "pattern": "^[a-z0-9_.-]+$"
                            },
                            "revision_id": {
                              "type": "string",
                              "format": "uuid"
                            },
                            "title": {
                              "type": "string"
                            },
                            "context": {
                              "type": "string",
                              "pattern": "^[a-z_]+$"
                            }
                          },
                          "required": [
                            "code",
                            "revision_id",
                            "title",
                            "context"
                          ]
                        },
                        "on": {
                          "type": "string",
                          "format": "date"
                        },
                        "truth": {
                          "enum": [
                            "true",
                            "false",
                            "unknown"
                          ],
                          "type": "string"
                        },
                        "unknown_fields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "trace": {
                          "$ref": "#/$defs/0"
                        },
                        "facts": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "code": {
                                "type": "string"
                              },
                              "revision_id": {
                                "type": "string",
                                "format": "uuid"
                              }
                            },
                            "required": [
                              "code",
                              "revision_id"
                            ]
                          }
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-z0-9-]+$"
                              },
                              "title": {
                                "type": "string"
                              },
                              "publisher": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "page_url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "sha256": {
                                "type": "string",
                                "pattern": "^[0-9a-f]{64}$"
                              },
                              "retrieved_on": {
                                "type": "string",
                                "format": "date"
                              },
                              "locators": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "id",
                              "title",
                              "publisher",
                              "url",
                              "sha256",
                              "retrieved_on",
                              "locators"
                            ]
                          }
                        },
                        "left_to_a_person": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "evidence": {
                                "type": "object",
                                "properties": {
                                  "source_id": {
                                    "type": "string"
                                  },
                                  "locator": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "source_id",
                                  "locator"
                                ]
                              }
                            },
                            "required": [
                              "title",
                              "evidence"
                            ]
                          }
                        }
                      },
                      "required": [
                        "snapshot_id",
                        "rule",
                        "on",
                        "truth",
                        "unknown_fields",
                        "trace",
                        "facts",
                        "sources",
                        "left_to_a_person"
                      ],
                      "$defs": {
                        "0": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "combinator": {
                                  "enum": [
                                    "all",
                                    "any"
                                  ],
                                  "type": "string"
                                },
                                "truth": {
                                  "enum": [
                                    "true",
                                    "false",
                                    "unknown"
                                  ],
                                  "type": "string"
                                },
                                "parts": {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/$defs/0"
                                  }
                                }
                              },
                              "required": [
                                "combinator",
                                "truth",
                                "parts"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "read": {
                                  "type": "object",
                                  "properties": {
                                    "back": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 10
                                    },
                                    "over": {
                                      "enum": [
                                        "on",
                                        "any",
                                        "all"
                                      ],
                                      "type": "string"
                                    },
                                    "of": {
                                      "enum": [
                                        "owner"
                                      ],
                                      "type": "string"
                                    },
                                    "across": {
                                      "enum": [
                                        "held_by"
                                      ],
                                      "type": "string"
                                    },
                                    "through": {
                                      "type": "object",
                                      "properties": {
                                        "attribution": {
                                          "type": "string",
                                          "pattern": "^[a-z0-9_.]+$"
                                        },
                                        "lines": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "additionalProperties": {
                                            "type": "object",
                                            "properties": {
                                              "fact_code": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_.]+$"
                                              },
                                              "amount": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              }
                                            },
                                            "required": [
                                              "fact_code",
                                              "amount"
                                            ]
                                          }
                                        },
                                        "skip": {
                                          "type": "object",
                                          "properties": {
                                            "rules": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              },
                                              "minItems": 1
                                            },
                                            "from": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            },
                                            "to": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "rules",
                                            "from",
                                            "to"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "attribution"
                                      ]
                                    }
                                  },
                                  "required": []
                                },
                                "operator": {
                                  "enum": [
                                    "eq",
                                    "neq",
                                    "in",
                                    "not_in",
                                    "is_true",
                                    "is_false",
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte"
                                  ],
                                  "type": "string"
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        },
                                        {
                                          "type": "boolean"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "against": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "const": "literal"
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "const": "fact"
                                        },
                                        "code": {
                                          "type": "string"
                                        },
                                        "amount": {
                                          "type": "string"
                                        },
                                        "revision_id": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "pattern": "^-?\\d+(\\.\\d+)?$"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "evidence": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "source_id": {
                                                "type": "string"
                                              },
                                              "locator": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "source_id",
                                              "locator"
                                            ]
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "code",
                                        "amount",
                                        "revision_id",
                                        "value",
                                        "evidence"
                                      ]
                                    }
                                  ]
                                },
                                "truth": {
                                  "enum": [
                                    "true",
                                    "false",
                                    "unknown"
                                  ],
                                  "type": "string"
                                },
                                "margin": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "stood_in": {
                                  "anyOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "field": {
                                          "type": "string"
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "number"
                                            },
                                            {
                                              "type": "boolean"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "field",
                                        "value"
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "computed": {
                                  "$ref": "#/$defs/1"
                                }
                              },
                              "required": [
                                "field",
                                "operator",
                                "value",
                                "against",
                                "truth",
                                "margin",
                                "stood_in"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "expression": {
                                  "$ref": "#/$defs/3"
                                },
                                "operator": {
                                  "enum": [
                                    "gt",
                                    "gte",
                                    "lt",
                                    "lte"
                                  ],
                                  "type": "string"
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "against": {
                                  "oneOf": [
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "const": "literal"
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "anyOf": [
                                                {
                                                  "type": "string"
                                                },
                                                {
                                                  "type": "number"
                                                },
                                                {
                                                  "type": "boolean"
                                                },
                                                {
                                                  "type": "array",
                                                  "items": {
                                                    "type": "string"
                                                  }
                                                }
                                              ]
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "value"
                                      ]
                                    },
                                    {
                                      "type": "object",
                                      "properties": {
                                        "kind": {
                                          "const": "fact"
                                        },
                                        "code": {
                                          "type": "string"
                                        },
                                        "amount": {
                                          "type": "string"
                                        },
                                        "revision_id": {
                                          "anyOf": [
                                            {
                                              "type": "string"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "value": {
                                          "anyOf": [
                                            {
                                              "type": "string",
                                              "pattern": "^-?\\d+(\\.\\d+)?$"
                                            },
                                            {
                                              "type": "null"
                                            }
                                          ]
                                        },
                                        "evidence": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "source_id": {
                                                "type": "string"
                                              },
                                              "locator": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "source_id",
                                              "locator"
                                            ]
                                          }
                                        }
                                      },
                                      "required": [
                                        "kind",
                                        "code",
                                        "amount",
                                        "revision_id",
                                        "value",
                                        "evidence"
                                      ]
                                    }
                                  ]
                                },
                                "truth": {
                                  "enum": [
                                    "true",
                                    "false",
                                    "unknown"
                                  ],
                                  "type": "string"
                                },
                                "margin": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "expression",
                                "operator",
                                "value",
                                "against",
                                "truth",
                                "margin"
                              ]
                            }
                          ]
                        },
                        "1": {
                          "type": "object",
                          "properties": {
                            "function": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "string"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "ruling": {
                              "type": "object",
                              "properties": {
                                "term": {
                                  "type": "string",
                                  "pattern": "^[a-z0-9_.]+$"
                                },
                                "from": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "until": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                },
                                "holds": {
                                  "type": "boolean"
                                },
                                "value": {
                                  "type": "string"
                                },
                                "decided_by": {
                                  "enum": [
                                    "business",
                                    "authority",
                                    "court"
                                  ],
                                  "type": "string"
                                },
                                "decided_on": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "note": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "term",
                                "from",
                                "until",
                                "decided_by",
                                "decided_on",
                                "note"
                              ]
                            },
                            "on": {
                              "type": "string",
                              "format": "date"
                            },
                            "shareholders": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "party_id": {
                                    "type": "string"
                                  },
                                  "name": {
                                    "type": "string"
                                  },
                                  "kind": {
                                    "enum": [
                                      "person",
                                      "organisation"
                                    ],
                                    "type": "string"
                                  },
                                  "shareholding": {
                                    "anyOf": [
                                      {
                                        "type": "string",
                                        "pattern": "^-?\\d+(\\.\\d+)?$"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "foreign": {
                                    "type": "object",
                                    "properties": {
                                      "truth": {
                                        "enum": [
                                          "true",
                                          "false",
                                          "unknown"
                                        ],
                                        "type": "string"
                                      },
                                      "citizen": {
                                        "anyOf": [
                                          {
                                            "type": "boolean"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "reasoning": {
                                        "anyOf": [
                                          {
                                            "$ref": "#/$defs/0"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "formed_in": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "truth",
                                      "citizen",
                                      "reasoning",
                                      "formed_in"
                                    ]
                                  },
                                  "holds": {
                                    "type": "object",
                                    "properties": {
                                      "truth": {
                                        "enum": [
                                          "true",
                                          "false",
                                          "unknown"
                                        ],
                                        "type": "string"
                                      },
                                      "reasoning": {
                                        "anyOf": [
                                          {
                                            "$ref": "#/$defs/0"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      }
                                    },
                                    "required": [
                                      "truth",
                                      "reasoning"
                                    ]
                                  },
                                  "behind": {
                                    "type": "boolean"
                                  },
                                  "standards": {
                                    "type": "array",
                                    "items": {
                                      "$ref": "#/$defs/2"
                                    }
                                  },
                                  "through": {
                                    "type": "array",
                                    "items": {
                                      "type": "object",
                                      "properties": {
                                        "holder": {
                                          "type": "string"
                                        },
                                        "fraction": {
                                          "type": "string",
                                          "pattern": "^-?\\d+(\\.\\d+)?$"
                                        },
                                        "route": {
                                          "type": "array",
                                          "items": {
                                            "type": "object",
                                            "properties": {
                                              "party_id": {
                                                "type": "string"
                                              },
                                              "rule": {
                                                "type": "string"
                                              }
                                            },
                                            "required": [
                                              "party_id",
                                              "rule"
                                            ]
                                          }
                                        }
                                      },
                                      "required": [
                                        "holder",
                                        "fraction",
                                        "route"
                                      ]
                                    }
                                  }
                                },
                                "required": [
                                  "party_id",
                                  "name",
                                  "kind",
                                  "shareholding",
                                  "foreign",
                                  "holds",
                                  "behind"
                                ]
                              }
                            },
                            "rules": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "revision_id": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "revision_id"
                                ]
                              }
                            },
                            "left_to_a_person": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "title": {
                                    "type": "string"
                                  },
                                  "evidence": {
                                    "type": "object",
                                    "properties": {
                                      "source_id": {
                                        "type": "string"
                                      },
                                      "locator": {
                                        "type": "string"
                                      }
                                    },
                                    "required": [
                                      "source_id",
                                      "locator"
                                    ]
                                  }
                                },
                                "required": [
                                  "title",
                                  "evidence"
                                ]
                              }
                            },
                            "formed_in": {
                              "anyOf": [
                                {
                                  "type": "string"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "reasoning": {
                              "anyOf": [
                                {
                                  "$ref": "#/$defs/0"
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "standards": {
                              "type": "array",
                              "items": {
                                "$ref": "#/$defs/2"
                              }
                            },
                            "pending": {
                              "type": "array",
                              "items": {
                                "type": "string"
                              }
                            }
                          },
                          "required": [
                            "function",
                            "value",
                            "shareholders",
                            "rules",
                            "left_to_a_person"
                          ]
                        },
                        "2": {
                          "type": "object",
                          "properties": {
                            "code": {
                              "type": "string"
                            },
                            "revision_id": {
                              "type": "string"
                            },
                            "value": {
                              "anyOf": [
                                {
                                  "anyOf": [
                                    {
                                      "type": "boolean"
                                    },
                                    {
                                      "type": "string"
                                    }
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "pending": {
                              "type": "boolean"
                            },
                            "matters": {
                              "type": "boolean"
                            },
                            "how": {
                              "enum": [
                                "law",
                                "determination",
                                "unsettled"
                              ],
                              "type": "string"
                            },
                            "unsettled": {
                              "enum": [
                                "holds",
                                "does_not_hold",
                                "pending"
                              ],
                              "type": "string"
                            },
                            "parts": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "structure": {
                                    "enum": [
                                      "line",
                                      "conjunction",
                                      "disjunction",
                                      "cascade",
                                      "presumption",
                                      "weighing",
                                      "by_reference",
                                      "none"
                                    ],
                                    "type": "string"
                                  },
                                  "decider": {
                                    "enum": [
                                      "law",
                                      "business",
                                      "authority",
                                      "court",
                                      "parties"
                                    ],
                                    "type": "string"
                                  },
                                  "truth": {
                                    "enum": [
                                      "true",
                                      "false",
                                      "unknown"
                                    ],
                                    "type": "string"
                                  },
                                  "settled_by": {
                                    "anyOf": [
                                      {
                                        "enum": [
                                          "law",
                                          "determination"
                                        ],
                                        "type": "string"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  },
                                  "reasoning": {
                                    "anyOf": [
                                      {
                                        "$ref": "#/$defs/0"
                                      },
                                      {
                                        "type": "null"
                                      }
                                    ]
                                  }
                                },
                                "required": [
                                  "code",
                                  "structure",
                                  "decider",
                                  "truth",
                                  "settled_by",
                                  "reasoning"
                                ]
                              }
                            },
                            "determination": {
                              "anyOf": [
                                {
                                  "type": "object",
                                  "properties": {
                                    "standard": {
                                      "type": "string",
                                      "pattern": "^[a-z0-9_.-]+$"
                                    },
                                    "from": {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    "until": {
                                      "anyOf": [
                                        {
                                          "type": "string",
                                          "format": "date"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "holds": {
                                      "type": "boolean"
                                    },
                                    "value": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    },
                                    "decided_by": {
                                      "enum": [
                                        "business",
                                        "authority",
                                        "court"
                                      ],
                                      "type": "string"
                                    },
                                    "decided_on": {
                                      "type": "string",
                                      "format": "date"
                                    },
                                    "parts": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "code": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "holds": {
                                            "anyOf": [
                                              {
                                                "type": "boolean"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "note": {
                                            "anyOf": [
                                              {
                                                "type": "string"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          }
                                        },
                                        "required": [
                                          "code",
                                          "holds",
                                          "note"
                                        ]
                                      }
                                    },
                                    "note": {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "null"
                                        }
                                      ]
                                    }
                                  },
                                  "required": [
                                    "standard",
                                    "from",
                                    "until",
                                    "holds",
                                    "decided_by",
                                    "decided_on",
                                    "parts",
                                    "note"
                                  ]
                                },
                                {
                                  "type": "null"
                                }
                              ]
                            },
                            "period": {
                              "type": "object",
                              "properties": {
                                "from": {
                                  "type": "string",
                                  "format": "date"
                                },
                                "until": {
                                  "type": "string",
                                  "format": "date"
                                }
                              },
                              "required": [
                                "from",
                                "until"
                              ]
                            }
                          },
                          "required": [
                            "code",
                            "revision_id",
                            "value",
                            "pending",
                            "matters",
                            "how",
                            "unsettled",
                            "parts",
                            "determination",
                            "period"
                          ]
                        },
                        "3": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "field": {
                                  "type": "string"
                                },
                                "read": {
                                  "type": "object",
                                  "properties": {
                                    "back": {
                                      "type": "integer",
                                      "minimum": 1,
                                      "maximum": 10
                                    },
                                    "over": {
                                      "enum": [
                                        "on",
                                        "any",
                                        "all"
                                      ],
                                      "type": "string"
                                    },
                                    "of": {
                                      "enum": [
                                        "owner"
                                      ],
                                      "type": "string"
                                    },
                                    "across": {
                                      "enum": [
                                        "held_by"
                                      ],
                                      "type": "string"
                                    },
                                    "through": {
                                      "type": "object",
                                      "properties": {
                                        "attribution": {
                                          "type": "string",
                                          "pattern": "^[a-z0-9_.]+$"
                                        },
                                        "lines": {
                                          "type": "object",
                                          "propertyNames": {
                                            "type": "string",
                                            "pattern": "^[a-z0-9_]+$"
                                          },
                                          "additionalProperties": {
                                            "type": "object",
                                            "properties": {
                                              "fact_code": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_.]+$"
                                              },
                                              "amount": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              }
                                            },
                                            "required": [
                                              "fact_code",
                                              "amount"
                                            ]
                                          }
                                        },
                                        "skip": {
                                          "type": "object",
                                          "properties": {
                                            "rules": {
                                              "type": "array",
                                              "items": {
                                                "type": "string",
                                                "pattern": "^[a-z0-9_]+$"
                                              },
                                              "minItems": 1
                                            },
                                            "from": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            },
                                            "to": {
                                              "type": "object",
                                              "properties": {
                                                "field": {
                                                  "type": "string",
                                                  "pattern": "^[a-z0-9_.]+$"
                                                },
                                                "is": {
                                                  "type": "boolean"
                                                }
                                              },
                                              "required": [
                                                "field",
                                                "is"
                                              ]
                                            }
                                          },
                                          "required": [
                                            "rules",
                                            "from",
                                            "to"
                                          ]
                                        }
                                      },
                                      "required": [
                                        "attribution"
                                      ]
                                    }
                                  },
                                  "required": []
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "anyOf": [
                                        {
                                          "type": "string"
                                        },
                                        {
                                          "type": "number"
                                        }
                                      ]
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "field",
                                "value"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "arithmetic": {
                                  "enum": [
                                    "add",
                                    "multiply",
                                    "divide"
                                  ],
                                  "type": "string"
                                },
                                "terms": {
                                  "type": "array",
                                  "items": {
                                    "$ref": "#/$defs/3"
                                  }
                                },
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    },
                                    {
                                      "type": "null"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "arithmetic",
                                "terms",
                                "value"
                              ]
                            },
                            {
                              "type": "object",
                              "properties": {
                                "value": {
                                  "anyOf": [
                                    {
                                      "type": "string"
                                    },
                                    {
                                      "type": "number"
                                    }
                                  ]
                                }
                              },
                              "required": [
                                "value"
                              ]
                            }
                          ]
                        }
                      }
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`input_invalid`: The request does not match the action’s input schema.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "`key_missing`: This action needs an API key (Authorization: Bearer <key>). `key_invalid`: The API key is unknown, revoked or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`plan_excludes_action`: The account’s plan does not include this action.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "404": {
            "description": "`not_found`: No such action or document.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`rule_not_in_force`: The rule montaye publishes by that code states the law of other days: no revision of it is in force on the day asked.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests from this client; slow down.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/franchise-tax/calculate": {
      "post": {
        "operationId": "franchise_tax_calculate",
        "summary": "Compute a Delaware corporation’s franchise tax",
        "description": "Delaware’s annual franchise tax for one year by both of its methods (Authorized Shares, and Assumed Par Value Capital when the issued shares and gross assets are given), and the lesser, which is what is owed. Every step names the fact revision it read and the Division of Corporations’ own sentence. The annual report fee is not included.",
        "security": [
          {
            "bearer": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "jurisdiction": {
                    "const": "us_de"
                  },
                  "tax_year": {
                    "type": "integer",
                    "minimum": 2018,
                    "maximum": 2100
                  },
                  "authorized": {
                    "type": "array",
                    "items": {
                      "type": "object",
                      "properties": {
                        "shares": {
                          "type": "string",
                          "pattern": "^\\d+$"
                        },
                        "par_value": {
                          "anyOf": [
                            {
                              "type": "string",
                              "pattern": "^-?\\d+(\\.\\d+)?$"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "shares",
                        "par_value"
                      ]
                    },
                    "minItems": 1,
                    "maxItems": 20
                  },
                  "issued_shares": {
                    "type": "string",
                    "pattern": "^\\d+$"
                  },
                  "gross_assets": {
                    "type": "string",
                    "pattern": "^\\d+(\\.\\d{1,2})?$"
                  }
                },
                "required": [
                  "jurisdiction",
                  "tax_year",
                  "authorized"
                ]
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, and what the call used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "result",
                    "usage"
                  ],
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "jurisdiction": {
                          "const": "us_de"
                        },
                        "tax_year": {
                          "type": "number"
                        },
                        "tax": {
                          "type": "string",
                          "pattern": "^\\d+(\\.\\d{1,2})?$"
                        },
                        "method": {
                          "enum": [
                            "authorized_shares",
                            "assumed_par_value"
                          ],
                          "type": "string"
                        },
                        "methods": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "method": {
                                "enum": [
                                  "authorized_shares",
                                  "assumed_par_value"
                                ],
                                "type": "string"
                              },
                              "tax": {
                                "type": "string",
                                "pattern": "^\\d+(\\.\\d{1,2})?$"
                              },
                              "steps": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "label": {
                                      "type": "string"
                                    },
                                    "value": {
                                      "type": "string",
                                      "pattern": "^-?\\d+(\\.\\d+)?$"
                                    }
                                  },
                                  "required": [
                                    "label",
                                    "value"
                                  ]
                                }
                              },
                              "facts": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "code": {
                                      "type": "string"
                                    },
                                    "revision_id": {
                                      "type": "string"
                                    }
                                  },
                                  "required": [
                                    "code",
                                    "revision_id"
                                  ]
                                }
                              },
                              "source_ids": {
                                "type": "array",
                                "items": {
                                  "type": "string"
                                }
                              }
                            },
                            "required": [
                              "method",
                              "tax",
                              "steps",
                              "facts",
                              "source_ids"
                            ]
                          }
                        },
                        "not_computed": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "method": {
                                "enum": [
                                  "authorized_shares",
                                  "assumed_par_value"
                                ],
                                "type": "string"
                              },
                              "reason": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "method",
                              "reason"
                            ]
                          }
                        },
                        "snapshot_id": {
                          "type": "string"
                        }
                      },
                      "required": [
                        "jurisdiction",
                        "tax_year",
                        "tax",
                        "method",
                        "methods",
                        "not_computed",
                        "snapshot_id"
                      ]
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`input_invalid`: The request does not match the action’s input schema.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "`key_missing`: This action needs an API key (Authorization: Bearer <key>). `key_invalid`: The API key is unknown, revoked or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "402": {
            "description": "`trial_exhausted`: The trial key has used all of its included calls. `quota_exhausted`: The plan’s calls for this month are used; a larger plan or the next month opens more.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "403": {
            "description": "`plan_excludes_action`: The account’s plan does not include this action.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "422": {
            "description": "`table_not_effective`: No reviewed fact is in force for this pay date.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests from this client; slow down.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/trial-keys": {
      "post": {
        "operationId": "account_create_trial",
        "summary": "Get a trial API key",
        "description": "Opens a trial account and returns its API key, with no sign-up. The key is shown once; only its hash is kept. The trial plan includes a fixed number of paycheck computations.",
        "security": [],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "label": {
                    "type": "string",
                    "minLength": 1,
                    "maxLength": 80,
                    "default": "trial"
                  }
                },
                "required": []
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The result, and what the call used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "result",
                    "usage"
                  ],
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "key": {
                          "type": "string",
                          "pattern": "^mty_[A-Za-z0-9]{8}_[A-Za-z0-9]{40}$"
                        },
                        "key_prefix": {
                          "type": "string"
                        },
                        "account_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "plan": {
                          "type": "string"
                        },
                        "included": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "action": {
                                "type": "string"
                              },
                              "quantity": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "per": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "action",
                              "quantity",
                              "per"
                            ]
                          }
                        }
                      },
                      "required": [
                        "key",
                        "key_prefix",
                        "account_id",
                        "plan",
                        "included"
                      ]
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`input_invalid`: The request does not match the action’s input schema.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests from this client; slow down.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`database_unavailable`: The ledger database cannot be reached right now.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/usage": {
      "get": {
        "operationId": "usage_list",
        "summary": "See the account’s usage",
        "description": "What the key’s account has used against its plan, and its most recent calls with their outcome or refusal code.",
        "security": [
          {
            "bearer": []
          }
        ],
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "required": false,
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 100,
              "default": 20
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The result, and what the call used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "result",
                    "usage"
                  ],
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "account_id": {
                          "type": "string",
                          "format": "uuid"
                        },
                        "plan": {
                          "type": "string"
                        },
                        "actions": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "action": {
                                "type": "string"
                              },
                              "used": {
                                "type": "number"
                              },
                              "included": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "remaining": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "action",
                              "used",
                              "included",
                              "remaining"
                            ]
                          }
                        },
                        "recent_calls": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string"
                              },
                              "action": {
                                "type": "string"
                              },
                              "outcome": {
                                "type": "string"
                              },
                              "refusal_code": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "at": {
                                "type": "string"
                              }
                            },
                            "required": [
                              "id",
                              "action",
                              "outcome",
                              "refusal_code",
                              "at"
                            ]
                          }
                        },
                        "recorded_through": {
                          "anyOf": [
                            {
                              "type": "string"
                            },
                            {
                              "type": "null"
                            }
                          ]
                        }
                      },
                      "required": [
                        "account_id",
                        "plan",
                        "actions",
                        "recent_calls",
                        "recorded_through"
                      ]
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "`input_invalid`: The request does not match the action’s input schema.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "401": {
            "description": "`key_missing`: This action needs an API key (Authorization: Bearer <key>). `key_invalid`: The API key is unknown, revoked or expired.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "429": {
            "description": "`rate_limited`: Too many requests from this client; slow down.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          },
          "503": {
            "description": "`database_unavailable`: The ledger database cannot be reached right now.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    },
    "/v1/status": {
      "get": {
        "operationId": "status_read",
        "summary": "See what montaye watches and how fresh it is",
        "description": "The facts computations read now (each with its official source), the ones that stop being in force within 90 days with nothing published after them (and how far their successor has come), every official document and dataset montaye watches with when it was last checked and what the check found, the datasets the reference tables come from (each with its licence, and the notice it asks to travel with the data), and how montaye’s background jobs ran. No key needed; nothing of any customer is in it.",
        "security": [],
        "parameters": [],
        "responses": {
          "200": {
            "description": "The result, and what the call used.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "result",
                    "usage"
                  ],
                  "properties": {
                    "result": {
                      "type": "object",
                      "properties": {
                        "facts": {
                          "anyOf": [
                            {
                              "type": "object",
                              "properties": {
                                "snapshot_id": {
                                  "type": "string",
                                  "format": "uuid"
                                },
                                "generated_at": {
                                  "type": "string",
                                  "format": "date-time"
                                },
                                "facts": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "code": {
                                        "type": "string"
                                      },
                                      "jurisdiction": {
                                        "type": "string"
                                      },
                                      "shape": {
                                        "type": "string"
                                      },
                                      "levy": {
                                        "anyOf": [
                                          {
                                            "type": "string"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "valid_from": {
                                        "type": "string",
                                        "format": "date"
                                      },
                                      "valid_until": {
                                        "anyOf": [
                                          {
                                            "type": "string",
                                            "format": "date"
                                          },
                                          {
                                            "type": "null"
                                          }
                                        ]
                                      },
                                      "revision_id": {
                                        "type": "string",
                                        "format": "uuid"
                                      },
                                      "sources": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "code",
                                      "jurisdiction",
                                      "shape",
                                      "levy",
                                      "valid_from",
                                      "valid_until",
                                      "revision_id",
                                      "sources"
                                    ]
                                  }
                                },
                                "sources": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "id": {
                                        "type": "string"
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "publisher": {
                                        "type": "string"
                                      },
                                      "url": {
                                        "type": "string",
                                        "format": "uri"
                                      },
                                      "page_url": {
                                        "type": "string",
                                        "format": "uri"
                                      },
                                      "retrieved_on": {
                                        "type": "string",
                                        "format": "date"
                                      }
                                    },
                                    "required": [
                                      "id",
                                      "title",
                                      "publisher",
                                      "url",
                                      "retrieved_on"
                                    ]
                                  }
                                },
                                "rules": {
                                  "type": "array",
                                  "items": {
                                    "type": "object",
                                    "properties": {
                                      "code": {
                                        "type": "string"
                                      },
                                      "revision_id": {
                                        "type": "string",
                                        "format": "uuid"
                                      },
                                      "title": {
                                        "type": "string"
                                      },
                                      "context": {
                                        "type": "string"
                                      },
                                      "sources": {
                                        "type": "array",
                                        "items": {
                                          "type": "string"
                                        }
                                      }
                                    },
                                    "required": [
                                      "code",
                                      "revision_id",
                                      "title",
                                      "context",
                                      "sources"
                                    ]
                                  }
                                }
                              },
                              "required": [
                                "snapshot_id",
                                "generated_at",
                                "facts",
                                "sources"
                              ]
                            },
                            {
                              "type": "null"
                            }
                          ]
                        },
                        "horizon": {
                          "type": "object",
                          "properties": {
                            "on": {
                              "type": "string",
                              "format": "date"
                            },
                            "within_days": {
                              "type": "number"
                            },
                            "ending": {
                              "type": "array",
                              "items": {
                                "type": "object",
                                "properties": {
                                  "code": {
                                    "type": "string"
                                  },
                                  "jurisdiction": {
                                    "type": "string"
                                  },
                                  "valid_until": {
                                    "type": "string",
                                    "format": "date"
                                  },
                                  "days_left": {
                                    "type": "number"
                                  },
                                  "successor": {
                                    "enum": [
                                      "none",
                                      "proposed",
                                      "accepted"
                                    ],
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "code",
                                  "jurisdiction",
                                  "valid_until",
                                  "days_left",
                                  "successor"
                                ]
                              }
                            }
                          },
                          "required": [
                            "on",
                            "within_days",
                            "ending"
                          ]
                        },
                        "sources": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "publisher": {
                                "type": "string"
                              },
                              "url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "page_url": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "uri"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "layer": {
                                "type": "string"
                              },
                              "licence": {
                                "type": "string"
                              },
                              "expected_cadence": {
                                "type": "string",
                                "pattern": "^P(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?$"
                              },
                              "watched_since": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "checks_30d": {
                                "type": "number"
                              },
                              "last_checked_at": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_http_status": {
                                "anyOf": [
                                  {
                                    "type": "number"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_result": {
                                "anyOf": [
                                  {
                                    "enum": [
                                      "unchanged",
                                      "changed",
                                      "first_seen",
                                      "broken",
                                      "challenged",
                                      "disallowed",
                                      "recorded"
                                    ],
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_refusal": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "first_seen_at": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_changed_at": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_good_at": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "overdue": {
                                "type": "boolean"
                              }
                            },
                            "required": [
                              "title",
                              "publisher",
                              "url",
                              "page_url",
                              "layer",
                              "licence",
                              "expected_cadence",
                              "watched_since",
                              "checks_30d",
                              "last_checked_at",
                              "last_http_status",
                              "last_result",
                              "last_refusal",
                              "first_seen_at",
                              "last_changed_at",
                              "last_good_at",
                              "overdue"
                            ]
                          }
                        },
                        "datasets": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "title": {
                                "type": "string"
                              },
                              "publisher": {
                                "type": "string"
                              },
                              "version": {
                                "type": "string"
                              },
                              "licence": {
                                "type": "string"
                              },
                              "licence_title": {
                                "type": "string"
                              },
                              "licence_url": {
                                "type": "string",
                                "format": "uri"
                              },
                              "notice": {
                                "anyOf": [
                                  {
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "imported_at": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "state": {
                                "enum": [
                                  "open",
                                  "approved",
                                  "applied"
                                ],
                                "type": "string"
                              },
                              "applied_at": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              }
                            },
                            "required": [
                              "title",
                              "publisher",
                              "version",
                              "licence",
                              "licence_title",
                              "licence_url",
                              "notice",
                              "imported_at",
                              "state",
                              "applied_at"
                            ]
                          }
                        },
                        "jobs": {
                          "type": "array",
                          "items": {
                            "type": "object",
                            "properties": {
                              "job": {
                                "type": "string"
                              },
                              "cadence": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^P(?=\\d|T\\d)(\\d+Y)?(\\d+M)?(\\d+D)?(T(\\d+H)?(\\d+M)?(\\d+S)?)?$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_started_at": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_finished_at": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_outcome": {
                                "anyOf": [
                                  {
                                    "enum": [
                                      "scheduled",
                                      "running",
                                      "succeeded",
                                      "failed",
                                      "cancelled"
                                    ],
                                    "type": "string"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "last_succeeded_at": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "format": "date-time"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "runs_7d": {
                                "type": "number"
                              },
                              "failed_7d": {
                                "type": "number"
                              }
                            },
                            "required": [
                              "job",
                              "cadence",
                              "last_started_at",
                              "last_finished_at",
                              "last_outcome",
                              "last_succeeded_at",
                              "runs_7d",
                              "failed_7d"
                            ]
                          }
                        }
                      },
                      "required": [
                        "facts",
                        "horizon",
                        "sources",
                        "datasets",
                        "jobs"
                      ]
                    },
                    "usage": {
                      "$ref": "#/components/schemas/Usage"
                    }
                  }
                }
              }
            }
          },
          "503": {
            "description": "`database_unavailable`: The ledger database cannot be reached right now.",
            "content": {
              "application/problem+json": {
                "schema": {
                  "$ref": "#/components/schemas/Problem"
                }
              }
            }
          }
        }
      }
    }
  },
  "components": {
    "securitySchemes": {
      "bearer": {
        "type": "http",
        "scheme": "bearer",
        "description": "A key from POST /v1/trial-keys."
      }
    },
    "schemas": {
      "Usage": {
        "type": "object",
        "properties": {
          "request_id": {
            "type": "string",
            "format": "uuid"
          },
          "action": {
            "type": "string"
          },
          "plan": {
            "type": [
              "string",
              "null"
            ]
          },
          "meter": {
            "type": [
              "string",
              "null"
            ]
          },
          "quantity": {
            "type": "integer"
          },
          "included": {
            "type": [
              "integer",
              "null"
            ]
          },
          "used": {
            "type": [
              "integer",
              "null"
            ]
          },
          "remaining": {
            "type": [
              "integer",
              "null"
            ]
          }
        }
      },
      "Problem": {
        "type": "object",
        "required": [
          "type",
          "title",
          "status",
          "code"
        ],
        "properties": {
          "type": {
            "type": "string",
            "format": "uri",
            "description": "https://montaye.com/refusals/<code>"
          },
          "title": {
            "type": "string"
          },
          "status": {
            "type": "integer"
          },
          "detail": {
            "type": "string"
          },
          "code": {
            "type": "string",
            "enum": [
              "input_invalid",
              "parameter_missing",
              "jurisdiction_unsupported",
              "table_not_effective",
              "key_missing",
              "key_invalid",
              "trial_exhausted",
              "plan_excludes_action",
              "billing_limit_reached",
              "rate_limited",
              "database_unavailable",
              "not_found",
              "method_not_allowed",
              "session_missing",
              "grant_missing",
              "quota_exhausted",
              "plan_unknown",
              "key_unknown",
              "payments_unavailable",
              "payment_event_invalid",
              "mail_unavailable",
              "ci_report_invalid",
              "business_unknown",
              "legal_form_unknown",
              "identifier_scheme_unknown",
              "identifier_invalid",
              "file_unknown",
              "file_kind_unknown",
              "file_type_unsupported",
              "file_too_large",
              "trait_field_unknown",
              "jurisdiction_unknown",
              "obligation_unknown",
              "obligation_step_invalid",
              "party_unknown",
              "standard_unknown",
              "standard_part_unknown",
              "term_unknown",
              "term_not_ruled",
              "rule_not_in_force"
            ]
          },
          "retryable": {
            "type": "boolean"
          },
          "parameter": {
            "type": "string"
          },
          "request_id": {
            "type": "string"
          }
        }
      }
    }
  }
}
