{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "https://discern.sh/schema/v1/discern-proof-note.schema.json",
  "x-discern-compatibility-policy": "result-output",
  "title": "DiscernProofNoteEnvelope",
  "description": "The discern Proof envelope follows the Dead Simple Signing Envelope (DSSE) field and payload boundary. discern attaches it to a landed commit as a Git note under refs/notes/discern. The note body is this object as one line of JSON plus a newline. Decode payload from Base64 and keep those bytes unchanged: a DSSE v1 signature is over PAE(UTF8(payloadType), payload bytes). No other envelope field enters that signature input. payloadType points to the payload definition in this schema. Standard signed DSSE envelopes carry at least one signature; discern's unsigned extension carries an empty signatures array. keyid is an unauthenticated lookup hint; a signing profile and trust policy decide the algorithm, verification key, and identity.",
  "x-discern-payload-type": "https://discern.sh/schema/v1/discern-proof-note.schema.json#/$defs/DiscernProofNotePayload",
  "x-discern-dsse-envelope": "https://github.com/secure-systems-lab/dsse/blob/v1.0.2/envelope.md",
  "x-discern-dsse-protocol": "https://github.com/secure-systems-lab/dsse/blob/v1.0.2/protocol.md",
  "type": "object",
  "properties": {
    "payloadType": {
      "type": "string",
      "const": "https://discern.sh/schema/v1/discern-proof-note.schema.json#/$defs/DiscernProofNotePayload",
      "description": "The Proof payload's published type. DSSE authenticates this value together with the decoded payload bytes."
    },
    "payload": {
      "type": "string",
      "description": "Standard or URL-safe Base64-encoded UTF-8 JSON matching DiscernProofNotePayload, with or without padding. These decoded bytes are the DSSE payload and must not be reserialized before verification.",
      "contentEncoding": "base64",
      "contentMediaType": "application/json",
      "contentSchema": {
        "$ref": "#/$defs/DiscernProofNotePayload"
      }
    },
    "signatures": {
      "type": "array",
      "items": {
        "type": "object",
        "properties": {
          "keyid": {
            "type": "string",
            "description": "Optional key-selection hint. It is not authenticated by DSSE and must not be used as evidence that a key is trusted."
          },
          "sig": {
            "type": "string",
            "description": "The Base64-encoded signature over DSSE v1 pre-authentication encoding of payloadType and the decoded payload bytes."
          }
        },
        "required": [
          "sig"
        ],
        "description": "One DSSE signature over this envelope's payload type and decoded payload bytes. No signing profile or trust policy is selected today."
      },
      "description": "DSSE signatures over this payload. Standard signed envelopes carry at least one. Current unsigned writers emit discern's empty-array extension."
    }
  },
  "required": [
    "payloadType",
    "payload",
    "signatures"
  ],
  "$defs": {
    "DiscernProofClaim": {
      "title": "DiscernProofClaim",
      "type": "object",
      "properties": {
        "completion": {
          "type": "object",
          "properties": {
            "candidate_id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "proof_id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "candidate": {
              "type": "object",
              "properties": {
                "attempt_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "sources": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "effort_id": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[A-Za-z0-9_-]+$"
                      },
                      "branch": {
                        "type": "string",
                        "pattern": "^refs\\/heads\\/[^\\s~^:?*\\[\\\\]+$"
                      },
                      "head": {
                        "type": "string",
                        "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                      },
                      "tree": {
                        "type": "string",
                        "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                      }
                    },
                    "required": [
                      "effort_id",
                      "branch",
                      "head",
                      "tree"
                    ]
                  }
                },
                "predecessor": {
                  "type": "string",
                  "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                },
                "head": {
                  "type": "string",
                  "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                },
                "tree": {
                  "type": "string",
                  "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                },
                "policy": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "requirement_set": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "integration": {
                  "type": "object",
                  "properties": {
                    "procedure": {
                      "type": "string",
                      "const": "merge-trunk"
                    }
                  },
                  "required": [
                    "procedure"
                  ]
                }
              },
              "required": [
                "attempt_id",
                "sources",
                "predecessor",
                "head",
                "tree",
                "policy",
                "requirement_set"
              ]
            },
            "validation": {
              "type": "object",
              "properties": {
                "attempt_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "candidate_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "head": {
                  "type": "string",
                  "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                },
                "policy": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "requirement_set": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "mode": {
                  "type": "string",
                  "enum": [
                    "strict",
                    "report"
                  ],
                  "x-discern-vocabulary": "x-discern-validation-modes"
                },
                "requirements": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[A-Za-z0-9_-]+$"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "job",
                          "scope",
                          "standard"
                        ],
                        "x-discern-vocabulary": "x-discern-requirement-kinds"
                      },
                      "definition": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{64}$"
                      }
                    },
                    "required": [
                      "id",
                      "kind",
                      "definition"
                    ]
                  }
                },
                "receipts": {
                  "minItems": 1,
                  "type": "array",
                  "items": {
                    "type": "object",
                    "properties": {
                      "requirement": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "string",
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          "kind": {
                            "type": "string",
                            "enum": [
                              "job",
                              "scope",
                              "standard"
                            ],
                            "x-discern-vocabulary": "x-discern-requirement-kinds"
                          },
                          "definition": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          }
                        },
                        "required": [
                          "id",
                          "kind",
                          "definition"
                        ]
                      },
                      "evidence_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "candidate_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "policy": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{64}$"
                      },
                      "reading": {
                        "anyOf": [
                          {
                            "type": "number"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      }
                    },
                    "required": [
                      "requirement",
                      "evidence_id",
                      "candidate_id",
                      "policy",
                      "reading"
                    ]
                  }
                },
                "assembled_at": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                },
                "review": {
                  "type": "object",
                  "properties": {
                    "attempt_id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "candidate_id": {
                      "type": "string",
                      "format": "uuid",
                      "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                    },
                    "path": {
                      "type": "string",
                      "minLength": 1
                    },
                    "digest": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    },
                    "bytes": {
                      "type": "integer",
                      "minimum": 0,
                      "maximum": 9007199254740991
                    }
                  },
                  "required": [
                    "attempt_id",
                    "candidate_id",
                    "path",
                    "digest",
                    "bytes"
                  ]
                }
              },
              "required": [
                "attempt_id",
                "candidate_id",
                "head",
                "policy",
                "requirement_set",
                "mode",
                "requirements",
                "receipts",
                "assembled_at"
              ]
            },
            "components": {
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "evidence": {
                    "type": "object",
                    "properties": {
                      "attempt_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "candidate_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "sequence": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "purpose": {
                        "type": "string",
                        "enum": [
                          "completion",
                          "diagnostic"
                        ],
                        "x-discern-vocabulary": "x-discern-evidence-purposes"
                      },
                      "mode": {
                        "type": "string",
                        "enum": [
                          "strict",
                          "report"
                        ],
                        "x-discern-vocabulary": "x-discern-validation-modes"
                      },
                      "applicability": {
                        "type": "object",
                        "properties": {
                          "producer": {
                            "type": "string",
                            "minLength": 1
                          },
                          "policy": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          },
                          "protected_definitions": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          },
                          "command": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          },
                          "extractor": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          },
                          "inputs": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          },
                          "denominator_inputs": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          },
                          "toolchain": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          },
                          "environment": {
                            "type": "string",
                            "pattern": "^[0-9a-f]{64}$"
                          },
                          "seed": {
                            "type": "integer",
                            "minimum": -9007199254740991,
                            "maximum": 9007199254740991
                          },
                          "closure": {
                            "oneOf": [
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "declared"
                                  },
                                  "declaration": {
                                    "type": "string",
                                    "pattern": "^[0-9a-f]{64}$"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "declaration"
                                ]
                              },
                              {
                                "type": "object",
                                "properties": {
                                  "kind": {
                                    "type": "string",
                                    "const": "candidate"
                                  },
                                  "head": {
                                    "type": "string",
                                    "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                                  }
                                },
                                "required": [
                                  "kind",
                                  "head"
                                ]
                              }
                            ]
                          }
                        },
                        "required": [
                          "producer",
                          "policy",
                          "protected_definitions",
                          "command",
                          "extractor",
                          "inputs",
                          "denominator_inputs",
                          "toolchain",
                          "environment",
                          "seed",
                          "closure"
                        ]
                      },
                      "finished_at": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      },
                      "artifacts": {
                        "type": "array",
                        "items": {
                          "type": "object",
                          "properties": {
                            "attempt_id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "candidate_id": {
                              "type": "string",
                              "format": "uuid",
                              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                            },
                            "path": {
                              "type": "string",
                              "minLength": 1
                            },
                            "digest": {
                              "type": "string",
                              "pattern": "^[0-9a-f]{64}$"
                            },
                            "bytes": {
                              "type": "integer",
                              "minimum": 0,
                              "maximum": 9007199254740991
                            }
                          },
                          "required": [
                            "attempt_id",
                            "candidate_id",
                            "path",
                            "digest",
                            "bytes"
                          ]
                        }
                      },
                      "outcome": {
                        "oneOf": [
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "passed"
                              },
                              "capture_complete": {
                                "type": "boolean",
                                "const": true
                              },
                              "metrics": {
                                "type": "object",
                                "propertyNames": {
                                  "type": "string"
                                },
                                "additionalProperties": {
                                  "type": "number"
                                }
                              }
                            },
                            "required": [
                              "kind",
                              "capture_complete",
                              "metrics"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "failed"
                              },
                              "reason": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "kind",
                              "reason"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "cancelled"
                              },
                              "reason": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "kind",
                              "reason"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "unrun"
                              },
                              "reason": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "kind",
                              "reason"
                            ]
                          },
                          {
                            "type": "object",
                            "properties": {
                              "kind": {
                                "type": "string",
                                "const": "stale"
                              },
                              "reason": {
                                "type": "string",
                                "minLength": 1
                              }
                            },
                            "required": [
                              "kind",
                              "reason"
                            ]
                          }
                        ]
                      }
                    },
                    "required": [
                      "attempt_id",
                      "candidate_id",
                      "sequence",
                      "purpose",
                      "mode",
                      "applicability",
                      "finished_at",
                      "artifacts",
                      "outcome"
                    ]
                  }
                },
                "required": [
                  "id",
                  "evidence"
                ]
              }
            },
            "attempts": {
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "identity": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "candidate_id": {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      "executor": {
                        "type": "object",
                        "properties": {
                          "operation_id": {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          "originating_effort": {
                            "type": "string",
                            "minLength": 1,
                            "pattern": "^[A-Za-z0-9_-]+$"
                          },
                          "started_at": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          },
                          "operation_handle": {
                            "type": "string"
                          }
                        },
                        "required": [
                          "operation_id",
                          "originating_effort",
                          "started_at"
                        ]
                      },
                      "sequence": {
                        "type": "integer",
                        "exclusiveMinimum": 0,
                        "maximum": 9007199254740991
                      },
                      "rerun_of": {
                        "anyOf": [
                          {
                            "type": "string",
                            "format": "uuid",
                            "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                          },
                          {
                            "type": "null"
                          }
                        ]
                      },
                      "started_at": {
                        "type": "integer",
                        "minimum": 0,
                        "maximum": 9007199254740991
                      }
                    },
                    "required": [
                      "id",
                      "candidate_id",
                      "executor",
                      "sequence",
                      "rerun_of",
                      "started_at"
                    ]
                  },
                  "subjects": {
                    "type": "array",
                    "items": {
                      "type": "string",
                      "pattern": "^[0-9a-f]{64}$"
                    }
                  },
                  "purpose": {
                    "type": "string",
                    "enum": [
                      "completion",
                      "diagnostic"
                    ],
                    "x-discern-vocabulary": "x-discern-evidence-purposes"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "strict",
                      "report"
                    ],
                    "x-discern-vocabulary": "x-discern-validation-modes"
                  },
                  "state": {
                    "oneOf": [
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "planning"
                          },
                          "claim": {
                            "type": "object",
                            "properties": {
                              "token": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "executor": {
                                "type": "object",
                                "properties": {
                                  "operation_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                  },
                                  "originating_effort": {
                                    "type": "string",
                                    "minLength": 1,
                                    "pattern": "^[A-Za-z0-9_-]+$"
                                  },
                                  "started_at": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "operation_handle": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "operation_id",
                                  "originating_effort",
                                  "started_at"
                                ]
                              },
                              "acquired_at": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "renewed_at": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "expires_at": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "token",
                              "executor",
                              "acquired_at",
                              "expires_at"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "claim"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "claimed"
                          },
                          "claim": {
                            "type": "object",
                            "properties": {
                              "token": {
                                "type": "string",
                                "format": "uuid",
                                "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                              },
                              "executor": {
                                "type": "object",
                                "properties": {
                                  "operation_id": {
                                    "type": "string",
                                    "format": "uuid",
                                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                                  },
                                  "originating_effort": {
                                    "type": "string",
                                    "minLength": 1,
                                    "pattern": "^[A-Za-z0-9_-]+$"
                                  },
                                  "started_at": {
                                    "type": "integer",
                                    "minimum": 0,
                                    "maximum": 9007199254740991
                                  },
                                  "operation_handle": {
                                    "type": "string"
                                  }
                                },
                                "required": [
                                  "operation_id",
                                  "originating_effort",
                                  "started_at"
                                ]
                              },
                              "acquired_at": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "renewed_at": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              },
                              "expires_at": {
                                "type": "integer",
                                "minimum": 0,
                                "maximum": 9007199254740991
                              }
                            },
                            "required": [
                              "token",
                              "executor",
                              "acquired_at",
                              "expires_at"
                            ]
                          }
                        },
                        "required": [
                          "kind",
                          "claim"
                        ]
                      },
                      {
                        "type": "object",
                        "properties": {
                          "kind": {
                            "type": "string",
                            "const": "finished"
                          },
                          "outcome": {
                            "type": "string",
                            "x-discern-vocabulary": "x-discern-attempt-outcomes"
                          },
                          "finished_at": {
                            "type": "integer",
                            "minimum": 0,
                            "maximum": 9007199254740991
                          }
                        },
                        "required": [
                          "kind",
                          "outcome",
                          "finished_at"
                        ]
                      }
                    ]
                  }
                },
                "required": [
                  "identity",
                  "subjects",
                  "purpose",
                  "mode",
                  "state"
                ]
              }
            },
            "executors": {
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "operation_id": {
                    "type": "string",
                    "format": "uuid",
                    "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                  },
                  "originating_effort": {
                    "type": "string",
                    "minLength": 1,
                    "pattern": "^[A-Za-z0-9_-]+$"
                  },
                  "started_at": {
                    "type": "integer",
                    "minimum": 0,
                    "maximum": 9007199254740991
                  },
                  "operation_handle": {
                    "type": "string"
                  }
                },
                "required": [
                  "operation_id",
                  "originating_effort",
                  "started_at"
                ]
              }
            }
          },
          "required": [
            "candidate_id",
            "proof_id",
            "candidate",
            "validation",
            "components",
            "attempts",
            "executors"
          ]
        },
        "branch": {
          "type": "string"
        },
        "trunk": {
          "type": "string"
        },
        "head": {
          "type": "string"
        },
        "files_total": {
          "type": "number"
        },
        "insertions": {
          "type": "number"
        },
        "deletions": {
          "type": "number"
        },
        "mode": {
          "type": "string",
          "enum": [
            "strict",
            "report"
          ],
          "x-discern-vocabulary": "x-discern-validation-modes"
        },
        "checkpoint_drops": {
          "type": "array",
          "items": {
            "oneOf": [
              {
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "const": "policy"
                  },
                  "checkpoint": {
                    "type": "null"
                  },
                  "mode": {
                    "type": "null"
                  },
                  "policy_commit": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string",
                    "x-discern-vocabulary": "x-discern-policy-checkpoint-drop-reasons"
                  },
                  "account": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "scope",
                  "checkpoint",
                  "mode",
                  "reason",
                  "account"
                ]
              },
              {
                "type": "object",
                "properties": {
                  "scope": {
                    "type": "string",
                    "const": "checkpoint"
                  },
                  "checkpoint": {
                    "type": "string"
                  },
                  "mode": {
                    "type": "string",
                    "enum": [
                      "stop",
                      "advise"
                    ],
                    "x-discern-vocabulary": "x-discern-checkpoint-modes"
                  },
                  "policy_commit": {
                    "type": "string"
                  },
                  "reason": {
                    "type": "string",
                    "x-discern-vocabulary": "x-discern-entry-checkpoint-drop-reasons"
                  },
                  "account": {
                    "type": "string",
                    "maxLength": 500
                  }
                },
                "required": [
                  "scope",
                  "checkpoint",
                  "mode",
                  "policy_commit",
                  "reason",
                  "account"
                ]
              }
            ]
          }
        },
        "standard_proposals": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "standard": {
                "type": "string"
              },
              "commit": {
                "type": "string"
              },
              "bound_commit": {
                "type": "string"
              },
              "measured_commit": {
                "type": "string"
              },
              "definition_fingerprint": {
                "type": "string"
              },
              "trunk": {
                "type": "string"
              },
              "trunk_commit": {
                "type": "string"
              },
              "direction": {
                "type": "string",
                "enum": [
                  "up",
                  "down"
                ],
                "x-discern-vocabulary": "x-discern-proposal-directions"
              },
              "trunk_limit": {
                "type": "number"
              },
              "proposed_limit": {
                "type": "number"
              },
              "measurement": {
                "type": "number"
              },
              "delta": {
                "type": "number"
              },
              "reason": {
                "type": "string"
              },
              "evidence_paths": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "standard",
              "commit",
              "bound_commit",
              "measured_commit",
              "definition_fingerprint",
              "trunk",
              "trunk_commit",
              "direction",
              "trunk_limit",
              "proposed_limit",
              "measurement",
              "delta",
              "reason",
              "evidence_paths"
            ]
          }
        }
      },
      "required": [
        "completion",
        "branch",
        "trunk",
        "head",
        "files_total",
        "insertions",
        "deletions"
      ],
      "description": "The durable structured gate claim: branch and trunk labels, the validated commit abbreviation, and whole-diff statistics. The payload's full commit subject remains the Proof identity."
    },
    "DiscernProofPresentation": {
      "title": "DiscernProofPresentation",
      "type": "object",
      "properties": {
        "line": {
          "type": "string"
        },
        "markdown": {
          "type": "string"
        }
      },
      "required": [
        "line",
        "markdown"
      ],
      "description": "The Proof line and Markdown page derived from the gate result for human inspection. Verification policy uses the structured claim, never these renderings."
    },
    "DiscernAcceptanceEvidence": {
      "title": "DiscernAcceptanceEvidence",
      "type": "object",
      "properties": {
        "consent": {
          "type": "object",
          "properties": {
            "source": {
              "type": "string",
              "x-discern-vocabulary": "x-discern-consent-sources"
            },
            "scopes": {
              "type": "array",
              "items": {
                "type": "string"
              }
            }
          },
          "required": [
            "source"
          ]
        },
        "variances": {
          "type": "array",
          "items": {
            "$ref": "#/$defs/DiscernAuthorizedVariance"
          }
        },
        "standard_proposals": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "standard": {
                "type": "string"
              },
              "commit": {
                "type": "string"
              },
              "bound_commit": {
                "type": "string"
              },
              "measured_commit": {
                "type": "string"
              },
              "definition_fingerprint": {
                "type": "string"
              },
              "trunk": {
                "type": "string"
              },
              "trunk_commit": {
                "type": "string"
              },
              "direction": {
                "type": "string",
                "enum": [
                  "up",
                  "down"
                ],
                "x-discern-vocabulary": "x-discern-proposal-directions"
              },
              "trunk_limit": {
                "type": "number"
              },
              "proposed_limit": {
                "type": "number"
              },
              "measurement": {
                "type": "number"
              },
              "delta": {
                "type": "number"
              },
              "reason": {
                "type": "string"
              },
              "evidence_paths": {
                "minItems": 1,
                "type": "array",
                "items": {
                  "type": "string",
                  "minLength": 1
                }
              }
            },
            "required": [
              "standard",
              "commit",
              "bound_commit",
              "measured_commit",
              "definition_fingerprint",
              "trunk",
              "trunk_commit",
              "direction",
              "trunk_limit",
              "proposed_limit",
              "measurement",
              "delta",
              "reason",
              "evidence_paths"
            ]
          }
        }
      },
      "required": [
        "consent",
        "variances",
        "standard_proposals"
      ],
      "description": "How one landing was authorized: the consent evidence, each owner-authorized variance for a declared-unmet checkpoint, and each exact owner-approved standard limit. A reader can therefore distinguish a conclusion awaiting a decision from one the owner authorized to land."
    },
    "DiscernAuthorizedVariance": {
      "title": "DiscernAuthorizedVariance",
      "type": "object",
      "properties": {
        "checkpoint": {
          "type": "string"
        },
        "definition_hash": {
          "type": "string"
        },
        "subject": {
          "type": "string"
        },
        "why": {
          "type": "string"
        }
      },
      "required": [
        "checkpoint",
        "definition_hash",
        "subject",
        "why"
      ],
      "description": "Owner authorization to land one declared-unmet checkpoint, bound to the exact declaration (checkpoint, definition hash, subject fingerprint, rationale) and the commit it landed with. Never a future policy."
    },
    "DiscernEmergencyExceptionPayload": {
      "title": "DiscernEmergencyExceptionPayload",
      "type": "object",
      "properties": {
        "kind": {
          "type": "string",
          "const": "emergency-exception"
        },
        "version": {
          "type": "number",
          "const": 1
        },
        "landing_id": {
          "type": "string",
          "format": "uuid",
          "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
        },
        "claim": {
          "type": "object",
          "properties": {
            "kind": {
              "type": "string",
              "const": "exception"
            },
            "authorization_id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "authorized_at": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "actual_trunk": {
              "type": "string",
              "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
            },
            "source": {
              "type": "object",
              "properties": {
                "effort_id": {
                  "type": "string",
                  "minLength": 1,
                  "pattern": "^[A-Za-z0-9_-]+$"
                },
                "branch": {
                  "type": "string",
                  "pattern": "^refs\\/heads\\/[^\\s~^:?*\\[\\\\]+$"
                },
                "head": {
                  "type": "string",
                  "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                },
                "tree": {
                  "type": "string",
                  "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
                }
              },
              "required": [
                "effort_id",
                "branch",
                "head",
                "tree"
              ]
            },
            "candidate_id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "candidate_head": {
              "type": "string",
              "pattern": "^(?:[0-9a-f]{40}|[0-9a-f]{64})$"
            },
            "policy": {
              "type": "string",
              "pattern": "^[0-9a-f]{64}$"
            },
            "review": {
              "type": "object",
              "properties": {
                "attempt_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "candidate_id": {
                  "type": "string",
                  "format": "uuid",
                  "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                },
                "path": {
                  "type": "string",
                  "minLength": 1
                },
                "digest": {
                  "type": "string",
                  "pattern": "^[0-9a-f]{64}$"
                },
                "bytes": {
                  "type": "integer",
                  "minimum": 0,
                  "maximum": 9007199254740991
                }
              },
              "required": [
                "attempt_id",
                "candidate_id",
                "path",
                "digest",
                "bytes"
              ]
            },
            "reason": {
              "type": "string",
              "minLength": 1
            },
            "exceptions": {
              "minItems": 1,
              "type": "array",
              "items": {
                "type": "object",
                "properties": {
                  "requirement": {
                    "type": "object",
                    "properties": {
                      "id": {
                        "type": "string",
                        "minLength": 1,
                        "pattern": "^[A-Za-z0-9_-]+$"
                      },
                      "kind": {
                        "type": "string",
                        "enum": [
                          "job",
                          "scope",
                          "standard"
                        ],
                        "x-discern-vocabulary": "x-discern-requirement-kinds"
                      },
                      "definition": {
                        "type": "string",
                        "pattern": "^[0-9a-f]{64}$"
                      }
                    },
                    "required": [
                      "id",
                      "kind",
                      "definition"
                    ]
                  },
                  "state": {
                    "type": "string",
                    "enum": [
                      "failed",
                      "unrun",
                      "stale"
                    ],
                    "x-discern-vocabulary": "x-discern-exception-states"
                  },
                  "evidence_id": {
                    "anyOf": [
                      {
                        "type": "string",
                        "format": "uuid",
                        "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
                      },
                      {
                        "type": "null"
                      }
                    ]
                  }
                },
                "required": [
                  "requirement",
                  "state",
                  "evidence_id"
                ]
              }
            }
          },
          "required": [
            "kind",
            "authorization_id",
            "authorized_at",
            "actual_trunk",
            "source",
            "candidate_id",
            "candidate_head",
            "policy",
            "reason",
            "exceptions"
          ]
        },
        "executor": {
          "type": "object",
          "properties": {
            "operation_id": {
              "type": "string",
              "format": "uuid",
              "pattern": "^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$"
            },
            "originating_effort": {
              "type": "string",
              "minLength": 1,
              "pattern": "^[A-Za-z0-9_-]+$"
            },
            "started_at": {
              "type": "integer",
              "minimum": 0,
              "maximum": 9007199254740991
            },
            "operation_handle": {
              "type": "string"
            }
          },
          "required": [
            "operation_id",
            "originating_effort",
            "started_at"
          ]
        }
      },
      "required": [
        "kind",
        "version",
        "landing_id",
        "claim",
        "executor"
      ],
      "description": "An emergency integration records exceptions and issues no passing Proof. The unsigned envelope records available facts without authenticating an owner."
    },
    "DiscernEmergencyExceptionEnvelope": {
      "title": "DiscernEmergencyExceptionEnvelope",
      "type": "object",
      "properties": {
        "payloadType": {
          "type": "string",
          "const": "https://discern.sh/schema/v1/discern-proof-note.schema.json#/$defs/DiscernEmergencyExceptionPayload"
        },
        "payload": {
          "type": "string",
          "description": "Base64-encoded emergency exception payload bytes. Preserve these bytes for future verification; this payload is never passing Proof."
        },
        "signatures": {
          "type": "array",
          "items": {
            "type": "object",
            "properties": {
              "keyid": {
                "type": "string",
                "description": "Optional key-selection hint. It is not authenticated by DSSE and must not be used as evidence that a key is trusted."
              },
              "sig": {
                "type": "string",
                "description": "The Base64-encoded signature over DSSE v1 pre-authentication encoding of payloadType and the decoded payload bytes."
              }
            },
            "required": [
              "sig"
            ],
            "description": "One DSSE signature over this envelope's payload type and decoded payload bytes. No signing profile or trust policy is selected today."
          },
          "description": "DSSE signatures over this payload. Standard signed envelopes carry at least one. Current unsigned writers emit discern's empty-array extension."
        }
      },
      "required": [
        "payloadType",
        "payload",
        "signatures"
      ],
      "description": "An unsigned or future signed emergency envelope records an integration exception. It cannot attest passing validation."
    },
    "DiscernProofNotePayload": {
      "title": "DiscernProofNotePayload",
      "type": "object",
      "properties": {
        "subject": {
          "type": "object",
          "properties": {
            "commit": {
              "type": "string",
              "description": "The full object id of the validated, landed commit."
            }
          },
          "required": [
            "commit"
          ]
        },
        "proof": {
          "$ref": "#/$defs/DiscernProofClaim"
        },
        "presentation": {
          "$ref": "#/$defs/DiscernProofPresentation"
        },
        "acceptance": {
          "$ref": "#/$defs/DiscernAcceptanceEvidence"
        },
        "issuer": {
          "type": "object",
          "properties": {
            "name": {
              "type": "string",
              "description": "The issuer's asserted display name. A verified signature protects this text from alteration; trust policy decides who the signing key represents."
            },
            "email": {
              "type": "string",
              "description": "The issuer's asserted email address. A verified signature protects this text from alteration; trust policy decides who the signing key represents."
            },
            "key": {
              "type": "string",
              "description": "The issuer's asserted key or key reference. Verifiers use their signing profile and trust policy rather than trusting this value on its own."
            }
          },
          "description": "Identity details asserted by the Proof payload. A verified Dead Simple Signing Envelope (DSSE) signature protects these details from alteration but does not establish who controls the signing key. Current writers leave them absent."
        },
        "brief": {
          "type": "string",
          "description": "Reserved: a reference to a signed intent artifact. Current writers leave it absent."
        }
      },
      "required": [
        "subject",
        "proof",
        "presentation"
      ],
      "description": "The Proof claim carried as UTF-8 JSON in the DSSE payload: the landed commit, structured gate facts, separate human presentation, optional acceptance evidence (consent plus authorized variances), and optional issuer assertion and intent reference."
    }
  },
  "x-discern-policy-checkpoint-drop-reasons": [
    "merge_base_unresolved",
    "governing_config_unreadable",
    "governing_config_invalid",
    "open_question_store_unreadable",
    "open_question_store_corrupt",
    "declaration_evidence_unavailable",
    "strand_check_unavailable"
  ],
  "x-discern-entry-checkpoint-drop-reasons": [
    "checkpoint_missing_question",
    "checkpoint_question_file_missing",
    "checkpoint_question_file_invalid_path",
    "checkpoint_question_file_not_regular",
    "checkpoint_question_file_oversized",
    "checkpoint_question_file_invalid_utf8",
    "checkpoint_question_file_unreadable",
    "checkpoint_question_source_conflict",
    "checkpoint_selector_conflict",
    "checkpoint_unknown_scope",
    "effort_diff_unreadable",
    "trigger_content_unavailable",
    "trigger_history_unavailable",
    "when_spawn_failed",
    "when_timeout",
    "when_invalid_exit",
    "when_cancelled",
    "when_input_failed",
    "when_input_cleanup_failed",
    "when_output_limit",
    "open_question_store_rebuilt",
    "subject_unavailable",
    "open_question_store_write_failed"
  ],
  "x-discern-consent-sources": [
    "conversation",
    "standing-grant",
    "effort-grant"
  ],
  "x-discern-attempt-outcomes": [
    "passed",
    "failed",
    "cancelled"
  ]
}
