{
  "openapi": "3.1.0",
  "info": {
    "title": "TemporalLock runtime",
    "version": "0.1.0",
    "description": "Append-only observation receipts. Client sends the chain JSON (stateless). Receipts, not truth claims."
  },
  "servers": [
    {
      "url": "https://temporallock-download-tracker.vibelock.workers.dev"
    }
  ],
  "paths": {
    "/v1/health": {
      "get": {
        "operationId": "health",
        "summary": "Liveness",
        "responses": {
          "200": {
            "description": "ok",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/genesis": {
      "post": {
        "operationId": "genesis",
        "summary": "Mint the first receipt (prev_hash = 64 zeros).",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "summary",
                  "evidence"
                ],
                "properties": {
                  "summary": {
                    "type": "string"
                  },
                  "evidence": {
                    "type": "string"
                  },
                  "confidence": {
                    "type": "number"
                  },
                  "timestamp": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "genesis",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/append": {
      "post": {
        "operationId": "append",
        "summary": "Append a receipt. Client sends the existing chain JSON.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "required": [
                  "summary",
                  "evidence"
                ],
                "properties": {
                  "chain": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "receipts": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "summary": {
                    "type": "string"
                  },
                  "evidence": {
                    "type": "string"
                  },
                  "confidence": {
                    "type": "number"
                  },
                  "timestamp": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "append",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/verify": {
      "post": {
        "operationId": "verify",
        "summary": "Walk hashes and links. Receipts, not truth claims.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "chain": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "receipts": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "verify",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    },
    "/v1/gate": {
      "post": {
        "operationId": "gate",
        "summary": "Hash content, genesis or append, then verify. Stateless.",
        "requestBody": {
          "required": true,
          "content": {
            "application/json": {
              "schema": {
                "type": "object",
                "properties": {
                  "content": {
                    "type": "string"
                  },
                  "sha256": {
                    "type": "string"
                  },
                  "chain": {
                    "oneOf": [
                      {
                        "type": "array",
                        "items": {
                          "type": "object"
                        }
                      },
                      {
                        "type": "string"
                      }
                    ]
                  },
                  "summary": {
                    "type": "string"
                  },
                  "file": {
                    "type": "string"
                  }
                }
              }
            }
          }
        },
        "responses": {
          "200": {
            "description": "gate",
            "content": {
              "application/json": {
                "schema": {
                  "type": "object"
                }
              }
            }
          }
        }
      }
    }
  }
}