{
    "$schema":  "https://json-schema.org/draft/2020-12/schema",
    "$id":  "https://www.article11.ai/schemas/openreceipt.v1.json",
    "title":  "A11 OpenReceipt v1",
    "description":  "A verifiable record of what an agent read, checked, and claimed, under what authority, and with what remaining uncertainty. OpenReceipt produces verifiable records, not certifications: it proves what was read, checked, and claimed, and by whom; it does not certify compliance, safety, or legal sufficiency.",
    "$comment":  "Extension metadata (license, authors, canonicalization) lives under the single x_a11 keyword. Strict-mode validators: whitelist x_a11 or run non-strict; unknown keywords are legal JSON Schema annotations.",
    "x_a11":  {
                  "license":  "CC0-1.0",
                  "authors":  [
                                  {
                                      "name":  "Steve Sonza",
                                      "role":  "THE_BRIDGE, human author and final authority",
                                      "kind":  "human"
                                  },
                                  {
                                      "name":  "S2_CASE",
                                      "role":  "schema design, receipt architecture",
                                      "kind":  "ai",
                                      "model":  "Claude, by Anthropic"
                                  },
                                  {
                                      "name":  "S_CODEX",
                                      "role":  "boundary review, overclaim guard",
                                      "kind":  "ai",
                                      "model":  "GPT-5 class, by OpenAI"
                                  }
                              ],
                  "canonicalization":  "RFC 8785 JSON Canonicalization Scheme. To hash a receipt, remove the signature object, canonicalize per RFC 8785, then SHA-256 the UTF-8 bytes. To sign a receipt, remove the signature object, canonicalize per RFC 8785, and Ed25519-sign the UTF-8 bytes of that canonical unsigned receipt. Signatures cover the canonical unsigned receipt bytes."
              },
    "type":  "object",
    "required":  [
                     "schema",
                     "subject",
                     "reader",
                     "decision",
                     "issued_at",
                     "disclaimer"
                 ],
    "additionalProperties":  false,
    "properties":  {
                       "schema":  {
                                      "const":  "article11.openreceipt.v1"
                                  },
                       "subject":  {
                                       "type":  "object",
                                       "description":  "What the receipt is about. Hash-only by design: there is no field for raw content and there never will be in v1.",
                                       "required":  [
                                                        "type",
                                                        "content_sha256"
                                                    ],
                                       "additionalProperties":  false,
                                       "properties":  {
                                                          "type":  {
                                                                       "enum":  [
                                                                                    "document",
                                                                                    "prompt",
                                                                                    "policy",
                                                                                    "action",
                                                                                    "dataset",
                                                                                    "other"
                                                                                ]
                                                                   },
                                                          "content_sha256":  {
                                                                                 "type":  "string",
                                                                                 "pattern":  "^[a-f0-9]{64}$"
                                                                             },
                                                          "content_bytes":  {
                                                                                "type":  "integer",
                                                                                "minimum":  0
                                                                            },
                                                          "label":  {
                                                                        "type":  "string",
                                                                        "maxLength":  120
                                                                    }
                                                      }
                                   },
                       "reader":  {
                                      "type":  "object",
                                      "required":  [
                                                       "agent"
                                                   ],
                                      "additionalProperties":  false,
                                      "properties":  {
                                                         "agent":  {
                                                                       "type":  "string",
                                                                       "maxLength":  120
                                                                   },
                                                         "model":  {
                                                                       "type":  "string",
                                                                       "maxLength":  120
                                                                   },
                                                         "operator":  {
                                                                          "type":  "string",
                                                                          "maxLength":  120
                                                                      }
                                                     }
                                  },
                       "read":  {
                                    "type":  "array",
                                    "maxItems":  20,
                                    "items":  {
                                                  "type":  "object",
                                                  "required":  [
                                                                   "source"
                                                               ],
                                                  "additionalProperties":  false,
                                                  "properties":  {
                                                                     "source":  {
                                                                                    "type":  "string",
                                                                                    "maxLength":  300
                                                                                },
                                                                     "sha256":  {
                                                                                    "type":  "string",
                                                                                    "pattern":  "^[a-f0-9]{64}$"
                                                                                },
                                                                     "retrieved_at":  {
                                                                                          "type":  "string",
                                                                                          "format":  "date-time"
                                                                                      }
                                                                 }
                                              }
                                },
                       "checks":  {
                                      "type":  "array",
                                      "maxItems":  20,
                                      "items":  {
                                                    "type":  "object",
                                                    "required":  [
                                                                     "name",
                                                                     "result"
                                                                 ],
                                                    "additionalProperties":  false,
                                                    "properties":  {
                                                                       "name":  {
                                                                                    "type":  "string",
                                                                                    "maxLength":  120
                                                                                },
                                                                       "result":  {
                                                                                      "enum":  [
                                                                                                   "pass",
                                                                                                   "fail",
                                                                                                   "unverifiable"
                                                                                               ]
                                                                                  },
                                                                       "detail":  {
                                                                                      "type":  "string",
                                                                                      "maxLength":  300
                                                                                  }
                                                                   }
                                                }
                                  },
                       "decision":  {
                                        "description":  "Three-state decision language. UNVERIFIABLE is a first-class answer, not a failure.",
                                        "enum":  [
                                                     "ALLOW",
                                                     "DENY",
                                                     "UNVERIFIABLE"
                                                 ]
                                    },
                       "authority":  {
                                         "type":  "object",
                                         "additionalProperties":  false,
                                         "properties":  {
                                                            "granted_by":  {
                                                                               "type":  "string",
                                                                               "maxLength":  120
                                                                           },
                                                            "scope":  {
                                                                          "type":  "string",
                                                                          "maxLength":  300
                                                                      }
                                                        }
                                     },
                       "uncertainties":  {
                                             "type":  "array",
                                             "maxItems":  10,
                                             "items":  {
                                                           "type":  "string",
                                                           "maxLength":  300
                                                       }
                                         },
                       "constitution":  {
                                            "type":  "object",
                                            "additionalProperties":  false,
                                            "properties":  {
                                                               "version":  {
                                                                               "type":  "string",
                                                                               "maxLength":  40
                                                                           },
                                                               "sha256":  {
                                                                              "type":  "string",
                                                                              "pattern":  "^[a-f0-9]{64}$"
                                                                          }
                                                           }
                                        },
                       "issued_at":  {
                                         "type":  "string",
                                         "format":  "date-time"
                                     },
                       "nonce":  {
                                     "type":  "string",
                                     "maxLength":  64
                                 },
                       "signature":  {
                                         "type":  "object",
                                         "description":  "Optional in v1. A receipt with a valid signature is a signed receipt; without one it is a plain receipt. Verification tooling ships in the SDK lane.",
                                         "required":  [
                                                          "alg",
                                                          "public_key",
                                                          "signature"
                                                      ],
                                         "additionalProperties":  false,
                                         "properties":  {
                                                            "alg":  {
                                                                        "enum":  [
                                                                                     "ed25519"
                                                                                 ]
                                                                    },
                                                            "public_key":  {
                                                                               "type":  "string",
                                                                               "maxLength":  120,
                                                                               "description":  "Base64 of the raw 32-byte Ed25519 public key."
                                                                           },
                                                            "signature":  {
                                                                              "type":  "string",
                                                                              "maxLength":  200,
                                                                              "description":  "Base64 of the raw 64-byte Ed25519 signature over the UTF-8 bytes of the RFC 8785 canonical form of the receipt with the signature object removed."
                                                                          }
                                                        }
                                     },
                       "disclaimer":  {
                                          "const":  "OpenReceipt produces verifiable records, not certifications: it proves what was read, checked, and claimed, and by whom; it does not certify compliance, safety, or legal sufficiency."
                                      }
                   }
}
