{
  "openapi": "3.1.0",
  "info": {
    "title": "Verdifax Orchestrator API",
    "version": "1.0.0",
    "description": "The Verdifax Orchestrator REST API.\n\n**Verification.** Download a run's sealed audit bundle from `GET /runs/{id}/artifacts` and\ncheck it offline with the open-source verifier,\n[verdifax-verify](https://github.com/Verdifax/verdifax-verify).\n\n**Authentication.** Most endpoints require an API key passed via the\n`X-Verdifax-Key` header. `/health`, `/version`, `/openapi.json` and\n`/dcae/verify` are anonymous (no key required), as are the two public\naudit-bundle routes, which serve only runs an admin has published.\n\n**Scope.** This document describes what a customer API key can call.\nAdministrative and billing routes are not listed.\n\n**Rate limiting.** Authenticated endpoints share a per-key budget\n(production default 1000 requests per minute).\n\n**Query values.** Each query value is given once. A request that gives any\nquery value more than once is refused with 400 and a message naming it,\nunless it adds `lenient=1`, which uses the first; `lenient` itself must be\ngiven once.\n",
    "contact": {
      "name": "Verdifax",
      "email": "team@verdifax.com",
      "url": "https://verdifax.com"
    },
    "license": {
      "name": "Proprietary",
      "url": "https://verdifax.com/legal/terms-conditions/"
    }
  },
  "servers": [
    {
      "url": "https://api.verdifax.com",
      "description": "Production"
    }
  ],
  "tags": [
    {
      "name": "Health",
      "description": "Liveness and deploy attestation. No auth."
    },
    {
      "name": "Execute",
      "description": "The core pipeline-execution surface."
    },
    {
      "name": "Runs",
      "description": "Sealed run records, which these routes only read, and the key's own request-key routes (POST and DELETE /keys/request-key), which register and clear that key."
    },
    {
      "name": "Verification",
      "description": "Re-derive sealed hashes from canonical preimages."
    },
    {
      "name": "CRES",
      "description": "Cryptographic Record Erasure System."
    },
    {
      "name": "Accounts",
      "description": "A company on Verdifax. Every key belongs to one account for life. The owner key manages member keys, the account policy, which every key must pass on top of its own, and the account's runs."
    },
    {
      "name": "Sign-off",
      "description": "An account's approvers sign off results: approve or reject one exact record, receipt or job, anchored on the public log."
    },
    {
      "name": "Signal feed",
      "description": "Every control signal in an account, ordered and checkable."
    },
    {
      "name": "Webhooks",
      "description": "Push the signal feed to an https receiver."
    }
  ],
  "components": {
    "securitySchemes": {
      "ApiKey": {
        "type": "apiKey",
        "in": "header",
        "name": "X-Verdifax-Key",
        "description": "An API key issued by Verdifax. It is stored hashed, and the secret is shown exactly once at creation."
      }
    },
    "schemas": {
      "Hex64": {
        "type": "string",
        "pattern": "^[0-9a-f]{64}$",
        "description": "64-character lowercase hex SHA-256 output.",
        "example": "27a729b99f9ed493956c7863611c88b3f79d3e1144b80a8cdfd34b061fc41b6f"
      },
      "RFC3339Nano": {
        "type": "string",
        "format": "date-time",
        "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]+)?Z$",
        "description": "UTC time, RFC 3339 with full nanosecond precision and Z suffix.",
        "example": "2026-05-07T15:30:00.000000000Z"
      },
      "Health": {
        "type": "object",
        "required": [
          "ok",
          "service",
          "version",
          "time"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "example": true
          },
          "service": {
            "type": "string",
            "example": "verdifax-orchestrator-api"
          },
          "version": {
            "type": "string",
            "description": "API contract version. Bumped only on incompatible REST-surface changes.",
            "example": "1.0.0"
          },
          "orchestrator_version": {
            "type": "string",
            "description": "Binary version, set at build time via Go ldflags.",
            "example": "0.3.0"
          },
          "orchestrator_git_sha": {
            "type": "string",
            "description": "Git SHA of the deployed binary.",
            "example": "941291edcebcabc1234"
          },
          "time": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "checks": {
            "type": "object",
            "description": "What a monitor needs. The status code stays 200 whatever this says.",
            "properties": {
              "database_writable": {
                "type": "boolean"
              },
              "kms": {
                "type": "object",
                "description": "The deployment's AWS KMS keys, each with one purpose: log_signing signs public-log entries (checked by reading its public half, never by signing), cres encrypts CRES data keys, webhook_secrets encrypts webhook signing secrets (each encryption key checked by encrypting and decrypting a test value). Each key is checked at start and at most every five minutes.",
                "required": [
                  "log_signing",
                  "cres",
                  "webhook_secrets"
                ],
                "properties": {
                  "log_signing": {
                    "$ref": "#/components/schemas/KMSKeyHealth"
                  },
                  "cres": {
                    "$ref": "#/components/schemas/KMSKeyHealth"
                  },
                  "webhook_secrets": {
                    "$ref": "#/components/schemas/KMSKeyHealth"
                  }
                }
              },
              "backup": {
                "type": "object",
                "properties": {
                  "configured": {
                    "type": "boolean"
                  },
                  "ok": {
                    "type": "boolean"
                  },
                  "lag_seconds": {
                    "type": "integer",
                    "description": "How long local writes have been waiting to reach the backup."
                  },
                  "checked_at": {
                    "type": "string",
                    "format": "date-time"
                  },
                  "detail": {
                    "type": "string"
                  }
                }
              }
            }
          }
        }
      },
      "Version": {
        "type": "object",
        "required": [
          "service",
          "formula_version",
          "kernel_versions",
          "engine_versions"
        ],
        "properties": {
          "service": {
            "type": "string"
          },
          "api_contract_version": {
            "type": "string"
          },
          "orchestrator_version": {
            "type": "string"
          },
          "orchestrator_git_sha": {
            "type": "string"
          },
          "formula_version": {
            "type": "string",
            "description": "Current manifest era label.",
            "example": "v1.7 (Phase 17, CRES)"
          },
          "formula_eras": {
            "type": "array",
            "description": "Every era this binary can verify, in chronological order.",
            "items": {
              "type": "object",
              "properties": {
                "era": {
                  "type": "string",
                  "example": "v1.7"
                },
                "label": {
                  "type": "string",
                  "example": "Phase 17, CRES"
                }
              }
            }
          },
          "kernel_versions": {
            "type": "object",
            "description": "Per-kernel canonical-preimage version tags.",
            "additionalProperties": {
              "type": "string"
            }
          },
          "engine_versions": {
            "type": "object",
            "description": "Public-API engine identifiers (DCAE, CRES).",
            "additionalProperties": {
              "type": "string"
            }
          },
          "aivp_t4_mode": {
            "type": "string",
            "enum": [
              "mock",
              "t4"
            ]
          },
          "runtime": {
            "type": "object"
          },
          "region": {
            "type": "string"
          },
          "instance": {
            "type": "string"
          },
          "time": {
            "$ref": "#/components/schemas/RFC3339Nano"
          }
        }
      },
      "ExecuteRequest": {
        "type": "object",
        "required": [
          "program_id",
          "route_id",
          "registry_record_hash"
        ],
        "properties": {
          "payload": {
            "type": "string",
            "description": "Base64-encoded payload bytes. Mutually exclusive with payload_text."
          },
          "payload_text": {
            "type": "string",
            "description": "Plain-text payload. Mutually exclusive with payload."
          },
          "program_id": {
            "$ref": "#/components/schemas/Hex64"
          },
          "route_id": {
            "type": "string",
            "example": "payments-disbursement-demo"
          },
          "registry_record_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "ai_output_text": {
            "type": "string",
            "description": "Optional AI output text. When present, the AIVP stage reviews it."
          },
          "attested_context": {
            "type": "object",
            "description": "Caller-attested actor + decision metadata. Round 64: client_name and client_version are the AI assistant's own declared name and version, as an MCP client gives them, each at most 128 bytes of printable ASCII: sealed as declared, not verified, and read by a policy's setup watch and attested_setup condition. They are accepted only while the server's round 64 release setting (VERDIFAX_ROUND64_FEATURES) is on; until then a request carrying either is refused with 409. A record carrying them needs verdifax-verify v0.38.0."
          },
          "request_signature": {
            "type": "object",
            "description": "Required when a request key is registered for this API key. The customer signs the request on its own machine.",
            "required": [
              "signature",
              "signed_at",
              "nonce"
            ],
            "properties": {
              "signature": {
                "type": "string",
                "description": "Base64 Ed25519 signature."
              },
              "signed_at": {
                "type": "string",
                "format": "date-time"
              },
              "nonce": {
                "type": "string",
                "description": "32 lowercase hex characters, used once."
              },
              "version": {
                "type": "string",
                "description": "2 for a signature over signed_request. Omit for version 1."
              }
            }
          },
          "reproducibility_context": {
            "type": "object",
            "description": "Caller-declared reproducibility metadata."
          },
          "request_substance": {
            "type": "object",
            "description": "Caller-supplied substance of the request: prompt, output, cost, latency and origin metadata. Sealed as supplied, except latency.total_ms and the authentication method, key id and key name, which the server can replace with what it observed, and the origin hashes and country, which the server fills when they are empty."
          },
          "authorization_chain": {
            "type": "object",
            "description": "Caller-supplied approval chain. Sealed as supplied, not verified by Verdifax."
          },
          "regulatory_scaffolding": {
            "type": "object",
            "description": "Caller-supplied regulatory metadata. Sealed as supplied, not an assessment by Verdifax."
          },
          "causal_graph": {
            "type": "object",
            "description": "Caller-supplied record of what led to this run. Sealed as supplied."
          },
          "job": {
            "$ref": "#/components/schemas/JobLink"
          },
          "signed_request": {
            "type": "string",
            "description": "The whole request as one JSON string, sent with a version 2 request_signature and nothing else. The server reads the request from these exact bytes."
          },
          "policy_context": {
            "type": "object",
            "additionalProperties": false,
            "description": "Values the active policy's rules read. They are the customer's own statements: a rule on them judges what was declared, not whether it was true. Unknown values are refused with 400. actor_type, mfa_satisfied and session_age_seconds describe the attested actor, so they are refused unless attested_context names one.",
            "properties": {
              "actor_type": {
                "type": "string",
                "enum": [
                  "agent",
                  "user",
                  "service",
                  "system"
                ],
                "description": "Who is acting. When omitted, a model provider in attested_context means an agent."
              },
              "mfa_satisfied": {
                "type": "boolean",
                "description": "The customer's statement that the actor passed multi-factor authentication."
              },
              "session_age_seconds": {
                "type": "integer",
                "minimum": 0
              },
              "object_type": {
                "type": "string",
                "enum": [
                  "text",
                  "transaction",
                  "code",
                  "data",
                  "model",
                  "file"
                ]
              },
              "object_id": {
                "type": "string",
                "maxLength": 256
              },
              "classification": {
                "type": "string",
                "enum": [
                  "PUBLIC",
                  "INTERNAL",
                  "CONFIDENTIAL",
                  "RESTRICTED",
                  "TOP_SECRET",
                  "TS_SCI"
                ]
              },
              "data_quality": {
                "type": "object",
                "additionalProperties": false,
                "description": "The customer's declaration about the data the decision used: where it came from, the time it describes and the checks the customer ran on it. It is sealed with the policy inputs, and a rule's data_quality condition can require and test it. Verdifax judges none of it.",
                "properties": {
                  "source": {
                    "type": "string",
                    "maxLength": 200,
                    "description": "Where the data came from, at most 200 bytes of UTF-8."
                  },
                  "as_of": {
                    "type": "string",
                    "pattern": "^[0-9]{4}-[0-9]{2}-[0-9]{2}T[0-9]{2}:[0-9]{2}:[0-9]{2}(\\.[0-9]{1,9})?(Z|[+-][0-9]{2}:[0-9]{2})$",
                    "description": "The time the data describes, such as 2026-11-11T09:00:00Z or 2026-11-11T09:00:00+05:30: a real calendar time, with an offset of at most 23:59."
                  },
                  "checks": {
                    "type": "array",
                    "maxItems": 50,
                    "description": "The checks the customer ran on the data, each with a distinct name.",
                    "items": {
                      "type": "object",
                      "additionalProperties": false,
                      "required": [
                        "name",
                        "result"
                      ],
                      "properties": {
                        "name": {
                          "type": "string",
                          "minLength": 1,
                          "maxLength": 100,
                          "description": "The check's name, at most 100 bytes of UTF-8 and not only white space."
                        },
                        "result": {
                          "type": "string",
                          "enum": [
                            "pass",
                            "fail",
                            "warn"
                          ]
                        }
                      }
                    }
                  }
                }
              },
              "data_use": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "purpose",
                  "basis"
                ],
                "description": "Round 64, data-use basis: the customer's declaration of the data use the decision rests on, in the customer's own short codes. Verdifax seals the declaration as made, in the policy inputs and in its own data_use field of the run's record or receipt, a refusal before the rules ran included, and a rule's data_use condition can test it. Verdifax does not check it and judges none of it. A code is lowercase letters, digits, dots, underscores, colons and hyphens, so a code cannot hold a space or an email address; a code can still spell a person's name, so do not put identifiers of people in one. Accepted only while the server's round 64 release setting (VERDIFAX_ROUND64_FEATURES) is on; until then a request carrying it is refused with 409. A malformed declaration is refused with 400. A record or receipt carrying it needs verdifax-verify v0.38.0.",
                "properties": {
                  "purpose": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9._:-]{0,63}$",
                    "description": "The customer's code for the purpose, such as claims.review."
                  },
                  "basis": {
                    "type": "string",
                    "pattern": "^[a-z0-9][a-z0-9._:-]{0,63}$",
                    "description": "The customer's code for the basis it declares, such as contract."
                  },
                  "categories": {
                    "type": "array",
                    "maxItems": 20,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "pattern": "^[a-z0-9][a-z0-9._:-]{0,63}$"
                    },
                    "description": "The customer's codes for the categories of data, at most 20, each once."
                  },
                  "reference": {
                    "type": "string",
                    "pattern": "^hmac-sha256:[0-9a-f]{64}$",
                    "description": "Optional: a keyed digest the customer computed on its own machine, such as of a consent or contract number, so Verdifax never receives the number itself."
                  }
                }
              }
            }
          },
          "expected_policy_hash": {
            "allOf": [
              {
                "$ref": "#/components/schemas/Hex64"
              }
            ],
            "description": "Optional. The policy hash the request expects to run under. When another policy is active the run is refused with 409."
          }
        }
      },
      "ExecuteResponse": {
        "type": "object",
        "required": [
          "ok",
          "run_id",
          "manifest",
          "duration_ms"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "run_id": {
            "type": "integer",
            "format": "int64"
          },
          "manifest": {
            "$ref": "#/components/schemas/ExecutionManifest"
          },
          "duration_ms": {
            "type": "integer"
          },
          "record_hash": {
            "type": "string",
            "description": "The hash a later step names: the manifest hash of a completed run, or the receipt hash of a refused or halted run."
          },
          "aivp_trace_text": {
            "type": "string",
            "description": "The text the AI review checked, when a review ran on this run's AI output. Returned once and not stored: its SHA-256 is sealed as manifest.AivpReview.trace_hash (and in a halt receipt's review block), so keep it to let anyone re-run the review's contradiction check offline with verdifax-verify."
          }
        }
      },
      "ExecutionManifest": {
        "type": "object",
        "description": "Sealed manifest. ManifestHash is the SHA-256 seal over this manifest's canonical preimage fields, not over every property listed here.",
        "properties": {
          "EnvelopeID": {
            "type": "string"
          },
          "EnvelopeHash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "ManifestHash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "DseCommitmentHash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "TokOrderingHash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "DscFinalStateHash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "EraseStatus": {
            "type": "string",
            "enum": [
              "intact",
              "shredded",
              "tombstone"
            ],
            "description": "Sealed-at-write erasure state."
          }
        },
        "additionalProperties": true
      },
      "Run": {
        "type": "object",
        "properties": {
          "id": {
            "type": "integer",
            "format": "int64"
          },
          "api_key_id": {
            "type": "integer",
            "format": "int64",
            "description": "The key that requested the run."
          },
          "created_at": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "manifest_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "status": {
            "type": "string",
            "enum": [
              "ok",
              "aivp_t4_halt",
              "attestation_gap",
              "ccv_halt",
              "macc_halt",
              "pepg_deny",
              "probe",
              "stage_error"
            ]
          },
          "manifest": {
            "$ref": "#/components/schemas/ExecutionManifest"
          }
        }
      },
      "VerifyResponse": {
        "type": "object",
        "required": [
          "ok",
          "verified",
          "manifest_hash",
          "recomputed_hash"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "verified": {
            "type": "boolean"
          },
          "manifest_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "recomputed_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "formula_version": {
            "type": "string"
          },
          "verification_at": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "verification_kind": {
            "type": "string",
            "example": "manifest-self-seal"
          },
          "dcae_engine_hint": {
            "type": "object",
            "properties": {
              "available_at": {
                "type": "string",
                "example": "POST /dcae/verify"
              },
              "engine_version": {
                "type": "string",
                "example": "verdifax-dcae/1.0.0"
              }
            }
          }
        }
      },
      "DCAEProofBundle": {
        "type": "object",
        "required": [
          "envelope_id",
          "envelope_hash",
          "aer_hash",
          "zksp_binding_hash",
          "formal_verifier_status",
          "manifest_hash",
          "canonical_manifest_preimage"
        ],
        "properties": {
          "preimage_version": {
            "type": "string",
            "example": "verdifax.dcae.v1"
          },
          "envelope_id": {
            "type": "string"
          },
          "envelope_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "aer_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "zksp_binding_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "formal_verifier_status": {
            "type": "string",
            "example": "SCAFFOLD_R1CS_HASH_FACADE"
          },
          "manifest_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "canonical_manifest_preimage": {
            "type": "string"
          }
        }
      },
      "DCAEVerdict": {
        "type": "object",
        "required": [
          "verified",
          "engine_version"
        ],
        "properties": {
          "verified": {
            "type": "boolean"
          },
          "failure_reason": {
            "type": "string",
            "enum": [
              "",
              "manifest_hash_mismatch",
              "missing_fields",
              "zksp_status_invalid",
              "unsupported_version"
            ]
          },
          "verified_closure_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "engine_version": {
            "type": "string",
            "example": "verdifax-dcae/1.0.0"
          }
        }
      },
      "DeletionReceipt": {
        "type": "object",
        "properties": {
          "preimage_version": {
            "type": "string",
            "example": "verdifax.cres.v1"
          },
          "envelope_id": {
            "type": "string"
          },
          "field_path": {
            "type": "string"
          },
          "deletion_clock": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "actor_id": {
            "type": "string"
          },
          "ciphertext_hash_at_shred": {
            "$ref": "#/components/schemas/Hex64"
          },
          "dsar_reference": {
            "type": "string"
          },
          "engine_version": {
            "type": "string",
            "example": "verdifax-cres/1.0.0"
          },
          "receipt_hash": {
            "$ref": "#/components/schemas/Hex64"
          }
        }
      },
      "Error": {
        "type": "object",
        "required": [
          "ok",
          "error"
        ],
        "properties": {
          "ok": {
            "type": "boolean",
            "example": false
          },
          "error": {
            "type": "string"
          }
        }
      },
      "JobLink": {
        "type": "object",
        "description": "Places this run in a job map. A job can split into branches and join again.",
        "required": [
          "job_id",
          "step_id"
        ],
        "properties": {
          "job_id": {
            "type": "string",
            "description": "1 to 128 letters, digits, dots, dashes, underscores or colons."
          },
          "step_id": {
            "type": "string",
            "description": "Unique within the job, same characters as job_id."
          },
          "previous_record_hashes": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "The record hashes this step directly follows, sorted, with no repeats. Empty for a step that starts the job, several for a step that joins branches."
          },
          "external_previous": {
            "type": "array",
            "items": {
              "type": "string"
            },
            "description": "Record hashes from another Verdifax account, sorted, with no repeats. The server does not check them."
          },
          "final": {
            "type": "boolean",
            "description": "Closes the job. It must lead back to every record in the job."
          }
        }
      },
      "RequestKeyChange": {
        "type": "object",
        "description": "The current key's approval. Required once a key is registered: a signature over verdifax.request-key-change.v1, the new key, signed_at and nonce, joined by zero bytes. The new key is empty when clearing.",
        "required": [
          "signature",
          "signed_at",
          "nonce"
        ],
        "properties": {
          "signature": {
            "type": "string"
          },
          "signed_at": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          }
        }
      },
      "KMSKeyHealth": {
        "type": "object",
        "description": "One KMS key: whether the deployment names it, and whether its last check passed. ok is absent when configured is false.",
        "required": [
          "configured"
        ],
        "properties": {
          "configured": {
            "type": "boolean"
          },
          "ok": {
            "type": "boolean"
          }
        }
      },
      "PublicSignOff": {
        "type": "object",
        "required": [
          "decision",
          "sequence",
          "signed_at",
          "note_sealed"
        ],
        "properties": {
          "decision": {
            "type": "string",
            "description": "approve or reject"
          },
          "sequence": {
            "type": "integer",
            "description": "The sign-off's place in the account's sign-off chain."
          },
          "signed_at": {
            "type": "string",
            "format": "date-time"
          },
          "note_sealed": {
            "type": "boolean",
            "description": "True when the sign-off seals a note by its hash. The note itself is not served."
          }
        }
      },
      "PublicSignOffAnswer": {
        "type": "object",
        "required": [
          "ok",
          "run_id",
          "read",
          "signoffs",
          "decision_in_force"
        ],
        "properties": {
          "ok": {
            "type": "boolean"
          },
          "run_id": {
            "type": "integer",
            "format": "int64"
          },
          "read": {
            "type": "boolean",
            "description": "False when the run's sign-offs could not be read; the answer then says nothing about whether there are any."
          },
          "signoffs": {
            "type": "array",
            "items": {
              "$ref": "#/components/schemas/PublicSignOff"
            },
            "description": "The sign-offs on this record, oldest first. A later one supersedes an earlier one."
          },
          "job": {
            "type": "object",
            "description": "Present when the run is a step of a job.",
            "properties": {
              "job_id": {
                "type": "string"
              },
              "step_id": {
                "type": "string"
              },
              "final": {
                "type": "boolean"
              },
              "read": {
                "type": "boolean",
                "description": "False when the job's sign-off could not be read."
              },
              "final_run_id": {
                "type": "integer",
                "format": "int64",
                "description": "The job's final step, which carries the job's sign-off; absent while it has not run."
              },
              "final_run_public_url": {
                "type": "string",
                "description": "Where the final step's public bundle or receipt is served, when that record is public."
              },
              "signoffs": {
                "type": "array",
                "items": {
                  "$ref": "#/components/schemas/PublicSignOff"
                }
              }
            }
          },
          "decision_in_force": {
            "type": [
              "object",
              "null"
            ],
            "description": "The decision in force, by the rule verdifax-verify uses: for a step of a job, the latest job decision on its final step when there is one, and otherwise the latest sign-off naming this result; a job decision on this final step governs its own record sign-offs. Null when nothing is signed off, and for a step whose job's sign-offs could not be read, since the job's decision would govern.",
            "properties": {
              "decision": {
                "type": "string"
              },
              "run_id": {
                "type": "integer",
                "format": "int64"
              },
              "on": {
                "type": "string",
                "enum": [
                  "this_record",
                  "job_final_step"
                ]
              },
              "signed_as": {
                "type": "string",
                "enum": [
                  "record",
                  "receipt",
                  "job"
                ],
                "description": "The kind of sign-off in force."
              },
              "sequence": {
                "type": "integer",
                "format": "int64",
                "description": "The sign-off in force's place in the account's chain."
              },
              "signed_at": {
                "type": "string",
                "description": "When the sign-off in force was signed."
              },
              "own_decision": {
                "type": "string",
                "description": "When a job's decision governs, this result's own latest sign-off; absent otherwise."
              }
            }
          }
        }
      },
      "SetupChange": {
        "type": "object",
        "additionalProperties": false,
        "description": "verdifax.setup-change.v1, the entry of a setup.changed event (round 64). setup_hash is SHA-256 over length-prefixed parts (decimal length, a colon, the bytes): verdifax.setup-hash.v1, then for each watched fact in the fixed order model_provider, model_name, model_version, model_temperature, prompt_hash, client_name, client_version, review_model, review_prompt_id, review_checker_id: the fact, who states it, and its value (empty when not stated). setup_change_hash covers every field but itself and the anchor, length-prefixed: format, run_id, record_kind, record_hash, scope, activation_hash, the word fields, the fields joined by commas, previous_setup_hash, setup_hash, then for each watched fact the fact, who states it and its value, then changed_at and the signal place (the word signal, account, sequence, previous_signal_hash). Its public-log leaf kind is setup_change.",
        "required": [
          "format",
          "run_id",
          "record_kind",
          "record_hash",
          "scope",
          "activation_hash",
          "fields",
          "previous_setup_hash",
          "setup_hash",
          "setup",
          "changed_at",
          "signal",
          "setup_change_hash"
        ],
        "properties": {
          "format": {
            "const": "verdifax.setup-change.v1"
          },
          "run_id": {
            "type": "integer",
            "minimum": 1
          },
          "record_kind": {
            "type": "string",
            "description": "record for an allowed run, or the stopped run's receipt kind."
          },
          "record_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "scope": {
            "type": "string",
            "pattern": "^(account|key-[1-9][0-9]*)$"
          },
          "activation_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "fields": {
            "type": "array",
            "items": {
              "type": "string"
            }
          },
          "previous_setup_hash": {
            "type": "string",
            "description": "Empty for the first setup the watch saw in its scope."
          },
          "setup_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "setup": {
            "type": "object",
            "additionalProperties": false,
            "properties": {
              "declared_by_caller": {
                "type": "object",
                "additionalProperties": false,
                "description": "What the request declared.",
                "properties": {
                  "model_provider": {
                    "type": "string"
                  },
                  "model_name": {
                    "type": "string"
                  },
                  "model_version": {
                    "type": "string"
                  },
                  "model_temperature": {
                    "type": "string"
                  },
                  "prompt_hash": {
                    "type": "string"
                  },
                  "client_name": {
                    "type": "string"
                  },
                  "client_version": {
                    "type": "string"
                  }
                }
              },
              "attested_by_verdifax": {
                "type": "object",
                "additionalProperties": false,
                "description": "What Verdifax's AI review stated about itself.",
                "properties": {
                  "review_model": {
                    "type": "string"
                  },
                  "review_prompt_id": {
                    "type": "string"
                  },
                  "review_checker_id": {
                    "type": "string"
                  }
                }
              }
            }
          },
          "changed_at": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "signal": {
            "type": "object"
          },
          "setup_change_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "anchor": {
            "type": "object"
          }
        }
      },
      "PolicyReviewDue": {
        "type": "object",
        "additionalProperties": false,
        "description": "verdifax.policy-review-due.v1, the entry of a review.due event (round 64), sealed once per activation when the review date its policy declares passes while it is still in force. due_at is review_by in UTC, or activated_at plus interval_days whole days, written in RFC 3339 with nanoseconds. statement is always: the date this policy declared has passed while activation N was in force. It says nothing about whether anyone reviewed the policy. review_due_hash covers every field but itself and the anchor, length-prefixed, in the order listed, interval_days as a decimal (0 when absent), then the signal place. Its public-log leaf kind is review_due.",
        "required": [
          "format",
          "chain_id",
          "activation_sequence",
          "activation_hash",
          "document_hash",
          "activated_at",
          "due_at",
          "statement",
          "stated_at",
          "signal",
          "review_due_hash"
        ],
        "properties": {
          "format": {
            "const": "verdifax.policy-review-due.v1"
          },
          "chain_id": {
            "type": "string",
            "pattern": "^(api-key|account)-[1-9][0-9]*$"
          },
          "activation_sequence": {
            "type": "integer",
            "minimum": 1
          },
          "activation_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "document_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "activated_at": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "review_by": {
            "type": "string"
          },
          "interval_days": {
            "type": "integer",
            "minimum": 1,
            "maximum": 3660
          },
          "due_at": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "statement": {
            "type": "string"
          },
          "stated_at": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "signal": {
            "type": "object"
          },
          "review_due_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "anchor": {
            "type": "object"
          }
        }
      },
      "AccountStop": {
        "type": "object",
        "additionalProperties": false,
        "description": "verdifax.account-stop.v1, the entry of an account.stopped or account.resumed event (round 64). The owner and Verdifax each hold a stop of their own and lift only their own. account_stop_hash is SHA-256 over length-prefixed parts (decimal length, a colon, the bytes): format, action, decided_by, key_id, then the word scope with signoffs and webhooks or the word no_scope, reason_sha256, runs_in_progress, lifts_sequence, then the word owner_signature with public_key, signature, signed_at and nonce, or the word unsigned with the unsigned statement, or the word no_signature, then changed_at and the signal place (the word signal, account, sequence, previous_signal_hash). Its public-log leaf kind is account_stop. The record states who stopped or resumed the account and when; it touches no key.",
        "required": [
          "format",
          "action",
          "decided_by",
          "runs_in_progress",
          "changed_at",
          "signal",
          "account_stop_hash"
        ],
        "properties": {
          "format": {
            "const": "verdifax.account-stop.v1"
          },
          "action": {
            "type": "string",
            "enum": [
              "stop",
              "resume"
            ]
          },
          "decided_by": {
            "type": "string",
            "enum": [
              "owner",
              "verdifax_admin"
            ],
            "description": "owner places or lifts the owner's stop; verdifax_admin places or lifts Verdifax's."
          },
          "key_id": {
            "type": "integer",
            "description": "The account key that asked: the owner key, or a member key its owner granted account_stop. Absent for Verdifax."
          },
          "scope": {
            "type": "object",
            "description": "A stop's scope; a resume carries none.",
            "properties": {
              "signoffs": {
                "type": "string",
                "enum": [
                  "accept",
                  "refuse"
                ]
              },
              "webhooks": {
                "type": "string",
                "enum": [
                  "continue",
                  "pause"
                ]
              }
            }
          },
          "reason_sha256": {
            "type": "string",
            "pattern": "^[0-9a-f]{64}$",
            "description": "SHA-256 of the reason text sent; the text is not kept."
          },
          "runs_in_progress": {
            "type": "integer",
            "minimum": 0,
            "description": "On a stop, the account's runs admitted before it and still running when it was sealed; they finish. 0 on a resume."
          },
          "lifts_sequence": {
            "type": "integer",
            "description": "On a resume, the feed place of the stop it lifts."
          },
          "owner_signature": {
            "type": "object",
            "description": "The owner's request-key signature: on every owner resume, and on an owner stop when one came."
          },
          "unsigned": {
            "type": "string",
            "description": "On an owner stop sent without a signature, the fixed statement that the record is the server's word."
          },
          "changed_at": {
            "type": "string",
            "format": "date-time"
          },
          "signal": {
            "type": "object"
          },
          "account_stop_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "anchor": {
            "type": "object"
          }
        }
      },
      "SignOffRefusal": {
        "type": "object",
        "additionalProperties": false,
        "description": "verdifax.signoff-refusal.v1, the entry of a signoff.refused event (round 64): a sign-off an active approver signed on one of the account's results, refused because a stop whose scope refuses sign-offs stood. It keeps the attempt exactly as the approver signed it (chain_id, previous_signoff_hash, target, decision, note_hash, approver_key, signature, signed_at, nonce, verifiable with the sign-off preimage), names the stop's feed place (stop_sequence), the approver's registration (approver_id) and reason_code ACCOUNT_STOPPED. signoff_refusal_hash is SHA-256 over length-prefixed parts: format, chain_id, previous_signoff_hash, target kind, run_id, digest, job_id, decision, note_hash, approver_key, approver_id, signature, signed_at, nonce, stop_sequence, reason_code, refused_at, then the signal place (the word signal, account, sequence, previous_signal_hash). Its public-log leaf kind is signoff_refusal. The same signed attempt is sealed once.",
        "required": [
          "format",
          "chain_id",
          "previous_signoff_hash",
          "target",
          "decision",
          "approver_key",
          "approver_id",
          "signature",
          "signed_at",
          "nonce",
          "stop_sequence",
          "reason_code",
          "refused_at",
          "signal",
          "signoff_refusal_hash"
        ],
        "properties": {
          "format": {
            "const": "verdifax.signoff-refusal.v1"
          },
          "chain_id": {
            "type": "string"
          },
          "previous_signoff_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "target": {
            "type": "object"
          },
          "decision": {
            "type": "string",
            "enum": [
              "approve",
              "reject"
            ]
          },
          "note_hash": {
            "type": "string"
          },
          "approver_key": {
            "type": "string"
          },
          "approver_id": {
            "type": "integer",
            "minimum": 1
          },
          "signature": {
            "type": "string"
          },
          "signed_at": {
            "type": "string"
          },
          "nonce": {
            "type": "string"
          },
          "stop_sequence": {
            "type": "integer",
            "minimum": 1
          },
          "reason_code": {
            "const": "ACCOUNT_STOPPED"
          },
          "refused_at": {
            "type": "string",
            "format": "date-time"
          },
          "signal": {
            "type": "object"
          },
          "signoff_refusal_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "anchor": {
            "type": "object"
          }
        }
      },
      "SealedTarget": {
        "type": "object",
        "additionalProperties": false,
        "description": "A response target sealed into a result's own feed entry (round 64, response times): the run.sealed record's signoff_target, from the rule's signoff.within, or a receipt context's response_target, from the policy's response_targets.refusals (a refused run) or response_targets.stops (a halted run). Present only when the target sets seal_in_result. It joins its record's hash under its own label: on a run.sealed record after the other fields, the word signoff_target, within as a decimal, compare and notice, each length-prefixed; in a receipt context, the parts response_target, within, compare and notice. A record or context without one hashes as before. Needs verdifax-verify v0.38.0.",
        "required": [
          "within",
          "compare",
          "notice"
        ],
        "properties": {
          "within": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31622400,
            "description": "The target, in whole seconds."
          },
          "compare": {
            "type": "string",
            "enum": [
              "first_signoff",
              "first_approval",
              "decision_in_force"
            ],
            "description": "The sign-off whose time is held against the target."
          },
          "notice": {
            "type": "string",
            "enum": [
              "event",
              "head",
              "both"
            ],
            "description": "How a passed target is shown: a sealed signoff.target_passed event, the feed head only, or both."
          }
        }
      },
      "SignOffTargetPassed": {
        "type": "object",
        "additionalProperties": false,
        "description": "verdifax.signoff-target-passed.v1, the entry of a signoff.target_passed event (round 64, response times): a result's response target passed with no sign-off of the kind it compares on the public log by the deadline. Sealed once per result, only when the target's notice is event or both, by a sweep that waits until the server's clock is at least five minutes past the deadline, so the record's own public-log time is at or after it while the public log's clock is within five minutes of the server's. start is the result entry's public-log time in whole seconds (start_basis public_log), or its sealed record time when the entry has none (record_time); deadline is start plus within, in UTC with RFC 3339 and nanoseconds. statement is always: no sign-off of the kind this target compares was on the public log by the deadline. It states a time and the customer's own target and judges nothing. target_passed_hash covers every field but itself and the anchor, length-prefixed, in the order listed, numbers as decimals, then the signal place (the word signal, account, sequence, previous_signal_hash). Its public-log leaf kind is signoff_target. Needs verdifax-verify v0.38.0.",
        "required": [
          "format",
          "result_kind",
          "run_id",
          "result_sequence",
          "result_hash",
          "source",
          "within",
          "compare",
          "notice",
          "start_basis",
          "start",
          "deadline",
          "statement",
          "stated_at",
          "signal",
          "target_passed_hash"
        ],
        "properties": {
          "format": {
            "const": "verdifax.signoff-target-passed.v1"
          },
          "result_kind": {
            "type": "string",
            "enum": [
              "record",
              "receipt"
            ]
          },
          "run_id": {
            "type": "integer",
            "minimum": 1
          },
          "result_sequence": {
            "type": "integer",
            "minimum": 1,
            "description": "The feed place of the result's own event, before this one."
          },
          "result_hash": {
            "$ref": "#/components/schemas/Hex64",
            "description": "The result event's entry hash: the run.sealed record's run_sealed_hash, or the receipt's hash."
          },
          "source": {
            "type": "string",
            "enum": [
              "signoff.within",
              "response_targets.refusals",
              "response_targets.stops"
            ]
          },
          "within": {
            "type": "integer",
            "minimum": 1,
            "maximum": 31622400
          },
          "compare": {
            "type": "string",
            "enum": [
              "first_signoff",
              "first_approval",
              "decision_in_force"
            ]
          },
          "notice": {
            "type": "string",
            "enum": [
              "event",
              "both"
            ]
          },
          "start_basis": {
            "type": "string",
            "enum": [
              "public_log",
              "record_time"
            ]
          },
          "start": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "deadline": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "statement": {
            "const": "no sign-off of the kind this target compares was on the public log by the deadline"
          },
          "stated_at": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "signal": {
            "type": "object"
          },
          "target_passed_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "anchor": {
            "type": "object"
          }
        }
      },
      "PeriodSummary": {
        "type": "object",
        "additionalProperties": false,
        "description": "verdifax.period-summary.v1 (round 64, board summary): an account's figures for one period, from (included) to to (excluded), counted from its signal feed alone under the counting rules verdifax.period-summary-counting.v1 up to a feed head stated on the public log after the period. Every event is placed by its own sealed time; an event whose record was deleted has none to read and is counted apart, as events.record_deleted.unplaced, when its place lies between the first and last event placed in the period. Each figure commits to the exact list of feed events it counts: events_digest is SHA-256 over length-prefixed parts, verdifax.period-summary-events.v1 then each event as sequence:event_hash in ascending sequence. summary_hash covers format, account, from, to, counting_rules, head_sequence, head_hash, head_statement_hash, stated_at, the number of figures, then each figure's name, value and events_digest, length-prefixed. Its public-log leaf is the v3 receipt leaf of kind period_summary over the account, summary_hash, head_sequence and head_hash. A count is never negative; a figure whose name ends in _seconds is a time and is stated as measured. The statement sits beside the feed and is never a feed event. verdifax-verify v0.38.0 --summary with --signals recounts every figure.",
        "required": [
          "format",
          "account",
          "from",
          "to",
          "counting_rules",
          "head_sequence",
          "head_hash",
          "head_statement_hash",
          "figures",
          "stated_at",
          "summary_hash"
        ],
        "properties": {
          "format": {
            "const": "verdifax.period-summary.v1"
          },
          "account": {
            "type": "string",
            "pattern": "^account-[1-9][0-9]*$"
          },
          "from": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "to": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "counting_rules": {
            "type": "string",
            "const": "verdifax.period-summary-counting.v1"
          },
          "head_sequence": {
            "type": "integer",
            "minimum": 1
          },
          "head_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "head_statement_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "figures": {
            "type": "array",
            "description": "Each figure once, in ascending name order. Names include runs.sealed, runs.refused, runs.refused.code:<code>, runs.refused.account_stopped, runs.refused.data_use_declared, runs.halted.receipt:<kind>, runs.failed.class:<class>, signoffs.made, signoffs.made.approve, results.decision_in_force.approve, results.signoff_required.none_in_force, policy.changed, keys.created.by:<who decided>, account.stops, account.stopped_seconds, setup.changed, review.due, signoff.target_passed and response_times.*; a figure with nothing to count is left out.",
            "items": {
              "type": "object",
              "additionalProperties": false,
              "required": [
                "name",
                "value",
                "events_digest"
              ],
              "properties": {
                "name": {
                  "type": "string",
                  "pattern": "^[a-z0-9][a-z0-9._:-]{0,127}$"
                },
                "value": {
                  "type": "integer"
                },
                "events_digest": {
                  "$ref": "#/components/schemas/Hex64"
                }
              }
            }
          },
          "stated_at": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "summary_hash": {
            "$ref": "#/components/schemas/Hex64"
          },
          "anchor": {
            "type": "object"
          }
        }
      },
      "ResponseTimes": {
        "type": "object",
        "description": "verdifax.response-times.v1 (round 64): for each result placed in the period by its sealed time (a run.sealed record that requires a sign-off or seals a target, a refused or halted run's receipt that seals a target, or any of these a sign-off names), except a result whose run was deleted, which is counted in results_deleted, the wait from the result's public-log entry to its first sign-off, its first approval and the decision in force, with the record times beside, counted up to the feed head under verdifax.period-summary-counting.v1. A wait longer than the target is stated as measured, and no time is judged. verdifax-verify v0.38.0 --signals pack.json --response-times recomputes it.",
        "properties": {
          "form": {
            "const": "verdifax.response-times.v1"
          },
          "account": {
            "type": "string"
          },
          "from": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "to": {
            "$ref": "#/components/schemas/RFC3339Nano"
          },
          "counting_rules": {
            "type": "string"
          },
          "request_target": {
            "type": "integer",
            "description": "The target given in the request, applied to each result that seals none, compared with its first sign-off."
          },
          "head_sequence": {
            "type": "integer"
          },
          "head": {
            "type": [
              "object",
              "null"
            ],
            "description": "The feed head statement, verdifax.feed-head.v1, on the public log; null for an empty feed."
          },
          "results": {
            "type": "array",
            "items": {
              "type": "object",
              "properties": {
                "run_id": {
                  "type": "integer"
                },
                "result_kind": {
                  "type": "string",
                  "enum": [
                    "record",
                    "receipt"
                  ]
                },
                "event_kind": {
                  "type": "string",
                  "enum": [
                    "run.sealed",
                    "run.refused",
                    "run.halted"
                  ]
                },
                "sequence": {
                  "type": "integer"
                },
                "recorded_at": {
                  "type": "string"
                },
                "logged_at": {
                  "type": "string",
                  "format": "date-time"
                },
                "signoff_required": {
                  "type": "boolean"
                },
                "target": {
                  "type": "object",
                  "properties": {
                    "within": {
                      "type": "integer"
                    },
                    "compare": {
                      "type": "string"
                    },
                    "notice": {
                      "type": "string"
                    },
                    "source": {
                      "type": "string",
                      "enum": [
                        "sealed",
                        "request"
                      ]
                    }
                  }
                },
                "first_signoff": {
                  "type": "object",
                  "properties": {
                    "sequence": {
                      "type": "integer"
                    },
                    "decision": {
                      "type": "string",
                      "enum": [
                        "approve",
                        "reject"
                      ]
                    },
                    "recorded_at": {
                      "type": "string"
                    },
                    "logged_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "log_seconds": {
                      "type": "integer",
                      "description": "The sign-off's public-log time minus the result's, as measured; may be negative."
                    },
                    "record_seconds": {
                      "type": "integer",
                      "description": "The sign-off's recorded_at minus the result's sealed time, whole seconds truncated toward zero."
                    }
                  }
                },
                "first_approval": {
                  "type": "object",
                  "properties": {
                    "sequence": {
                      "type": "integer"
                    },
                    "decision": {
                      "type": "string",
                      "enum": [
                        "approve",
                        "reject"
                      ]
                    },
                    "recorded_at": {
                      "type": "string"
                    },
                    "logged_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "log_seconds": {
                      "type": "integer",
                      "description": "The sign-off's public-log time minus the result's, as measured; may be negative."
                    },
                    "record_seconds": {
                      "type": "integer",
                      "description": "The sign-off's recorded_at minus the result's sealed time, whole seconds truncated toward zero."
                    }
                  }
                },
                "decision_in_force": {
                  "type": "object",
                  "properties": {
                    "sequence": {
                      "type": "integer"
                    },
                    "decision": {
                      "type": "string",
                      "enum": [
                        "approve",
                        "reject"
                      ]
                    },
                    "recorded_at": {
                      "type": "string"
                    },
                    "logged_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "log_seconds": {
                      "type": "integer",
                      "description": "The sign-off's public-log time minus the result's, as measured; may be negative."
                    },
                    "record_seconds": {
                      "type": "integer",
                      "description": "The sign-off's recorded_at minus the result's sealed time, whole seconds truncated toward zero."
                    }
                  }
                },
                "compared": {
                  "type": "string",
                  "enum": [
                    "first_signoff",
                    "first_approval",
                    "decision_in_force"
                  ]
                },
                "compared_on": {
                  "type": "string",
                  "enum": [
                    "public_log",
                    "record_time"
                  ]
                },
                "compared_seconds": {
                  "type": "integer",
                  "description": "The wait compared: to the compared sign-off, or to the feed head for a result with none."
                },
                "standing": {
                  "type": "string",
                  "enum": [
                    "within_target",
                    "longer_than_target_signed_after",
                    "unsigned_within_target_as_of_head",
                    "unsigned_longer_than_target_as_of_head",
                    "signed_no_target",
                    "unsigned_no_target_as_of_head"
                  ]
                }
              }
            }
          },
          "aggregates": {
            "type": "object",
            "properties": {
              "results": {
                "type": "integer"
              },
              "results_deleted": {
                "type": "integer"
              },
              "with_target": {
                "type": "integer"
              },
              "first_signoff": {
                "type": "object",
                "properties": {
                  "reached": {
                    "type": "integer"
                  },
                  "public_log": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer"
                      },
                      "median_seconds": {
                        "type": "integer",
                        "description": "The lower middle of the sorted waits."
                      },
                      "p90_seconds": {
                        "type": "integer",
                        "description": "The ceil(0.9 n)-th smallest wait."
                      },
                      "longest_seconds": {
                        "type": "integer"
                      },
                      "longest_run_id": {
                        "type": "integer"
                      }
                    }
                  },
                  "record_time": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer"
                      },
                      "median_seconds": {
                        "type": "integer",
                        "description": "The lower middle of the sorted waits."
                      },
                      "p90_seconds": {
                        "type": "integer",
                        "description": "The ceil(0.9 n)-th smallest wait."
                      },
                      "longest_seconds": {
                        "type": "integer"
                      },
                      "longest_run_id": {
                        "type": "integer"
                      }
                    }
                  }
                }
              },
              "first_approval": {
                "type": "object",
                "properties": {
                  "reached": {
                    "type": "integer"
                  },
                  "public_log": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer"
                      },
                      "median_seconds": {
                        "type": "integer",
                        "description": "The lower middle of the sorted waits."
                      },
                      "p90_seconds": {
                        "type": "integer",
                        "description": "The ceil(0.9 n)-th smallest wait."
                      },
                      "longest_seconds": {
                        "type": "integer"
                      },
                      "longest_run_id": {
                        "type": "integer"
                      }
                    }
                  },
                  "record_time": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer"
                      },
                      "median_seconds": {
                        "type": "integer",
                        "description": "The lower middle of the sorted waits."
                      },
                      "p90_seconds": {
                        "type": "integer",
                        "description": "The ceil(0.9 n)-th smallest wait."
                      },
                      "longest_seconds": {
                        "type": "integer"
                      },
                      "longest_run_id": {
                        "type": "integer"
                      }
                    }
                  }
                }
              },
              "decision_in_force": {
                "type": "object",
                "properties": {
                  "reached": {
                    "type": "integer"
                  },
                  "public_log": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer"
                      },
                      "median_seconds": {
                        "type": "integer",
                        "description": "The lower middle of the sorted waits."
                      },
                      "p90_seconds": {
                        "type": "integer",
                        "description": "The ceil(0.9 n)-th smallest wait."
                      },
                      "longest_seconds": {
                        "type": "integer"
                      },
                      "longest_run_id": {
                        "type": "integer"
                      }
                    }
                  },
                  "record_time": {
                    "type": "object",
                    "properties": {
                      "count": {
                        "type": "integer"
                      },
                      "median_seconds": {
                        "type": "integer",
                        "description": "The lower middle of the sorted waits."
                      },
                      "p90_seconds": {
                        "type": "integer",
                        "description": "The ceil(0.9 n)-th smallest wait."
                      },
                      "longest_seconds": {
                        "type": "integer"
                      },
                      "longest_run_id": {
                        "type": "integer"
                      }
                    }
                  }
                }
              },
              "unsigned_as_of_head": {
                "type": "integer"
              },
              "longer_than_target_signed_after": {
                "type": "integer"
              },
              "longer_than_target_unsigned_as_of_head": {
                "type": "integer"
              }
            }
          },
          "feed": {
            "type": "array",
            "items": {
              "type": "object"
            },
            "description": "With pack=1: every event of the feed from its first to the head, as GET /account/signals serves them."
          }
        }
      }
    }
  },
  "paths": {
    "/attestations": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "List attestation receipts for the authenticated key, or its account for an owner key",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer"
            },
            "description": "A whole number of 1 or more; a value above the maximum is capped, and the response reports the limit used. Any other value is refused with 400 unless lenient=1."
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "A whole number of 0 or more. Any other value is refused with 400 unless lenient=1."
          },
          {
            "in": "query",
            "name": "lenient",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "1, true or yes asks for a value the server cannot read to be ignored or replaced with its default instead of refused with 400. Any other value than these six is refused."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "A query value the server cannot read, without lenient=1"
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Attestation storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Past receipts only. Lists the attestation receipts this key made before 2026-10-19. Since then the attestation route, POST /attest, answers 410 on the hosted API, so no new receipts are made; every past receipt stays readable here. A key that never made one gets an empty list. An account's owner key lists the receipts of every key of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/attestations/{id}": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "One attestation receipt",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "400": {
            "description": "Invalid id",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "401": {
            "description": "Authentication required",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "404": {
            "description": "Not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "Attestation storage unavailable",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Past receipts only. Returns one attestation receipt this key made before 2026-10-19; no new receipts are made, because POST /attest answers 410 on the hosted API since then. A receipt that does not exist and a receipt made by another key both answer 404, so the answer never shows whether another key's receipt exists. An account's owner key reads the receipt of any key of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked; another account's receipt answers 404 to it."
      }
    },
    "/dcae/verify": {
      "post": {
        "tags": [
          "Verification"
        ],
        "summary": "Stateless DCAE verification (no auth)",
        "description": "Accepts a sealed ProofBundle, returns a binary verdict.\nStateless, same input always produces the same verdict.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/DCAEProofBundle"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Verdict",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/DCAEVerdict"
                }
              }
            }
          }
        }
      }
    },
    "/execute": {
      "post": {
        "tags": [
          "Execute"
        ],
        "summary": "Execute the pipeline + return sealed manifest",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Run completed successfully",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ExecuteResponse"
                }
              }
            }
          },
          "401": {
            "description": "Missing or invalid API key",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The run did not complete: the policy gate refused it (sealed DenyReceipt in body), an attestation gap refused it (AttestationGapReceipt), a CCV, MACC or AI review check halted it (its halt receipt), or it failed with a server error, a complete-record anchor that could not be made among them (the failure receipt's hash in record_hash, when one was sealed). While the account is stopped (round 64), every new run is refused with a sealed DenyReceipt whose fired_rule_id is account_stop and decision_reason_code ACCOUNT_STOPPED",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "409": {
            "description": "The job block was refused: a bad link, a repeated step, a closed job or a dropped branch",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "lenient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "Since round 60 a body field the server does not define is refused with 400 naming it, because it would not be sealed. lenient=1 drops such a field instead, as the server did before."
          }
        ]
      }
    },
    "/execute/batch": {
      "post": {
        "tags": [
          "Execute"
        ],
        "summary": "Run up to 1,000 executions in one request",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "runs"
                ],
                "properties": {
                  "runs": {
                    "type": "array",
                    "maxItems": 1000,
                    "items": {
                      "$ref": "#/components/schemas/ExecuteRequest"
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "successful": {
                      "type": "integer"
                    },
                    "failed": {
                      "type": "integer"
                    },
                    "duration_ms": {
                      "type": "integer"
                    },
                    "results": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "description": "One row per submitted run, in order. A failed row carries error fields or a typed halt receipt."
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "parameters": [
          {
            "name": "lenient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "Since round 60 a body field the server does not define is refused with 400 naming it, because it would not be sealed. lenient=1 drops such a field instead, as the server did before."
          }
        ]
      }
    },
    "/execute/verify-determinism": {
      "post": {
        "tags": [
          "Execute"
        ],
        "summary": "Run one payload twice and compare the hashes",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "$ref": "#/components/schemas/ExecuteRequest"
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "deterministic": {
                      "type": "boolean"
                    },
                    "first": {
                      "type": "object",
                      "properties": {
                        "run_id": {
                          "type": "integer"
                        },
                        "manifest_hash": {
                          "type": "string"
                        },
                        "bundle_hash": {
                          "type": "string"
                        },
                        "duration_ms": {
                          "type": "integer"
                        },
                        "status": {
                          "type": "string",
                          "description": "ok, stage_error, or the refusal or halt kind: pepg_deny, ccv_halt, macc_halt or aivp_t4_halt."
                        },
                        "error": {
                          "type": "string"
                        },
                        "receipt": {
                          "type": "object",
                          "description": "The sealed receipt of a refused or halted replay. The replay's manifest hash covers its hash."
                        }
                      }
                    },
                    "second": {
                      "type": "object",
                      "properties": {
                        "run_id": {
                          "type": "integer"
                        },
                        "manifest_hash": {
                          "type": "string"
                        },
                        "bundle_hash": {
                          "type": "string"
                        },
                        "duration_ms": {
                          "type": "integer"
                        },
                        "status": {
                          "type": "string",
                          "description": "ok, stage_error, or the refusal or halt kind: pepg_deny, ccv_halt, macc_halt or aivp_t4_halt."
                        },
                        "error": {
                          "type": "string"
                        },
                        "receipt": {
                          "type": "object",
                          "description": "The sealed receipt of a refused or halted replay. The replay's manifest hash covers its hash."
                        }
                      }
                    },
                    "diff": {
                      "type": "object",
                      "properties": {
                        "differs": {
                          "type": "boolean",
                          "description": "True when the status or the manifest hash differs."
                        },
                        "manifest_hash_differs": {
                          "type": "boolean"
                        },
                        "bundle_hash_differs": {
                          "type": "boolean"
                        },
                        "differing_fields": {
                          "type": "array",
                          "items": {
                            "type": "string"
                          }
                        },
                        "reason": {
                          "type": "string",
                          "description": "Why there is no verdict, when neither replay sealed a record."
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid request",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "Replays one request twice under a pinned clock and nonce, and compares the manifest hashes the two replays sealed. A completed replay and a replay the policy refused or a later check halted each seal a manifest hash, so two replays are deterministic when they end the same way with the same manifest hash; a refused or halted replay's row carries its sealed receipt. A completed, refused or halted replay is stored with status probe, and a replay that sealed nothing, or whose record could not be anchored on the in-process ledger, with status stage_error; no replay makes a public-log entry. When neither replay sealed anything, deterministic is false, nothing is listed as differing, and diff.reason says why.",
        "parameters": [
          {
            "name": "lenient",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "Since round 60 a body field the server does not define is refused with 400 naming it, because it would not be sealed. lenient=1 drops such a field instead, as the server did before."
          }
        ]
      }
    },
    "/health": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Liveness probe + binary identity",
        "description": "Returns `ok: true` when the orchestrator is up. No auth.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Health"
                }
              }
            }
          }
        }
      }
    },
    "/keys/request-key": {
      "post": {
        "tags": [
          "Runs"
        ],
        "summary": "Register the customer's request-signing public key",
        "description": "Registering a key makes a request signature required on this API key. Verdifax receives only the public key. The proof is a signature, by the matching private key, over the text verdifax.request-key.v1, a zero byte, and the base64 public key. Since round 61, for a key in a customer's account, each registration, rotation and clear is sealed in the account's signal feed as an account.changed event (request_key.registered, request_key.rotated, request_key.cleared), decided by the account's side (owner), in the same transaction as the change: a rotation and a clear carry the current key's approval, request_key_approval, which the verifier checks against the key before it. When the record cannot be sealed the change is not made.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "public_key",
                  "proof"
                ],
                "properties": {
                  "public_key": {
                    "type": "string"
                  },
                  "proof": {
                    "type": "string"
                  },
                  "change": {
                    "$ref": "#/components/schemas/RequestKeyChange"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "public_key": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The key and proof do not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The current key did not approve this change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The key is an approver key in the account, or the request key changed since the change was signed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Runs"
        ],
        "summary": "Clear the request-signing key",
        "description": "Request signatures stop being required on this API key. Since round 61, for a key in a customer's account, each registration, rotation and clear is sealed in the account's signal feed as an account.changed event (request_key.registered, request_key.rotated, request_key.cleared), decided by the account's side (owner), in the same transaction as the change: a rotation and a clear carry the current key's approval, request_key_approval, which the verifier checks against the key before it. When the record cannot be sealed the change is not made.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The current key did not approve this change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The key is an approver key in the account, or the request key changed since the change was signed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "change": {
                    "$ref": "#/components/schemas/RequestKeyChange"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/openapi.json": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "This API description",
        "description": "The OpenAPI document for the customer API. No auth.",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/public/runs/{token}/bundle.json": {
      "get": {
        "tags": [
          "Runs",
          "Verification"
        ],
        "summary": "Public audit bundle by unguessable token",
        "description": "No key required; the token is the capability. Serves the bundle\nwhile the run carrying this token is published. A stopped run has no\nbundle and is served at its receipt address instead. A malformed\ntoken (anything but 32 lowercase hex characters) is rejected\nbefore any lookup. Unknown, malformed, and unpublished tokens\nall return the same 404.\n\nA record the hardware-attested machine (attested.verdifax.com) made public is also served here, as an exact copy, so its link answers while that machine is off. The machine sends each copy with a statement signed by its copy-statement key, a key it uses for nothing else; the statement binds this link's token to the record's kind, run and SHA-256, and to the SHA-256 of the run's sign-off file when there is one. Each statement is also logged on the public log under the same key, so its time is the log's and not the one it states. The hosted service keeps the copy only when that statement checks, its public-log entry names it, is signed by the copy-statement key and is included in the log, the record is of the kind the statement names (read from the record itself), the public verifier passes the record and the statement with its entry, and the record's public-log entry is signed by that machine's log-signing key; it refuses any statement for the same token that is not newer than the last one it accepted, so an old or replayed statement cannot bring a copy back, and the same statement sent again changes nothing. The copy is served with the header X-Verdifax-Hosted-Copy naming the machine, the header X-Verdifax-Hosted-Copy-Statement carrying the signed statement and the header X-Verdifax-Hosted-Copy-Anchor carrying the statement's public-log entry, which verdifax-verify --copy-statement with --copy-anchor and --copy-token checks offline, judging the copy-statement key's period by the log's time, with --copy-signoff for the sign-off file served at the same link. The 132 copies kept before statements were logged (November 28, 2026) carry no entry until the machine next sends them; the verifier accepts those statements by their pinned SHA-256. The copy is dropped only when the machine sends a signed statement withdrawing or deleting the record.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The audit bundle JSON (Cache-Control public, max-age=3600)",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/public/runs/{token}/receipt.json": {
      "get": {
        "tags": [
          "Runs",
          "Verification"
        ],
        "summary": "Public receipt of a stopped run by unguessable token",
        "description": "No key required; the token is the capability. Serves a published\nstopped run's sealed receipt (a policy refusal, an AI-output review\nhalt, a per-run or cumulative budget halt, an attestation gap or a\nfailure), the same document its key holder fetches from the run's\nreceipt route, with its public-log entry beside it, so verdifax-verify\nchecks this address as it checks the key holder's copy. Unknown,\nmalformed and unpublished tokens, and tokens of runs that did not\nstop, all return the same 404.\n\nA record the hardware-attested machine (attested.verdifax.com) made public is also served here, as an exact copy, so its link answers while that machine is off. The machine sends each copy with a statement signed by its copy-statement key, a key it uses for nothing else; the statement binds this link's token to the record's kind, run and SHA-256, and to the SHA-256 of the run's sign-off file when there is one. Each statement is also logged on the public log under the same key, so its time is the log's and not the one it states. The hosted service keeps the copy only when that statement checks, its public-log entry names it, is signed by the copy-statement key and is included in the log, the record is of the kind the statement names (read from the record itself), the public verifier passes the record and the statement with its entry, and the record's public-log entry is signed by that machine's log-signing key; it refuses any statement for the same token that is not newer than the last one it accepted, so an old or replayed statement cannot bring a copy back, and the same statement sent again changes nothing. The copy is served with the header X-Verdifax-Hosted-Copy naming the machine, the header X-Verdifax-Hosted-Copy-Statement carrying the signed statement and the header X-Verdifax-Hosted-Copy-Anchor carrying the statement's public-log entry, which verdifax-verify --copy-statement with --copy-anchor and --copy-token checks offline, judging the copy-statement key's period by the log's time, with --copy-signoff for the sign-off file served at the same link. The 132 copies kept before statements were logged (November 28, 2026) carry no entry until the machine next sends them; the verifier accepts those statements by their pinned SHA-256. The copy is dropped only when the machine sends a signed statement withdrawing or deleting the record.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The receipt document (Cache-Control public, max-age=3600)",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/public/runs/{token}/report.pdf": {
      "get": {
        "tags": [
          "Runs",
          "Verification"
        ],
        "summary": "Public audit PDF of a published run by unguessable token",
        "description": "No key required; the token is the capability. Serves the audit PDF of a\npublished run, as its key holder gets it, without the account's live budget\nsnapshot or deletion receipts. Unknown, malformed and unpublished tokens all\nreturn the same 404.\n",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "default": "comprehensive"
            },
            "description": "One of the four format names; case and surrounding spaces do not matter. Missing means comprehensive. Any other name is refused with 400 unless fallback=comprehensive is set."
          },
          {
            "in": "query",
            "name": "fallback",
            "schema": {
              "type": "string",
              "enum": [
                "comprehensive"
              ]
            },
            "description": "Set to comprehensive to receive the comprehensive report when format is not one of the four names. Without it, an unknown format is refused with 400."
          },
          {
            "in": "query",
            "name": "inline",
            "schema": {
              "type": "string"
            },
            "description": "1, true or yes asks for inline display; empty, 0, false or no for a download. Any other value is refused with 400. With lenient=1, only 1 means inline."
          },
          {
            "in": "query",
            "name": "lenient",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "1, true or yes asks for a value the server cannot read to be ignored or replaced with its default instead of refused with 400. Any other value than these six is refused."
          }
        ],
        "responses": {
          "200": {
            "description": "PDF bytes (Cache-Control no-store)",
            "content": {
              "application/pdf": {}
            }
          },
          "400": {
            "description": "An unknown format without fallback=comprehensive, or a fallback other than comprehensive, or a query value the server cannot read, without lenient=1"
          },
          "404": {
            "description": "Not found"
          }
        }
      },
      "post": {
        "tags": [
          "Runs",
          "Verification"
        ],
        "summary": "Public audit PDF of a published run, printing the AI's answer",
        "description": "No key required; the token is the capability. Serves the audit PDF of a\npublished run, as its key holder gets it, without the account's live budget\nsnapshot or deletion receipts. Unknown, malformed and unpublished tokens all\nreturn the same 404.\nThe answer is printed, marked as supplied, only when its SHA-256 is the\nhash the record seals; other text is refused with 422.\n",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "default": "comprehensive"
            },
            "description": "One of the four format names; case and surrounding spaces do not matter. Missing means comprehensive. Any other name is refused with 400 unless fallback=comprehensive is set."
          },
          {
            "in": "query",
            "name": "fallback",
            "schema": {
              "type": "string",
              "enum": [
                "comprehensive"
              ]
            },
            "description": "Set to comprehensive to receive the comprehensive report when format is not one of the four names. Without it, an unknown format is refused with 400."
          },
          {
            "in": "query",
            "name": "inline",
            "schema": {
              "type": "string"
            },
            "description": "1, true or yes asks for inline display; empty, 0, false or no for a download. Any other value is refused with 400. With lenient=1, only 1 means inline."
          },
          {
            "in": "query",
            "name": "lenient",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "1, true or yes asks for a value the server cannot read to be ignored or replaced with its default instead of refused with 400. Any other value than these six is refused."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "ai_output_text"
                ],
                "properties": {
                  "format": {
                    "type": "string",
                    "description": "One of the four format names; case and surrounding spaces do not matter. Missing means comprehensive. Any other name is refused with 400 unless fallback=comprehensive is set."
                  },
                  "fallback": {
                    "type": "string",
                    "enum": [
                      "comprehensive"
                    ],
                    "description": "As the fallback query parameter. When both are set they must be equal."
                  },
                  "ai_output_text": {
                    "type": "string",
                    "description": "The AI's exact answer. Printed only when its SHA-256 is the answer hash the record seals; used for this response only and stored nowhere."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PDF bytes (Cache-Control no-store)",
            "content": {
              "application/pdf": {}
            }
          },
          "400": {
            "description": "No answer text, an unknown field, an unknown format without fallback=comprehensive, or two different formats or fallbacks, or a query value the server cannot read, without lenient=1"
          },
          "404": {
            "description": "Not found"
          },
          "422": {
            "description": "The text is not the answer the record seals, or the record seals none"
          }
        }
      }
    },
    "/public/runs/{token}/signoff.json": {
      "get": {
        "tags": [
          "Runs",
          "Verification"
        ],
        "summary": "Sign-off of a published run",
        "description": "No key required. The sign-off facts this published run's audit report prints: each decision, its place in the account's sign-off chain, when it was signed and whether a note is sealed by its hash, and for a step of a job, the job's final step and the decision on it, the decision on the whole job, which governs the step. The note, the approver key and the signatures are not served; verdifax-verify --signoff checks them from the account's sign-off records. Every run that is not served here returns the same 404.\n\nA record the hardware-attested machine (attested.verdifax.com) made public is also served here, as an exact copy, so its link answers while that machine is off. The machine sends each copy with a statement signed by its copy-statement key, a key it uses for nothing else; the statement binds this link's token to the record's kind, run and SHA-256, and to the SHA-256 of the run's sign-off file when there is one. Each statement is also logged on the public log under the same key, so its time is the log's and not the one it states. The hosted service keeps the copy only when that statement checks, its public-log entry names it, is signed by the copy-statement key and is included in the log, the record is of the kind the statement names (read from the record itself), the public verifier passes the record and the statement with its entry, and the record's public-log entry is signed by that machine's log-signing key; it refuses any statement for the same token that is not newer than the last one it accepted, so an old or replayed statement cannot bring a copy back, and the same statement sent again changes nothing. The copy is served with the header X-Verdifax-Hosted-Copy naming the machine, the header X-Verdifax-Hosted-Copy-Statement carrying the signed statement and the header X-Verdifax-Hosted-Copy-Anchor carrying the statement's public-log entry, which verdifax-verify --copy-statement with --copy-anchor and --copy-token checks offline, judging the copy-statement key's period by the log's time, with --copy-signoff for the sign-off file served at the same link. The 132 copies kept before statements were logged (November 28, 2026) carry no entry until the machine next sends them; the verifier accepts those statements by their pinned SHA-256. The copy is dropped only when the machine sends a signed statement withdrawing or deleting the record.",
        "parameters": [
          {
            "in": "path",
            "name": "token",
            "required": true,
            "schema": {
              "type": "string",
              "pattern": "^[0-9a-f]{32}$"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sign-off facts (Cache-Control no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSignOffAnswer"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/runs": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "List runs scoped to the authenticated key",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 500
            },
            "description": "A whole number of 1 or more; a value above the maximum is capped, and the response reports the limit used. Any other value is refused with 400 unless lenient=1."
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "A whole number of 0 or more. Any other value is refused with 400 unless lenient=1."
          },
          {
            "in": "query",
            "name": "lenient",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "1, true or yes asks for a value the server cannot read to be ignored or replaced with its default instead of refused with 400. Any other value than these six is refused."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "runs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Run"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A query value the server cannot read, without lenient=1"
          }
        }
      }
    },
    "/runs/export": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "Export the runs held for the authenticated key in a period",
        "description": "Lists the runs the server holds for this key in the period, failures included, with up to 10,000 rows per export. It states what the server stored, not a verdict: check a record with the verifier. A call that never reached Verdifax cannot appear here.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "description": "RFC 3339 time, inclusive.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "to",
            "description": "RFC 3339 time, exclusive. Defaults to the time of the request.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          },
          {
            "name": "job_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only the runs of this job."
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv the body is the same rows as CSV, and the X-Verdifax-Total and X-Verdifax-Truncated headers say whether the period holds more runs than were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "to": {
                      "type": "string"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "returned": {
                      "type": "integer"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "by_status": {
                      "type": "object",
                      "description": "Rows returned, counted by status."
                    },
                    "runs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "run_id": {
                            "type": "integer"
                          },
                          "api_key_id": {
                            "type": "integer",
                            "description": "The key that requested the run, so an account's export can be grouped by key."
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "error_stage": {
                            "type": "string"
                          },
                          "route_id": {
                            "type": "string"
                          },
                          "manifest_hash": {
                            "type": "string"
                          },
                          "log_entry_id": {
                            "type": "string"
                          },
                          "leaf_hash": {
                            "type": "string"
                          },
                          "complete_record_entry_id": {
                            "type": "string"
                          },
                          "complete_record_leaf_hash": {
                            "type": "string"
                          },
                          "anchor_source": {
                            "type": "string",
                            "enum": [
                              "bundle",
                              "receipt",
                              "none"
                            ],
                            "description": "Where the log columns came from: a completed run's bundle, a refused or halted run's receipt, or none."
                          },
                          "job_id": {
                            "type": "string"
                          },
                          "step_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-Verdifax-Total": {
                "schema": {
                  "type": "integer"
                },
                "description": "Runs held for the period. Sent with format=csv."
              },
              "X-Verdifax-Truncated": {
                "schema": {
                  "type": "boolean"
                },
                "description": "True when the period holds more runs than were returned. Sent with format=csv."
              }
            }
          },
          "400": {
            "description": "Invalid format or time",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/runs/search": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "Search runs scoped to the authenticated key",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "manifest_hash",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "program_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "route_id",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "status",
            "schema": {
              "type": "string"
            }
          },
          {
            "in": "query",
            "name": "from",
            "description": "RFC 3339 time. A value the server cannot read is refused with 400; with lenient=1 it is left out of the search.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "to",
            "description": "RFC 3339 time. A value the server cannot read is refused with 400; with lenient=1 it is left out of the search.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 500
            },
            "description": "A whole number of 1 or more; a value above the maximum is capped, and the response reports the limit used. Any other value is refused with 400 unless lenient=1."
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "default": 0
            },
            "description": "A whole number of 0 or more. Any other value is refused with 400 unless lenient=1."
          },
          {
            "in": "query",
            "name": "lenient",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "1, true or yes asks for a value the server cannot read to be ignored or replaced with its default instead of refused with 400. Any other value than these six is refused."
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    },
                    "runs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Run"
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A query value the server cannot read, without lenient=1"
          }
        }
      }
    },
    "/runs/{id}": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "Get a single run by ID",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Run"
                }
              }
            }
          },
          "404": {
            "description": "Run not found"
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/aivp-t4-halt-receipt": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "Halt receipt of a run the AIVP stage stopped",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "aivp_t4_halt_receipt": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The run did not end in this outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/allow-token": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "The AllowToken of an ok run",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "allow_token": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Not an allow run, or no AllowToken",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/artifacts": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "The run's sealed audit bundle",
        "description": "The bundle a key holder downloads to verify offline with verdifax-verify. A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "Run or bundle not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/runs/{id}/attestation-gap-receipt": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "AttestationGapReceipt of a halted run",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "attestation_gap_receipt": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The run did not end in this outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/bundle.json": {
      "get": {
        "tags": [
          "Runs",
          "Verification"
        ],
        "summary": "Public audit bundle by run id (grandfathered records only)",
        "description": "Past records only. This numbered address serves only a record made public here before October 16, 2026; none is public today, and a record published now is served only at its own unguessable token link. Every other run answers 404.\n\nNo key required. Serves the bundle only for records that were\npublic before schema v18 (is_public = 1 with no public token).\nA run's route_id never makes it public. Every other run,\nincluding a run published with a token, returns the same 404\nwhether or not it exists.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The audit bundle JSON (Cache-Control public, max-age=3600)",
            "content": {
              "application/json": {}
            }
          },
          "404": {
            "description": "Run not found, or not public at this URL"
          }
        }
      }
    },
    "/runs/{id}/ccv-halt-receipt": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "CCVHaltReceipt of a halted run",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "ccv_halt_receipt": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The run did not end in this outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/ces-audit-record": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "The CES audit record of a run",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          },
          "404": {
            "description": "No CES audit record for this run",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/deletion-receipts": {
      "get": {
        "tags": [
          "CRES"
        ],
        "summary": "List CRES deletion receipts for a run",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer",
                      "format": "int64"
                    },
                    "count": {
                      "type": "integer"
                    },
                    "receipts": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/DeletionReceipt"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/deny-receipt": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "DenyReceipt of a pepg_deny run",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "deny_receipt": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The run did not end in this outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/macc-halt-receipt": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "MACCHaltReceipt of a halted run",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "macc_halt_receipt": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "The run did not end in this outcome",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/report": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "Audit report for a run, as JSON",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "report": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "Run not found",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/runs/{id}/report.pdf": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "Audit PDF for a run",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "default": "comprehensive"
            },
            "description": "One of the four format names; case and surrounding spaces do not matter. Missing means comprehensive. Any other name is refused with 400 unless fallback=comprehensive is set."
          },
          {
            "in": "query",
            "name": "fallback",
            "schema": {
              "type": "string",
              "enum": [
                "comprehensive"
              ]
            },
            "description": "Set to comprehensive to receive the comprehensive report when format is not one of the four names. Without it, an unknown format is refused with 400."
          },
          {
            "in": "query",
            "name": "inline",
            "schema": {
              "type": "string"
            },
            "description": "1, true or yes asks for inline display; empty, 0, false or no for a download. Any other value is refused with 400. With lenient=1, only 1 means inline."
          },
          {
            "in": "query",
            "name": "lenient",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "1, true or yes asks for a value the server cannot read to be ignored or replaced with its default instead of refused with 400. Any other value than these six is refused."
          }
        ],
        "responses": {
          "200": {
            "description": "PDF bytes",
            "content": {
              "application/pdf": {}
            }
          },
          "400": {
            "description": "An unknown format without fallback=comprehensive, or a fallback other than comprehensive, or a query value the server cannot read, without lenient=1"
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      },
      "post": {
        "tags": [
          "Runs"
        ],
        "summary": "Audit PDF for a run, printing the AI's answer",
        "description": "A record seals only the SHA-256 of the AI's answer (ai_output_text), not its text; text a caller puts in request_substance (such as output.content_inline) is stored as sent. This\nrequest carries the answer text, and the report prints it on its first page,\nmarked as supplied by the caller, only when the text's SHA-256 is the hash\nthe record seals. Other text, or text for a record that seals no answer, is\nrefused with 422 and nothing is printed. A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "default": "comprehensive"
            },
            "description": "One of the four format names; case and surrounding spaces do not matter. Missing means comprehensive. Any other name is refused with 400 unless fallback=comprehensive is set."
          },
          {
            "in": "query",
            "name": "fallback",
            "schema": {
              "type": "string",
              "enum": [
                "comprehensive"
              ]
            },
            "description": "Set to comprehensive to receive the comprehensive report when format is not one of the four names. Without it, an unknown format is refused with 400."
          },
          {
            "in": "query",
            "name": "inline",
            "schema": {
              "type": "string"
            },
            "description": "1, true or yes asks for inline display; empty, 0, false or no for a download. Any other value is refused with 400. With lenient=1, only 1 means inline."
          },
          {
            "in": "query",
            "name": "lenient",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "1, true or yes asks for a value the server cannot read to be ignored or replaced with its default instead of refused with 400. Any other value than these six is refused."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "ai_output_text"
                ],
                "properties": {
                  "format": {
                    "type": "string",
                    "description": "One of the four format names; case and surrounding spaces do not matter. Missing means comprehensive. Any other name is refused with 400 unless fallback=comprehensive is set."
                  },
                  "fallback": {
                    "type": "string",
                    "enum": [
                      "comprehensive"
                    ],
                    "description": "As the fallback query parameter. When both are set they must be equal."
                  },
                  "ai_output_text": {
                    "type": "string",
                    "description": "The AI's exact answer. Printed only when its SHA-256 is the answer hash the record seals; used for this response only and stored nowhere."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "PDF bytes (Cache-Control no-store)",
            "content": {
              "application/pdf": {}
            }
          },
          "400": {
            "description": "No answer text, an unknown field, an unknown format without fallback=comprehensive, or two different formats or fallbacks, or a query value the server cannot read, without lenient=1"
          },
          "422": {
            "description": "The text is not the answer the record seals, or the record seals none"
          }
        }
      }
    },
    "/runs/{id}/signoff.json": {
      "get": {
        "tags": [
          "Runs",
          "Verification"
        ],
        "summary": "Sign-off of a grandfathered public run",
        "description": "Past records only. This numbered address serves only a record made public here before October 16, 2026; none is public today, and a record published now is served only at its own unguessable token link. Every other run answers 404.\n\nAs /public/runs/{token}/signoff.json, for a run made public before public links used tokens. No key required. The sign-off facts this published run's audit report prints: each decision, its place in the account's sign-off chain, when it was signed and whether a note is sealed by its hash, and for a step of a job, the job's final step and the decision on it, the decision on the whole job, which governs the step. The note, the approver key and the signatures are not served; verdifax-verify --signoff checks them from the account's sign-off records. Every run that is not served here returns the same 404.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sign-off facts (Cache-Control no-store)",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PublicSignOffAnswer"
                }
              }
            }
          },
          "404": {
            "description": "Not found"
          }
        }
      }
    },
    "/runs/{id}/verify": {
      "get": {
        "tags": [
          "Verification"
        ],
        "summary": "Recompute the manifest hash from sealed inputs",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer",
              "format": "int64"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/VerifyResponse"
                }
              }
            }
          }
        },
        "description": "A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it."
      }
    },
    "/stats": {
      "get": {
        "tags": [
          "Runs"
        ],
        "summary": "Run statistics for the authenticated key",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "total_runs": {
                      "type": "integer"
                    },
                    "runs_today": {
                      "type": "integer"
                    },
                    "runs_last_24h": {
                      "type": "integer"
                    },
                    "pass_rate": {
                      "type": "number"
                    },
                    "avg_duration_ms": {
                      "type": "number"
                    },
                    "last_run_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "runs_by_program": {
                      "type": "object"
                    }
                  }
                }
              }
            },
            "headers": {
              "X-Verdifax-Allowed-Tools": {
                "schema": {
                  "type": "string"
                },
                "description": "Round 64: the tool allowlist the key's owner granted it, comma-separated. Absent when the key has none."
              }
            }
          }
        }
      }
    },
    "/version": {
      "get": {
        "tags": [
          "Health"
        ],
        "summary": "Deploy attestation surface",
        "description": "Surfaces orchestrator binary identity, the current manifest era,\nevery era this binary can verify, and per-kernel preimage versions.\nOperators and the verifier CLI use this to confirm at-a-glance\nwhich build is serving traffic.\n",
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Version"
                }
              }
            }
          }
        }
      }
    },
    "/policies": {
      "get": {
        "tags": [
          "Policies"
        ],
        "summary": "List this key's policy documents",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The documents, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "chain_id": {
                      "type": "string",
                      "description": "The chain of this key's policy changes, for example api-key-7."
                    },
                    "newest_activation_hash": {
                      "type": "string",
                      "description": "The newest change, or 64 zeros when there is none. The next change must name it."
                    },
                    "active_document_hash": {
                      "type": "string",
                      "description": "The document in force, or empty under the built-in policy."
                    },
                    "policies": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "policy_id": {
                            "type": "string"
                          },
                          "policy_version": {
                            "type": "string"
                          },
                          "policy_hash": {
                            "type": "string"
                          },
                          "document_hash": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "description": "With the documents, the chain this key's changes belong to and the newest change in it: what a client signs to activate a document."
      },
      "post": {
        "tags": [
          "Policies"
        ],
        "summary": "Upload a policy document",
        "description": "Stores the exact text. Nothing changes until it is activated. Every field either works or is refused here. Verdifax does not write, review or approve a customer's policy.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "document"
                ],
                "properties": {
                  "document": {
                    "type": "string",
                    "description": "The exact text of the policy, up to 64 KB."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored."
          },
          "400": {
            "description": "Refused, with the reason."
          },
          "409": {
            "description": "This key holds the most documents allowed."
          }
        }
      }
    },
    "/policies/test": {
      "post": {
        "tags": [
          "Policies"
        ],
        "summary": "Show which rule would fire on sample inputs",
        "description": "Seals nothing and takes no place in a rate window.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "document": {
                    "type": "string"
                  },
                  "document_hash": {
                    "type": "string"
                  },
                  "inputs": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The outcome and the rule."
          }
        }
      }
    },
    "/policies/history": {
      "get": {
        "tags": [
          "Policies"
        ],
        "summary": "The chain of policy changes, oldest first",
        "description": "The form verdifax-verify --policy-history reads: the calling key's own policy chain. The list holds the policy changes, verdifax.policy.activation.v1, oldest first, with restore gaps (verdifax.restore-gap.v1) and interrupted records (verdifax.chain-interrupted.v1) in the places they close.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The chain, oldest first."
          }
        }
      }
    },
    "/policies/{document_hash}": {
      "get": {
        "tags": [
          "Policies"
        ],
        "summary": "Read one policy document",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "document_hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SHA-256 of the exact text."
          }
        ],
        "responses": {
          "200": {
            "description": "The document, as exact text."
          },
          "404": {
            "description": "No such policy under this key."
          }
        }
      }
    },
    "/policies/{document_hash}/activate": {
      "post": {
        "tags": [
          "Policies"
        ],
        "summary": "Make a stored document the policy in force",
        "description": "One more link in a chain anchored on the public log. If a request key is registered, it must sign the change: an Ed25519 signature over the UTF-8 bytes of verdifax.policy.activation.v1, chain_id, document_hash, previous_activation_hash, signed_at and nonce, joined by zero bytes. signed_at is RFC 3339 within five minutes of the server's clock, and nonce is 32 hex characters, used once. GET /policies returns chain_id and the newest change. Rolling back is activating an earlier document.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "document_hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SHA-256 of the exact text."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "previous_activation_hash"
                ],
                "properties": {
                  "previous_activation_hash": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "object",
                    "properties": {
                      "signature": {
                        "type": "string"
                      },
                      "signed_at": {
                        "type": "string"
                      },
                      "nonce": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The change record."
          },
          "403": {
            "description": "The request key must approve this change."
          },
          "404": {
            "description": "No such policy under this key."
          },
          "409": {
            "description": "Not yet effective, or not the newest change."
          },
          "503": {
            "description": "The change could not be logged, so it was not made."
          }
        }
      }
    },
    "/account/policies": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List the account's policy documents",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The documents, newest first.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "chain_id": {
                      "type": "string",
                      "description": "The chain of the account's policy changes, for example account-7."
                    },
                    "newest_activation_hash": {
                      "type": "string",
                      "description": "The newest change, or 64 zeros when there is none. The next change must name it."
                    },
                    "active_document_hash": {
                      "type": "string",
                      "description": "The document in force, or empty under the built-in policy."
                    },
                    "policies": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "policy_id": {
                            "type": "string"
                          },
                          "policy_version": {
                            "type": "string"
                          },
                          "policy_hash": {
                            "type": "string"
                          },
                          "document_hash": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "description": "The account's policy, which every key in the account must pass on top of the key's own policy. The bodies are those of /policies; chain_id is account-N. With the documents, the chain the account's changes belong to and the newest change in it: what a client signs to activate a document. Needs the account's owner key, which manages the account and cannot run anything itself."
      },
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Upload an account policy document",
        "description": "The account's policy, which every key in the account must pass on top of the key's own policy. The bodies are those of /policies; chain_id is account-N. Stores the exact text. Nothing changes until it is activated. Every field either works or is refused here. Verdifax does not write, review or approve a customer's policy. Needs the account's owner key, which manages the account and cannot run anything itself.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "document"
                ],
                "properties": {
                  "document": {
                    "type": "string",
                    "description": "The exact text of the policy, up to 64 KB."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Stored."
          },
          "400": {
            "description": "Refused, with the reason."
          },
          "409": {
            "description": "This key holds the most documents allowed."
          }
        }
      }
    },
    "/account/policies/test": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Show which rule of an account policy would fire on sample inputs",
        "description": "The same body as /policies/test, for the account's documents. Seals nothing and takes no place in a rate window. Needs the account's owner key, which manages the account and cannot run anything itself.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "document": {
                    "type": "string"
                  },
                  "document_hash": {
                    "type": "string"
                  },
                  "inputs": {
                    "type": "object"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The outcome and the rule."
          }
        }
      }
    },
    "/account/policies/history": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "The chain of the account's policy changes, oldest first",
        "description": "The form verdifax-verify --account-policy-history reads. Needs the account's owner key, which manages the account and cannot run anything itself. The list holds the policy changes, verdifax.policy.activation.v1, oldest first, with restore gaps (verdifax.restore-gap.v1) and interrupted records (verdifax.chain-interrupted.v1) in the places they close.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The chain, oldest first."
          }
        }
      }
    },
    "/account/policies/{document_hash}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Read one of the account's policy documents",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "document_hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SHA-256 of the exact text."
          }
        ],
        "responses": {
          "200": {
            "description": "The document, as exact text."
          },
          "404": {
            "description": "No such policy in this account."
          }
        },
        "description": " Needs the account's owner key, which manages the account and cannot run anything itself."
      }
    },
    "/account/policies/{document_hash}/activate": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Make a stored document the account's policy in force",
        "description": "Every change to an account policy must be signed by the owner key's request key, registered with POST /account/request-key, over chain_id account-N. One more link in a chain anchored on the public log. The signature is an Ed25519 signature over the UTF-8 bytes of verdifax.policy.activation.v1, chain_id, document_hash, previous_activation_hash, signed_at and nonce, joined by zero bytes. signed_at is RFC 3339 within five minutes of the server's clock, and nonce is 32 hex characters, used once. GET /account/policies returns chain_id and the newest change. Rolling back is activating an earlier document. Needs the account's owner key, which manages the account and cannot run anything itself.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "document_hash",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string"
            },
            "description": "SHA-256 of the exact text."
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "previous_activation_hash"
                ],
                "properties": {
                  "previous_activation_hash": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "object",
                    "properties": {
                      "signature": {
                        "type": "string"
                      },
                      "signed_at": {
                        "type": "string"
                      },
                      "nonce": {
                        "type": "string"
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The change record."
          },
          "403": {
            "description": "The request key must approve this change."
          },
          "404": {
            "description": "No such policy in this account."
          },
          "409": {
            "description": "Not yet effective, or not the newest change."
          },
          "503": {
            "description": "The change could not be logged, so it was not made."
          }
        }
      }
    },
    "/account/request-key": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Register the owner key's request-signing public key",
        "description": "The owner key's request key signs every change to the account's policy. Verdifax receives only the public key. The proof is a signature, by the matching private key, over the text verdifax.request-key.v1, a zero byte, and the base64 public key. Needs the account's owner key, which manages the account and cannot run anything itself. Since round 61, for a key in a customer's account, each registration, rotation and clear is sealed in the account's signal feed as an account.changed event (request_key.registered, request_key.rotated, request_key.cleared), decided by the account's side (owner), in the same transaction as the change: a rotation and a clear carry the current key's approval, request_key_approval, which the verifier checks against the key before it. When the record cannot be sealed the change is not made.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "public_key",
                  "proof"
                ],
                "properties": {
                  "public_key": {
                    "type": "string"
                  },
                  "proof": {
                    "type": "string"
                  },
                  "change": {
                    "$ref": "#/components/schemas/RequestKeyChange"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "public_key": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The key and proof do not match",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "The current key did not approve this change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The key is an approver key in the account, or the request key changed since the change was signed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "delete": {
        "tags": [
          "Accounts"
        ],
        "summary": "Clear the owner key's request-signing public key",
        "description": "The owner key's request key signs every change to the account's policy, so with none registered the account's policy cannot be changed. A trial owner key's request key can be replaced but not cleared. Needs the account's owner key, which manages the account and cannot run anything itself. Since round 61, for a key in a customer's account, each registration, rotation and clear is sealed in the account's signal feed as an account.changed event (request_key.registered, request_key.rotated, request_key.cleared), decided by the account's side (owner), in the same transaction as the change: a rotation and a clear carry the current key's approval, request_key_approval, which the verifier checks against the key before it. When the record cannot be sealed the change is not made.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The current key did not approve this change",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The key is an approver key in the account, or the request key changed since the change was signed",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        },
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "change": {
                    "$ref": "#/components/schemas/RequestKeyChange"
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/runs": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List the runs of every key in the account",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "default": 50,
              "maximum": 500
            }
          },
          {
            "in": "query",
            "name": "offset",
            "schema": {
              "type": "integer",
              "default": 0
            }
          }
        ],
        "responses": {
          "200": {
            "description": "OK",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "runs": {
                      "type": "array",
                      "items": {
                        "$ref": "#/components/schemas/Run"
                      }
                    },
                    "total": {
                      "type": "integer"
                    },
                    "limit": {
                      "type": "integer"
                    },
                    "offset": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "description": "Needs the account's owner key, which manages the account and cannot run anything itself."
      }
    },
    "/account/runs/export": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Export the runs of every key in the account in a period",
        "description": "The account's view covers the runs its keys made through Verdifax, not runs made elsewhere. The export also carries the account's policy documents and chain of changes. Lists the runs the server holds for the account's keys in the period, failures included, with up to 10,000 rows per export. It states what the server stored, not a verdict: check a record with the verifier. A call that never reached Verdifax cannot appear here. Needs the account's owner key, which manages the account and cannot run anything itself.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "query",
            "name": "from",
            "description": "RFC 3339 time, inclusive.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "to",
            "description": "RFC 3339 time, exclusive. Defaults to the time of the request.",
            "schema": {
              "type": "string",
              "format": "date-time"
            }
          },
          {
            "in": "query",
            "name": "format",
            "schema": {
              "type": "string",
              "enum": [
                "json",
                "csv"
              ],
              "default": "json"
            }
          },
          {
            "name": "job_id",
            "in": "query",
            "required": false,
            "schema": {
              "type": "string"
            },
            "description": "Only the runs of this job."
          }
        ],
        "responses": {
          "200": {
            "description": "OK. With format=csv the body is the same rows as CSV, and the X-Verdifax-Total and X-Verdifax-Truncated headers say whether the period holds more runs than were returned.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "to": {
                      "type": "string"
                    },
                    "total": {
                      "type": "integer"
                    },
                    "returned": {
                      "type": "integer"
                    },
                    "truncated": {
                      "type": "boolean"
                    },
                    "by_status": {
                      "type": "object",
                      "description": "Rows returned, counted by status."
                    },
                    "runs": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "run_id": {
                            "type": "integer"
                          },
                          "api_key_id": {
                            "type": "integer",
                            "description": "The key that requested the run, so an account's export can be grouped by key."
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "status": {
                            "type": "string"
                          },
                          "error_stage": {
                            "type": "string"
                          },
                          "route_id": {
                            "type": "string"
                          },
                          "manifest_hash": {
                            "type": "string"
                          },
                          "log_entry_id": {
                            "type": "string"
                          },
                          "leaf_hash": {
                            "type": "string"
                          },
                          "complete_record_entry_id": {
                            "type": "string"
                          },
                          "complete_record_leaf_hash": {
                            "type": "string"
                          },
                          "anchor_source": {
                            "type": "string",
                            "enum": [
                              "bundle",
                              "receipt",
                              "none"
                            ],
                            "description": "Where the log columns came from: a completed run's bundle, a refused or halted run's receipt, or none."
                          },
                          "job_id": {
                            "type": "string"
                          },
                          "step_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              },
              "text/csv": {
                "schema": {
                  "type": "string"
                }
              }
            },
            "headers": {
              "X-Verdifax-Total": {
                "schema": {
                  "type": "integer"
                },
                "description": "Runs held for the period. Sent with format=csv."
              },
              "X-Verdifax-Truncated": {
                "schema": {
                  "type": "boolean"
                },
                "description": "True when the period holds more runs than were returned. Sent with format=csv."
              }
            }
          },
          "400": {
            "description": "Invalid format or time",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "Read the owner's account",
        "description": "The account's number, name, tier, key counts and policy chain. The account number is a label Verdifax assigned, not a verified company identity. Needs the account's owner key, which manages the account and cannot run anything itself.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The account.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "account_id": {
                      "type": "string",
                      "description": "account-N, as records seal it."
                    },
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "member_keys": {
                      "type": "integer"
                    },
                    "owner_keys": {
                      "type": "integer"
                    },
                    "chain_id": {
                      "type": "string"
                    },
                    "time_zone": {
                      "type": "string",
                      "description": "The second zone the account's reports show beside UTC: an IANA zone, \"none\" for UTC alone, or empty for the zone of the server's region, which an account that never chose sees."
                    },
                    "owner_replacement": {
                      "type": "string",
                      "enum": [
                        "allowed",
                        "blocked"
                      ],
                      "description": "The owner's block on Verdifax replacing or revoking the owner key."
                    },
                    "verdifax_deletion": {
                      "type": "string",
                      "enum": [
                        "allowed",
                        "blocked"
                      ],
                      "description": "The owner's block on Verdifax deleting a record."
                    },
                    "owner_reads": {
                      "type": "string",
                      "enum": [
                        "allowed",
                        "blocked"
                      ],
                      "description": "Whether the owner key reads the account's records. Blocked until the owner allows it."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/time-zone": {
      "put": {
        "tags": [
          "Accounts"
        ],
        "summary": "Choose the second time zone on the account's reports",
        "description": "Every audit report shows times in UTC and one more zone. Set an IANA zone such as Europe/London, \"none\" for UTC alone, or empty to go back to the zone of the server's region, which is what an account that never chose sees. It changes how times are displayed, never a sealed value. Needs the account's owner key.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "time_zone"
                ],
                "properties": {
                  "time_zone": {
                    "type": "string",
                    "maxLength": 64
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The zone now chosen.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "time_zone": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not an IANA zone the server knows, \"none\" or empty."
          },
          "403": {
            "description": "Not the account's owner key."
          }
        }
      }
    },
    "/account/keys": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "summary": "List the account's keys",
        "description": "Every key in the account, owner keys included, without secrets. Needs the account's owner key, which manages the account and cannot run anything itself.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The keys.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "keys": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "name": {
                            "type": "string"
                          },
                          "account_id": {
                            "type": "string"
                          },
                          "owner": {
                            "type": "boolean"
                          },
                          "tier": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "last_used_at": {
                            "type": "string"
                          },
                          "run_count": {
                            "type": "integer"
                          },
                          "revoked": {
                            "type": "boolean"
                          },
                          "expires_at": {
                            "type": "string"
                          },
                          "allowed_tools": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            },
                            "description": "A member key's allowlist, when its owner granted one."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Accounts"
        ],
        "summary": "Create a member key in the account",
        "description": "The key takes the account's tier and stays in the account for life. On a trial account it needs a request key before it can run. The secret is shown once. Needs the account's owner key, which manages the account and cannot run anything itself.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "expires_at": {
                    "type": "string",
                    "description": "RFC 3339 or YYYY-MM-DD."
                  },
                  "allowed_tools": {
                    "type": "array",
                    "minItems": 1,
                    "uniqueItems": true,
                    "items": {
                      "type": "string",
                      "enum": [
                        "verify_record",
                        "verify_feed",
                        "get_record",
                        "list_records",
                        "read_feed",
                        "list_pending_signoffs",
                        "get_signoffs",
                        "test_policy",
                        "seal_decision",
                        "prepare_signoff",
                        "account_stop"
                      ]
                    },
                    "description": "Round 64: the tool allowlist the owner grants the key: verdifax-mcp tool names, and account_stop, which lets the key place the owner's stop and never lift one. Sealed, sorted, in the key's key.created record. The key is then refused (403) on every route outside the routes those tools call (GET /stats and POST /keys/request-key always stay open), and GET /stats reports the list in X-Verdifax-Allowed-Tools. Owner powers and approver keys are never grantable. Absent: no allowlist, and the key is made exactly as before. Refused with 409 while VERDIFAX_ROUND64_FEATURES is off."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "The key, with its secret.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "owner": {
                      "type": "boolean"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "created_at": {
                      "type": "string",
                      "format": "date-time"
                    },
                    "last_used_at": {
                      "type": "string"
                    },
                    "run_count": {
                      "type": "integer"
                    },
                    "revoked": {
                      "type": "boolean"
                    },
                    "expires_at": {
                      "type": "string"
                    },
                    "ok": {
                      "type": "boolean"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "request_key_required": {
                      "type": "boolean"
                    },
                    "hint": {
                      "type": "string"
                    },
                    "allowed_tools": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      },
                      "description": "The allowlist granted, when one was."
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/keys/{id}": {
      "delete": {
        "tags": [
          "Accounts"
        ],
        "summary": "Revoke one of the account's member keys",
        "description": "A key in another account, or an owner key, answers 404. Needs the account's owner key, which manages the account and cannot run anything itself.",
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked."
          },
          "404": {
            "description": "No such member key in this account."
          }
        }
      }
    },
    "/signoffs": {
      "post": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "previous_signoff_hash",
                  "target",
                  "decision",
                  "approver_key",
                  "signature",
                  "signed_at",
                  "nonce"
                ],
                "properties": {
                  "previous_signoff_hash": {
                    "type": "string",
                    "description": "The account's newest sign-off, from GET /signoffs/newest, or 64 zeros for the first."
                  },
                  "target": {
                    "type": "object",
                    "required": [
                      "kind",
                      "run_id",
                      "digest"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "record",
                          "receipt",
                          "job"
                        ]
                      },
                      "run_id": {
                        "type": "integer"
                      },
                      "digest": {
                        "type": "string",
                        "description": "What the result's public-log entry covers: a completed run's complete-record anchored digest, a refused or halted run's receipt hash, or a job's final step record digest."
                      },
                      "job_id": {
                        "type": "string",
                        "description": "For a job only."
                      }
                    }
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "reject"
                    ]
                  },
                  "note_hash": {
                    "type": "string",
                    "description": "SHA-256 of the approver's note, or empty. The note's text never reaches Verdifax."
                  },
                  "approver_key": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string",
                    "description": "The approver key's Ed25519 signature over verdifax.signoff.v1, chain_id, previous_signoff_hash, target kind, run_id, digest, job_id, decision, note_hash, signed_at and nonce, joined by zero bytes."
                  },
                  "signed_at": {
                    "type": "string",
                    "description": "RFC 3339, within five minutes of the server's clock."
                  },
                  "nonce": {
                    "type": "string",
                    "description": "32 hex characters."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Recorded and anchored.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "signoff": {
                      "type": "object",
                      "description": "A sign-off record, verdifax.signoff.v1.",
                      "properties": {
                        "format": {
                          "type": "string"
                        },
                        "chain_id": {
                          "type": "string"
                        },
                        "sequence": {
                          "type": "integer"
                        },
                        "previous_signoff_hash": {
                          "type": "string"
                        },
                        "decision": {
                          "type": "string"
                        },
                        "note_hash": {
                          "type": "string"
                        },
                        "approver_key": {
                          "type": "string"
                        },
                        "signature": {
                          "type": "string"
                        },
                        "signed_at": {
                          "type": "string"
                        },
                        "nonce": {
                          "type": "string"
                        },
                        "recorded_at": {
                          "type": "string"
                        },
                        "signoff_hash": {
                          "type": "string"
                        },
                        "anchor": {
                          "type": "object"
                        },
                        "target": {
                          "type": "object",
                          "required": [
                            "kind",
                            "run_id",
                            "digest"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "record",
                                "receipt",
                                "job"
                              ]
                            },
                            "run_id": {
                              "type": "integer"
                            },
                            "digest": {
                              "type": "string",
                              "description": "What the result's public-log entry covers: a completed run's complete-record anchored digest, a refused or halted run's receipt hash, or a job's final step record digest."
                            },
                            "job_id": {
                              "type": "string",
                              "description": "For a job only."
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The signature does not verify, or the approver key is not registered or was revoked."
          },
          "409": {
            "description": "The target is not this account's result or digest, or the chain moved.. Round 64: while a stop whose scope refuses sign-offs stands, a valid signed sign-off is refused with error_code ACCOUNT_STOPPED and its sealed refusal (signoff_refusal, record_hash), sealed in the feed as signoff.refused; the same attempt sent again while that stop stands, within five minutes of its signed_at, is answered with that refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "signoff_refusal": {
                      "$ref": "#/components/schemas/SignOffRefusal"
                    },
                    "record_hash": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Submit an approver's signed sign-off",
        "description": "Any key in the account submits it; the approver's signature, not the calling key, decides who approved. The server checks the target is this account's result and the digest its public-log entry covers, links the sign-off to the account's previous one and anchors it on the public log. A later sign-off on the same result supersedes the earlier one. A sign-off shows that the holder of an approver key the account registered signed that decision on that result, and that Verdifax logged it. It does not show the review was careful, the result was right, or who the person is, and it gates nothing on its own. Verdifax did not review the result."
      }
    },
    "/account/signoffs": {
      "post": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "previous_signoff_hash",
                  "target",
                  "decision",
                  "approver_key",
                  "signature",
                  "signed_at",
                  "nonce"
                ],
                "properties": {
                  "previous_signoff_hash": {
                    "type": "string",
                    "description": "The account's newest sign-off, from GET /signoffs/newest, or 64 zeros for the first."
                  },
                  "target": {
                    "type": "object",
                    "required": [
                      "kind",
                      "run_id",
                      "digest"
                    ],
                    "properties": {
                      "kind": {
                        "type": "string",
                        "enum": [
                          "record",
                          "receipt",
                          "job"
                        ]
                      },
                      "run_id": {
                        "type": "integer"
                      },
                      "digest": {
                        "type": "string",
                        "description": "What the result's public-log entry covers: a completed run's complete-record anchored digest, a refused or halted run's receipt hash, or a job's final step record digest."
                      },
                      "job_id": {
                        "type": "string",
                        "description": "For a job only."
                      }
                    }
                  },
                  "decision": {
                    "type": "string",
                    "enum": [
                      "approve",
                      "reject"
                    ]
                  },
                  "note_hash": {
                    "type": "string",
                    "description": "SHA-256 of the approver's note, or empty. The note's text never reaches Verdifax."
                  },
                  "approver_key": {
                    "type": "string"
                  },
                  "signature": {
                    "type": "string",
                    "description": "The approver key's Ed25519 signature over verdifax.signoff.v1, chain_id, previous_signoff_hash, target kind, run_id, digest, job_id, decision, note_hash, signed_at and nonce, joined by zero bytes."
                  },
                  "signed_at": {
                    "type": "string",
                    "description": "RFC 3339, within five minutes of the server's clock."
                  },
                  "nonce": {
                    "type": "string",
                    "description": "32 hex characters."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Recorded and anchored.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "signoff": {
                      "type": "object",
                      "description": "A sign-off record, verdifax.signoff.v1.",
                      "properties": {
                        "format": {
                          "type": "string"
                        },
                        "chain_id": {
                          "type": "string"
                        },
                        "sequence": {
                          "type": "integer"
                        },
                        "previous_signoff_hash": {
                          "type": "string"
                        },
                        "decision": {
                          "type": "string"
                        },
                        "note_hash": {
                          "type": "string"
                        },
                        "approver_key": {
                          "type": "string"
                        },
                        "signature": {
                          "type": "string"
                        },
                        "signed_at": {
                          "type": "string"
                        },
                        "nonce": {
                          "type": "string"
                        },
                        "recorded_at": {
                          "type": "string"
                        },
                        "signoff_hash": {
                          "type": "string"
                        },
                        "anchor": {
                          "type": "object"
                        },
                        "target": {
                          "type": "object",
                          "required": [
                            "kind",
                            "run_id",
                            "digest"
                          ],
                          "properties": {
                            "kind": {
                              "type": "string",
                              "enum": [
                                "record",
                                "receipt",
                                "job"
                              ]
                            },
                            "run_id": {
                              "type": "integer"
                            },
                            "digest": {
                              "type": "string",
                              "description": "What the result's public-log entry covers: a completed run's complete-record anchored digest, a refused or halted run's receipt hash, or a job's final step record digest."
                            },
                            "job_id": {
                              "type": "string",
                              "description": "For a job only."
                            }
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "403": {
            "description": "The signature does not verify, or the approver key is not registered or was revoked."
          },
          "409": {
            "description": "The target is not this account's result or digest, or the chain moved.. Round 64: while a stop whose scope refuses sign-offs stands, a valid signed sign-off is refused with error_code ACCOUNT_STOPPED and its sealed refusal (signoff_refusal, record_hash), sealed in the feed as signoff.refused; the same attempt sent again while that stop stands, within five minutes of its signed_at, is answered with that refusal.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "error": {
                      "type": "string"
                    },
                    "error_code": {
                      "type": "string"
                    },
                    "signoff_refusal": {
                      "$ref": "#/components/schemas/SignOffRefusal"
                    },
                    "record_hash": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "Submit an approver's signed sign-off with the owner key",
        "description": "The same as POST /signoffs, for the owner key. Needs the account's owner key. A sign-off shows that the holder of an approver key the account registered signed that decision on that result, and that Verdifax logged it. It does not show the review was careful, the result was right, or who the person is, and it gates nothing on its own. Verdifax did not review the result."
      }
    },
    "/signoffs/newest": {
      "get": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The account's chain and its newest sign-off.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "chain_id": {
                      "type": "string"
                    },
                    "newest_signoff_hash": {
                      "type": "string"
                    },
                    "sequence": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "What an approver signs against: the account's chain and newest sign-off"
      }
    },
    "/account/signoffs/newest": {
      "get": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "responses": {
          "200": {
            "description": "The account's chain and its newest sign-off.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "chain_id": {
                      "type": "string"
                    },
                    "newest_signoff_hash": {
                      "type": "string"
                    },
                    "sequence": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        },
        "summary": "The account's chain and newest sign-off, for the owner key",
        "description": "Needs the account's owner key."
      }
    },
    "/runs/{id}/signoffs": {
      "get": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sign-offs on the run, oldest first, in the form verdifax-verify --signoff reads.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "A sign-off record, verdifax.signoff.v1.",
                    "properties": {
                      "format": {
                        "type": "string"
                      },
                      "chain_id": {
                        "type": "string"
                      },
                      "sequence": {
                        "type": "integer"
                      },
                      "previous_signoff_hash": {
                        "type": "string"
                      },
                      "decision": {
                        "type": "string"
                      },
                      "note_hash": {
                        "type": "string"
                      },
                      "approver_key": {
                        "type": "string"
                      },
                      "signature": {
                        "type": "string"
                      },
                      "signed_at": {
                        "type": "string"
                      },
                      "nonce": {
                        "type": "string"
                      },
                      "recorded_at": {
                        "type": "string"
                      },
                      "signoff_hash": {
                        "type": "string"
                      },
                      "anchor": {
                        "type": "object"
                      },
                      "target": {
                        "type": "object",
                        "required": [
                          "kind",
                          "run_id",
                          "digest"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "record",
                              "receipt",
                              "job"
                            ]
                          },
                          "run_id": {
                            "type": "integer"
                          },
                          "digest": {
                            "type": "string",
                            "description": "What the result's public-log entry covers: a completed run's complete-record anchored digest, a refused or halted run's receipt hash, or a job's final step record digest."
                          },
                          "job_id": {
                            "type": "string",
                            "description": "For a job only."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such run for this key."
          }
        },
        "summary": "The sign-offs on a run this key made"
      }
    },
    "/account/runs/{id}/signoffs": {
      "get": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sign-offs on the run, oldest first, in the form verdifax-verify --signoff reads.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "type": "object",
                    "description": "A sign-off record, verdifax.signoff.v1.",
                    "properties": {
                      "format": {
                        "type": "string"
                      },
                      "chain_id": {
                        "type": "string"
                      },
                      "sequence": {
                        "type": "integer"
                      },
                      "previous_signoff_hash": {
                        "type": "string"
                      },
                      "decision": {
                        "type": "string"
                      },
                      "note_hash": {
                        "type": "string"
                      },
                      "approver_key": {
                        "type": "string"
                      },
                      "signature": {
                        "type": "string"
                      },
                      "signed_at": {
                        "type": "string"
                      },
                      "nonce": {
                        "type": "string"
                      },
                      "recorded_at": {
                        "type": "string"
                      },
                      "signoff_hash": {
                        "type": "string"
                      },
                      "anchor": {
                        "type": "object"
                      },
                      "target": {
                        "type": "object",
                        "required": [
                          "kind",
                          "run_id",
                          "digest"
                        ],
                        "properties": {
                          "kind": {
                            "type": "string",
                            "enum": [
                              "record",
                              "receipt",
                              "job"
                            ]
                          },
                          "run_id": {
                            "type": "integer"
                          },
                          "digest": {
                            "type": "string",
                            "description": "What the result's public-log entry covers: a completed run's complete-record anchored digest, a refused or halted run's receipt hash, or a job's final step record digest."
                          },
                          "job_id": {
                            "type": "string",
                            "description": "For a job only."
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such run for this key."
          }
        },
        "summary": "The sign-offs on any run of the account",
        "description": "Needs the account's owner key."
      }
    },
    "/account/signoffs/history": {
      "get": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "The account's whole chain of sign-offs, oldest first",
        "description": "The form verdifax-verify --signoff-history reads. Needs the account's owner key. The list holds the account's sign-offs, oldest first, with restore gaps and interrupted records in the places they close, and last the chain's head statement, verdifax.signoff-head.v1, anchored on the public log, whenever the chain holds a place and the head could be made, stored and anchored. Otherwise it is left out, and verdifax-verify then cannot call the history complete.",
        "responses": {
          "200": {
            "description": "The chain.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "array",
                  "items": {
                    "oneOf": [
                      {
                        "type": "object",
                        "description": "A sign-off record, verdifax.signoff.v1.",
                        "properties": {
                          "format": {
                            "type": "string"
                          },
                          "chain_id": {
                            "type": "string"
                          },
                          "sequence": {
                            "type": "integer"
                          },
                          "previous_signoff_hash": {
                            "type": "string"
                          },
                          "decision": {
                            "type": "string"
                          },
                          "note_hash": {
                            "type": "string"
                          },
                          "approver_key": {
                            "type": "string"
                          },
                          "signature": {
                            "type": "string"
                          },
                          "signed_at": {
                            "type": "string"
                          },
                          "nonce": {
                            "type": "string"
                          },
                          "recorded_at": {
                            "type": "string"
                          },
                          "signoff_hash": {
                            "type": "string"
                          },
                          "anchor": {
                            "type": "object"
                          },
                          "target": {
                            "type": "object",
                            "required": [
                              "kind",
                              "run_id",
                              "digest"
                            ],
                            "properties": {
                              "kind": {
                                "type": "string",
                                "enum": [
                                  "record",
                                  "receipt",
                                  "job"
                                ]
                              },
                              "run_id": {
                                "type": "integer"
                              },
                              "digest": {
                                "type": "string",
                                "description": "What the result's public-log entry covers: a completed run's complete-record anchored digest, a refused or halted run's receipt hash, or a job's final step record digest."
                              },
                              "job_id": {
                                "type": "string",
                                "description": "For a job only."
                              }
                            }
                          }
                        }
                      },
                      {
                        "type": "object",
                        "description": "A restore gap, verdifax.restore-gap.v1: the places the chain skips after a restore from backup.",
                        "properties": {
                          "format": {
                            "type": "string",
                            "const": "verdifax.restore-gap.v1"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "lost_from": {
                            "type": "integer"
                          },
                          "lost_to": {
                            "type": "integer"
                          },
                          "recorded_at": {
                            "type": "string"
                          },
                          "signal": {
                            "type": "object",
                            "properties": {
                              "signal_account": {
                                "type": "string"
                              },
                              "signal_sequence": {
                                "type": "integer"
                              },
                              "signal_previous_hash": {
                                "type": "string"
                              }
                            }
                          },
                          "restore_gap_hash": {
                            "type": "string"
                          },
                          "anchor": {
                            "type": "object"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "description": "An interrupted record, verdifax.chain-interrupted.v1: a place whose public-log entry was never confirmed, closed and named.",
                        "properties": {
                          "format": {
                            "type": "string",
                            "const": "verdifax.chain-interrupted.v1"
                          },
                          "chain": {
                            "type": "string"
                          },
                          "place": {
                            "type": "integer"
                          },
                          "record_kind": {
                            "type": "string"
                          },
                          "planned_record_hash": {
                            "type": "string"
                          },
                          "planned_leaf": {
                            "type": "string"
                          },
                          "recorded_at": {
                            "type": "string"
                          },
                          "signal": {
                            "type": "object",
                            "properties": {
                              "signal_account": {
                                "type": "string"
                              },
                              "signal_sequence": {
                                "type": "integer"
                              },
                              "signal_previous_hash": {
                                "type": "string"
                              }
                            }
                          },
                          "interrupted_hash": {
                            "type": "string"
                          },
                          "anchor": {
                            "type": "object"
                          }
                        }
                      },
                      {
                        "type": "object",
                        "description": "The chain's head statement, verdifax.signoff-head.v1, the last item: the chain's highest place, taken by a sign-off or closed by a restore gap or an interrupted record, and the hash of its newest sign-off, anchored on the public log. verdifax-verify says the history is complete as of the entry's integration time, and requires a head when a rule requires a person's sign-off.",
                        "required": [
                          "format",
                          "chain_id",
                          "sequence",
                          "head_hash",
                          "stated_at",
                          "head_statement_hash"
                        ],
                        "properties": {
                          "format": {
                            "type": "string",
                            "const": "verdifax.signoff-head.v1"
                          },
                          "chain_id": {
                            "type": "string"
                          },
                          "sequence": {
                            "type": "integer"
                          },
                          "head_hash": {
                            "type": "string",
                            "description": "The newest sign-off's hash; all zeros when the chain holds no sign-off."
                          },
                          "stated_at": {
                            "type": "string"
                          },
                          "head_statement_hash": {
                            "type": "string"
                          },
                          "anchor": {
                            "type": "object"
                          }
                        }
                      }
                    ]
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/approvers": {
      "post": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Register an approver key",
        "description": "An approver key is never a request key in the same account, so the key that requested a run can never sign it off. The proof is the new key's signature over verdifax.approver-key.v1, a zero byte, and the base64 key. Needs the account's owner key.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "public_key",
                  "name",
                  "proof"
                ],
                "properties": {
                  "public_key": {
                    "type": "string"
                  },
                  "name": {
                    "type": "string"
                  },
                  "proof": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Registered.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "public_key": {
                      "type": "string"
                    },
                    "name": {
                      "type": "string"
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "registered_at": {
                      "type": "string"
                    },
                    "revoked": {
                      "type": "boolean"
                    },
                    "revoked_at": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "409": {
            "description": "Already registered, or a request key in the account."
          }
        }
      },
      "get": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List the account's approver keys, revoked ones included",
        "description": "Needs the account's owner key.",
        "responses": {
          "200": {
            "description": "The approvers.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "approvers": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "public_key": {
                            "type": "string"
                          },
                          "name": {
                            "type": "string"
                          },
                          "account_id": {
                            "type": "string"
                          },
                          "registered_at": {
                            "type": "string"
                          },
                          "revoked": {
                            "type": "boolean"
                          },
                          "revoked_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/approvers/{id}": {
      "delete": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Revoke an approver key",
        "description": "Its earlier sign-offs stay on the record. Needs the account's owner key.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked."
          },
          "404": {
            "description": "No such active approver in this account."
          }
        }
      }
    },
    "/signals": {
      "get": {
        "tags": [
          "Signal feed"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read the account's signal feed (feed key)",
        "description": "Every control signal Verdifax recorded for the account, oldest first, after sequence `after`: successful, refused, halted and failed runs, policy changes, sign-offs, approver and key changes, record publications and withdrawals, account changes, record deletions, restore gaps and interrupted entries. Each event is a CloudEvents 1.0 JSON envelope whose data carries the sealed entry, or, for an event whose record was deleted, entry null and the record's tombstone in deleted; the entry seals the event's place in the feed and is anchored on the public log when the log accepts it, and otherwise committed by the next event whose entry is anchored. With `wait`, the call holds open up to that many seconds for the next event. `verdifax-verify --signals` checks a saved response. The feed cannot show a signal Verdifax never recorded. Needs a feed key, which reads the feed and nothing else. Since round 61, a page that reaches the feed's end ends with the feed's head statement in head (verdifax.feed-head.v1), anchored on the public log, so a saved feed shows it was complete as of that entry's time.",
        "parameters": [
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "in": "query",
            "name": "wait",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Events after the given place.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "specversion": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "time": {
                            "type": "string"
                          },
                          "datacontenttype": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "form": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "description": "The event kind: run.refused, run.halted, run.failed, run.sealed, policy.changed, signoff.recorded, approver.registered, approver.revoked, key.created, key.revoked, run.published, run.unpublished, chain.gap, chain.interrupted, account.changed or run.deleted. account.changed and run.deleted (round 60) record a change to the account, its settings or its keys' terms (such as the account's creation, a key's tier, a cleared request key or a requested owner-key replacement), and a record's deletion, each with who decided; key changes since verdifax.key-change.v2 also seal decided_by. Since round 61, account.changed also records each customer key's request key registered (request_key.registered), rotated (request_key.rotated, carrying the replaced key's approval in request_key_approval) and cleared by its holder (request_key.cleared decided by owner, with the approval) or by Verdifax (decided by verdifax_admin), so a verifier can follow each key's request-key chain. Round 64: an account whose policy turns the feature on also gets setup.changed (a verdifax.setup-change.v1 record: the policy's setup watch saw a setup in its scope that differs from the one it saw last, with the watched values, each labelled declared_by_caller or attested_by_verdifax; it states what was declared and what Verdifax's AI review stated, never which model ran) and review.due (a verdifax.policy-review-due.v1 record: the date this policy declared has passed while the named activation was in force). Under a setup watch, run.sealed records and the receipt contexts of the runs it counts carry setup_hash. These need verdifax-verify v0.38.0. Round 64, response times: an account whose policy sets a response target with notice event or both also gets signoff.target_passed (a verdifax.signoff-target-passed.v1 record: the result's target passed with no sign-off of the compared kind on the public log by the deadline); when a target sets seal_in_result, the run.sealed record of each run its rule allows carries signoff_target, and each refused or halted run's receipt context it applies to carries response_target. These need verdifax-verify v0.38.0."
                              },
                              "account": {
                                "type": "string"
                              },
                              "sequence": {
                                "type": "integer"
                              },
                              "previous_signal_hash": {
                                "type": "string"
                              },
                              "event_hash": {
                                "type": "string"
                              },
                              "run_id": {
                                "type": "integer"
                              },
                              "api_key_id": {
                                "type": "integer"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "entry": {
                                "type": "object",
                                "description": "The event's sealed entry, in the form the verifier reads; null when the event's record was deleted, with the tombstone in deleted."
                              },
                              "deleted": {
                                "type": "object",
                                "description": "Since round 60: on a refused, halted or failed run's event whose record was deleted, the record's tombstone (verdifax.run-deletion.v1), served in place of the entry. The event's hash is its kind, the record hash the tombstone seals, and its place."
                              }
                            }
                          }
                        }
                      }
                    },
                    "next_after": {
                      "type": "integer"
                    },
                    "newest": {
                      "type": "integer"
                    },
                    "head": {
                      "type": "object",
                      "description": "Since round 61: on a page that reaches the feed's end, Verdifax's head statement, verdifax.feed-head.v1: the account, the feed's highest event (sequence) and that event's hash (head_hash), stated_at, head_statement_hash and its public-log entry (anchor, receipt kind feed_head). It is reused for 5 minutes while the feed has not changed. verdifax-verify --signals fails a feed that ends below the head's event, says the feed (and the owner's blocks) held as of the entry's integration time, fails a head older than --feed-head-max-age (24 hours by default), and without a head says a later event may exist. A page that stops before the end, or whose head could not be made, stored and anchored, carries none.",
                      "properties": {
                        "format": {
                          "type": "string",
                          "const": "verdifax.feed-head.v1"
                        },
                        "account": {
                          "type": "string"
                        },
                        "sequence": {
                          "type": "integer"
                        },
                        "head_hash": {
                          "type": "string"
                        },
                        "stated_at": {
                          "type": "string"
                        },
                        "head_statement_hash": {
                          "type": "string"
                        },
                        "anchor": {
                          "type": "object"
                        }
                      },
                      "required": [
                        "format",
                        "account",
                        "sequence",
                        "head_hash",
                        "stated_at",
                        "head_statement_hash"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A bad after, limit or wait."
          },
          "429": {
            "description": "The key already holds two waits open."
          }
        }
      }
    },
    "/account/signals": {
      "get": {
        "tags": [
          "Signal feed"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read the account's signal feed (owner key)",
        "description": "Every control signal Verdifax recorded for the account, oldest first, after sequence `after`: successful, refused, halted and failed runs, policy changes, sign-offs, approver and key changes, record publications and withdrawals, account changes, record deletions, restore gaps and interrupted entries. Each event is a CloudEvents 1.0 JSON envelope whose data carries the sealed entry, or, for an event whose record was deleted, entry null and the record's tombstone in deleted; the entry seals the event's place in the feed and is anchored on the public log when the log accepts it, and otherwise committed by the next event whose entry is anchored. With `wait`, the call holds open up to that many seconds for the next event. `verdifax-verify --signals` checks a saved response. The feed cannot show a signal Verdifax never recorded. Needs the account's owner key. Since round 61, a page that reaches the feed's end ends with the feed's head statement in head (verdifax.feed-head.v1), anchored on the public log, so a saved feed shows it was complete as of that entry's time.",
        "parameters": [
          {
            "in": "query",
            "name": "after",
            "schema": {
              "type": "integer",
              "minimum": 0
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          },
          {
            "in": "query",
            "name": "wait",
            "schema": {
              "type": "integer",
              "minimum": 0,
              "maximum": 25
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Events after the given place.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "events": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "specversion": {
                            "type": "string"
                          },
                          "id": {
                            "type": "string"
                          },
                          "source": {
                            "type": "string"
                          },
                          "type": {
                            "type": "string"
                          },
                          "time": {
                            "type": "string"
                          },
                          "datacontenttype": {
                            "type": "string"
                          },
                          "data": {
                            "type": "object",
                            "properties": {
                              "form": {
                                "type": "string"
                              },
                              "kind": {
                                "type": "string",
                                "description": "The event kind: run.refused, run.halted, run.failed, run.sealed, policy.changed, signoff.recorded, approver.registered, approver.revoked, key.created, key.revoked, run.published, run.unpublished, chain.gap, chain.interrupted, account.changed or run.deleted. account.changed and run.deleted (round 60) record a change to the account, its settings or its keys' terms (such as the account's creation, a key's tier, a cleared request key or a requested owner-key replacement), and a record's deletion, each with who decided; key changes since verdifax.key-change.v2 also seal decided_by. Since round 61, account.changed also records each customer key's request key registered (request_key.registered), rotated (request_key.rotated, carrying the replaced key's approval in request_key_approval) and cleared by its holder (request_key.cleared decided by owner, with the approval) or by Verdifax (decided by verdifax_admin), so a verifier can follow each key's request-key chain. Round 64: an account whose policy turns the feature on also gets setup.changed (a verdifax.setup-change.v1 record: the policy's setup watch saw a setup in its scope that differs from the one it saw last, with the watched values, each labelled declared_by_caller or attested_by_verdifax; it states what was declared and what Verdifax's AI review stated, never which model ran) and review.due (a verdifax.policy-review-due.v1 record: the date this policy declared has passed while the named activation was in force). Under a setup watch, run.sealed records and the receipt contexts of the runs it counts carry setup_hash. These need verdifax-verify v0.38.0. Round 64, response times: an account whose policy sets a response target with notice event or both also gets signoff.target_passed (a verdifax.signoff-target-passed.v1 record: the result's target passed with no sign-off of the compared kind on the public log by the deadline); when a target sets seal_in_result, the run.sealed record of each run its rule allows carries signoff_target, and each refused or halted run's receipt context it applies to carries response_target. These need verdifax-verify v0.38.0."
                              },
                              "account": {
                                "type": "string"
                              },
                              "sequence": {
                                "type": "integer"
                              },
                              "previous_signal_hash": {
                                "type": "string"
                              },
                              "event_hash": {
                                "type": "string"
                              },
                              "run_id": {
                                "type": "integer"
                              },
                              "api_key_id": {
                                "type": "integer"
                              },
                              "reason": {
                                "type": "string"
                              },
                              "entry": {
                                "type": "object",
                                "description": "The event's sealed entry, in the form the verifier reads; null when the event's record was deleted, with the tombstone in deleted."
                              },
                              "deleted": {
                                "type": "object",
                                "description": "Since round 60: on a refused, halted or failed run's event whose record was deleted, the record's tombstone (verdifax.run-deletion.v1), served in place of the entry. The event's hash is its kind, the record hash the tombstone seals, and its place."
                              }
                            }
                          }
                        }
                      }
                    },
                    "next_after": {
                      "type": "integer"
                    },
                    "newest": {
                      "type": "integer"
                    },
                    "head": {
                      "type": "object",
                      "description": "Since round 61: on a page that reaches the feed's end, Verdifax's head statement, verdifax.feed-head.v1: the account, the feed's highest event (sequence) and that event's hash (head_hash), stated_at, head_statement_hash and its public-log entry (anchor, receipt kind feed_head). It is reused for 5 minutes while the feed has not changed. verdifax-verify --signals fails a feed that ends below the head's event, says the feed (and the owner's blocks) held as of the entry's integration time, fails a head older than --feed-head-max-age (24 hours by default), and without a head says a later event may exist. A page that stops before the end, or whose head could not be made, stored and anchored, carries none.",
                      "properties": {
                        "format": {
                          "type": "string",
                          "const": "verdifax.feed-head.v1"
                        },
                        "account": {
                          "type": "string"
                        },
                        "sequence": {
                          "type": "integer"
                        },
                        "head_hash": {
                          "type": "string"
                        },
                        "stated_at": {
                          "type": "string"
                        },
                        "head_statement_hash": {
                          "type": "string"
                        },
                        "anchor": {
                          "type": "object"
                        }
                      },
                      "required": [
                        "format",
                        "account",
                        "sequence",
                        "head_hash",
                        "stated_at",
                        "head_statement_hash"
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A bad after, limit or wait."
          }
        }
      }
    },
    "/account/feed-keys": {
      "post": {
        "tags": [
          "Signal feed"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Create a feed key",
        "description": "A feed key reads GET /signals and nothing else: it cannot run anything, read records, manage webhooks or change the account. Creating one is itself an event in the feed. Needs the account's owner key.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "name"
                ],
                "properties": {
                  "name": {
                    "type": "string"
                  },
                  "expires_at": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Created; the secret is shown once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "integer"
                    },
                    "name": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "string"
                    },
                    "tier": {
                      "type": "string"
                    },
                    "account_id": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A bad name or expiry."
          }
        }
      }
    },
    "/account/feed-keys/{id}": {
      "delete": {
        "tags": [
          "Signal feed"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Revoke a feed key",
        "description": "Revoking it is itself an event in the feed. Needs the account's owner key.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Revoked."
          },
          "404": {
            "description": "No such feed key in this account."
          }
        }
      }
    },
    "/account/webhooks": {
      "post": {
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Subscribe a webhook",
        "description": "Verdifax sends each feed event, in the same CloudEvents envelope, to an https address on a public host, queued for delivery the moment it is stored and sent by a delivery worker that runs every two seconds to each subscription whose types include its kind, signed under the Standard Webhooks scheme (webhook-id, webhook-timestamp, webhook-signature) with the secret returned once here. Deliveries are retried for 24 hours. A delivery is a copy: the pull feed and the public log are the record. An empty types list takes every kind. Needs the account's owner key. From verifier v0.35.0's server release on, each subscription is added and each removed only with its record in the account's signal feed, an account.changed event signed by the owner's request key, which seals the SHA-256 of the address, never the address, and the kinds it takes; the new subscription receives that event first, and an ended one is not sent the event that ends it.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "url",
                  "owner_signature"
                ],
                "properties": {
                  "url": {
                    "type": "string",
                    "description": "An https address on a public host, sent exactly as the server stores it (the server refuses any other form, naming the stored one), since the owner's signature covers its SHA-256."
                  },
                  "types": {
                    "type": "array",
                    "items": {
                      "type": "string"
                    }
                  },
                  "owner_signature": {
                    "type": "object",
                    "description": "The owner's signature over the change webhook.subscribed, whose subject is the value the record seals: sha256=<the SHA-256 of the address, lowercase hex> kinds=<the types sorted and joined with commas, or all>. Ed25519 by the owner key's request key over verdifax.owner-change-signature.v1, the account (account-N), the change, its subject, signed_at and nonce, joined by zero bytes. The record seals it. Verdifax never holds the owner's request key, so it cannot make a signature with it, and `verdifax-verify --signals --owner-request-key` confirms every owner change in the feed was signed with the owner's key. Required: an owner with no request key registered is refused.",
                    "required": [
                      "signature",
                      "signed_at",
                      "nonce"
                    ],
                    "properties": {
                      "signature": {
                        "type": "string",
                        "description": "Base64 Ed25519 signature."
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "RFC 3339, within five minutes of the server's clock."
                      },
                      "nonce": {
                        "type": "string",
                        "description": "32 hex characters, used once."
                      }
                    }
                  }
                },
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Subscribed; the secret is shown once.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "id": {
                      "type": "integer"
                    },
                    "url": {
                      "type": "string"
                    },
                    "types": {
                      "type": "array",
                      "items": {
                        "type": "string"
                      }
                    },
                    "created_at": {
                      "type": "string"
                    },
                    "secret": {
                      "type": "string"
                    },
                    "hint": {
                      "type": "string"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "Not https on a public host, or an unknown type."
          },
          "409": {
            "description": "The account already holds ten subscriptions."
          },
          "503": {
            "description": "Webhooks need the deployment's KMS key."
          }
        }
      },
      "get": {
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List webhook subscriptions",
        "description": "Never shows a secret. Needs the account's owner key.",
        "responses": {
          "200": {
            "description": "The live subscriptions.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "webhooks": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "url": {
                            "type": "string"
                          },
                          "types": {
                            "type": "array",
                            "items": {
                              "type": "string"
                            }
                          },
                          "created_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/webhooks/{id}": {
      "delete": {
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Delete a webhook subscription",
        "description": "Undelivered events stay in the pull feed. Needs the account's owner key, and from verifier v0.35.0's server release on the owner's request-key signature: the removal is sealed in the account's signal feed as an account.changed event, webhook.deleted.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "Deleted."
          },
          "404": {
            "description": "No such webhook in this account."
          },
          "400": {
            "description": "The owner's signature is missing, does not verify over this change, or was used before."
          }
        },
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "owner_signature"
                ],
                "additionalProperties": false,
                "properties": {
                  "owner_signature": {
                    "type": "object",
                    "description": "The owner's signature over the change webhook.deleted, whose subject is the subscription's value as its webhook.subscribed record sealed it.",
                    "required": [
                      "signature",
                      "signed_at",
                      "nonce"
                    ],
                    "properties": {
                      "signature": {
                        "type": "string",
                        "description": "Base64 Ed25519 signature."
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "RFC 3339, within five minutes of the server's clock."
                      },
                      "nonce": {
                        "type": "string",
                        "description": "32 hex characters, used once."
                      }
                    }
                  }
                }
              }
            }
          }
        }
      }
    },
    "/account/webhooks/{id}/deliveries": {
      "get": {
        "tags": [
          "Webhooks"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List a subscription's deliveries",
        "description": "Newest first: each event's status (pending, delivered or failed), attempts and the receiver's last answer. Needs the account's owner key.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          },
          {
            "in": "query",
            "name": "limit",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 500
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The deliveries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "webhook_id": {
                      "type": "integer"
                    },
                    "deliveries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "sequence": {
                            "type": "integer"
                          },
                          "status": {
                            "type": "string"
                          },
                          "attempts": {
                            "type": "integer"
                          },
                          "last_status_code": {
                            "type": "integer"
                          },
                          "last_error": {
                            "type": "string"
                          },
                          "created_at": {
                            "type": "string"
                          },
                          "delivered_at": {
                            "type": "string"
                          },
                          "next_attempt_at": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such webhook in this account."
          }
        }
      }
    },
    "/runs/{id}/failure-receipt": {
      "get": {
        "tags": [
          "Runs"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "A failed run's sealed failure receipt",
        "description": "A run sent to /execute or /execute/batch that fails with a server error seals a failure receipt naming the request, the stage that failed and an error class, anchored on the public log when the log accepts it, like every receipt; the raw error text never enters it. A failed determinism replay, and a failure whose receipt could not be built or stored, have none. Runs that failed before failure receipts were sealed have none. A key reads its own runs. An account's owner key reads every run of its account while the account's owner-reads setting is allowed, and is refused with 403 while it is blocked, as it is until the owner allows it.",
        "parameters": [
          {
            "in": "path",
            "name": "id",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The receipt document, in the form verdifax-verify reads.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "failure_receipt": {
                      "type": "object",
                      "properties": {
                        "anchor_required": {
                          "type": "boolean"
                        },
                        "envelope_id": {
                          "type": "string"
                        },
                        "error_class": {
                          "type": "string"
                        },
                        "evaluator_version": {
                          "type": "string"
                        },
                        "fail_clock": {
                          "type": "string"
                        },
                        "failed_stage": {
                          "type": "string"
                        },
                        "version": {
                          "type": "string"
                        },
                        "hash": {
                          "type": "string"
                        }
                      }
                    },
                    "receipt_anchor": {
                      "type": "object"
                    },
                    "receipt_context": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such run, not a failed run, or a failed run from before failure receipts."
          }
        }
      }
    },
    "/account/runs/{id}/publish": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run's public state, its links when public, and the publication this request sealed, or null when the run was already in the asked state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "public": {
                      "type": "boolean"
                    },
                    "public_bundle_url": {
                      "type": "string",
                      "description": "Where the run's audit bundle is served, present only while the run is public and has a bundle."
                    },
                    "public_receipt_url": {
                      "type": "string",
                      "description": "Where a stopped run's sealed receipt is served, present only while the run is public and stopped; such a run has no bundle address."
                    },
                    "verify_url": {
                      "type": "string"
                    },
                    "publication": {
                      "oneOf": [
                        {
                          "type": "object",
                          "description": "A run publication, verdifax.run-publication.v2: the decision, who made it (owner, or verdifax_admin for a Verdifax admin key), sealed and anchored, with its place in the account's signal feed. Publications sealed before v2 are verdifax.run-publication.v1 and carry no decided_by; each was the owner's.",
                          "properties": {
                            "format": {
                              "type": "string"
                            },
                            "action": {
                              "type": "string",
                              "enum": [
                                "run.published",
                                "run.unpublished"
                              ]
                            },
                            "decided_by": {
                              "type": "string",
                              "enum": [
                                "owner",
                                "verdifax_admin"
                              ]
                            },
                            "run_id": {
                              "type": "integer"
                            },
                            "record_hash": {
                              "type": "string"
                            },
                            "job_id": {
                              "type": "string"
                            },
                            "step_id": {
                              "type": "string"
                            },
                            "changed_at": {
                              "type": "string"
                            },
                            "signal": {
                              "type": "object"
                            },
                            "publication_hash": {
                              "type": "string"
                            },
                            "anchor": {
                              "type": "object"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The id is not a positive integer."
          },
          "401": {
            "description": "No key, or a revoked key."
          },
          "403": {
            "description": "Not the account's owner key."
          },
          "404": {
            "description": "No such run in this account."
          }
        },
        "summary": "Make one of the account's records public",
        "description": "The account's owner key makes a record made by any key of the account public on a random link, the same link a later publish restores. The decision is sealed as a run publication (verdifax.run-publication.v2, which names who decided), anchored on the public log when the log accepts it and placed in the account's signal feed as a run.published event. Idempotent: a run already public is answered as it is, with no new event. The service's admin key cannot publish another key's record."
      }
    },
    "/account/runs/{id}/unpublish": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The run's public state, its links when public, and the publication this request sealed, or null when the run was already in the asked state.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "public": {
                      "type": "boolean"
                    },
                    "public_bundle_url": {
                      "type": "string",
                      "description": "Where the run's audit bundle is served, present only while the run is public and has a bundle."
                    },
                    "public_receipt_url": {
                      "type": "string",
                      "description": "Where a stopped run's sealed receipt is served, present only while the run is public and stopped; such a run has no bundle address."
                    },
                    "verify_url": {
                      "type": "string"
                    },
                    "publication": {
                      "oneOf": [
                        {
                          "type": "object",
                          "description": "A run publication, verdifax.run-publication.v2: the decision, who made it (owner, or verdifax_admin for a Verdifax admin key), sealed and anchored, with its place in the account's signal feed. Publications sealed before v2 are verdifax.run-publication.v1 and carry no decided_by; each was the owner's.",
                          "properties": {
                            "format": {
                              "type": "string"
                            },
                            "action": {
                              "type": "string",
                              "enum": [
                                "run.published",
                                "run.unpublished"
                              ]
                            },
                            "decided_by": {
                              "type": "string",
                              "enum": [
                                "owner",
                                "verdifax_admin"
                              ]
                            },
                            "run_id": {
                              "type": "integer"
                            },
                            "record_hash": {
                              "type": "string"
                            },
                            "job_id": {
                              "type": "string"
                            },
                            "step_id": {
                              "type": "string"
                            },
                            "changed_at": {
                              "type": "string"
                            },
                            "signal": {
                              "type": "object"
                            },
                            "publication_hash": {
                              "type": "string"
                            },
                            "anchor": {
                              "type": "object"
                            }
                          }
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The id is not a positive integer."
          },
          "401": {
            "description": "No key, or a revoked key."
          },
          "403": {
            "description": "Not the account's owner key."
          },
          "404": {
            "description": "No such run in this account."
          }
        },
        "summary": "Withdraw one of the account's records from its public link",
        "description": "The account's owner key withdraws a public record; both public routes answer 404 for it afterwards, and its link is kept so a later publish restores it. The decision is sealed as a run publication and placed in the feed as a run.unpublished event. Idempotent for a run that is not public."
      }
    },
    "/account/settings/{setting}": {
      "put": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Set one of the owner's settings (owner key)",
        "description": "owner-replacement: while blocked, Verdifax cannot replace the account's owner key, revoke it, or start a replacement. verdifax-deletion: while blocked, Verdifax cannot delete one of the account's records. Each change is sealed in the account's signal feed with the owner's signature, and the verifier fails a feed that shows a Verdifax replacement or deletion after a block. Asking for the value already set changes nothing and seals nothing. verdifax-stop (round 64, refused with 409 while VERDIFAX_ROUND64_FEATURES is off): while blocked, Verdifax cannot place its own stop on the account; the owner's own stop is unaffected. owner-reads: while allowed, the account's owner key reads the record, receipts and reports of every run of its account; blocked until the owner allows it.",
        "parameters": [
          {
            "name": "setting",
            "in": "path",
            "required": true,
            "schema": {
              "type": "string",
              "enum": [
                "owner-replacement",
                "verdifax-deletion",
                "verdifax-stop",
                "owner-reads"
              ]
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "value",
                  "owner_signature"
                ],
                "additionalProperties": false,
                "properties": {
                  "value": {
                    "type": "string",
                    "enum": [
                      "allowed",
                      "blocked"
                    ],
                    "description": "The change signed is setting.owner_replacement, setting.verdifax_deletion, setting.verdifax_stop or setting.owner_reads, and its subject is this value."
                  },
                  "owner_signature": {
                    "type": "object",
                    "description": "The owner's signature: Ed25519 by the owner key's request key over verdifax.owner-change-signature.v1, the account (account-N), the change, its subject, signed_at and nonce, joined by zero bytes. The record seals it. Verdifax never holds the owner's request key, so it cannot make a signature with it, and `verdifax-verify --signals --owner-request-key` confirms every owner change in the feed was signed with the owner's key. Required: an owner with no request key registered is refused.",
                    "required": [
                      "signature",
                      "signed_at",
                      "nonce"
                    ],
                    "properties": {
                      "signature": {
                        "type": "string",
                        "description": "Base64 Ed25519 signature."
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "RFC 3339, within five minutes of the server's clock."
                      },
                      "nonce": {
                        "type": "string",
                        "description": "32 hex characters, used once."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The setting and the change this request sealed, or null when it was already set.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "setting": {
                      "type": "string"
                    },
                    "value": {
                      "type": "string"
                    },
                    "account_change": {
                      "oneOf": [
                        {
                          "type": "object",
                          "description": "An account change, verdifax.account-change.v1: action, decided_by (owner or verdifax_admin), key_id (key actions), value, changed_at, owner_signature (owner changes), request_key_approval (since round 61, on a request key rotated or cleared by its holder: the current request key's public_key, signature, signed_at and nonce over the new key, empty for a clear), its place in the account's signal feed, account_change_hash and its public-log entry."
                        },
                        {
                          "type": "null"
                        }
                      ]
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A bad value; no request key registered; a signature that does not verify, is outside the time window or reuses a nonce."
          },
          "404": {
            "description": "No such setting."
          }
        }
      }
    },
    "/account/runs/{id}/delete": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Delete one of the account's records (owner key)",
        "description": "Deletes the record and seals its tombstone in the account's signal feed, in one write. The owner signs the run and the record hash it read, so the tombstone names the exact record. A public record is refused with 409 until it is withdrawn with POST /account/runs/{id}/unpublish. The owner's own deletions are never blocked.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer"
            }
          }
        ],
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "record_hash",
                  "owner_signature"
                ],
                "additionalProperties": false,
                "properties": {
                  "record_hash": {
                    "type": "string",
                    "description": "The record's hash: a completed run's manifest hash, or a stopped run's receipt hash."
                  },
                  "owner_signature": {
                    "type": "object",
                    "description": "The owner's signature: Ed25519 by the owner key's request key over verdifax.owner-change-signature.v1, the account (account-N), run.deleted, the subject RUN_ID:RECORD_HASH, signed_at and nonce, joined by zero bytes. The record seals it. Verdifax never holds the owner's request key, so it cannot make a signature with it, and `verdifax-verify --signals --owner-request-key` confirms every owner change in the feed was signed with the owner's key. Required: an owner with no request key registered is refused.",
                    "required": [
                      "signature",
                      "signed_at",
                      "nonce"
                    ],
                    "properties": {
                      "signature": {
                        "type": "string",
                        "description": "Base64 Ed25519 signature."
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "RFC 3339, within five minutes of the server's clock."
                      },
                      "nonce": {
                        "type": "string",
                        "description": "32 hex characters, used once."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The record is deleted.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "run_id": {
                      "type": "integer"
                    },
                    "deleted": {
                      "type": "boolean"
                    },
                    "run_deletion": {
                      "type": "object",
                      "description": "A run deletion, verdifax.run-deletion.v1: decided_by (owner or verdifax_admin), run_id, record_hash, job_id and step_id when the record was in a job, changed_at, owner_signature (owner deletions), its place in the account's signal feed, deletion_hash and its public-log entry. The tombstone stays in the feed when the record is gone."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "No request key registered, or a signature that does not verify; or the run holds no sealed record."
          },
          "404": {
            "description": "No such run in this account."
          },
          "409": {
            "description": "The record is public, or record_hash is not this run's."
          }
        }
      }
    },
    "/account/stop": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read the account's stops (owner key)",
        "description": "Each stop standing on the account, the owner's verdifax-stop setting, and the account's runs in progress now. Reading never changes anything.",
        "responses": {
          "200": {
            "description": "The account's stops.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "stopped": {
                      "type": "boolean"
                    },
                    "holds": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "holder": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "verdifax"
                            ]
                          },
                          "stop_sequence": {
                            "type": "integer",
                            "description": "The feed place of the stop's account.stopped event."
                          },
                          "stopped_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "scope": {
                            "type": "object",
                            "properties": {
                              "signoffs": {
                                "type": "string",
                                "enum": [
                                  "accept",
                                  "refuse"
                                ]
                              },
                              "webhooks": {
                                "type": "string",
                                "enum": [
                                  "continue",
                                  "pause"
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    "verdifax_stop": {
                      "type": "string",
                      "enum": [
                        "allowed",
                        "blocked"
                      ]
                    },
                    "runs_in_progress": {
                      "type": "integer"
                    }
                  }
                }
              }
            }
          }
        }
      },
      "post": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Stop the account (owner key, or a member key granted account_stop)",
        "description": "Places the owner's stop. While any stop stands, every new run is refused with a sealed deny receipt (fired_rule_id account_stop, decision_reason_code ACCOUNT_STOPPED), answered with HTTP 422 on /execute and in the row's result on /execute/batch; runs already in progress finish and the record counts them. Sign-offs on results already sealed are accepted unless signoffs is refuse; webhook deliveries continue unless webhooks is pause, and a paused delivery waits without its retry window running out. No key is revoked or changed. Sealed in the account's signal feed as account.stopped. The owner key may sign the stop with its request key; without a signature the record seals the unsigned statement, the server's word. A member key may stop only when its owner granted it account_stop, and never resumes. Refused with 409 while VERDIFAX_ROUND64_FEATURES is off.",
        "requestBody": {
          "required": false,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "properties": {
                  "signoffs": {
                    "type": "string",
                    "enum": [
                      "accept",
                      "refuse"
                    ],
                    "default": "accept"
                  },
                  "webhooks": {
                    "type": "string",
                    "enum": [
                      "continue",
                      "pause"
                    ],
                    "default": "continue"
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Optional text; only its SHA-256 is sealed."
                  },
                  "owner_signature": {
                    "type": "object",
                    "description": "The owner's signature: Ed25519 by the owner key's request key over verdifax.owner-change-signature.v1, the account (account-N), the change (account.stopped or account.resumed), its subject, signed_at and nonce, joined by zero bytes. The subject is the action (stop or resume), key=<the owner key's id>, for a stop signoffs=<accept or refuse> and webhooks=<continue or pause>, for a resume lifts=<the stop's feed place>, and reason_sha256=<the reason's SHA-256, or nothing>, joined by single spaces.",
                    "required": [
                      "signature",
                      "signed_at",
                      "nonce"
                    ],
                    "properties": {
                      "signature": {
                        "type": "string",
                        "description": "Base64 Ed25519 signature."
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "RFC 3339, within five minutes of the server's clock."
                      },
                      "nonce": {
                        "type": "string",
                        "description": "32 hex characters, used once."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stop or resume sealed, and the stops now standing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "stopped": {
                      "type": "boolean",
                      "description": "True while any stop stands: the account runs only when neither the owner's nor Verdifax's stands."
                    },
                    "holds": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "holder": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "verdifax"
                            ]
                          },
                          "stop_sequence": {
                            "type": "integer",
                            "description": "The feed place of the stop's account.stopped event."
                          },
                          "stopped_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "scope": {
                            "type": "object",
                            "properties": {
                              "signoffs": {
                                "type": "string",
                                "enum": [
                                  "accept",
                                  "refuse"
                                ]
                              },
                              "webhooks": {
                                "type": "string",
                                "enum": [
                                  "continue",
                                  "pause"
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    "account_stop": {
                      "$ref": "#/components/schemas/AccountStop"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A malformed body, or a signature that does not verify.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "403": {
            "description": "A member key its owner did not grant account_stop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The owner's stop already stands, or the release setting is off.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/resume": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Lift the owner's stop (owner key)",
        "description": "Lifts the owner's stop at lifts_sequence, signed by the owner key's request key; an owner with no request key registered is refused. It never lifts Verdifax's stop: the account runs again only when no stop stands. Sealed as account.resumed. Lifting a stop never checks VERDIFAX_ROUND64_FEATURES, so a stop placed while it was on is lifted after a rollback to a build with it off.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "lifts_sequence",
                  "owner_signature"
                ],
                "properties": {
                  "lifts_sequence": {
                    "type": "integer",
                    "minimum": 1,
                    "description": "The stop_sequence GET /account/stop shows for the owner's stop."
                  },
                  "reason": {
                    "type": "string",
                    "maxLength": 1000,
                    "description": "Optional text; only its SHA-256 is sealed."
                  },
                  "owner_signature": {
                    "type": "object",
                    "description": "The owner's signature: Ed25519 by the owner key's request key over verdifax.owner-change-signature.v1, the account (account-N), the change (account.stopped or account.resumed), its subject, signed_at and nonce, joined by zero bytes. The subject is the action (stop or resume), key=<the owner key's id>, for a stop signoffs=<accept or refuse> and webhooks=<continue or pause>, for a resume lifts=<the stop's feed place>, and reason_sha256=<the reason's SHA-256, or nothing>, joined by single spaces.",
                    "required": [
                      "signature",
                      "signed_at",
                      "nonce"
                    ],
                    "properties": {
                      "signature": {
                        "type": "string",
                        "description": "Base64 Ed25519 signature."
                      },
                      "signed_at": {
                        "type": "string",
                        "format": "date-time",
                        "description": "RFC 3339, within five minutes of the server's clock."
                      },
                      "nonce": {
                        "type": "string",
                        "description": "32 hex characters, used once."
                      }
                    }
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "The stop or resume sealed, and the stops now standing.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "ok": {
                      "type": "boolean"
                    },
                    "account_id": {
                      "type": "string"
                    },
                    "stopped": {
                      "type": "boolean",
                      "description": "True while any stop stands: the account runs only when neither the owner's nor Verdifax's stands."
                    },
                    "holds": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "holder": {
                            "type": "string",
                            "enum": [
                              "owner",
                              "verdifax"
                            ]
                          },
                          "stop_sequence": {
                            "type": "integer",
                            "description": "The feed place of the stop's account.stopped event."
                          },
                          "stopped_at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "scope": {
                            "type": "object",
                            "properties": {
                              "signoffs": {
                                "type": "string",
                                "enum": [
                                  "accept",
                                  "refuse"
                                ]
                              },
                              "webhooks": {
                                "type": "string",
                                "enum": [
                                  "continue",
                                  "pause"
                                ]
                              }
                            }
                          }
                        }
                      }
                    },
                    "account_stop": {
                      "$ref": "#/components/schemas/AccountStop"
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "A malformed body, or a signature missing or not verifying.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "No owner stop stands, or lifts_sequence names another stop.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/summaries": {
      "post": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Seal a period summary for a board (owner key)",
        "description": "Counts the account's figures for one period from its signal feed alone, up to a feed head on the public log stated after the period (a new one, or one stated in the last five minutes for an unchanged feed), and seals the statement, verdifax.period-summary.v1, on the public log beside the feed. The period must have ended at least 15 minutes ago, so every event sealed in it is in the feed. Asking again for the same period over the same feed serves the summary already sealed (200, reused true). Refused with 409 while VERDIFAX_ROUND64_FEATURES is off, and with 409 when the feed head cannot be put on the public log; 422 for a period that has not ended long enough ago, or that starts before the account's feed counts every successful run. GET /account/stats answers as before. Needs verdifax-verify v0.38.0 to count the figures again.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "additionalProperties": false,
                "required": [
                  "from",
                  "to"
                ],
                "properties": {
                  "from": {
                    "type": "string",
                    "format": "date-time",
                    "description": "RFC 3339; the period includes it."
                  },
                  "to": {
                    "type": "string",
                    "format": "date-time",
                    "description": "RFC 3339; the period ends before it."
                  }
                }
              }
            }
          }
        },
        "responses": {
          "201": {
            "description": "Sealed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "reused": {
                      "type": "boolean",
                      "description": "True when the summary already sealed for this period over this same feed is served again."
                    },
                    "summary": {
                      "$ref": "#/components/schemas/PeriodSummary"
                    },
                    "head": {
                      "type": "object",
                      "description": "The feed-head statement, verdifax.feed-head.v1, that the summary counted up to, as put on the public log; GET /account/summaries/{id}/head serves it again after later events reach the feed."
                    }
                  }
                }
              }
            }
          },
          "200": {
            "description": "The summary already sealed for this period over this feed.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "id": {
                      "type": "integer"
                    },
                    "reused": {
                      "type": "boolean",
                      "description": "True when the summary already sealed for this period over this same feed is served again."
                    },
                    "summary": {
                      "$ref": "#/components/schemas/PeriodSummary"
                    },
                    "head": {
                      "type": "object",
                      "description": "The feed-head statement, verdifax.feed-head.v1, that the summary counted up to, as put on the public log; GET /account/summaries/{id}/head serves it again after later events reach the feed."
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "The body is not {from, to} as RFC 3339 times, or to is not after from.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "VERDIFAX_ROUND64_FEATURES is off, the feed is empty, or the feed head could not be put on the public log.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "422": {
            "description": "The period ended less than 15 minutes ago, or starts before the account's feed counts every successful run.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "503": {
            "description": "The summary was counted but its public-log entry was not made; nothing is served as sealed.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      },
      "get": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "List the account's period summaries (owner key)",
        "description": "Newest first. Reading never depends on the release setting.",
        "parameters": [
          {
            "name": "limit",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "default": 50
            },
            "description": "At most 200."
          }
        ],
        "responses": {
          "200": {
            "description": "The summaries.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "limit": {
                      "type": "integer"
                    },
                    "summaries": {
                      "type": "array",
                      "items": {
                        "type": "object",
                        "properties": {
                          "id": {
                            "type": "integer"
                          },
                          "from": {
                            "type": "string"
                          },
                          "to": {
                            "type": "string"
                          },
                          "head_sequence": {
                            "type": "integer"
                          },
                          "stated_at": {
                            "type": "string"
                          },
                          "summary_hash": {
                            "type": "string"
                          },
                          "on_public_log": {
                            "type": "boolean"
                          },
                          "log_entry_id": {
                            "type": "string"
                          }
                        }
                      }
                    }
                  }
                }
              }
            }
          },
          "400": {
            "description": "limit is not a whole number of 1 or more.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/summaries/{id}": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read one period summary as stored and anchored (owner key)",
        "description": "The statement verdifax-verify --summary reads with the account's feed (GET /account/signals, read to the summary's head_sequence or later).",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The sealed statement.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/PeriodSummary"
                }
              }
            }
          },
          "404": {
            "description": "No such summary in this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/summaries/{id}/head": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Read the feed-head statement a period summary counted up to (owner key)",
        "description": "The verdifax.feed-head.v1 statement the summary names (head_statement_hash), exactly as Verdifax put it on the public log, served also after later events reach the feed. Give it to verdifax-verify --summary --summary-head when the feed page checked does not end with it.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The head statement, as anchored.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "properties": {
                    "format": {
                      "const": "verdifax.feed-head.v1"
                    },
                    "account": {
                      "type": "string"
                    },
                    "sequence": {
                      "type": "integer"
                    },
                    "head_hash": {
                      "$ref": "#/components/schemas/Hex64"
                    },
                    "stated_at": {
                      "$ref": "#/components/schemas/RFC3339Nano"
                    },
                    "head_statement_hash": {
                      "$ref": "#/components/schemas/Hex64"
                    },
                    "anchor": {
                      "type": "object"
                    }
                  }
                }
              }
            }
          },
          "404": {
            "description": "No such summary in this account, or the head statement it names is not stored.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/summaries/{id}/report.pdf": {
      "get": {
        "tags": [
          "Accounts"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "One period summary as a PDF for a board (owner key)",
        "description": "A plain first page with the period's facts and six cards, what the statement proves and does not, every figure, the fingerprints on a later page and the command that recounts it. It prints the sealed figures as stated; verdifax-verify counts them again from the feed.",
        "parameters": [
          {
            "name": "id",
            "in": "path",
            "required": true,
            "schema": {
              "type": "integer",
              "minimum": 1
            }
          }
        ],
        "responses": {
          "200": {
            "description": "The PDF.",
            "content": {
              "application/pdf": {
                "schema": {
                  "type": "string",
                  "format": "binary"
                }
              }
            }
          },
          "404": {
            "description": "No such summary in this account.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    },
    "/account/signoffs/response-times": {
      "get": {
        "tags": [
          "Sign-off"
        ],
        "security": [
          {
            "ApiKey": []
          }
        ],
        "summary": "Response times from results to sign-offs (owner key)",
        "description": "verdifax.response-times.v1, computed from the feed alone up to a feed head on the public log: for each result of the period, except one whose run was deleted (counted in results_deleted), its wait to the first sign-off, the first approval and the decision in force, on the public log first with the sealed record times beside, and the customer's own target where one applies. Every query value is read strictly (400 with what is allowed); a value this report does not read is refused. Reading never depends on the release setting.",
        "parameters": [
          {
            "name": "from",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; results sealed at or after it."
          },
          {
            "name": "to",
            "in": "query",
            "required": true,
            "schema": {
              "type": "string",
              "format": "date-time"
            },
            "description": "RFC 3339; results sealed before it."
          },
          {
            "name": "target",
            "in": "query",
            "schema": {
              "type": "integer",
              "minimum": 1,
              "maximum": 31622400
            },
            "description": "A target in whole seconds for each result that seals none, compared with its first sign-off."
          },
          {
            "name": "pack",
            "in": "query",
            "schema": {
              "type": "string",
              "enum": [
                "1",
                "true",
                "yes",
                "0",
                "false",
                "no"
              ]
            },
            "description": "1 embeds the feed from its first event to the head, for verdifax-verify --signals pack.json --response-times."
          }
        ],
        "responses": {
          "200": {
            "description": "The report.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/ResponseTimes"
                }
              }
            }
          },
          "400": {
            "description": "A query value is missing, unreadable or not one this report reads.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          },
          "409": {
            "description": "The feed head could not be put on the public log.",
            "content": {
              "application/json": {
                "schema": {
                  "$ref": "#/components/schemas/Error"
                }
              }
            }
          }
        }
      }
    }
  }
}
