{"openapi":"3.1.0","info":{"title":"pokayoke review API","version":"0.1.0","description":"Submit a source review, follow its progress and read the pokeyoka-review/1 envelope; manage the account's repositories, plan and keys. Every path under /api/v1 and POST /mcp takes an API key as a bearer token."},"servers":[{"url":"https://pokayoke.sh"}],"tags":[{"name":"api","description":"The bearer-key HTTP API at /api/v1: one endpoint per account operation."},{"name":"mcp","description":"The MCP JSON-RPC endpoint."},{"name":"site","description":"The website’s own routes a script can call without a key."}],"paths":{"/api/v1/account":{"get":{"summary":"The account behind the key: user, plan, usage and links.","operationId":"getAccount","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The account behind the key.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Account"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reviews":{"get":{"summary":"Reviews, queued and running included, each with its open fixes on GitHub, 25 to a numbered page: ?page (from 1; past the last, the last), ?sort (when, commit, repo, result, fixes, trigger, branch, took; when by default), ?dir (asc or desc; the column’s own by default), ?scope (all, or repositories: repository reviews with a commit), ?status.","operationId":"listReviews","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"scope","in":"query","required":false,"description":"all (the default), or repositories: only repository reviews with a commit.","schema":{"enum":["all","repositories"],"default":"all"}},{"name":"sort","in":"query","required":false,"description":"The column to sort by: when started (the default), commit, repo, result (worst first: proven (an exploit a run proved), not run (a finding confirmed only by reading the code, an unproven one, or a partial run), reviewing, clear, failed), fixes open, trigger, branch, took.","schema":{"enum":["when","commit","repo","result","fixes","trigger","branch","took"],"default":"when"}},{"name":"dir","in":"query","required":false,"description":"asc or desc; by default the column’s own: when, result, fixes and took descending, the rest ascending.","schema":{"enum":["asc","desc"]}},{"name":"page","in":"query","required":false,"description":"The page, from 1; past the last page, the last.","schema":{"type":"integer","minimum":1,"default":1}},{"name":"status","in":"query","required":false,"description":"Only reviews in this state.","schema":{"enum":["queued","running","complete","partial","failed"]}}],"responses":{"200":{"description":"One numbered page of reviews, 25 at most, in the order asked for; every tie broken by the newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewPage"}}}},"400":{"description":"invalid_args: A missing or unknown field, a bad value, or a target this server will not take.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"post":{"summary":"Queue a review: JSON {kind: repo|code|patch|server, ...}, or a multipart upload with kind=upload and an archive file part. Spends one unit of the monthly quota.","operationId":"startReview","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/StartReviewRequest"}},"multipart/form-data":{"schema":{"$ref":"#/components/schemas/StartReviewUpload"}}}},"responses":{"202":{"description":"The review is queued and one review of the monthly quota is spent (a server scan spends the scan rate limit instead).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewAccepted"}}}},"400":{"description":"invalid_args: A missing or unknown field, a bad value, or a target this server will not take.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"403":{"description":"forbidden: A server scan on a deployment with scans off, or a submission of a private repository that no GitHub App installation linked to the account covers: reason is not_installed, with install_url, and nothing is queued. forbidden_target: A review target that names a path on this server: a directory, a local path or a file: URL. Review a clone URL, pasted code or an uploaded archive instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"payload_too_large: A JSON body over 1 MiB (a review submission over 1600 KiB), or an upload over 25 MiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"unsupported_media_type: The body is not application/json, or multipart/form-data for an upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"quota_exhausted: The account has used every review of its monthly quota, or (a free account, period: \"day\") every review of its daily limit; resets_at says when it refills. rate_limited: Too many server scans started recently; retry_after_seconds says how long to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"internal: Uploads, or reviews, are not configured on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reviews/{id}":{"get":{"summary":"One review, with its envelope once finished.","operationId":"getReview","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The review id, as the review list or a submission returned it.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"The review, with its envelope once it has finished.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewDetail"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"404":{"description":"not_found: No such review, finding, repository or key, or one this key may not read; an embargoed review answers exactly as a missing one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reviews/{id}/events":{"get":{"summary":"A review’s progress events after ?after (a sequence number).","operationId":"getReviewEvents","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The review id, as the review list or a submission returned it.","schema":{"type":"string","minLength":1}},{"name":"after","in":"query","required":false,"description":"Only events with a larger sequence number; pass back next_after. Defaults to 0: all.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"The review's progress events after the cursor, at most 200, oldest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewEvents"}}}},"400":{"description":"invalid_args: A missing or unknown field, a bad value, or a target this server will not take.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"404":{"description":"not_found: No such review, finding, repository or key, or one this key may not read; an embargoed review answers exactly as a missing one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reviews/{id}/findings":{"get":{"summary":"The findings of one review.","operationId":"listFindings","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The review id, as the review list or a submission returned it.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"The findings of one review.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingList"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"404":{"description":"not_found: No such review, finding, repository or key, or one this key may not read; an embargoed review answers exactly as a missing one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reviews/{id}/findings/{finding_id}":{"get":{"summary":"One finding of one review.","operationId":"getFinding","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The review id, as the review list or a submission returned it.","schema":{"type":"string","minLength":1}},{"name":"finding_id","in":"path","required":true,"description":"The finding id, as the findings list carries it.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"One finding: the envelope’s own finding object, or its list row when the envelope no longer carries it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FindingDetail"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"404":{"description":"not_found: No such review, finding, repository or key, or one this key may not read; an embargoed review answers exactly as a missing one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/reviews/{id}/prompt":{"get":{"summary":"A prompt for a coding agent that fixes the review’s confirmed and unproven findings, with their full context, as the prompt field; ?finding for one finding. 202 with prompt null while the review is queued or running.","operationId":"getReviewFixPrompt","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The review id, as the review list or a submission returned it.","schema":{"type":"string","minLength":1}},{"name":"finding","in":"query","required":false,"description":"Only this finding, as the findings list carries its id. A refuted or suppressed finding has nothing to fix and answers not_found.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"A prompt for a coding agent that fixes the review’s confirmed and unproven findings, as the prompt field: the same text /r/{id}?format=prompt answers. While the review is queued or running the answer is 202 with prompt null.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixPrompt"}}}},"400":{"description":"invalid_args: A server scan has no fix prompt, or the finding id is malformed.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"404":{"description":"not_found: No such review, or no such finding to fix in it (a refuted or suppressed finding included).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repositories":{"get":{"summary":"Installed and reviewed repositories: monitoring, last review, open findings; with the monitored count and the plan limit. ?sort (repo, branch, head, result, monitoring, pushed; pushed, the newest push first, by default), ?dir (asc or desc; the column’s own by default); every tie by the name.","operationId":"listRepositories","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"sort","in":"query","required":false,"description":"The column to sort by: pushed (the last push; the default), repo (the name), branch, head (when the head commit was pushed), result (the newest review, worst first: proven (an exploit a run proved), not run (a finding confirmed only by reading the code, an unproven one, or a partial run), reviewing, clear, failed), monitoring (monitored first). A repository with no value sorts last.","schema":{"enum":["repo","branch","head","result","monitoring","pushed"],"default":"pushed"}},{"name":"dir","in":"query","required":false,"description":"asc or desc; by default the column’s own: head, result, monitoring and pushed descending, repo and branch ascending.","schema":{"enum":["asc","desc"]}}],"responses":{"200":{"description":"The account’s repositories in the order asked for, every tie broken by the name, with the monitored count against the plan limit.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepositoryList"}}}},"400":{"description":"invalid_args: A missing or unknown field, a bad value, or a target this server will not take.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/repositories/{owner}/{name}/monitoring":{"put":{"summary":"Switch push reviews of one repository on or off: JSON {monitored}. 409 limit_reached past the plan; 404 not_installed.","operationId":"setMonitoring","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"owner","in":"path","required":true,"description":"The repository owner, as on GitHub.","schema":{"type":"string","minLength":1}},{"name":"name","in":"path","required":true,"description":"The repository name, as on GitHub.","schema":{"type":"string","minLength":1}}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MonitoringRequest"}}}},"responses":{"200":{"description":"The repository after the switch.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repository"}}}},"400":{"description":"invalid_args: A missing or unknown field, a bad value, or a target this server will not take.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"404":{"description":"not_found: No linked installation covers the repository: reason is not_installed, with install_url.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"409":{"description":"limit_reached: The plan monitors no more repositories; switch one off, or upgrade at upgrade_url when it is not null (it is null on Enterprise, a grant, with billing off, or where no larger plan is sold).","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"payload_too_large: A JSON body over 1 MiB (a review submission over 1600 KiB), or an upload over 25 MiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"unsupported_media_type: The body is not application/json, or multipart/form-data for an upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/installations":{"get":{"summary":"The linked GitHub App installations and the install links.","operationId":"listInstallations","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The linked installations and the install links.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstallationList"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/fixes":{"get":{"summary":"Fix pull requests and advisories delivered to the account’s repositories; ?limit.","operationId":"listFixes","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"limit","in":"query","required":false,"description":"Rows per page: default 20, at most 200.","schema":{"type":"integer","minimum":1,"maximum":200,"default":20}}],"responses":{"200":{"description":"Fix deliveries, newest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FixList"}}}},"400":{"description":"invalid_args: A missing or unknown field, a bad value, or a target this server will not take.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing":{"get":{"summary":"The plan, its price, status and renewal.","operationId":"billingSummary","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The plan, its status and renewal.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummary"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing/checkout":{"post":{"summary":"A Stripe Checkout link for a paid plan: JSON {plan, interval} or ?plan=&interval=; plan pro (the default), team or enterprise, interval month (the default) or year, where this deployment sells it. The quantity is the plan’s own. 409 already_subscribed on any paid plan; 400 invalid_args for an unknown field or a plan and interval not sold here; 503 billing_disabled.","operationId":"checkoutUrl","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"plan","in":"query","required":false,"description":"The plan to buy: pro, team or enterprise, pro by default, where this deployment sells it; a JSON body {plan, interval} says the same.","schema":{"enum":["pro","team","enterprise"],"default":"pro"}},{"name":"interval","in":"query","required":false,"description":"How often it bills: month or year, month by default, where this deployment sells the plan at that interval. Pro and Team bill each contributor past the included number, counted at checkout.","schema":{"enum":["month","year"],"default":"month"}}],"requestBody":{"required":false,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutRequest"}}}},"responses":{"200":{"description":"A Stripe Checkout link for a person to open; no payment happens in this call.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutLink"}}}},"400":{"description":"invalid_args: An unknown field, a plan that is not pro, team or enterprise, an interval that is not month or year, or a plan this deployment does not sell at that interval.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"409":{"description":"already_subscribed: The account already pays for a plan, a grandfathered one included; switch plans in the billing portal instead.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"413":{"description":"payload_too_large: A JSON body over 1 MiB (a review submission over 1600 KiB), or an upload over 25 MiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"upstream_error: GitHub or Stripe did not answer; try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"billing_disabled: Billing is not enabled on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing/portal":{"post":{"summary":"A Stripe billing portal link. 409 no_customer; 503 billing_disabled.","operationId":"portalUrl","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"A Stripe billing portal link for a person to open.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PortalLink"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"409":{"description":"no_customer: The account has no billing history yet; open checkout first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"upstream_error: GitHub or Stripe did not answer; try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"billing_disabled: Billing is not enabled on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/billing/credits":{"post":{"summary":"A Stripe Checkout link for one review pack: more manual reviews, spent in the UTC month it is bought in, for any account, Free included. No body. 400 invalid_args where this deployment sells no pack; 503 billing_disabled.","operationId":"creditsUrl","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"A Stripe Checkout link for one review pack, for a person to open; the reviews are added once Stripe confirms the payment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckoutLink"}}}},"400":{"description":"invalid_args: This deployment sells no review pack, or the body named a field.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"413":{"description":"payload_too_large: A JSON body over 1 MiB (a review submission over 1600 KiB), or an upload over 25 MiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"upstream_error: GitHub or Stripe did not answer; try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"billing_disabled: Billing is not enabled on this deployment.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/keys":{"get":{"summary":"The account’s API keys, without their secrets.","operationId":"listApiKeys","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The account’s keys, without their secrets.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ApiKeyList"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/keys/{id}":{"delete":{"summary":"Revoke one API key (the calling key included).","operationId":"revokeApiKey","tags":["api"],"security":[{"bearerAuth":[]}],"parameters":[{"name":"id","in":"path","required":true,"description":"The key id, as the key list carries it.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"The revoked key. Revoking the calling key ends it: the next request answers 401.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/RevokedKey"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"404":{"description":"not_found: No such review, finding, repository or key, or one this key may not read; an embargoed review answers exactly as a missing one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications":{"get":{"summary":"Exploit alerts: the verified address they go to, on or off, the least severity that sends one, and any address waiting for verification.","operationId":"getNotifications","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"Where exploit alerts go, whether they are on, and the least severity that sends one.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notifications"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}},"put":{"summary":"Change exploit alerts: JSON {email, enabled, min_severity}, each optional. A new address is mailed a verification link and receives alerts once it is opened; null or the sign-in address returns them to that address. 429 rate_limited past 5 links an account an hour, or 3 links an address a day across every account.","operationId":"setNotifications","tags":["api"],"security":[{"bearerAuth":[]}],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NotificationsRequest"}}}},"responses":{"200":{"description":"The settings after the change. A new address shows under pending until its link is opened.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notifications"}}}},"400":{"description":"invalid_args: A missing or unknown field, a bad value, or a target this server will not take.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"413":{"description":"payload_too_large: A JSON body over 1 MiB (a review submission over 1600 KiB), or an upload over 25 MiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"415":{"description":"unsupported_media_type: The body is not application/json, or multipart/form-data for an upload.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: Five verification emails went out in the last hour; retry_after_seconds says how long to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"upstream_error: The verification email could not be sent; the address is kept, ask for a new link.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/api/v1/notifications/verify":{"post":{"summary":"Mail a fresh verification link to the address waiting for one. 404 not_found when none waits; 429 rate_limited past 5 links an account an hour, or 3 links an address a day.","operationId":"resendVerification","tags":["api"],"security":[{"bearerAuth":[]}],"responses":{"200":{"description":"The settings, with the fresh link’s send and expiry times under pending.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Notifications"}}}},"401":{"description":"unauthenticated: No API key, or one that is unknown or revoked; the answer carries WWW-Authenticate: Bearer.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}},"headers":{"www-authenticate":{"description":"Bearer, with the API realm.","schema":{"type":"string"}}}},"404":{"description":"not_found: No address is waiting for verification.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"429":{"description":"rate_limited: Five verification emails went out in the last hour; retry_after_seconds says how long to wait.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"500":{"description":"internal: The server failed; the message says what, never where.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"502":{"description":"upstream_error: The verification email could not be sent; try again.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}},"503":{"description":"internal: This deployment sends no email.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Error"}}}}}}},"/mcp":{"post":{"summary":"The MCP endpoint","operationId":"mcp","tags":["mcp"],"description":"Model Context Protocol over streamable HTTP: one JSON-RPC 2.0 object per POST, with no session and no event stream; protocol revisions 2025-11-25, 2025-06-18, 2024-11-05. tools/list returns 21 tools: review_submit, review_get, review_list, finding_get, review_patch, server_scan, review_events, finding_list, review_fix_prompt, account_get, repository_list, repository_monitor, installation_list, fix_list, billing_checkout, billing_portal, billing_credits, api_key_list, api_key_revoke, notifications_get, notifications_set. Each tool's input and output schemas are in tools/list; the server card at https://pokayoke.sh/.well-known/mcp/server-card.json names the endpoint and its transport.","security":[{"bearerAuth":[]}],"requestBody":{"required":true,"description":"One JSON-RPC request, at most 1 MiB; a tools/call at most 1600 KiB, so a code or diff argument at its 512 KiB limit fits once JSON escapes it.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcRequest"}}}},"responses":{"200":{"description":"The JSON-RPC response. A protocol error, and a tool that failed (-32603), is an error member inside this 200.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"202":{"description":"A notification (no id) is acknowledged and not executed."},"400":{"description":"A JSON-RPC batch; send one object per request.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}},"401":{"description":"No API key, or one that is unknown or revoked."},"405":{"description":"Any method but POST; the Allow header says POST."},"413":{"description":"A body over 1 MiB, or a tools/call over 1600 KiB.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/JsonRpcResponse"}}}}}}},"/submit":{"post":{"summary":"Submit a review","operationId":"submitReview","tags":["site"],"requestBody":{"required":true,"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitRequest"}},"application/x-www-form-urlencoded":{"schema":{"$ref":"#/components/schemas/SubmitRequest"}},"multipart/form-data":{"schema":{"type":"object","description":"An archive upload: at most 25 MiB compressed, and an archive whose extraction exceeds 2000 files or 100 MiB is refused.","properties":{"kind":{"type":"string","enum":["upload"],"description":"The archive upload target."},"archive":{"type":"string","format":"binary","description":"A zip, tar or tar.gz file of source code to review."}},"required":["kind","archive"]}}}},"responses":{"202":{"description":"The review is queued. A JSON submission gets this body: {\"id\":\"<review-id>\"}.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SubmitAccepted"}}}},"303":{"description":"A form or multipart submission. The Location header is /r/<review-id>.","headers":{"location":{"description":"The report path for the queued review.","schema":{"type":"string"}}}},"400":{"description":"The target is missing or malformed."},"403":{"description":"The form came from another site, or a private repository needs a signed-in account."},"413":{"description":"The request body is larger than this server accepts."},"429":{"description":"A rate limit or the monthly review quota is exhausted."},"503":{"description":"Reviews are not configured on this deployment."}}}},"/r/{id}":{"get":{"summary":"Read a review report","operationId":"getReport","tags":["site"],"parameters":[{"name":"id","in":"path","required":true,"description":"The review id returned by POST /submit.","schema":{"type":"string"}},{"name":"format","in":"query","required":false,"description":"html (the default), json for the envelope, markdown for a rendered report, or prompt for a coding agent’s fix prompt.","schema":{"type":"string","enum":["html","json","markdown","prompt"]}},{"name":"finding","in":"query","required":false,"description":"With format=prompt: only this finding.","schema":{"type":"string","minLength":1}}],"responses":{"200":{"description":"The report in the requested format.","content":{"text/html":{"schema":{"type":"string"}},"application/json":{"schema":{"$ref":"#/components/schemas/ReviewEnvelope"}},"text/markdown":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}},"202":{"description":"The review is queued or running; there is no envelope yet.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/PendingReview"}},"text/html":{"schema":{"type":"string"}},"text/plain":{"schema":{"type":"string"}}}},"400":{"description":"The format is not html, json, markdown or prompt."},"404":{"description":"No review with that id, a review the caller may not read (an embargoed review, or a GitHub-delivered review of a public or unknown-visibility repository, to anyone but its owner and the repository's maintainers), or (format=prompt) no such finding to fix."},"406":{"description":"A server scan has no markdown rendering or fix prompt; request ?format=json."}}}},"/r/{id}/events":{"get":{"summary":"Follow the progress of a review","operationId":"getReportEvents","tags":["site"],"parameters":[{"name":"id","in":"path","required":true,"description":"The review id returned by POST /submit.","schema":{"type":"string"}},{"name":"after","in":"query","required":false,"description":"Return only events with a sequence number greater than this cursor; pass back next_after. Defaults to 0.","schema":{"type":"integer","minimum":0,"default":0}}],"responses":{"200":{"description":"The progress of one review, at most 200 events oldest first.","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewProgress"}}}},"400":{"description":"The `after` cursor is not a non-negative integer."},"404":{"description":"No review with that id, or a review the caller may not read (an embargoed review, or a GitHub-delivered review of a public or unknown-visibility repository, to anyone but its owner and the repository's maintainers)."}}}},"/healthz":{"get":{"summary":"Liveness","operationId":"getHealth","tags":["site"],"responses":{"200":{"description":"The service is up. The body is the literal `ok` and a newline, the word the deploy smoke check and the probes look for.","content":{"text/plain":{"schema":{"type":"string","const":"ok\n"}}}}}}}},"components":{"securitySchemes":{"bearerAuth":{"type":"http","scheme":"bearer","description":"An API key created on the dashboard (https://pokayoke.sh/dashboard) and shown once. The same key calls /api/v1 and /mcp; a revoked key answers 401."}},"schemas":{"Error":{"type":"object","description":"Every refusal under /api/v1, at the status its code maps to. A refusal with context carries it beside the code: upgrade_url, used and limit on limit_reached; resets_at and upgrade_url on quota_exhausted (upgrade_url: it is null on Enterprise, a grant, with billing off, or where no larger plan is sold), and period: \"day\" when it is a free account’s daily limit; retry_after_seconds on rate_limited; reason: \"not_installed\" and install_url on the forbidden of a submission of a private repository that no installation linked to the account covers, and on the not_found of a repository no installation covers.","properties":{"error":{"type":"object","properties":{"code":{"enum":["invalid_args","unauthenticated","forbidden","forbidden_target","not_found","method_not_allowed","limit_reached","already_subscribed","no_customer","payload_too_large","unsupported_media_type","quota_exhausted","rate_limited","internal","upstream_error","billing_disabled"],"description":"Branch on this, never on the message."},"message":{"type":"string","description":"One sentence for a person."}},"required":["code","message"],"additionalProperties":true}},"required":["error"],"additionalProperties":false},"Account":{"type":"object","description":"The account behind the calling key: user, plan, usage this month, links, the open findings of its monitored repositories, how many exploits are proven and open, and how many fixes are open on GitHub with where to find them. A validated JSON object, never free-form prose.","properties":{"user":{"type":"object","description":"The signed-in user.","properties":{"id":{"type":"string"},"email":{"type":["string","null"]},"login":{"type":["string","null"]}},"required":["id","email","login"],"additionalProperties":true},"plan":{"type":"object","description":"The account’s plan and its limits.","properties":{"id":{"enum":["unlimited","free","pro","team","enterprise","legacy_pro","legacy_max","grant"],"description":"unlimited is a self-hosted server with billing off; pro, team and enterprise are sold, smallest first; legacy_pro and legacy_max are a subscriber kept on the terms of an earlier price, never sold again; grant is an operator’s."},"label":{"type":"string"},"interval":{"enum":["month","year",null],"description":"How often a sold plan bills; null on Free, a legacy plan, a grant and while billing is off."},"grandfathered":{"type":"boolean","description":"The account existed before the current catalog: on Free it has no contributor limit. False while billing is off."},"price_label":{"type":["string","null"],"description":"What the plan pays: a sold plan’s price at its interval, a legacy plan’s own price; null on Free, on a grant and while billing is off."},"status":{"type":["string","null"],"description":"Stripe’s word for the subscription, or null."},"repo_limit":{"type":["integer","null"],"minimum":0,"description":"Monitored repositories allowed; null is no limit."},"review_quota":{"type":"integer","minimum":0,"description":"Reviews allowed per UTC month."},"renews_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"past_due":{"type":"boolean"},"past_due_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the payment failed: the subscription was first seen past_due. Null when not past due or not recorded."},"grace_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When a past-due plan stops being Pro unless a retry goes through: 14 days from past_due_since, or from the period end when that is null. An earlier ends_at comes first. Null when not past due."},"billing_enabled":{"type":"boolean"}},"required":["id","label","interval","grandfathered","price_label","status","repo_limit","review_quota","renews_at","ends_at","past_due","past_due_since","grace_ends_at","billing_enabled"],"additionalProperties":true},"usage":{"type":"object","description":"Usage this UTC month.","properties":{"reviews":{"type":"object","description":"The monthly review quota every submission spends.","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":"integer","minimum":0,"description":"The plan’s monthly quota plus credits."},"resets_at":{"type":"string","format":"date-time"},"credits":{"type":"integer","minimum":0,"description":"Manual reviews review packs added to this UTC month; they expire at its end."}},"required":["used","limit","resets_at","credits"],"additionalProperties":true},"monitored":{"type":"object","description":"Monitored repositories against the plan limit.","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":["integer","null"],"minimum":0}},"required":["used","limit"],"additionalProperties":true},"push_reviews_this_month":{"type":"integer","minimum":0,"description":"Push and pull-request reviews; they spend no monthly quota."},"contributors":{"type":"object","description":"Distinct people who pushed to or opened a pull request on a monitored private repository in the trailing 90 days (bots never count), against what the plan includes.","properties":{"used":{"type":"integer","minimum":0,"description":"Contributors in the window."},"included":{"type":["integer","null"],"minimum":0,"description":"Contributors the plan includes: on Free only these are reviewed (anyone else’s push is skipped with X-Pokayoke-Skip: contributor limit); on Pro and Team each one past it is billed. Null: not counted against the plan (Enterprise, a legacy plan, grandfathered Free, a grant, billing off)."}},"required":["used","included"],"additionalProperties":true},"daily":{"type":"object","description":"A free account’s daily limit: reviews that run the models in one UTC day, across the website, the HTTP API, these tools and its pushes and pull requests. A reuse of a review already run and a server scan do not count. Past it a submission answers quota_exhausted (period \"day\") and a push or pull request waits until resets_at. Pull requests by authors without write access draw on their own allowance of the same limit (strangers_used), never on the account’s.","properties":{"used":{"type":"integer","minimum":0,"description":"The account’s own reviews that ran the models this UTC day; pull requests by authors without write access are in strangers_used, not here."},"limit":{"type":["integer","null"],"minimum":0,"description":"The limit; null: none (a paid plan, a grant, billing off). The account’s own reviews and the pull requests of authors without write access each have this many."},"resets_at":{"type":"string","format":"date-time","description":"The next 00:00 UTC: the count starts again and waiting reviews run."},"waiting":{"type":"integer","minimum":0,"description":"Push and pull-request reviews waiting for the reset, strangers_waiting of them included."},"reached":{"type":"boolean","description":"used has reached limit: the account’s new reviews wait or are refused."},"strangers_used":{"type":"integer","minimum":0,"description":"Pull requests by authors without write access that ran the models this UTC day: their own allowance of limit, never counted in used."},"strangers_reached":{"type":"boolean","description":"strangers_used has reached limit: new pull requests by authors without write access wait until resets_at; the account’s own reviews are not affected."},"strangers_waiting":{"type":"integer","minimum":0,"description":"Of waiting, the pull requests by authors without write access."}},"required":["used","limit","resets_at","waiting","reached"],"additionalProperties":true}},"required":["reviews","monitored","push_reviews_this_month","contributors"],"additionalProperties":true},"links":{"type":"object","description":"Where the install, pricing, MCP and docs pages live.","properties":{"install":{"type":["string","null"]},"fixer_install":{"type":["string","null"]},"pricing":{"type":"string"},"mcp":{"type":"string"},"docs":{"type":"string"}},"required":["install","fixer_install","pricing","mcp","docs"],"additionalProperties":true},"open_findings":{"type":"array","items":{"type":"object","description":"A confirmed or unproven finding of the newest finished review of a monitored repository.","properties":{"finding_id":{"type":"string"},"review_id":{"type":"string","description":"The review that found it: pass to review_get or finding_get."},"repo":{"type":"string","description":"owner/name, as repository_list names it."},"severity":{"enum":["critical","high","medium","low","info"]},"verdict":{"enum":["confirmed","unproven"],"description":"confirmed, or unproven: checked and not settled, or never reached."},"proven":{"type":"boolean","description":"True for a confirmed finding an executed run proved: an exploit proven. False for one confirmed by reading the code (verdict confirmed, no exploit run) and for an unproven one."},"title":{"type":"string"},"file":{"type":"string"},"line":{"type":"integer","minimum":0,"description":"0 when the report names no line."},"cwe":{"type":["string","null"]},"reviewed_at":{"type":"string","format":"date-time","description":"When the review that found it finished."}},"required":["finding_id","review_id","repo","severity","verdict","title","file","line","cwe","reviewed_at"],"additionalProperties":true},"description":"Every open finding of the monitored repositories (with no GitHub App on the deployment, of every reviewed repository): severity first, then confirmed before unproven, then the newest review."},"open_exploits":{"type":"integer","minimum":0,"description":"The proven exploits open: the findings among open_findings an executed run proved (proven true). A finding confirmed by reading the code is open but never counted here."},"open_fixes":{"type":"integer","minimum":0,"description":"The fixes delivered to the account’s repositories that are still open on GitHub: fix pull requests open, draft advisories not closed."},"open_fixes_url":{"type":["string","null"],"description":"Where those fixes are on GitHub: one repository’s open pull requests by the fixer App (its security advisories when it has only advisories), or every open pull request by the fixer App when they span repositories; null with none."}},"required":["user","plan","usage","links","open_findings","open_exploits","open_fixes","open_fixes_url"],"additionalProperties":true},"BillingSummary":{"type":"object","description":"The plan object GET /api/v1/account carries, with its id under the name plan.","properties":{"plan":{"enum":["unlimited","free","pro","team","enterprise","legacy_pro","legacy_max","grant"],"description":"unlimited is a self-hosted server with billing off; pro, team and enterprise are sold, smallest first; legacy_pro and legacy_max are a subscriber kept on the terms of an earlier price, never sold again; grant is an operator’s."},"label":{"type":"string"},"interval":{"enum":["month","year",null],"description":"How often a sold plan bills; null on Free, a legacy plan, a grant and while billing is off."},"grandfathered":{"type":"boolean","description":"The account existed before the current catalog: on Free it has no contributor limit. False while billing is off."},"price_label":{"type":["string","null"],"description":"What the plan pays: a sold plan’s price at its interval, a legacy plan’s own price; null on Free, on a grant and while billing is off."},"status":{"type":["string","null"],"description":"Stripe’s word for the subscription, or null."},"repo_limit":{"type":["integer","null"],"minimum":0,"description":"Monitored repositories allowed; null is no limit."},"review_quota":{"type":"integer","minimum":0,"description":"Reviews allowed per UTC month."},"renews_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"past_due":{"type":"boolean"},"past_due_since":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When the payment failed: the subscription was first seen past_due. Null when not past due or not recorded."},"grace_ends_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"When a past-due plan stops being Pro unless a retry goes through: 14 days from past_due_since, or from the period end when that is null. An earlier ends_at comes first. Null when not past due."},"billing_enabled":{"type":"boolean"}},"required":["plan","label","interval","grandfathered","price_label","status","repo_limit","review_quota","renews_at","ends_at","past_due","past_due_since","grace_ends_at","billing_enabled"],"additionalProperties":true},"Review":{"type":"object","description":"One review of the account, queued and running included. Every field is always present; an absent value is null.","properties":{"review_id":{"type":"string"},"kind":{"enum":["repo","code","server"],"description":"repo, code (a paste, a patch or an upload) or server."},"status":{"enum":["queued","running","complete","partial","failed"]},"subject":{"type":"string","description":"The repository URL, the scanned host, or a code review’s title (Pasted code, with its file name when one was given, or Uploaded archive)."},"repo":{"type":["string","null"],"description":"owner/name of a GitHub subject; null for anything else."},"trigger":{"type":["string","null"],"description":"push, pr, manual, mcp or cli; null for an older row."},"commit":{"type":["string","null"],"description":"The commit or ref reviewed; null for a paste or a scan."},"branch":{"type":["string","null"],"description":"The branch a push landed on; null for a pull request, a manual or agent review, a paste or a scan, and an older row."},"created_at":{"type":"string","format":"date-time"},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"error":{"type":["string","null"],"description":"Why the review failed, or null."},"embargoed":{"type":"boolean","description":"Held back from everyone but its owner."},"waiting_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"While a push or pull-request review waits for the account’s daily limit: when it runs, the next 00:00 UTC. Null otherwise."},"replaced":{"type":"boolean","description":"A newer waiting commit of the same branch or pull request ran in its place when the daily limit reset: this review never ran, which is not a failure. status stays failed for compatibility; branch on this, never on the error text."},"replaced_by":{"type":["string","null"],"description":"The review that ran in its place, when known; null otherwise."},"fixes":{"type":"object","description":"The fixes this review delivered that are still open on GitHub: fix pull requests open, draft advisories not closed. One pull request links to itself, several to the repository’s open pull requests by the fixer App; one advisory to itself, several to the repository’s security advisories. A URL is null at 0.","properties":{"pull_requests":{"type":"integer","minimum":0},"pull_requests_url":{"type":["string","null"]},"advisories":{"type":"integer","minimum":0},"advisories_url":{"type":["string","null"]}},"required":["pull_requests","pull_requests_url","advisories","advisories_url"],"additionalProperties":false},"findings":{"type":"object","properties":{"total":{"type":"integer","minimum":0},"confirmed":{"type":"integer","minimum":0,"description":"Findings the verifier confirmed, as the review’s report counts them: proven and confirmed_by_reading together; a hardening note an enforced closure holds is not one."},"proven":{"type":"integer","minimum":0,"description":"Of confirmed, the exploits proven: an executed run demonstrated them. Only this count is ever called proven."},"confirmed_by_reading":{"type":"integer","minimum":0,"description":"Of confirmed, the findings confirmed by reading the code: no exploit was run, so none is a proven exploit."},"unproven":{"type":"integer","minimum":0,"description":"Findings checked and not settled (the envelope’s stats.unproven); 0 before the review finishes."},"closed":{"type":"object","description":"The stored findings this review closed, by state: fixed (its proof no longer fires), no_longer_present and code_removed (neither is called fixed). Present only when the review closed one.","properties":{"fixed":{"type":"integer","minimum":0},"no_longer_present":{"type":"integer","minimum":0},"code_removed":{"type":"integer","minimum":0}},"required":["fixed","no_longer_present","code_removed"],"additionalProperties":false}},"required":["total","confirmed","unproven"],"additionalProperties":false},"report_url":{"type":"string","description":"The report page, relative to the site."},"events_url":{"type":"string","description":"The progress page, relative to the site."}},"required":["review_id","kind","status","subject","repo","trigger","commit","branch","created_at","finished_at","error","embargoed","waiting_until","replaced","replaced_by","findings","fixes","report_url","events_url"],"additionalProperties":true},"ReviewPage":{"type":"object","properties":{"reviews":{"type":"array","items":{"$ref":"#/components/schemas/Review"}},"page":{"type":"integer","minimum":1,"description":"The page read: the last page when the one asked for is past it."},"pages":{"type":"integer","minimum":1,"description":"How many pages there are; 1 with no review."},"per_page":{"type":"integer","minimum":1},"total":{"type":"integer","minimum":0,"description":"Every review in the scope and state asked for."},"sort":{"enum":["when","commit","repo","result","fixes","trigger","branch","took"]},"dir":{"enum":["asc","desc"]}},"required":["reviews","page","pages","per_page","total","sort","dir"],"additionalProperties":false},"ReviewDetail":{"allOf":[{"$ref":"#/components/schemas/Review"},{"type":"object","properties":{"envelope":{"anyOf":[{"$ref":"#/components/schemas/ReviewEnvelope"},{"$ref":"#/components/schemas/ServerEnvelope"},{"type":"null"}],"description":"The finished envelope, or null while the review is queued or running."}},"required":["envelope"]}]},"StartReviewRequest":{"description":"What to review, as JSON. An archive upload is the multipart body instead.","oneOf":[{"type":"object","description":"A repository, cloned at ref.","properties":{"kind":{"const":"repo"},"repo_url":{"type":"string","description":"Clone URL of the repository (https)."},"ref":{"type":["string","null"],"description":"Branch, tag or commit to review; defaults to the remote HEAD."},"scope":{"anyOf":[{"type":"null"},{"type":"string","minLength":1,"maxLength":256,"pattern":"^(?:\\./+)*(?!\\.{1,2}(?:/|$))[A-Za-z0-9._@+()\\[\\]~,=-]+(?:/+(?!\\.{1,2}(?:/|$))[A-Za-z0-9._@+()\\[\\]~,=-]+)*/*$"},{"type":"array","minItems":1,"maxItems":16,"items":{"type":"string","minLength":1,"maxLength":256,"pattern":"^(?:\\./+)*(?!\\.{1,2}(?:/|$))[A-Za-z0-9._@+()\\[\\]~,=-]+(?:/+(?!\\.{1,2}(?:/|$))[A-Za-z0-9._@+()\\[\\]~,=-]+)*/*$"}}],"description":"Narrow the review to one repository-relative path or a list of 1 to 16: each 1 to 256 characters of letters, digits and . _ @ + ( ) [ ] ~ , = - between slashes, with no leading slash and no . or .. segment. Anything else is refused as invalid_args."}},"required":["kind","repo_url"],"additionalProperties":false},{"type":"object","description":"Pasted source text, reviewed as one file.","properties":{"kind":{"const":"code"},"code":{"type":"string","description":"The source text, at most 512 KiB in UTF-8."},"path":{"type":["string","null"],"description":"File name for the text: one path segment, not a directory."}},"required":["kind","code"],"additionalProperties":false},{"type":"object","description":"A unified diff, reviewed without cloning anything.","properties":{"kind":{"const":"patch"},"diff":{"type":"string","description":"The patch as a unified diff, at most 512 KiB in UTF-8."}},"required":["kind","diff"],"additionalProperties":false},{"type":"object","description":"A live server scan of one public host.","properties":{"kind":{"const":"server"},"host":{"type":"string","description":"Hostname, host:port, or http(s) URL of the server to scan."}},"required":["kind","host"],"additionalProperties":false}]},"StartReviewUpload":{"type":"object","description":"An archive upload: at most 25 MiB, and an archive whose extraction exceeds 2000 files or 100 MiB is refused. It is unpacked before the quota is touched, so a refused archive costs nothing.","properties":{"kind":{"type":"string","enum":["upload"]},"archive":{"type":"string","format":"binary","description":"A zip, tar or tar.gz file of source code."}},"required":["kind","archive"]},"ReviewAccepted":{"type":"object","description":"The queued review. Poll the review, or its events, with this id.","properties":{"review_id":{"type":"string"},"status":{"const":"queued"},"report_url":{"type":"string","description":"The report page, relative to the site."},"events_url":{"type":"string","description":"The progress page, relative to the site."}},"required":["review_id","status","report_url","events_url"],"additionalProperties":false},"ReviewEvents":{"type":"object","description":"A review’s progress events after a sequence number, and whether more can come. A validated JSON object, never free-form prose.","properties":{"review_id":{"type":"string"},"status":{"enum":["queued","running","complete","partial","failed"]},"done":{"type":"boolean","description":"The review finished: no further event will arrive."},"events":{"type":"array","items":{"type":"object","description":"One progress event.","properties":{"seq":{"type":"integer","minimum":0},"kind":{"type":"string","description":"The stage, e.g. queued, cloning, hunting, verifying, done."},"detail":{"type":"string"},"data":{"type":["object","null"]},"at":{"type":"string","format":"date-time"}},"required":["seq","kind","detail","data","at"],"additionalProperties":true}},"next_after":{"type":"integer","minimum":0,"description":"Pass back as after to read only newer events."}},"required":["review_id","status","done","events","next_after"],"additionalProperties":true},"FindingList":{"type":"object","description":"The findings of one review. A validated JSON object, never free-form prose.","properties":{"review_id":{"type":"string"},"findings":{"type":"array","items":{"type":"object","description":"One finding, as the review’s list carries it. finding_get returns the whole finding.","properties":{"finding_id":{"type":"string","description":"Pass to finding_get with the review id."},"severity":{"type":"string"},"verdict":{"type":"string"},"tier":{"type":"string"},"title":{"type":"string"},"file":{"type":"string"},"line":{"type":"integer","minimum":0},"cwe":{"type":["string","null"]},"evidence":{"type":"object","description":"The finding’s evidence, beside the summary fields, when the record the row was built from carries it: the untrusted source, the sink it reaches, and what the verifier observed. Absent on a row built from the stored finding row, which keeps no evidence column.","additionalProperties":true},"verification":{"type":"object","description":"How the finding was verified, beside the verdict and tier summary: the procedure, the reason and the attempt’s cost when the row was built from an envelope that states them; a row built from the stored finding row carries the verdict and tier only, and an envelope that states nothing beyond those two writes no nested duplicate.","additionalProperties":true},"notProvenHere":{"const":true,"description":"The finding was carried from an earlier review and its proof was not run at this commit: it keeps its stored verdict, tier and count, and is counted apart from the exploits proven at this commit. The same mark the review’s finding carries; absent otherwise."}},"required":["finding_id","severity","verdict","tier","title","file","line","cwe"],"additionalProperties":true}}},"required":["review_id","findings"],"additionalProperties":true},"FindingRow":{"type":"object","description":"One finding, as the review’s list carries it. finding_get returns the whole finding.","properties":{"finding_id":{"type":"string","description":"Pass to finding_get with the review id."},"severity":{"type":"string"},"verdict":{"type":"string"},"tier":{"type":"string"},"title":{"type":"string"},"file":{"type":"string"},"line":{"type":"integer","minimum":0},"cwe":{"type":["string","null"]},"evidence":{"type":"object","description":"The finding’s evidence, beside the summary fields, when the record the row was built from carries it: the untrusted source, the sink it reaches, and what the verifier observed. Absent on a row built from the stored finding row, which keeps no evidence column.","additionalProperties":true},"verification":{"type":"object","description":"How the finding was verified, beside the verdict and tier summary: the procedure, the reason and the attempt’s cost when the row was built from an envelope that states them; a row built from the stored finding row carries the verdict and tier only, and an envelope that states nothing beyond those two writes no nested duplicate.","additionalProperties":true},"notProvenHere":{"const":true,"description":"The finding was carried from an earlier review and its proof was not run at this commit: it keeps its stored verdict, tier and count, and is counted apart from the exploits proven at this commit. The same mark the review’s finding carries; absent otherwise."}},"required":["finding_id","severity","verdict","tier","title","file","line","cwe"],"additionalProperties":true},"Finding":{"type":"object","description":"One validated pokeyoka-review/1 finding, exactly as the envelope carries it, never free-form prose.","properties":{"id":{"type":"string","description":"Unique within the envelope."},"file":{"type":"string","description":"Repository-relative path."},"line":{"type":"integer","minimum":1,"description":"1-based line the finding anchors to."},"severity":{"enum":["critical","high","medium","low","info"]},"cwe":{"type":["string","null"],"description":"CWE-<n>, or null when no CWE classification is honest."},"title":{"type":"string"},"description":{"type":"string"},"reachability":{"type":"string","description":"Who can reach the sink, and from where."},"trustBoundary":{"type":"string","description":"The threatModel.trustBoundaries[].entrypoint this finding crosses."},"evidence":{"type":"object","description":"Where untrusted data enters, the operation that consumes it, and what the verifier observed.","properties":{"source":{"type":"string","description":"Where untrusted data enters (a parameter, header, file, message)."},"sink":{"type":"string","description":"The operation that consumes it (query, exec, render, write)."},"observation":{"type":"string","description":"What the verifier observed, in its own words or a command result."},"sinkCode":{"type":"string","description":"The anchored sink line’s own source text, redacted like the other evidence strings. Optional: absent when no checkout was read."}},"required":["source","sink","observation"],"additionalProperties":false},"verification":{"type":"object","description":"How the finding was verified. T1 is model judgement; T0 is an executed, deterministic observation.","properties":{"verdict":{"enum":["confirm","refute","pending","inconclusive"]},"tier":{"enum":["T0","T1"]},"method":{"type":"string","description":"The procedure, e.g. \"executed-command\", \"source-read\", \"model-review\"."},"reason":{"type":"string","description":"Why the verdict follows; for a refutation, what was expected instead."},"cost":{"type":"object","properties":{"tokens":{"type":"integer","minimum":0},"ms":{"type":"integer","minimum":0}},"required":["tokens","ms"],"additionalProperties":false}},"required":["verdict","tier","method","reason","cost"],"additionalProperties":false},"suggestedFix":{"anyOf":[{"type":"null"},{"type":"object","properties":{"summary":{"type":"string"},"diff":{"type":"string","description":"Unified diff; may be empty when the summary is the whole suggestion."},"fixStatus":{"enum":["accepted","discarded"],"description":"How the fixer obtained the diff. Absent on older reports and on a patch never evaluated; discarded means published but not verified: read fixReason before applying it."},"fixReason":{"type":"string","description":"The fixer’s account of the status: why a discarded patch is unverified, or a note on how an accepted one was checked."},"fixMissing":{"type":"array","items":{"type":"string"},"description":"The typed gaps the fixer recorded for a discarded patch. One of backend, gateway, install, internal, oom, sandbox, spawn, toolchain or workspace means the fixer’s own machinery stopped: the patch is Not run, never judged on its merits."},"fixRepairs":{"type":"array","items":{"type":"string"},"description":"One line per hunk header the fixer recomputed from the diff body before an accepted patch applied; the diff is already corrected."},"fixReachObserved":{"const":false,"description":"Present only on an accepted patch whose replay could not watch the PoC reach the code (no Node script, or node -e): the exploit stopped, and nothing showed the app still serves the request."}},"required":["summary","diff"],"additionalProperties":false}]},"dedupeKey":{"type":"string","description":"Stable identity across runs, so a repeat finding merges instead of re-firing."},"firstSeen":{"type":"string","format":"date-time"},"lastSeen":{"type":"string","format":"date-time"},"suppressed":{"type":"boolean","description":"True when a committed baseline entry or an inline pokeyoka-ignore comment accepted this finding. Absent means not suppressed. The finding stays in findings[] and is published by no emitter: no SARIF result, no code-scanning alert and no --fail-on failure."},"proof":{"type":"object","description":"Never present in a served answer. The executed proof (the reproduction script and its command line, the signal, both output tails, the hardened control and its diff, the observations, each REQUEST:/RESPONSE: pair with the arm that printed it, the claims and the subject check) stays in the operator’s private record; read proofSummary instead.","additionalProperties":true},"proofSummary":{"type":"object","description":"The executed proof as served, in place of proof: level (the finding’s proofLevel, when it carries one), verdict, sentence (built by the code from these facts alone: the level, that a reproduction ran against the submitted code and against a hardened copy, both exit codes, and the record digest’s first characters), digest (the proof record’s sha256), control (what the hardened control showed: held when the signal was absent from the hardened copy, reproduced when it fired there too, not-run when the control could not be executed; never the control’s command, diff or output), and runs.vulnerable and runs.hardened, each with only exitCode (null when a signal ended it), outputBytes and outputSha256. Absent on a finding no executed run settled.","properties":{"level":{"enum":["source-read","path-reached","effect-demonstrated","oracle-read-back"]},"verdict":{"enum":["confirm","refute","pending","inconclusive"]},"sentence":{"type":"string"},"digest":{"type":"string","pattern":"^[0-9a-f]{64}$"},"control":{"enum":["held","reproduced","not-run"]},"runs":{"type":"object","properties":{"vulnerable":{"type":"object","properties":{"exitCode":{"type":["integer","null"],"description":"The process exit code; null when a signal ended it."},"outputBytes":{"type":"integer","minimum":0,"description":"Bytes of the retained combined output."},"outputSha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"sha256 of the retained combined output."}},"required":["exitCode","outputBytes","outputSha256"],"additionalProperties":false},"hardened":{"type":"object","properties":{"exitCode":{"type":["integer","null"],"description":"The process exit code; null when a signal ended it."},"outputBytes":{"type":"integer","minimum":0,"description":"Bytes of the retained combined output."},"outputSha256":{"type":"string","pattern":"^[0-9a-f]{64}$","description":"sha256 of the retained combined output."}},"required":["exitCode","outputBytes","outputSha256"],"additionalProperties":false}},"required":["vulnerable","hardened"],"additionalProperties":false}},"required":["verdict","sentence","digest","runs","control"],"additionalProperties":false},"proofLevel":{"enum":["source-read","path-reached","effect-demonstrated","oracle-read-back"],"description":"How much the finding’s own proof establishes, weakest first: source-read, path-reached, effect-demonstrated, oracle-read-back."},"supportedSeverity":{"enum":["critical","high","medium","low","info"],"description":"The severity band the finding’s proof supports. A cap, never a floor."},"claimedSeverity":{"enum":["critical","high","medium","low","info"],"description":"The hunter’s severity word, present only when an enforced band lowered severity."},"cvss":{"type":"object","description":"The CVSS vector the hunter stated, the score the review recomputed from it, whether the severity word agrees with the vector’s band, and the preconditions the score concedes.","additionalProperties":true},"review":{"type":"object","description":"The hunt’s own review record: counterevidence read, protections checked, the hunter’s confidence and why, the conditions that would change severity, the optional answer fields the hunter left out (one per gap), and who wrote the record (hunter or verifier). Absent on a finding no hunter answer raised (an agent search row, a fix residual, a chained finding).","additionalProperties":true},"discovery":{"type":"object","description":"How the finding was found: the route (lens, census, fix-residual, chain, agent), the lenses that raised it, the defect shape, and the parent finding of a chain.","additionalProperties":true},"closure":{"type":"object","description":"A site held back as a recorded hardening note: the closure test it fails, the primitive it reaches, the precondition the attacker lacks, the project’s own basis for the intent, any escape record, and whether a switch made the emitters read it.","additionalProperties":true},"reach":{"type":"object","description":"The reachability record: who controls the entry point, how strong the path is, the hops that were checked, and where the route is registered.","additionalProperties":true},"recordedChecks":{"type":"array","description":"Gate checks the run recorded but did not enforce: the check’s registered name, what enforcing it would do to the finding, what it found, the switch that would enforce it, and whether that switch was on.","items":{"type":"object","additionalProperties":true}},"health":{"type":"object","description":"What the attempt that settled the finding met: refused is the literal true when the provider refused the attempt, and an absent member is not a false one. The gateway’s model switches stay in the operator’s record.","additionalProperties":true},"fixRecord":{"type":"object","description":"The fix’s own record beside suggestedFix: the regression test and its patch, the three verifications (the proof refuses the fix, the control holds, the project’s tests pass), the delivery base and the other refs checked, the limits recorded, and the guard the fix reuses.","additionalProperties":true}},"required":["id","file","line","severity","cwe","title","description","reachability","trustBoundary","evidence","verification","suggestedFix","dedupeKey","firstSeen","lastSeen"],"additionalProperties":true},"FixPrompt":{"type":"object","description":"A fix prompt for a coding agent. A validated JSON object, never free-form prose.","properties":{"review_id":{"type":"string"},"status":{"enum":["queued","running","complete","partial","failed"]},"finding_id":{"type":["string","null"],"description":"The one finding the prompt covers, or null: every finding to fix."},"prompt":{"type":["string","null"],"description":"The prompt, plain text with Markdown; null while the review is queued or running, and for a run that failed before it wrote a report."},"findings":{"type":"object","description":"The findings the prompt covers.","properties":{"confirmed":{"type":"integer","minimum":0},"unproven":{"type":"integer","minimum":0}},"required":["confirmed","unproven"],"additionalProperties":true},"error":{"type":["string","null"],"description":"Why the review failed, or null."},"report_url":{"type":"string","description":"The report page the prompt links to."}},"required":["review_id","status","finding_id","prompt","findings","error","report_url"],"additionalProperties":true},"FindingDetail":{"description":"The envelope’s own finding object, or its list row when the envelope no longer carries it.","anyOf":[{"$ref":"#/components/schemas/Finding"},{"$ref":"#/components/schemas/FindingRow"}]},"RepositoryList":{"type":"object","description":"The account’s repositories sorted by one column (every tie by the name), with the monitored count against the plan limit. A validated JSON object, never free-form prose.","properties":{"repositories":{"type":"array","items":{"type":"object","description":"One repository an installation covers or a review named.","properties":{"repo":{"type":"string","description":"owner/name for a GitHub repository."},"url":{"type":"string"},"installed":{"type":"boolean","description":"A linked installation covers it."},"installation_id":{"type":["string","null"]},"monitoring":{"enum":["on","off","paused",null],"description":"The stored switch; null for a repository never switched."},"monitored":{"type":"boolean","description":"Exactly whether a push or pull request on it is reviewed now: installed, not switched off, and within the plan’s limit. A repository switched off is never reviewed."},"enforced":{"type":"boolean","description":"Whether plan limits apply on this deployment (billing is on). False: there is no repository limit, but a repository switched off is still not reviewed."},"visibility":{"enum":["public","private",null]},"branch":{"type":["string","null"],"description":"The branch of the newest push or review, else default_branch; null when none is known."},"default_branch":{"type":["string","null"],"description":"The repository’s default branch as the newest push or pull request named it; null before one."},"head":{"anyOf":[{"type":"null"},{"type":"object","description":"The newer of the newest push’s head and the newest review’s commit.","properties":{"sha":{"type":"string","description":"The commit."},"message":{"type":["string","null"],"description":"The first line of its message, at most 120 characters; null when unknown."},"at":{"type":"string","format":"date-time","description":"When the push arrived, or the review was submitted."}},"required":["sha","message","at"],"additionalProperties":true}]},"last_review":{"anyOf":[{"type":"null"},{"type":"object","description":"The newest review of it.","properties":{"review_id":{"type":"string"},"status":{"enum":["queued","running","complete","partial","failed"]},"verdict":{"enum":["clean","found",null]},"confirmed":{"type":"integer","minimum":0},"at":{"type":"string","format":"date-time"}},"required":["review_id","status","verdict","confirmed","at"],"additionalProperties":true}]},"latest_review":{"anyOf":[{"type":"null"},{"type":"object","description":"The newest review of it, with both counts.","properties":{"review_id":{"type":"string"},"status":{"enum":["queued","running","complete","partial","failed"]},"confirmed":{"type":"integer","minimum":0,"description":"Findings the verifier confirmed, as the review’s report counts them: proven and confirmed_by_reading together; a hardening note an enforced closure holds is not one."},"proven":{"type":"integer","minimum":0,"description":"Of confirmed, the exploits proven: an executed run demonstrated them."},"confirmed_by_reading":{"type":"integer","minimum":0,"description":"Of confirmed, the findings confirmed by reading the code: no exploit was run."},"unproven":{"type":"integer","minimum":0,"description":"Findings checked and not settled; 0 before it finishes."},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"waiting_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"While it waits for the account’s daily limit: when it runs, the next 00:00 UTC; null otherwise."}},"required":["review_id","status","confirmed","unproven","finished_at"],"additionalProperties":true}]},"open_findings":{"type":"integer","minimum":0},"skipped_pushes":{"type":"integer","minimum":0,"description":"Pushes not reviewed this UTC month because it was not monitored."},"last_skipped_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"contributor_skipped_pushes":{"type":"integer","minimum":0,"description":"Pushes and pull requests not reviewed this UTC month because their author was past the Free plan’s included contributors."},"last_contributor_skipped_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["repo","url","installed","installation_id","monitoring","monitored","enforced","visibility","branch","default_branch","head","last_review","latest_review","open_findings","skipped_pushes","last_skipped_at","contributor_skipped_pushes","last_contributor_skipped_at"],"additionalProperties":true}},"monitored":{"type":"object","description":"Monitored repositories against the plan limit.","properties":{"used":{"type":"integer","minimum":0},"limit":{"type":["integer","null"],"minimum":0}},"required":["used","limit"],"additionalProperties":true},"upgrade_url":{"type":["string","null"],"description":"The pricing page where a larger plan is sold than the account’s (Free, Pro, Team or a legacy plan); null on Enterprise, a grant, with billing off, or where nothing larger is sold."},"sort":{"enum":["repo","branch","head","result","monitoring","pushed"],"description":"The column the list is sorted by."},"dir":{"enum":["asc","desc"],"description":"The direction it is sorted in."}},"required":["repositories","monitored","upgrade_url","sort","dir"],"additionalProperties":true},"Repository":{"type":"object","description":"The repository after the switch. A validated JSON object, never free-form prose.","properties":{"repo":{"type":"string","description":"owner/name for a GitHub repository."},"url":{"type":"string"},"installed":{"type":"boolean","description":"A linked installation covers it."},"installation_id":{"type":["string","null"]},"monitoring":{"enum":["on","off","paused",null],"description":"The stored switch; null for a repository never switched."},"monitored":{"type":"boolean","description":"Exactly whether a push or pull request on it is reviewed now: installed, not switched off, and within the plan’s limit. A repository switched off is never reviewed."},"enforced":{"type":"boolean","description":"Whether plan limits apply on this deployment (billing is on). False: there is no repository limit, but a repository switched off is still not reviewed."},"visibility":{"enum":["public","private",null]},"branch":{"type":["string","null"],"description":"The branch of the newest push or review, else default_branch; null when none is known."},"default_branch":{"type":["string","null"],"description":"The repository’s default branch as the newest push or pull request named it; null before one."},"head":{"anyOf":[{"type":"null"},{"type":"object","description":"The newer of the newest push’s head and the newest review’s commit.","properties":{"sha":{"type":"string","description":"The commit."},"message":{"type":["string","null"],"description":"The first line of its message, at most 120 characters; null when unknown."},"at":{"type":"string","format":"date-time","description":"When the push arrived, or the review was submitted."}},"required":["sha","message","at"],"additionalProperties":true}]},"last_review":{"anyOf":[{"type":"null"},{"type":"object","description":"The newest review of it.","properties":{"review_id":{"type":"string"},"status":{"enum":["queued","running","complete","partial","failed"]},"verdict":{"enum":["clean","found",null]},"confirmed":{"type":"integer","minimum":0},"at":{"type":"string","format":"date-time"}},"required":["review_id","status","verdict","confirmed","at"],"additionalProperties":true}]},"latest_review":{"anyOf":[{"type":"null"},{"type":"object","description":"The newest review of it, with both counts.","properties":{"review_id":{"type":"string"},"status":{"enum":["queued","running","complete","partial","failed"]},"confirmed":{"type":"integer","minimum":0,"description":"Findings the verifier confirmed, as the review’s report counts them: proven and confirmed_by_reading together; a hardening note an enforced closure holds is not one."},"proven":{"type":"integer","minimum":0,"description":"Of confirmed, the exploits proven: an executed run demonstrated them."},"confirmed_by_reading":{"type":"integer","minimum":0,"description":"Of confirmed, the findings confirmed by reading the code: no exploit was run."},"unproven":{"type":"integer","minimum":0,"description":"Findings checked and not settled; 0 before it finishes."},"finished_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"waiting_until":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}],"description":"While it waits for the account’s daily limit: when it runs, the next 00:00 UTC; null otherwise."}},"required":["review_id","status","confirmed","unproven","finished_at"],"additionalProperties":true}]},"open_findings":{"type":"integer","minimum":0},"skipped_pushes":{"type":"integer","minimum":0,"description":"Pushes not reviewed this UTC month because it was not monitored."},"last_skipped_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"contributor_skipped_pushes":{"type":"integer","minimum":0,"description":"Pushes and pull requests not reviewed this UTC month because their author was past the Free plan’s included contributors."},"last_contributor_skipped_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["repo","url","installed","installation_id","monitoring","monitored","enforced","visibility","branch","default_branch","head","last_review","latest_review","open_findings","skipped_pushes","last_skipped_at","contributor_skipped_pushes","last_contributor_skipped_at"],"additionalProperties":true},"MonitoringRequest":{"type":"object","properties":{"monitored":{"type":"boolean","description":"true to review its pushes and pull requests, false to stop."}},"required":["monitored"],"additionalProperties":false},"InstallationList":{"type":"object","description":"The GitHub App installations linked to the account, and the install links. A validated JSON object, never free-form prose.","properties":{"installations":{"type":"array","items":{"type":"object","description":"One linked installation.","properties":{"installation_id":{"type":"string"},"account":{"type":"string"},"account_type":{"type":["string","null"]},"repository_selection":{"enum":["all","selected",null]},"repositories":{"type":"integer","minimum":0},"repository_names":{"type":"array","items":{"type":"string"}},"suspended":{"type":"boolean"},"installed_at":{"type":"string","format":"date-time"}},"required":["installation_id","account","account_type","repository_selection","repositories","repository_names","suspended","installed_at"],"additionalProperties":true}},"install_url":{"type":["string","null"],"description":"The sealed install link for this account; null when no App is configured."},"fixer":{"type":"object","description":"The fixer App that delivers fix pull requests and advisories.","properties":{"configured":{"type":"boolean"},"install_url":{"type":["string","null"]}},"required":["configured","install_url"],"additionalProperties":true}},"required":["installations","install_url","fixer"],"additionalProperties":true},"FixList":{"type":"object","description":"Fix pull requests and advisories delivered to the account’s repositories, newest first. A validated JSON object, never free-form prose.","properties":{"fixer":{"type":"object","description":"The fixer App that delivers fix pull requests and advisories.","properties":{"configured":{"type":"boolean"},"install_url":{"type":["string","null"]}},"required":["configured","install_url"],"additionalProperties":true},"deliveries":{"type":"array","items":{"type":"object","description":"One fix delivery.","properties":{"id":{"type":"string"},"review_id":{"type":"string"},"repo":{"type":"string"},"finding_id":{"type":"string"},"mode":{"enum":["pull_request","advisory"]},"state":{"type":"string"},"url":{"type":["string","null"]},"number":{"type":["integer","null"],"minimum":0},"ghsa_id":{"type":["string","null"]},"branch":{"type":["string","null"]},"reason":{"type":["string","null"]},"created_at":{"type":"string","format":"date-time"},"updated_at":{"type":"string","format":"date-time"},"resolved":{"type":"object","description":"Present only when the fix’s finding was closed on evidence. state is fixed (the fixer closes its pull request, its branch kept), no-longer-present or code-removed (neither is called fixed; the pull request is left open). at is when it closed; commit the reviewed commit at which the site first observed the close (a merged fix pull request’s merge commit), which may be later than the commit that made it, null when none is known (a fix pull request recorded merged before the merge commit was kept); review the review whose report established it, null when a merged fix pull request did. A fix never delivered (no pull request or advisory was opened) whose finding closed carries it too, with the delivery’s state skipped and its reason saying so; once the finding is proven again it is absent and the delivery reads its own state again.","properties":{"state":{"enum":["fixed","no-longer-present","code-removed"]},"at":{"type":"string","format":"date-time"},"commit":{"type":["string","null"]},"review":{"type":["string","null"]}},"required":["state","at","commit","review"],"additionalProperties":true},"finding_open":{"type":"boolean","description":"Present only on a merged fix pull request (state merged, mode pull_request): true only when the newest finished push review of the repository's default branch, of the merge or after it, lists the finding (matched by fix key) as open. Newest follows the chain of pushes, else the push received later: a review of an older commit that finished later is never the newest. False when that review does not list it or lists it closed, whatever an earlier review or the alert said, and when no review has finished since the merge. Read when the list is served, never stored; the state stays merged."},"finding_open_as_of":{"type":["string","null"],"description":"Present with finding_open: the commit of that newest finished review when finding_open is true; null when finding_open is false or that review names no commit."},"finding_open_proven":{"type":"boolean","description":"Present with finding_open: true when that newest finished review published the finding as proven at its commit (its proof ran there); false for a finding it confirmed by reading the code or carried from an earlier review, and when finding_open is false."}},"required":["id","review_id","repo","finding_id","mode","state","url","number","ghsa_id","branch","reason","created_at","updated_at"],"additionalProperties":true}}},"required":["fixer","deliveries"],"additionalProperties":true},"CheckoutLink":{"type":"object","description":"A Stripe Checkout link. A validated JSON object, never free-form prose.","properties":{"url":{"type":"string"},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["url","expires_at"],"additionalProperties":true},"CheckoutRequest":{"type":"object","properties":{"plan":{"enum":["pro","team","enterprise"],"description":"The plan to buy: pro (the default), team or enterprise."},"interval":{"enum":["month","year"],"description":"How often it bills: month (the default) or year."}},"additionalProperties":false,"description":"The plan to buy and how often it bills; every field is optional. An unknown field is refused."},"PortalLink":{"type":"object","description":"A Stripe billing portal link. A validated JSON object, never free-form prose.","properties":{"url":{"type":"string"}},"required":["url"],"additionalProperties":true},"ApiKeyList":{"type":"object","description":"The account’s API keys, without their secrets. A validated JSON object, never free-form prose.","properties":{"keys":{"type":"array","items":{"type":"object","description":"One API key, without its secret.","properties":{"id":{"type":"string"},"label":{"type":"string"},"prefix":{"type":"string","description":"The first characters of the key, to recognise it by."},"created_at":{"type":"string","format":"date-time"},"last_used_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"revoked_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["id","label","prefix","created_at","last_used_at","revoked_at"],"additionalProperties":true}}},"required":["keys"],"additionalProperties":true},"RevokedKey":{"type":"object","description":"The revoked key. A validated JSON object, never free-form prose.","properties":{"id":{"type":"string"},"revoked_at":{"type":"string","format":"date-time"}},"required":["id","revoked_at"],"additionalProperties":true},"Notifications":{"type":"object","description":"The account’s exploit alerts: where they go, whether they are on, and the least severity that sends one. A validated JSON object, never free-form prose.","properties":{"email":{"type":["string","null"],"description":"The verified address alerts go to; null when none does."},"source":{"enum":["account","custom",null],"description":"account: the sign-in address; custom: an address the account set and verified."},"enabled":{"type":"boolean"},"min_severity":{"enum":["critical","high","medium","low",null],"description":"The least severity that alerts; null alerts on every confirmed finding."},"active":{"type":"boolean","description":"An alert would go out now: on, with an address."},"pending":{"anyOf":[{"type":"null"},{"type":"object","description":"An address waiting on its verification link; alerts go to the sign-in address until it is opened.","properties":{"email":{"type":"string"},"sent_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]},"expires_at":{"anyOf":[{"type":"string","format":"date-time"},{"type":"null"}]}},"required":["email","sent_at","expires_at"],"additionalProperties":true}]},"account_email":{"type":["string","null"],"description":"The address the account signs in with, if any."},"mail_configured":{"type":"boolean","description":"This server can send email: verification links and alerts."}},"required":["email","source","enabled","min_severity","active","pending","account_email","mail_configured"],"additionalProperties":true},"NotificationsRequest":{"type":"object","properties":{"email":{"type":["string","null"],"description":"The address to send alerts to; null returns them to the sign-in address."},"enabled":{"type":"boolean","description":"false switches alerts off, true on."},"min_severity":{"enum":["critical","high","medium","low",null],"description":"The least severity that sends an alert; null alerts on every confirmed finding."}},"additionalProperties":false,"description":"Each field is optional; an absent one is kept. An unknown field is refused."},"ServerEnvelope":{"type":"object","description":"A pokeyoka-server/1 server-scan envelope. The field reference is at https://pokayoke.sh/docs#schema-title.","externalDocs":{"url":"https://pokayoke.sh/docs#schema-title","description":"pokeyoka-server/1 field reference."},"additionalProperties":true},"JsonRpcRequest":{"type":"object","description":"One JSON-RPC 2.0 request: initialize, tools/list or tools/call.","properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer","null"],"description":"Absent for a notification."},"method":{"type":"string","description":"initialize, tools/list, tools/call, ping or a notification."},"params":{"type":"object","additionalProperties":true,"description":"For tools/call: {name, arguments}."}},"required":["jsonrpc","method"],"additionalProperties":false},"JsonRpcResponse":{"type":"object","description":"One JSON-RPC 2.0 response: a result or an error, never both.","properties":{"jsonrpc":{"const":"2.0"},"id":{"type":["string","integer","null"]},"result":{"type":"object","additionalProperties":true},"error":{"type":"object","properties":{"code":{"type":"integer","description":"-32700, -32600, -32601, -32602 or -32603."},"message":{"type":"string","description":"For a failed tool: tool \"<name>\" failed: pokayoke-mcp: <code>: <detail>."}},"required":["code","message"],"additionalProperties":true}},"required":["jsonrpc","id"],"additionalProperties":false},"SubmitRequest":{"type":"object","description":"What to review. A form post sends the same field names.","properties":{"kind":{"type":"string","enum":["repo","code","server","upload"],"description":"A repository, pasted code, a live host or an uploaded archive."},"repo_url":{"type":"string","description":"Clone URL of the repository, required for kind=repo."},"ref":{"type":"string","description":"Branch, tag or commit to review; defaults to the remote HEAD."},"code":{"type":"string","description":"Source text to review, for kind=code."},"path":{"type":"string","description":"File name for pasted code: one path segment, not a directory."},"host":{"type":"string","description":"Hostname or URL to scan, for kind=server."}},"required":["kind"]},"SubmitAccepted":{"type":"object","description":"The queued review. Poll the report path, or the events path, with this id.","properties":{"id":{"type":"string","description":"The review id."}},"required":["id"],"additionalProperties":false},"PendingReview":{"type":"object","description":"A review that has not produced an envelope yet.","properties":{"id":{"type":"string"},"status":{"type":"string","description":"queued or running."},"error":{"type":["string","null"],"description":"Why the review failed, or null."}},"required":["id","status"],"additionalProperties":false},"ReviewEnvelope":{"type":"object","description":"A pokeyoka-review/1 review envelope. The field reference is at https://pokayoke.sh/docs#schema-title.","externalDocs":{"url":"https://pokayoke.sh/docs#schema-title","description":"pokeyoka-review/1 field reference."},"properties":{"resolved":{"type":"array","description":"Every stored finding this review closed, never also listed in findings. state is fixed (its stored proof no longer fires on this commit), no-longer-present (its code changed and the verifier no longer finds it; never called fixed) or code-removed (its file is gone or its code can no longer be found; never called fixed). provenIn is the review that last confirmed it and provenAt the commit that review read; at is this review’s commit: the reviewed commit at which the site first observed the close, which may be later than the commit that made it. Optional: absent when the review closed nothing, and on an envelope written before the field.","items":{"type":"object","properties":{"id":{"type":"string","minLength":1,"description":"The id the finding was last published under."},"file":{"type":"string","minLength":1},"line":{"type":"integer","minimum":1},"cwe":{"type":["string","null"]},"severity":{"enum":["critical","high","medium","low","info"]},"title":{"type":"string","minLength":1},"fixKey":{"type":"string","minLength":1,"description":"The fix’s line-independent identity, fix:<file>:<32 hex>: the key a fix delivery is joined to it by."},"state":{"enum":["fixed","no-longer-present","code-removed"]},"provenIn":{"type":"string","minLength":1,"description":"The review that last confirmed it (pass to review_get)."},"provenAt":{"type":"string","description":"The commit that review read (7–40 lowercase hex)."},"at":{"type":"string","description":"This review’s commit: the reviewed commit at which the site first observed the close, which may be later than the commit that made it."}},"required":["id","file","line","cwe","severity","title","fixKey","state","provenIn","provenAt","at"],"additionalProperties":true}}},"additionalProperties":true},"ReviewProgress":{"type":"object","description":"The progress of one review. Poll with the next_after it returned in `after`.","properties":{"status":{"type":"string","enum":["queued","running","complete","partial","failed"],"description":"The review status. A queued row with a mapping or hunting event reads as running."},"done":{"type":"boolean","description":"True once the status is complete, partial or failed."},"events":{"type":"array","items":{"$ref":"#/components/schemas/ReviewEvent"},"maxItems":200},"next_after":{"type":"integer","minimum":0,"description":"Pass back as after: the last seq this page scanned, or after when none."}},"required":["status","done","events","next_after"],"additionalProperties":false},"ReviewEvent":{"type":"object","description":"One progress event. The log is append-only, so a client polls from the next_after it was last given.","properties":{"seq":{"type":"integer","minimum":1,"description":"Strictly increasing cursor within the log."},"kind":{"type":"string","description":"The phase the run entered, e.g. queued, hunting, verifying, complete."},"detail":{"type":"string","description":"A short, code-written progress line."},"data":{"type":["object","null"],"additionalProperties":true,"description":"Optional structured counters, never repository text."},"at":{"type":"integer","description":"Milliseconds since the Unix epoch."}},"required":["seq","kind","detail","data","at"],"additionalProperties":false}}}}