{"openapi":"3.1.0","info":{"title":"OnceGate","description":"Safe retry coordination for irreversible AI-agent actions.","version":"1.0.0"},"paths":{"/":{"get":{"summary":"Manifest","operationId":"manifest__get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ManifestResponse"}}}},"500":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/healthz":{"get":{"summary":"Health","operationId":"health_healthz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HealthResponse"}}}},"500":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/readyz":{"get":{"summary":"Readiness","operationId":"readiness_readyz_get","responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReadinessResponse"}}}},"500":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/operations/claim":{"post":{"summary":"Claim","operationId":"claim_v1_operations_claim_post","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimRequest"}}},"required":true},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ClaimResponse"}}}},"413":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/operations/{operation_id}/resolve":{"post":{"summary":"Resolve","operationId":"resolve_v1_operations__operation_id__resolve_post","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}},{"name":"X-Execution-Token","in":"header","required":false,"schema":{"anyOf":[{"type":"string"},{"type":"null"}],"title":"X-Execution-Token"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveRequest"}}}},"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ResolveResponse"}}}},"403":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"404":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"409":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"413":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}}}},"/v1/operations/{operation_id}":{"get":{"summary":"Inspect","operationId":"inspect_v1_operations__operation_id__get","parameters":[{"name":"operation_id","in":"path","required":true,"schema":{"type":"string","title":"Operation Id"}}],"responses":{"200":{"description":"Successful Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/OperationResponse"}}}},"404":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"500":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"503":{"description":"Stable OnceGate error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}},"422":{"description":"Validation Error","content":{"application/json":{"schema":{"$ref":"#/components/schemas/HTTPValidationError"}}}}}}}},"components":{"schemas":{"ClaimRequest":{"properties":{"scope":{"type":"string","maxLength":100,"minLength":3,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]*$","title":"Scope"},"idempotency_key":{"type":"string","maxLength":200,"minLength":3,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]*$","title":"Idempotency Key"},"action":{"type":"string","maxLength":100,"minLength":1,"title":"Action"},"intent":{"$ref":"#/components/schemas/JsonObject"},"owner_id":{"anyOf":[{"type":"string","maxLength":100,"minLength":1},{"type":"null"}],"title":"Owner Id"},"lease_seconds":{"type":"integer","maximum":300.0,"minimum":5.0,"title":"Lease Seconds","default":60}},"additionalProperties":false,"type":"object","required":["scope","idempotency_key","action","intent"],"title":"ClaimRequest","description":"A stable business operation claim."},"ClaimResponse":{"properties":{"operation_id":{"type":"string","maxLength":64,"minLength":4,"pattern":"^op_[A-Za-z0-9_-]+$","title":"Operation Id"},"decision":{"$ref":"#/components/schemas/Decision"},"state":{"$ref":"#/components/schemas/OperationState"},"attempt":{"type":"integer","minimum":1.0,"title":"Attempt"},"fingerprint":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$","title":"Fingerprint"},"execution_token":{"anyOf":[{"type":"string","maxLength":256,"minLength":5,"pattern":"^ogt_[A-Za-z0-9_-]+$"},{"type":"null"}],"title":"Execution Token"},"lease_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lease Expires At"},"result":{"anyOf":[{"$ref":"#/components/schemas/JsonObject"},{"type":"null"}]},"instruction":{"type":"string","minLength":1,"title":"Instruction"}},"additionalProperties":false,"type":"object","required":["operation_id","decision","state","attempt","fingerprint","instruction"],"title":"ClaimResponse","description":"Stable response shape for every claim domain decision."},"Decision":{"type":"string","enum":["EXECUTE","IN_PROGRESS","REPLAY","CONFLICT","AMBIGUOUS"],"title":"Decision","description":"The complete claim decision set."},"ErrorDetail":{"properties":{"code":{"type":"string","minLength":1,"title":"Code"},"message":{"type":"string","minLength":1,"title":"Message"},"retryable":{"type":"boolean","title":"Retryable"}},"additionalProperties":false,"type":"object","required":["code","message","retryable"],"title":"ErrorDetail","description":"One sanitized, stable public error."},"ErrorResponse":{"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}},"additionalProperties":false,"type":"object","required":["error"],"title":"ErrorResponse","description":"The sole public HTTP error envelope."},"HTTPValidationError":{"properties":{"detail":{"items":{"$ref":"#/components/schemas/ValidationError"},"type":"array","title":"Detail"}},"type":"object","title":"HTTPValidationError"},"HealthResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","default":"ok"},"version":{"type":"string","title":"Version"}},"additionalProperties":false,"type":"object","required":["version"],"title":"HealthResponse","description":"Database-independent function liveness response."},"JsonObject":{"additionalProperties":{"$ref":"#/components/schemas/JsonValue"},"type":"object"},"JsonValue":{},"ManifestResponse":{"properties":{"service":{"type":"string","const":"OnceGate","title":"Service","default":"OnceGate"},"version":{"type":"string","title":"Version"},"description":{"type":"string","title":"Description"},"guarantee":{"type":"string","title":"Guarantee"},"docs_url":{"type":"string","title":"Docs Url"},"openapi_url":{"type":"string","title":"Openapi Url"},"skill_url":{"type":"string","title":"Skill Url"},"health_url":{"type":"string","title":"Health Url"},"readiness_url":{"type":"string","title":"Readiness Url"}},"additionalProperties":false,"type":"object","required":["version","description","guarantee","docs_url","openapi_url","skill_url","health_url","readiness_url"],"title":"ManifestResponse","description":"Small discovery document returned at the service root."},"OperationResponse":{"properties":{"operation_id":{"type":"string","maxLength":64,"minLength":4,"pattern":"^op_[A-Za-z0-9_-]+$","title":"Operation Id"},"scope":{"type":"string","maxLength":100,"minLength":3,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]*$","title":"Scope"},"idempotency_key":{"type":"string","maxLength":200,"minLength":3,"pattern":"^[A-Za-z0-9][A-Za-z0-9._:/-]*$","title":"Idempotency Key"},"action":{"type":"string","maxLength":100,"minLength":1,"title":"Action"},"state":{"$ref":"#/components/schemas/OperationState"},"attempt":{"type":"integer","minimum":1.0,"title":"Attempt"},"fingerprint":{"type":"string","pattern":"^sha256:[0-9a-f]{64}$","title":"Fingerprint"},"lease_expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"title":"Lease Expires At"},"result":{"anyOf":[{"$ref":"#/components/schemas/JsonObject"},{"type":"null"}]},"safe_next_action":{"$ref":"#/components/schemas/SafeNextAction"}},"additionalProperties":false,"type":"object","required":["operation_id","scope","idempotency_key","action","state","attempt","fingerprint","safe_next_action"],"title":"OperationResponse","description":"Inspection response; this model never contains an execution token."},"OperationState":{"type":"string","enum":["CLAIMED","RELEASED","SUCCEEDED","AMBIGUOUS"],"title":"OperationState","description":"Durable operation states."},"ReadinessResponse":{"properties":{"status":{"type":"string","const":"ok","title":"Status","default":"ok"},"database":{"type":"string","const":"reachable","title":"Database","default":"reachable"},"version":{"type":"string","title":"Version"}},"additionalProperties":false,"type":"object","required":["version"],"title":"ReadinessResponse","description":"Database readiness response returned after a successful probe."},"ResolutionOutcome":{"type":"string","enum":["SUCCEEDED","NOT_EXECUTED","UNKNOWN"],"title":"ResolutionOutcome","description":"Outcomes an execution-token holder may record."},"ResolveRequest":{"properties":{"outcome":{"$ref":"#/components/schemas/ResolutionOutcome"},"result":{"$ref":"#/components/schemas/JsonObject"}},"additionalProperties":false,"type":"object","required":["outcome","result"],"title":"ResolveRequest","description":"The caller's known outcome for one authorized attempt."},"ResolveResponse":{"properties":{"operation_id":{"type":"string","maxLength":64,"minLength":4,"pattern":"^op_[A-Za-z0-9_-]+$","title":"Operation Id"},"state":{"$ref":"#/components/schemas/OperationState"},"attempt":{"type":"integer","minimum":1.0,"title":"Attempt"},"safe_next_action":{"$ref":"#/components/schemas/SafeNextAction"},"result":{"$ref":"#/components/schemas/JsonObject"},"instruction":{"type":"string","minLength":1,"title":"Instruction"}},"additionalProperties":false,"type":"object","required":["operation_id","state","attempt","safe_next_action","result","instruction"],"title":"ResolveResponse","description":"Durable resolution state and safe follow-up guidance."},"SafeNextAction":{"type":"string","enum":["WAIT","CLAIM_AGAIN","USE_STORED_RESULT","RECONCILE"],"title":"SafeNextAction","description":"Non-authorizing guidance returned by resolution and inspection."},"ValidationError":{"properties":{"loc":{"items":{"anyOf":[{"type":"string"},{"type":"integer"}]},"type":"array","title":"Location"},"msg":{"type":"string","title":"Message"},"type":{"type":"string","title":"Error Type"},"input":{"title":"Input"},"ctx":{"type":"object","title":"Context"}},"type":"object","required":["loc","msg","type"],"title":"ValidationError"}}}}