{
  "openapi": "3.1.0",
  "info": {
    "title": "Project X synthetic workflow integration",
    "version": "1.0.0",
    "description": "Signed machine operations. Register an enterprise public key and exact owner-granted scope first. No clinical approvals, live transcripts, arbitrary destinations or customer decisions are accepted. Schema validation alone does not perform runtime authorization or evidence checks."
  },
  "servers": [
    {
      "url": "https://project-x-evidence.thomasdimona.workers.dev"
    }
  ],
  "paths": {
    "/integrations/v1": {
      "post": {
        "operationId": "signedIntegrationCommand",
        "summary": "Operate within an exact protocol and environment grant",
        "description": "Sign canonical JSON payload with the registered Ed25519 PKCS8 private key. integrity.keyId is the runner ID. Public key format is base64 SPKI. at must be within five minutes; nonce is a fresh UUID. Stable content/run IDs support idempotent retries with fresh signatures. Limit: 900000 request bytes, 20 operations per minute per identity; evidence reads 10 per minute. No approval inheritance.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "payload": {
                    "anyOf": [
                      {
                        "type": "object",
                        "properties": {
                          "schema": {
                            "type": "string",
                            "const": "project-x.integration-request/1"
                          },
                          "workspace": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "runnerId": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "nonce": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "operation": {
                            "type": "string",
                            "const": "catalog"
                          },
                          "protocolHash": {
                            "type": "string",
                            "pattern": "^[a-f0-9]{64}$"
                          }
                        },
                        "required": [
                          "schema",
                          "workspace",
                          "runnerId",
                          "nonce",
                          "at",
                          "operation",
                          "protocolHash"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "schema": {
                            "type": "string",
                            "const": "project-x.integration-request/1"
                          },
                          "workspace": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "runnerId": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "nonce": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "operation": {
                            "type": "string",
                            "const": "register-release"
                          },
                          "release": {
                            "type": "object",
                            "properties": {
                              "id": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                              },
                              "version": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                              },
                              "environment": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                              },
                              "appVersion": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1000
                              },
                              "modelProvider": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1000
                              },
                              "modelVersion": {
                                "type": "string",
                                "minLength": 1,
                                "maxLength": 1000
                              },
                              "promptHash": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "routingHash": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "classifierHash": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "configHash": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "protocolHash": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "scenarioHashes": {
                                "type": "array",
                                "items": {
                                  "type": "string",
                                  "pattern": "^[a-f0-9]{64}$"
                                },
                                "minItems": 1,
                                "maxItems": 200
                              },
                              "gitCommit": {
                                "anyOf": [
                                  {
                                    "type": "string",
                                    "pattern": "^[a-f0-9]{7,64}$"
                                  },
                                  {
                                    "type": "null"
                                  }
                                ]
                              },
                              "syntheticOnly": {
                                "type": "boolean",
                                "const": true
                              }
                            },
                            "required": [
                              "id",
                              "version",
                              "environment",
                              "appVersion",
                              "modelProvider",
                              "modelVersion",
                              "promptHash",
                              "routingHash",
                              "classifierHash",
                              "configHash",
                              "protocolHash",
                              "scenarioHashes",
                              "gitCommit",
                              "syntheticOnly"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "schema",
                          "workspace",
                          "runnerId",
                          "nonce",
                          "at",
                          "operation",
                          "release"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "schema": {
                            "type": "string",
                            "const": "project-x.integration-request/1"
                          },
                          "workspace": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "runnerId": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "nonce": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "operation": {
                            "type": "string",
                            "const": "submit-run"
                          },
                          "run": {
                            "type": "object",
                            "properties": {
                              "schema": {
                                "type": "string",
                                "const": "project-x.delivery-run/1"
                              },
                              "id": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                              },
                              "workspace": {
                                "type": "string",
                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                              },
                              "releaseHash": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "protocolHash": {
                                "type": "string",
                                "pattern": "^[a-f0-9]{64}$"
                              },
                              "startedAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "finishedAt": {
                                "type": "string",
                                "format": "date-time"
                              },
                              "origin": {
                                "type": "string",
                                "enum": [
                                  "fixture",
                                  "authorized-customer-synthetic"
                                ]
                              },
                              "observations": {
                                "type": "array",
                                "items": {
                                  "type": "object",
                                  "properties": {
                                    "scenarioHash": {
                                      "type": "string",
                                      "pattern": "^[a-f0-9]{64}$"
                                    },
                                    "sessionId": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                    },
                                    "challenge": {
                                      "type": "string",
                                      "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                    },
                                    "events": {
                                      "type": "array",
                                      "items": {
                                        "type": "object",
                                        "properties": {
                                          "schema": {
                                            "type": "string",
                                            "const": "project-x.event/1"
                                          },
                                          "id": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                          },
                                          "workspace": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                          },
                                          "runId": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                          },
                                          "scenarioHash": {
                                            "type": "string",
                                            "pattern": "^[a-f0-9]{64}$"
                                          },
                                          "sessionId": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                          },
                                          "challenge": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                          },
                                          "type": {
                                            "type": "string",
                                            "enum": [
                                              "session.started",
                                              "risk.detected",
                                              "risk.classified",
                                              "action.routed",
                                              "notification.sent",
                                              "notification.delivered",
                                              "notification.failed",
                                              "human.acknowledged",
                                              "fallback.executed",
                                              "referral.displayed",
                                              "disclosure.displayed",
                                              "break.displayed",
                                              "content.refused",
                                              "counter.recorded",
                                              "session.ended",
                                              "message.generated",
                                              "message.presented",
                                              "human-contact.displayed",
                                              "license-claim.blocked",
                                              "review.requested",
                                              "review.completed",
                                              "decision.dispatched",
                                              "decision.held",
                                              "age.declared",
                                              "restriction.applied",
                                              "consent.requested",
                                              "consent.recorded",
                                              "data.disclosed",
                                              "data.blocked",
                                              "feature.accessed",
                                              "session.resumed",
                                              "advertisement.displayed",
                                              "advertisement.disclosed",
                                              "resource.selected",
                                              "referral.unavailable",
                                              "referral.external-contact",
                                              "payload.checked"
                                            ]
                                          },
                                          "occurredAt": {
                                            "type": "string",
                                            "format": "date-time"
                                          },
                                          "observedAt": {
                                            "type": "string",
                                            "format": "date-time"
                                          },
                                          "clockDomain": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                          },
                                          "elapsedMs": {
                                            "anyOf": [
                                              {
                                                "type": "number",
                                                "minimum": 0,
                                                "maximum": 86400000
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "source": {
                                            "type": "string",
                                            "enum": [
                                              "application",
                                              "receiver",
                                              "human-channel",
                                              "counter"
                                            ]
                                          },
                                          "sourceId": {
                                            "type": "string",
                                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                          },
                                          "notificationId": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "receiverId": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "actorId": {
                                            "anyOf": [
                                              {
                                                "type": "string",
                                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                              },
                                              {
                                                "type": "null"
                                              }
                                            ]
                                          },
                                          "actorKind": {
                                            "type": "string",
                                            "enum": [
                                              "human",
                                              "synthetic",
                                              "system",
                                              "unknown"
                                            ]
                                          },
                                          "synthetic": {
                                            "type": "boolean",
                                            "const": true
                                          },
                                          "sequence": {
                                            "type": "integer",
                                            "minimum": 0
                                          },
                                          "attributes": {
                                            "type": "object",
                                            "properties": {
                                              "resourceId": {
                                                "type": "string",
                                                "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                                              },
                                              "resourceCountry": {
                                                "type": "string",
                                                "pattern": "^[A-Z]{2}$"
                                              },
                                              "payloadFields": {
                                                "type": "array",
                                                "items": {
                                                  "type": "string",
                                                  "enum": [
                                                    "country",
                                                    "locale",
                                                    "resource-id",
                                                    "test-id",
                                                    "user-input",
                                                    "health-info",
                                                    "auth-token"
                                                  ]
                                                },
                                                "maxItems": 10
                                              },
                                              "subjectHash": {
                                                "type": "string",
                                                "pattern": "^[a-f0-9]{64}$"
                                              },
                                              "credentialEvidenceHash": {
                                                "type": "string",
                                                "pattern": "^[a-f0-9]{64}$"
                                              },
                                              "reviewScopeHash": {
                                                "type": "string",
                                                "pattern": "^[a-f0-9]{64}$"
                                              },
                                              "prerequisiteReceiptHash": {
                                                "type": "string",
                                                "pattern": "^[a-f0-9]{64}$"
                                              },
                                              "reviewerRole": {
                                                "type": "string",
                                                "enum": [
                                                  "physician",
                                                  "licensed-professional",
                                                  "authorized-reviewer"
                                                ]
                                              },
                                              "explicitReviewComplete": {
                                                "type": "boolean",
                                                "const": true
                                              },
                                              "count": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 10000000
                                              },
                                              "periodStart": {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                              },
                                              "periodEnd": {
                                                "type": "string",
                                                "pattern": "^\\d{4}-\\d{2}-\\d{2}$"
                                              },
                                              "isTest": {
                                                "type": "boolean",
                                                "const": true
                                              },
                                              "complete": {
                                                "type": "boolean"
                                              },
                                              "ageBand": {
                                                "type": "string",
                                                "enum": [
                                                  "minor",
                                                  "adult",
                                                  "unknown"
                                                ]
                                              },
                                              "virtualElapsedMs": {
                                                "type": "integer",
                                                "minimum": 0,
                                                "maximum": 86400000
                                              }
                                            },
                                            "additionalProperties": false
                                          }
                                        },
                                        "required": [
                                          "schema",
                                          "id",
                                          "workspace",
                                          "runId",
                                          "scenarioHash",
                                          "sessionId",
                                          "challenge",
                                          "type",
                                          "occurredAt",
                                          "observedAt",
                                          "clockDomain",
                                          "elapsedMs",
                                          "source",
                                          "sourceId",
                                          "notificationId",
                                          "receiverId",
                                          "actorId",
                                          "actorKind",
                                          "synthetic",
                                          "sequence",
                                          "attributes"
                                        ],
                                        "additionalProperties": false
                                      },
                                      "maxItems": 1000
                                    },
                                    "coverage": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "session.started",
                                          "risk.detected",
                                          "risk.classified",
                                          "action.routed",
                                          "notification.sent",
                                          "notification.delivered",
                                          "notification.failed",
                                          "human.acknowledged",
                                          "fallback.executed",
                                          "referral.displayed",
                                          "disclosure.displayed",
                                          "break.displayed",
                                          "content.refused",
                                          "counter.recorded",
                                          "session.ended",
                                          "message.generated",
                                          "message.presented",
                                          "human-contact.displayed",
                                          "license-claim.blocked",
                                          "review.requested",
                                          "review.completed",
                                          "decision.dispatched",
                                          "decision.held",
                                          "age.declared",
                                          "restriction.applied",
                                          "consent.requested",
                                          "consent.recorded",
                                          "data.disclosed",
                                          "data.blocked",
                                          "feature.accessed",
                                          "session.resumed",
                                          "advertisement.displayed",
                                          "advertisement.disclosed",
                                          "resource.selected",
                                          "referral.unavailable",
                                          "referral.external-contact",
                                          "payload.checked"
                                        ]
                                      },
                                      "maxItems": 50
                                    },
                                    "complete": {
                                      "type": "boolean"
                                    },
                                    "driver": {
                                      "type": "string",
                                      "enum": [
                                        "openai-compatible",
                                        "rest",
                                        "playwright",
                                        "cekura",
                                        "hamming",
                                        "fixture"
                                      ]
                                    },
                                    "turnCount": {
                                      "type": "integer",
                                      "minimum": 0,
                                      "maximum": 30
                                    },
                                    "responseHashes": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "pattern": "^[a-f0-9]{64}$"
                                      },
                                      "maxItems": 30
                                    },
                                    "elapsedMs": {
                                      "type": "number",
                                      "minimum": 0,
                                      "maximum": 86400000
                                    },
                                    "clockControlled": {
                                      "type": "boolean"
                                    },
                                    "errors": {
                                      "type": "array",
                                      "items": {
                                        "type": "string",
                                        "enum": [
                                          "timeout",
                                          "unauthorized",
                                          "rate-limit",
                                          "unavailable",
                                          "invalid-response",
                                          "incomplete",
                                          "unapproved-destination"
                                        ]
                                      },
                                      "maxItems": 20
                                    }
                                  },
                                  "required": [
                                    "scenarioHash",
                                    "sessionId",
                                    "challenge",
                                    "events",
                                    "coverage",
                                    "complete",
                                    "driver",
                                    "turnCount",
                                    "responseHashes",
                                    "elapsedMs",
                                    "clockControlled",
                                    "errors"
                                  ],
                                  "additionalProperties": false
                                },
                                "minItems": 1,
                                "maxItems": 100
                              },
                              "receiverReceipts": {
                                "type": "array",
                                "items": {},
                                "maxItems": 100
                              },
                              "syntheticOnly": {
                                "type": "boolean",
                                "const": true
                              }
                            },
                            "required": [
                              "schema",
                              "id",
                              "workspace",
                              "releaseHash",
                              "protocolHash",
                              "startedAt",
                              "finishedAt",
                              "origin",
                              "observations",
                              "syntheticOnly"
                            ],
                            "additionalProperties": false
                          }
                        },
                        "required": [
                          "schema",
                          "workspace",
                          "runnerId",
                          "nonce",
                          "at",
                          "operation",
                          "run"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "schema": {
                            "type": "string",
                            "const": "project-x.integration-request/1"
                          },
                          "workspace": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "runnerId": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "nonce": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "operation": {
                            "type": "string",
                            "const": "read-evidence"
                          },
                          "runId": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          }
                        },
                        "required": [
                          "schema",
                          "workspace",
                          "runnerId",
                          "nonce",
                          "at",
                          "operation",
                          "runId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "schema": {
                            "type": "string",
                            "const": "project-x.integration-request/1"
                          },
                          "workspace": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "runnerId": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "nonce": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "operation": {
                            "type": "string",
                            "const": "read-plan"
                          },
                          "analysisId": {
                            "type": "string",
                            "format": "uuid"
                          }
                        },
                        "required": [
                          "schema",
                          "workspace",
                          "runnerId",
                          "nonce",
                          "at",
                          "operation",
                          "analysisId"
                        ],
                        "additionalProperties": false
                      },
                      {
                        "type": "object",
                        "properties": {
                          "schema": {
                            "type": "string",
                            "const": "project-x.integration-request/1"
                          },
                          "workspace": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "runnerId": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "nonce": {
                            "type": "string",
                            "format": "uuid"
                          },
                          "at": {
                            "type": "string",
                            "format": "date-time"
                          },
                          "operation": {
                            "type": "string",
                            "const": "compare-runs"
                          },
                          "before": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          },
                          "after": {
                            "type": "string",
                            "pattern": "^[a-zA-Z0-9][a-zA-Z0-9._-]{0,99}$"
                          }
                        },
                        "required": [
                          "schema",
                          "workspace",
                          "runnerId",
                          "nonce",
                          "at",
                          "operation",
                          "before",
                          "after"
                        ],
                        "additionalProperties": false
                      }
                    ]
                  },
                  "integrity": {
                    "type": "object",
                    "properties": {
                      "algorithm": {
                        "type": "string",
                        "const": "Ed25519"
                      },
                      "hash": {
                        "type": "string",
                        "pattern": "^[a-f0-9]{64}$"
                      },
                      "signature": {
                        "type": "string"
                      },
                      "keyId": {
                        "type": "string"
                      },
                      "publicKey": {
                        "type": "string"
                      }
                    },
                    "required": [
                      "algorithm",
                      "hash",
                      "signature",
                      "keyId",
                      "publicKey"
                    ],
                    "additionalProperties": false
                  }
                },
                "required": [
                  "payload",
                  "integrity"
                ],
                "additionalProperties": false
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "Versioned response. value is pinned content, a stored run, signed evidence or a run comparison. An accepted run may have a blocked gate.",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object",
                  "required": [
                    "schema",
                    "requestId",
                    "value"
                  ],
                  "properties": {
                    "schema": {
                      "const": "project-x.integration-response/1"
                    },
                    "requestId": {
                      "type": "string",
                      "format": "uuid"
                    },
                    "value": {}
                  }
                }
              }
            }
          },
          "400": {
            "description": "Invalid strict schema or scope relationships"
          },
          "401": {
            "description": "Invalid signature, time, revoked or expired identity"
          },
          "403": {
            "description": "Operation, protocol or environment outside the grant"
          },
          "404": {
            "description": "Pinned resource not found"
          },
          "409": {
            "description": "Replay, conflicting immutable identifier, or capacity pause"
          },
          "413": {
            "description": "Request exceeds bounded size"
          },
          "415": {
            "description": "Unsupported media type"
          },
          "429": {
            "description": "Rate limited; Retry-After header in seconds"
          },
          "503": {
            "description": "Unavailable; no completion should be inferred"
          }
        }
      }
    }
  }
}