{"openapi":"3.1.0","info":{"title":"SelectAgent Verify","version":"0.1.0","description":"Read-only GitHub issue postcondition verification. Never authorizes retrying the original write."},"servers":[{"url":".","description":"Same base path as this document: hosted /verify-api/ or local root."}],"security":[{"Bearer":[]}],"paths":{"/health":{"get":{"security":[],"responses":{"200":{"description":"Health","content":{"application/json":{"schema":{"type":"object","additionalProperties":false,"properties":{"status":{"const":"ok"},"service":{"const":"selectagent-verify"}},"required":["status","service"]}}}}}}},"/openapi.json":{"get":{"security":[],"responses":{"200":{"description":"This OpenAPI 3.1 document","content":{"application/json":{"schema":{"type":"object"}}}}}}},"/v1/contracts":{"post":{"operationId":"registerContract","requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Registration"}}}},"responses":{"200":{"description":"Success; idempotent retries return the original timestamped object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Contract"}}}},"400":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/contracts/{contract_id}/verify":{"post":{"operationId":"verifyOutcome","parameters":[{"name":"contract_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Episode"}}}},"responses":{"200":{"description":"Success; idempotent retries return the original timestamped object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}},"400":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/v1/verifications/{verification_id}":{"get":{"operationId":"getVerification","parameters":[{"name":"verification_id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"description":"Success; idempotent retries return the original timestamped object.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Verification"}}}},"400":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"403":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"404":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/html":{"schema":{"type":"string"}}}},"429":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}},"text/html":{"schema":{"type":"string"}}}},"503":{"description":"Rejected or unavailable; no provider write performed. Ingress rejections may use HTML; retain the original idempotency key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}}},"components":{"securitySchemes":{"Bearer":{"type":"http","scheme":"bearer"}},"schemas":{"Registration":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"connection_id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"},"repository":{"type":"string","maxLength":201,"pattern":"^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$"},"correlation_key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"},"expected":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":256},"required_labels":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"state":{"type":"string","enum":["open","closed"]}},"required":["title","required_labels","state"],"additionalProperties":false},"known_issue_number":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"idempotency_key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"}},"required":["connection_id","repository","correlation_key","expected","idempotency_key"],"additionalProperties":false},"Episode":{"$schema":"https://json-schema.org/draft/2020-12/schema","type":"object","properties":{"idempotency_key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"}},"required":["idempotency_key"],"additionalProperties":false},"Error":{"type":"object","additionalProperties":false,"properties":{"error":{"type":"object","additionalProperties":false,"properties":{"code":{"type":"string"},"reason":{"type":"string"}},"required":["code","reason"]}},"required":["error"]},"Contract":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"connection_id":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"},"repository":{"type":"string","maxLength":201,"pattern":"^[A-Za-z0-9_.-]+\\/[A-Za-z0-9_.-]+$"},"correlation_key":{"type":"string","pattern":"^[A-Za-z0-9][A-Za-z0-9_-]{0,95}$"},"expected":{"type":"object","properties":{"title":{"type":"string","minLength":1,"maxLength":256},"required_labels":{"default":[],"maxItems":30,"type":"array","items":{"type":"string","minLength":1,"maxLength":100}},"state":{"type":"string","enum":["open","closed"]}},"required":["title","required_labels","state"],"additionalProperties":false},"known_issue_number":{"type":"integer","exclusiveMinimum":0,"maximum":2147483647},"marker":{"type":"string"},"created_at":{"type":"string","format":"date-time"}},"required":["id","connection_id","repository","correlation_key","expected","marker","created_at"]},"Verification":{"type":"object","additionalProperties":false,"properties":{"id":{"type":"string","format":"uuid"},"contract_id":{"type":"string","format":"uuid"},"observed_at":{"type":"string","format":"date-time"},"status":{"enum":["verified","contradicted","indeterminate"]},"reason":{"type":"string"},"recovery":{"type":"object","additionalProperties":false,"properties":{"directive":{"enum":["reuse_existing_resource","reconcile_existing_resource","reconcile_duplicates","wait_and_reverify","retry_verification","restore_connection","inspect_reference"]},"safe_to_retry_original_write":{"const":false}},"required":["directive","safe_to_retry_original_write"]},"checks":{"anyOf":[{"type":"null"},{"type":"object","additionalProperties":false,"properties":{"marker_present":{"type":"boolean"},"title_matches":{"type":"boolean"},"state_matches":{"type":"boolean"},"required_labels_present":{"type":"boolean"}},"required":["marker_present","title_matches","state_matches","required_labels_present"]}]},"resources":{"type":"array","items":{"type":"object","additionalProperties":false,"properties":{"number":{"type":"integer"},"url":{"type":"string","format":"uri"}},"required":["number","url"]}},"coverage":{"type":"object","additionalProperties":false,"properties":{"scope":{"enum":["known_resource","bounded_repository_listing","synthetic_fixture","unknown"]},"complete":{"type":"boolean"},"pages":{"type":"integer"},"calls":{"type":"integer"}},"required":["scope","complete","pages","calls"]},"synthetic":{"type":"boolean"},"scope_note":{"type":"string"},"evidence_hash":{"type":"string","pattern":"^[a-f0-9]{64}$"}},"required":["id","contract_id","observed_at","status","reason","recovery","checks","resources","coverage","synthetic","scope_note","evidence_hash"]}}}}