{"openapi":"3.1.0","info":{"title":"Berrit","description":"","license":{"name":""},"version":"0.1.0"},"paths":{"/api/apps/github/webhook":{"post":{"tags":["apps"],"summary":"A delivery of the GitHub App's webhook, passed on to the GitHub app under its event name\nonce its `X-Hub-Signature-256` shows that GitHub sent it, signing with the app's webhook\nsecret (`GITHUB_WEBHOOK_SECRET`). Without the secret, no delivery is accepted. What it says of\nGitHub's installations is taken first ([`learnt`]), and the repositories it is about are those\nof GitHub's id of the one it names, or of its clone URL while one has no id, which it takes\nthen (decision 104). A `push` to a repository the instance has also has\nthis replica follow its forge at once (`DESIGN.md §5.2`).","operationId":"receive_github_webhook","parameters":[{"name":"X-GitHub-Event","in":"header","description":"The event's name","required":true,"schema":{"type":"string"}},{"name":"X-Hub-Signature-256","in":"header","description":"`sha256=`, then the body's HMAC-SHA256 under the webhook secret in hex","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Passed on"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}},"security":[{}]}},"/api/v1/events":{"get":{"tags":["events"],"summary":"Activity as it commits, as `activity` events whose data names it and whose id resumes it,\nwith a comment as heartbeat whenever the stream has been silent for a while. It opens with\na message of data `open` whose id resumes it too, and it ends when its token expires, or acts\nfor nobody at a read, as a revoked client's.","operationId":"stream_events","parameters":[{"name":"repo","in":"query","description":"Only this repo's activity, named `org/repo`.","required":false,"schema":{"type":"string"}},{"name":"change","in":"query","description":"Only this change's, by number. Needs `repo`.","required":false,"schema":{"$ref":"#/components/schemas/ChangeNumber"}},{"name":"after","in":"query","description":"The last id seen, or the one `GET /repos` answered as `Last-Event-ID`: what follows it\nis sent first. `Last-Event-ID` takes precedence; without either, the stream starts now.","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"access_token","in":"query","description":"The bearer token, for clients that cannot send `Authorization`, as a browser's\n`EventSource` cannot (RFC 6750 §2.3).","required":false,"schema":{"type":"string"}},{"name":"Last-Event-ID","in":"header","description":"The last id seen, as `EventSource` resends it on its own retries","required":false,"schema":{"type":["integer","null"],"format":"int64"}}],"responses":{"200":{"description":"`event: activity` frames, each with this as its data","content":{"text/event-stream":{"schema":{"$ref":"#/components/schemas/ActivityEvent"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/github/installation/repos":{"get":{"tags":["repos"],"summary":"The installations of the instance's GitHub App bound to the organisation, and what each may\nreach, as the heal this is reads it (decision 109); one GitHub refuses is named with GitHub's\nwords, and hides none of the others (decision 104). Each shown by the account GitHub names it\non as it shows its page, which is recorded: one bound before accounts were, or renamed since,\nis named so from then on. And those nobody bound that the caller's GitHub account installed,\nwhich the caller alone is offered; and GitHub's authorisation of the app, naming the\norganisation alone, through which a Bind of one of these, or of any, goes (T187).","operationId":"list_installation_repos","parameters":[{"name":"org","in":"query","description":"The organisation whose installations to list, by its slug.","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/InstallationListing"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/instance":{"get":{"tags":["repos"],"operationId":"get_instance","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Instance"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/me":{"get":{"tags":["users"],"operationId":"get_me","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Me"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"tags":["users"],"summary":"Berrit's part of the caller deleting their own account (`DESIGN.md §5.3`, decision 133), which\nAccount's deletion asks, with the token the person's session buys, once nothing holds the\naccount back, before better-auth deletes the user: refused to an app, to an agent and to an API\nkey. Their open changes are abandoned, saying why; their turns, the reviews asked of them and\ntheir drafts go, and the turns their acts gave others name the ghost; what they wrote stays\nunder an id that will name no account, a ghost's. Asked again, it does what is left.","operationId":"delete_me","responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/me/watches":{"get":{"tags":["users"],"summary":"Your watches, oldest first, each with what it is on, whose it is and its state, never its\nsecret: connected as a named agent, those you made as it.","operationId":"list_watches","responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Watch"}}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"tags":["users"],"summary":"Makes a watch, sent what happens on its change, its repository or, with neither, on every\nchange while it is your turn, from now on, that you may read as it is sent; connected as a\nnamed agent, the agent's. Made through an agent's connection or with an API key, it is sent\nnothing once that is disconnected or revoked. Answered with its secret, once. Its URL is a\nhook's, `https://` to a public address; a repository or change you cannot read is `not_found`,\na turn of someone who is a member of no organisation `invalid_body`, and a person who has made\n[`MOST`] watches is refused another.","operationId":"create_watch","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewWatch"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MadeWatch"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/me/watches/{id}":{"delete":{"tags":["users"],"summary":"Deletes a watch of yours: nothing more is sent to it, though a delivery already under way may\nstill arrive.","operationId":"delete_watch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/me/watches/{id}/pause":{"post":{"tags":["users"],"summary":"Pauses a watch of yours: nothing is sent to it until Resume, which starts it at what happens\nnext. A paused one stays as it is.","operationId":"pause_watch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watch"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/me/watches/{id}/resume":{"post":{"tags":["users"],"summary":"Starts a watch of yours again at the newest activity, its failure forgotten: what happened\nbefore is not sent, but for a delivery already under way, which may still arrive.","operationId":"resume_watch","parameters":[{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Watch"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos":{"get":{"tags":["repos"],"summary":"The repos of every organisation the caller is a member of, each with its `org`, but an\nunpaid one's, which answer `unpaid` (`DESIGN.md §5.6`); and, as `Last-Event-ID`, the latest\nactivity committed before they were read, which a stream follows them from (`GET /events`).","operationId":"list_repos","responses":{"200":{"headers":{"Last-Event-ID":{"schema":{"type":"integer","format":"int64"},"description":"The latest activity committed before the repos were read: a stream after it (`GET /events?after=`) misses nothing they do not show"}},"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Repo"}}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"tags":["repos"],"summary":"Registers the repo once Berrit can reach it through its provider, and wakes the poller for\nit, which clones it at once. A forge's refusal is `remote_unreachable` with the forge's words,\nand nothing is stored (`DESIGN.md §5.2`, decision 49); a remote Berrit never tries is\nrefused before the forge is asked, and so is the slug `key`, which `GET /repos/{org}/key`\nwould hide.","operationId":"create_repo","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewRepo"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repo"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/billing":{"get":{"tags":["repos"],"summary":"The organisation's standing and its subscription, for any member, whatever the standing.","operationId":"get_billing","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BillingSummary"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/github/installations":{"post":{"tags":["repos"],"summary":"Binds an installation of the instance's GitHub App to the organisation, for an owner or admin\nof it, then heals the organisation, so that the repositories waiting for it are reached at once\n(decision 109). With the code GitHub gave whoever authorised the app, as they installed it or\nas they followed a Bind (decision 71): the web's `/github/setup`, the app's callback URL, calls\nthis for the person GitHub sent back. The code buys their token on GitHub, which shows who they\nare there and which of the installation's repositories they may write; they must write every\none the installation reaches, so that binding gives nobody what they lack, and the binding\nrecords who they are and the account it is on. One recorded as nobody's binds for its\ninstaller alone, by GitHub's id of them. One GitHub confirms gone, a code's user reaching none,\nis forgotten. An installation stays with the organisation that bound it first, and binding it\nthere again changes nothing, but that one bound before installers' ids were recorded records\nits binder as its installer, unless it records another's login (T184). Naming no installation,\nas after a Bind, whose `state` names the organisation alone, it answers what the code's user\nmay bind instead ([`free`]); the one they pick is bound with the code GitHub gives them for it,\na second authorisation that GitHub answers at once (T187). The token is dropped either way:\nnothing of it is kept.","operationId":"bind_installation","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewInstallation"}}},"required":true},"responses":{"200":{"description":"What the code's user may bind","content":{"application/json":{"schema":{"$ref":"#/components/schemas/FreeInstallations"}}}},"204":{"description":"Bound to the organisation"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/github/installations/{id}":{"delete":{"tags":["repos"],"summary":"Unbinds an installation of the instance's GitHub App from the organisation, for an owner or\nadmin of it: its repositories wait for another, or are reached through one that reaches them\n(decision 109). Nothing on GitHub changes: it is left nobody's, offered to its installer again,\nwhose Bind binds it again; one bound before Berrit recorded installers' ids, offered to nobody,\nis forgotten, and binds again as installed again.","operationId":"unbind_installation","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"integer","format":"int64"}}],"responses":{"204":{"description":"Unbound"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/key":{"get":{"tags":["repos"],"summary":"The organisation's key, made at the first call (`DESIGN.md §5.2`): for its owners and\nadmins to register on its forges, and to read in its settings whatever its standing.","operationId":"get_org_key","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/OrgKey"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}":{"get":{"tags":["repos"],"operationId":"get_repo","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repo"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"delete":{"tags":["repos"],"summary":"Deletes the repo and everything of it in Berrit, then its clone in the cache; nothing on its\nforge is touched (`DESIGN.md §5.2`), and its slug is free at once. On a task of its own, so\nthat a request given up on midway cannot leave the clone behind the rows. Whatever the\norganisation's standing, since deleting the organisation deletes its repositories so.","operationId":"delete_repo","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Deleted"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"tags":["repos"],"summary":"A new URL or provider is used by the next operation on the repo, since every operation\nopens the cache with the repo's current ones, and the last check is forgotten. The forge\nis not asked, as `POST /repos/{slug}/check` does; but the GitHub App's token goes only to\nthe repositories of the organisation's installations. A re-clone clears `cloned_at` and wakes\nthe poller for the repo, which makes the clone again as it makes a first one, so the repo\nreads as cloning meanwhile (decision 50).","operationId":"patch_repo","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoPatch"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Repo"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/blob/{branch}/{path}":{"get":{"tags":["repos"],"operationId":"get_blob","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"path","description":"Any branch the forge has, `/` written `%2F`","required":true,"schema":{"type":"string"}},{"name":"path","in":"path","description":"Every segment after the branch","required":true,"schema":{"type":"string"}},{"name":"raw","in":"query","description":"The file's bytes as they are, rather than its lines.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"The file; with `raw`, its bytes, as text unless they are binary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Blob"}},"text/plain":{"schema":{"type":"string"}},"application/octet-stream":{"schema":{"type":"string"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/branches":{"get":{"tags":["repos"],"summary":"The forge's branches as [`Branches`] lists them, asked of the forge at each call, a rare\nevent, with no clone needed; what it answers is the copy `tree` and `blob` consult from then\non (`DESIGN.md §5.2`). A forge that refuses is `remote_unreachable` with what it said, the\n`detail` a failing `POST /repos/{slug}/check` reports.","operationId":"list_branches","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Branches"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes":{"get":{"tags":["changes"],"operationId":"list_changes","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"state","in":"query","required":false,"schema":{"$ref":"#/components/schemas/ChangeState"}},{"name":"owner","in":"query","description":"`me`, a `@handle` or an email, as are `reviewer` and `attention`.","required":false,"schema":{"type":"string"}},{"name":"reviewer","in":"query","required":false,"schema":{"type":"string"}},{"name":"attention","in":"query","required":false,"schema":{"type":"string"}},{"name":"team_turn","in":"query","description":"The open changes waiting on a team of the caller's and not on the caller: a team asked\nto review, none of whose members has voted on the current revision. The caller's alone,\nso that no one learns another's teams from it.","required":false,"schema":{"type":"string","description":"Whose teams' or agents' turn a list asks for: the caller's, and no one else's.","enum":["me"]}},{"name":"agent_turn","in":"query","description":"The open changes waiting on a named agent the caller drives (decision 163): its turn. The\ncaller's alone, as `team_turn` is.","required":false,"schema":{"type":"string","description":"Whose teams' or agents' turn a list asks for: the caller's, and no one else's.","enum":["me"]}},{"name":"target","in":"query","required":false,"schema":{"$ref":"#/components/schemas/BranchName"}},{"name":"q","in":"query","required":false,"schema":{"type":"string"}},{"name":"change_id","in":"query","description":"Change ids, comma-separated.","required":false,"schema":{"type":"string"}},{"name":"after","in":"query","required":false,"schema":{"type":"string"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangePage"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}":{"get":{"tags":["changes"],"operationId":"get_change","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeDetail"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/abandon":{"post":{"tags":["changes"],"summary":"`POST /repos/{slug}/changes/{n}/abandon` (owner or admin): the change closes, no one is\nasked for anything, and land is no longer requested, so that a restored change waits to\nbe asked again before it enters the train.","operationId":"abandon_change","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/activity":{"get":{"tags":["changes"],"operationId":"list_activity","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"after","in":"query","description":"The last id seen; what follows it is given.","required":false,"schema":{"type":"integer","format":"int64"}},{"name":"limit","in":"query","required":false,"schema":{"type":"integer","format":"int64"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ActivityPage"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/attention":{"post":{"tags":["changes"],"summary":"`POST /repos/{slug}/changes/{n}/attention`: puts users in and takes them out by hand.\nRemovals go first and the caller's own addition last, since putting anyone else in, or\ntaking them out, is an act that takes the caller out. Only someone in the attention set is\ntaken out: an owner's turn the rules leave to them, nobody's asking, has no Remove, and taking\nout anyone else not in it does nothing, the caller's own turn kept and nothing recorded\n(decision 142).","operationId":"set_attention","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AttentionEdit"}}},"required":true},"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/bundle":{"get":{"tags":["changes"],"summary":"`GET /repos/{org}/{repo}/changes/{n}/bundle`: change `n`, and with `stack` the open changes\nstacked on it, as a git bundle of their current revisions down to their target's tip as Berrit\nlast saw it (decision 166), to amend or rebase and push again.","operationId":"get_change_bundle","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"stack","in":"query","description":"With the open changes stacked on it, each a ref of the bundle.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeBundle"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/checks/{name}/log":{"get":{"tags":["checks"],"summary":"`GET /repos/{slug}/changes/{n}/checks/{name}/log`: the log of job `job` of run `name` of\nchange `n`, at `trigger` or the one expected last: `running` while GitHub runs the job, a page\nof its lines with their groups once it is kept, which its first view does once GitHub ended\nit, and `gone` with why once it is not kept. A job that is no job of the run is `not_found`,\nand GitHub's refusal to say the jobs or give the log is in GitHub's words.","operationId":"get_check_log","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"query","description":"The trigger of the run, of a check that runs at several; else the one expected last.","required":false,"schema":{"$ref":"#/components/schemas/Trigger"}},{"name":"job","in":"query","description":"GitHub's id of the job, as the run's page lists it.","required":true,"schema":{"type":"integer","format":"int64","minimum":0}},{"name":"after","in":"query","description":"The log's lines after this many, none by default.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"limit","in":"query","description":"At most this many of its lines, and never more than 10,000, which is the default.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/JobLog"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/checks/{name}/rerun":{"post":{"tags":["checks"],"summary":"`POST /repos/{slug}/changes/{n}/checks/{name}/rerun`: expects a check the target's tip\ndeclares again, now, of the app it belongs to there, whether or not it was expected before\n(`DESIGN.md §3.5`): at `trigger` when it is asked, one the check is expected at, on the train's\ncandidate for `train`; else on the train's candidate when the change is being tested there and\nthe check runs in the train, and on the current revision otherwise, at the trigger a run of it\nwaits to start at there, which it starts at once and supersedes (decision 129), else at the\nfirst trigger it runs at before the train.\nA check that matches nothing the change touches, or one that runs only in the train of a\nchange not being tested there, is expected of nothing a page shows: `conflict`. One whose\nresult the GitHub app posted with no way to run it again, a commit status, is not Berrit's\nto run again: `cannot_rerun`; a run always is, by a new dispatch (`DESIGN.md §3.5`), but a\nlanding step, and any check of a candidate that is landing, which nobody runs again (`DESIGN.md\n§3.7`, decision 130): `conflict`.","operationId":"rerun_check","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"query","description":"The trigger of the run, of a check that runs at several; else the one expected last.","required":false,"schema":{"$ref":"#/components/schemas/Trigger"}}],"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/comments":{"get":{"tags":["comments"],"operationId":"list_comments","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"revision","in":"query","description":"The revision to map line comments onto.","required":false,"schema":{"$ref":"#/components/schemas/RevisionNumber"}},{"name":"path","in":"query","description":"Only the comments on this file.","required":false,"schema":{"$ref":"#/components/schemas/RepoPath"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Comments"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"tags":["comments"],"summary":"`POST /repos/{slug}/changes/{n}/comments`: saves a draft, on an open change, or on any to an\napp. Only an app says whom it heard it from.","operationId":"create_draft","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewDraft"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftCreated"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/comments/{id}":{"delete":{"tags":["comments"],"summary":"`DELETE /repos/{slug}/changes/{n}/comments/{id}`: discards one of the caller's drafts.","operationId":"delete_draft","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"patch":{"tags":["comments"],"summary":"`PATCH /repos/{slug}/changes/{n}/comments/{id}`: rewrites one of the caller's drafts.","operationId":"edit_draft","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DraftEdit"}}},"required":true},"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/dependencies":{"post":{"tags":["dependencies"],"summary":"Anyone may add or remove. A dependency may name a change not sent yet; it waits until that\nchange exists and lands. One added while the change is in the train would not be waited\nfor, so the change must be held first.","operationId":"set_dependencies","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/DependenciesEdit"}}},"required":true},"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/land":{"post":{"tags":["changes"],"summary":"`POST /repos/{slug}/changes/{n}/land`: the change's land request, by which it enters the train\nonce it may, alone or with the stack below it (`DESIGN.md §3.7`). Anyone may set it\n(`DESIGN.md §4` step 5); setting it as it is does nothing, an owner's or admin's word to land it\nnow kept, and setting it otherwise takes that word back, the record saying so. Asking, whoever\nasks, answers the owner's turn on every change it asks to land, to land it or an ejection's,\nbut where something theirs to fix holds that change (`DESIGN.md §3.9`). A hold answers none,\nand withdraws as well every request above it that covers it, as each would carry it into the\ntrain: a hold on any member of a unit withdraws the unit. With `now`, an owner's or admin's word\nand why, the change lands now (decision 148): the request is set with the word, the reason a\ncomment of theirs on every member, and the train's next move lets its unit in over its members'\nunmet reviews and `push` and `approved` checks; while anything else holds it, or nothing does,\nnothing is done.","operationId":"set_land_request","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/LandRequest"}}},"required":true},"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/restore":{"post":{"tags":["changes"],"summary":"`POST /repos/{slug}/changes/{n}/restore` (owner or admin): an abandoned change opens\nagain, and it is its author's turn; one imported from a branch another open change was\nimported from since is `conflict`.","operationId":"restore_change","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/return":{"post":{"tags":["changes"],"summary":"`POST /repos/{slug}/changes/{n}/return` (owner or admin): the change goes back to its reviewers\n(decision 156), its revisions since they last had it named on the record, none where nothing\nwas sent since: those asked, those whose request for changes stands and those who approved a\npatch an edit changed since are put in, and its author is taken out. With nobody but its owner\nasked or voting there is nobody to return it to (`conflict`).","operationId":"return_change","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/review":{"post":{"tags":["reviews"],"summary":"`POST /repos/{slug}/changes/{n}/review`: publishes the caller's drafts on the change, its\nmessage as a comment on the whole change, its resolutions and its vote, as one activity,\nwhose payload names the message's comment among the comments it published.","description":"The message starts resolved: it says something rather than asks, and a thread that must\nbe answered is a draft. A review with nothing in it is refused, and so is an author's vote\n(the owner's, or that of whoever pushed a revision), or that of a person driving an agent\nthat is one, unless `review.self_approval` is on. An app may say whom it heard the message\nfrom, and then it votes not; what an app says, but a vote, a landed or abandoned change takes\ntoo, its attention left empty.","operationId":"publish_review","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewRequest"}}},"required":true},"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/reviewers":{"post":{"tags":["changes"],"summary":"`POST /repos/{slug}/changes/{n}/reviewers`: each person added is asked by name, and each one\nremoved leaves the attention set; a team, asked as a whole, is nobody's turn (`DESIGN.md\n§3.9`). What is added or required is named among the organisation's members and teams; what\nis lifted or removed, among the change's own reviewers, whom it names still after they have\nleft or emptied. A requirement is lifted, and a required reviewer taken off, which lifts it\ntoo, only as [`lifts`] says (decision 170).","operationId":"set_reviewers","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewersEdit"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ReviewersEdited"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/reviewers/suggested":{"get":{"tags":["changes"],"summary":"`GET /repos/{slug}/changes/{n}/reviewers/suggested`: whom Add a reviewer offers before anyone\nelse (decision 157), the people the unmet rules name, by the weight of the rules naming them,\nits owner left out, and whoever pushed a revision of it while `review.self_approval` is off,\nthen the teams they name, each with the rules it answers, under the configuration at its\ntarget's tip resolved against the organisation as it is now (`DESIGN.md §5.5`).","operationId":"suggested_reviewers","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SuggestedReviewers"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/revisions/{r}/diff":{"get":{"tags":["revisions"],"operationId":"get_diff","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"r","in":"path","description":"The revision's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"path","in":"query","required":true,"schema":{"$ref":"#/components/schemas/RepoPath"}},{"name":"against","in":"query","description":"`base`, the default, or the number of an earlier revision; with `from`, an earlier\nstate of the stack, an instant its files list names: the stack's interdiff since\n(`DESIGN.md §3.10`).","required":false,"schema":{"type":"string"}},{"name":"from","in":"query","description":"An open change below this one in its stack: the diff from the base of the revision of\nit this one stands on (decision 86).","required":false,"schema":{"$ref":"#/components/schemas/ChangeNumber"}},{"name":"context","in":"query","description":"Lines around each change, 3 by default, or `whole`.","required":false,"schema":{"type":"string"}},{"name":"ws","in":"query","description":"`exact`, the default, or `ignore`: lines compared by their spaces and tabs thus, a run\ncounting as one and none at either end, and shown as they are.","required":false,"schema":{"type":"string","description":"How a diff compares lines: as they are, or with their whitespace ignored, each line read\nby its spaces and tabs thus: a run counts as one, and none at either end. Other\nwhitespace, a no-break space or a form feed among it, is a character like any other.","enum":["exact","ignore"]}},{"name":"after","in":"query","description":"The diff's lines after this many, none by default: with `limit`, a range of them.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"limit","in":"query","description":"At most this many of the diff's lines, every one by default.","required":false,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"raw","in":"query","description":"The file's bytes at the revision as they are, as `blob`'s `raw` serves a file of a branch,\nrather than its diff: what reads a file too large to diff.","required":false,"schema":{"type":"boolean"}}],"responses":{"200":{"description":"The diff; with `raw`, the file's bytes at the revision, as text unless they are binary","content":{"application/json":{"schema":{"$ref":"#/components/schemas/Diff"}},"text/plain":{"schema":{"type":"string"}},"application/octet-stream":{"schema":{"type":"string"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/revisions/{r}/files":{"get":{"tags":["revisions"],"operationId":"list_files","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"r","in":"path","description":"The revision's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"from","in":"query","description":"An open change below this one in its stack: the files from the base of the revision of\nit this one stands on to this revision, the stack's (decision 86), and its earlier\nstates.","required":false,"schema":{"$ref":"#/components/schemas/ChangeNumber"}},{"name":"against","in":"query","description":"`base`, the default, or the number of an earlier revision: the files of the interdiff\nfrom it, with their counts; with `from`, an earlier state of the stack, one of its\n`states`: the files of the stack's interdiff since (`DESIGN.md §3.10`).","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Files"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/runs/{name}":{"get":{"tags":["checks"],"summary":"`GET /repos/{slug}/changes/{n}/runs/{name}`: run `name` of change `n`, at `trigger` or the one\nexpected last, as the change's checks have it, when Berrit started it, and GitHub's jobs of it,\nread now: GitHub's words where it does not give them, and Berrit's where it cannot ask. A check\nof the name that is no run, or none, is `not_found`.","operationId":"get_run","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"query","description":"The trigger of the run, of a check that runs at several; else the one expected last.","required":false,"schema":{"$ref":"#/components/schemas/Trigger"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ChangeRun"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/runs/{name}/cancel":{"post":{"tags":["checks"],"summary":"`POST /repos/{slug}/changes/{n}/runs/{name}/cancel`: asks GitHub to cancel the run it runs of\nrun `name` of change `n`, at `trigger` or the one expected last, and records that the caller\ndid (`run_cancelled`); GitHub's end of it, cancelled, is then its result. A `train` run, one\nGitHub does not run, or one it has ended, is a `conflict`: the train's runs are the train's.","operationId":"cancel_run","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"name","in":"path","required":true,"schema":{"type":"string"}},{"name":"trigger","in":"query","description":"The trigger of the run, of a check that runs at several; else the one expected last.","required":false,"schema":{"$ref":"#/components/schemas/Trigger"}}],"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/threads/{root}/resolve":{"post":{"tags":["comments"],"summary":"`POST /repos/{slug}/changes/{n}/threads/{root}/resolve`: sets the thread's resolved\nflag; setting it as it is records nothing.","operationId":"resolve_thread","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"root","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Resolve"}}},"required":true},"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/changes/{n}/votes/{user}/dismiss":{"post":{"tags":["reviews"],"summary":"`POST /repos/{slug}/changes/{n}/votes/{user}/dismiss` (the organisation's owners and\nadmins): the user's vote stops counting, for or against, until they vote again.","operationId":"dismiss_vote","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"n","in":"path","description":"The change's number","required":true,"schema":{"type":"integer","format":"int32","minimum":0}},{"name":"user","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"204":{"description":"Done"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/check":{"post":{"tags":["repos"],"summary":"Asks the forge now whether Berrit reaches it through the repo's provider, and, through the\nGitHub App, whether the app may post its check runs there and whether the default branch's\nrules there would refuse a landing (decision 147), and records the answer as the\nrepo's `last_check` unless a save changed the URL or the provider meanwhile. Through the\nGitHub App the organisation heals first, so that what is checked is where GitHub has the\nrepository now (decision 109). When the forge is reached, this replica follows it at once, so\nthat the one button checks access and refreshes what Berrit saw (`DESIGN.md §5.2`).","operationId":"check_repo","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/AccessCheck"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/checks":{"get":{"tags":["checks"],"summary":"`GET /repos/{slug}/checks?commit=`: the results that count for `commit`, by name and app:\nthose posted on it, or on the branch tip the revision it is was squashed from, whichever came\nlast, each as on `commit`.","operationId":"list_check_results","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"commit","in":"query","required":true,"schema":{"$ref":"#/components/schemas/CommitId"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/CheckResult"}}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"tags":["checks"],"summary":"`POST /repos/{slug}/checks`: an app's result of its check on a commit of the repository, a\nrevision, a train's candidate or the branch tip an imported revision was squashed from,\nreplacing the one it posted before and no other app's. Only an app posts one.","operationId":"post_check_result","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewResult"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CheckResult"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/config":{"get":{"tags":["repos"],"operationId":"get_config","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"query","description":"A branch Berrit tracks: the default branch, which is read when none is given, or the\ntarget of an open change.","required":false,"schema":{"$ref":"#/components/schemas/BranchName"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/RepoConfig"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"put":{"tags":["repos"],"summary":"Writes and lands the settings, answering the commit, the default branch's tip now, whose\n`tip_moved` refreshes the configuration in force. Refused: a `berrit.toml` or `checks.toml`\nthat changed since `base`, which the person never saw, or any commit at all where the form\nread none; a first commit where the forge has branches but not the default one; and a tip\nthat would not be valid, resolved as every tip is, whose settings would change nothing in\nforce, or admit nobody, their own fix included (decision 77).","operationId":"put_config","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewConfig"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ConfigCommit"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/hooks":{"get":{"tags":["repos"],"summary":"The repository's hooks, oldest first, each with its state and who made it, never its secret.","operationId":"list_hooks","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/Hook"}}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"tags":["repos"],"summary":"Makes a hook, sent what happens in the repository from now on, and answers it with its\nsecret, once. Its URL is `https://` to a public address, every address its host has now\namong them, with no user or password; a kind no activity has is `invalid_body`, and a\nrepository that has [`MOST`] hooks is refused another.","operationId":"create_hook","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/NewHook"}}},"required":true},"responses":{"201":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MadeHook"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/hooks/{id}":{"delete":{"tags":["repos"],"summary":"Deletes a hook: nothing more is sent to it, though a delivery already under way may still\narrive.","operationId":"delete_hook","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"204":{"description":"Deleted"},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/hooks/{id}/resume":{"post":{"tags":["repos"],"summary":"Starts a hook again at the newest activity, its failure forgotten: what happened before is\nnot sent, but for a delivery already under way, which may still arrive.","operationId":"resume_hook","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"id","in":"path","required":true,"schema":{"type":"string","format":"uuid"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Hook"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/import":{"get":{"tags":["changes"],"summary":"What `POST` would make of the two branches where the forge has them now. Nothing is written.","operationId":"preview_import","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"query","description":"The branch to import.","required":true,"schema":{"$ref":"#/components/schemas/BranchName"}},{"name":"target","in":"query","description":"The branch the changes would land on.","required":true,"schema":{"$ref":"#/components/schemas/BranchName"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportPreview"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}},"post":{"tags":["changes"],"summary":"Imports the branch in the mode asked: as new changes, or the next revisions of those made of\nit before, which keep their owners; a new one belongs to its commit's author when they have an\naccount, the tip's for a squash, and the caller otherwise. Answered as a send is, parents\nfirst. Importing the same tip again with the same message makes nothing (`created: false`).","operationId":"import_branch","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/ImportRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResponse"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/pulls":{"get":{"tags":["repos"],"summary":"`GET /repos/{slug}/pulls`: the open pull requests on GitHub of a repository reached through\nthe GitHub App, from its own branches other than Berrit's and its default, each with the open\nchange imported from its branch, if one is (`DESIGN.md §7`). Another repository's is\n`not_found`.","operationId":"list_pull_requests","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/PullRequest"}}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/push":{"post":{"tags":["changes"],"summary":"`POST /repos/{org}/{repo}/push`: a git bundle of commits for review, sent over MCP (decision\n166), received as a push of `refs/for/<target>` to the remote is: read into a scratch\nrepository as the remote's, every object checked as receive-pack checks a push's, then\n[`Push::receive`], the pusher the caller, a person or a named agent.","operationId":"push_changes","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/PushResponse"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/runs":{"get":{"tags":["checks"],"summary":"`GET /repos/{slug}/runs`: the runs waiting to start, in the order they will, those started\nthat `[github] at_once` counts, and how many runs stand or ended each way, as the rows say\n(`berrit_core::runs::board`).","operationId":"list_runs","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Runs"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/send":{"post":{"tags":["changes"],"operationId":"send_changes","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}}],"requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendRequest"}}},"required":true},"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/SendResponse"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/train/{branch}":{"get":{"tags":["train"],"operationId":"get_train","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"path","description":"The target branch, `/` written `%2F`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Train"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/train/{branch}/numbers":{"get":{"tags":["train"],"operationId":"get_train_numbers","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"path","description":"The target branch, `/` written `%2F`","required":true,"schema":{"type":"string"}},{"name":"days","in":"query","description":"How many days back to look, 1 to 365 [default: 30].","required":false,"schema":{"type":"integer","format":"int32","maximum":365,"minimum":1}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/TrainNumbers"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/train/{branch}/release":{"post":{"tags":["train"],"summary":"`POST /repos/{slug}/train/{branch}/release`: an owner or admin releases the held train, which\nmoves on at once (`DESIGN.md §3.7`): what held it, `train_released` recording who did and\nthrough what. Any other member is `forbidden`; a train nothing holds, or one whose landing\nsteps or reverts GitHub runs still, or may yet start, which may do what nobody expects yet, a\n`conflict` that says so, and that it may be cancelled on GitHub.","operationId":"release_train","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"path","description":"The target branch, `/` written `%2F`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Held"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/tree/{branch}":{"get":{"tags":["repos"],"operationId":"get_root_tree","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"path","description":"Any branch the forge has, `/` written `%2F`","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tree"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/tree/{branch}/{path}":{"get":{"tags":["repos"],"operationId":"get_tree","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"branch","in":"path","description":"Any branch the forge has, `/` written `%2F`","required":true,"schema":{"type":"string"}},{"name":"path","in":"path","description":"Every segment after the branch","required":true,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/Tree"}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}},"/api/v1/repos/{org}/{repo}/users":{"get":{"tags":["users"],"summary":"The first 20 members of the repository's organisation whose handle, email or name starts with\n`q`, by email: whom its changes may ask to review.","operationId":"search_users","parameters":[{"name":"org","in":"path","required":true,"schema":{"type":"string"}},{"name":"repo","in":"path","required":true,"schema":{"type":"string"}},{"name":"q","in":"query","description":"A prefix of the handle, with its `@` or without, the email or the name; empty matches\neveryone.","required":false,"schema":{"type":"string"}}],"responses":{"200":{"content":{"application/json":{"schema":{"type":"array","items":{"$ref":"#/components/schemas/User"}}}}},"default":{"description":"A failure: `error.code` says which (DESIGN.md §7)","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorBody"}}}}}}}},"components":{"schemas":{"AccessCheck":{"type":"object","description":"Whether Berrit reached a repo's forge with its provider's credentials (`git ls-remote`):\n`POST /repos/{slug}/check`. Over SSH, `detail` names the host key pinned on first use, for\nan admin to compare with the forge's; on a failure it is what the forge and git said.","required":["at","ok","detail"],"properties":{"at":{"type":"string","format":"date-time"},"detail":{"type":"string"},"link":{"oneOf":[{"$ref":"#/components/schemas/HttpUrl","description":"Where on the forge what `detail` asks is done: the target's rules on GitHub, when they would\nrefuse a landing (decision 147)."},{"type":"null"}]},"ok":{"type":"boolean"}}},"Activity":{"type":"object","required":["id","kind","payload","at"],"properties":{"actor":{"oneOf":[{"$ref":"#/components/schemas/UserId","description":"None for what Berrit did by itself."},{"type":"null"}]},"at":{"type":"string","format":"date-time"},"id":{"type":"integer","format":"int64"},"kind":{"$ref":"#/components/schemas/ActivityKind"},"payload":{},"via":{"oneOf":[{"$ref":"#/components/schemas/Credential","description":"What `actor` did it through, when not a session's."},{"type":"null"}]}}},"ActivityEvent":{"type":"object","description":"The data of an `activity` event on `GET /events`: what happened and where, with the\nactivity's payload, which names what an app acts on; the client refetches anything else.\nIts `id` is the event's id.","required":["id","org","repo","kind","payload","at"],"properties":{"at":{"type":"string","format":"date-time"},"change":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"None for events of the repo rather than a change, such as `tip_moved`."},{"type":"null"}]},"id":{"type":"integer","format":"int64"},"kind":{"$ref":"#/components/schemas/ActivityKind"},"org":{"$ref":"#/components/schemas/OrgSlug","description":"The organisation of `repo`."},"payload":{"description":"What the kind names, such as the commit and check of `check_requested`."},"repo":{"$ref":"#/components/schemas/RepoSlug"},"via":{"oneOf":[{"$ref":"#/components/schemas/Credential","description":"What its actor did it through, when not a session's."},{"type":"null"}]}}},"ActivityKind":{"type":"string","description":"What happened: exactly the catalogue in `DESIGN.md §6`.","enum":["change_created","revision_pushed","review_published","review_satisfied","thread_resolved","thread_unresolved","reviewers_changed","attention_changed","vote_dismissed","land_requested","land_held","abandoned","restored","returned","dependency_added","dependency_removed","check_requested","check_updated","run_cancelled","conflict_detected","conflict_cleared","candidates_stored","train_enqueued","train_testing","train_dequeued","train_ejected","train_stalled","train_released","landed","tip_moved","cloned"]},"ActivityPage":{"type":"object","description":"`GET …/activity`: the change's activity, oldest first.","required":["activity","next","users"],"properties":{"activity":{"type":"array","items":{"$ref":"#/components/schemas/Activity"}},"next":{"type":"integer","format":"int64","description":"The `after` that gives what follows: the last id here, or the `after` asked with when\nthere is nothing more yet."},"users":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/User"},"propertyNames":{"type":"string"}}}},"Anchor":{"type":"object","description":"Lines `start_line..=end_line` on `side` of `path` at `revision`; without lines, the file;\nwithout a path, the whole change.","properties":{"end_line":{"type":["integer","null"],"format":"int32","minimum":0},"path":{"oneOf":[{"$ref":"#/components/schemas/RepoPath"},{"type":"null"}]},"revision":{"oneOf":[{"$ref":"#/components/schemas/RevisionNumber"},{"type":"null"}]},"side":{"oneOf":[{"$ref":"#/components/schemas/Side"},{"type":"null"}]},"start_line":{"type":["integer","null"],"format":"int32","minimum":0}}},"ApprovalAfterEdit":{"type":"string","description":"What an `edit` revision does to approvals given before it (`DESIGN.md §3.4`).","enum":["keep","reset"]},"Approver":{"type":"string"},"ApproverSet":{"type":"array","items":{"$ref":"#/components/schemas/Approver"},"description":"Whose approvals a rule counts. Never empty in a rule; empty as the owners of a file\nthat has none.","uniqueItems":true},"AtOnce":{"type":"integer","format":"int32","description":"How many runs Berrit keeps started for the changes to a target: `[github] at_once` in its\n`berrit.toml`, 1 to 100 (`DESIGN.md §8.1`). GitHub queues what is beyond its own capacity, so\nthe number need only be roughly right.","maximum":100,"minimum":1},"AttentionEdit":{"type":"object","description":"`POST /repos/{slug}/changes/{n}/attention`: whose turn it is, by hand. `me` is the\ncaller.","properties":{"add":{"type":"array","items":{"$ref":"#/components/schemas/UserId"}},"remove":{"type":"array","items":{"$ref":"#/components/schemas/UserId"}}},"additionalProperties":false},"BillingRow":{"type":"object","description":"A subscription, as the billing service last said it.","required":["status","until","cancel_at_period_end","product"],"properties":{"cancel_at_period_end":{"type":"boolean","description":"Cancelled at its period's end, which it runs out."},"product":{"type":"string","description":"The product bought: the seat for a month or for a year."},"status":{"type":"string","description":"As the billing service names it: `trialing`, `active`, `past_due`, `canceled`…"},"until":{"type":"string","format":"date-time","description":"The end of the period paid for, or of the trial."}}},"BillingSummary":{"type":"object","description":"`GET /repos/{org}/billing`: an organisation's standing (`DESIGN.md §5.6`) and its\nsubscription; its seats are `GET /me`'s.","required":["standing"],"properties":{"current":{"oneOf":[{"$ref":"#/components/schemas/BillingRow","description":"Its subscription, which the standing reads: one still billed before one that ended,\nthen the one whose period ends last, in force or not; none before the first checkout."},{"type":"null"}]},"standing":{"$ref":"#/components/schemas/Standing"}}},"Blob":{"type":"object","description":"`GET /repos/{slug}/blob/{branch}/{path}`: one file at the tip of any branch the forge has,\nhighlighted as a diff's side is. A binary file, or one over the diff viewer's limits, has\nno lines; `?raw=true` gives its bytes instead. A symlink's file is its target.","required":["branch","commit","path","size","lines","binary","truncated"],"properties":{"binary":{"type":"boolean","description":"A NUL byte in its first 8 KiB, as Git decides; false when it was too large to read."},"branch":{"$ref":"#/components/schemas/BranchName"},"commit":{"$ref":"#/components/schemas/CommitId","description":"The branch's tip, where the file was read, as [`Tree::commit`] is."},"language":{"type":["string","null"],"description":"The language it was highlighted as; none for plain text, and for a file without lines."},"last_change":{"oneOf":[{"$ref":"#/components/schemas/LastChange","description":"The change that landed as the newest commit to change the file, if a change did."},{"type":"null"}]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/CodeLine"}},"path":{"$ref":"#/components/schemas/RepoPath"},"size":{"type":"integer","format":"int64","description":"In bytes.","minimum":0},"truncated":{"type":"boolean","description":"Over the diff viewer's limits, 1 MiB or 20,000 lines, as text: invalid UTF-8 shows as\nU+FFFD, three bytes for each."}}},"Blocker":{"oneOf":[{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["not_open"]}}},{"type":"object","description":"No valid configuration is in reach of the target's tip, so nothing enters until one\nlands (`DESIGN.md §3.4`). Nothing after it matters while it holds.","required":["kind"],"properties":{"kind":{"type":"string","enum":["config_broken"]}}},{"type":"object","description":"The review check does not pass. `blocked_by` are the users whose request for changes\nis in force, by id, so the status word says \"Changes requested\" for any and \"In review\" for\nnone (`docs/ux.md §3.4`).","required":["blocked_by","kind"],"properties":{"blocked_by":{"type":"array","items":{"$ref":"#/components/schemas/UserId"}},"kind":{"type":"string","enum":["review_unmet"]}}},{"type":"object","required":["name","trigger","kind"],"properties":{"kind":{"type":"string","enum":["check_pending"]},"name":{"$ref":"#/components/schemas/CheckName"},"trigger":{"$ref":"#/components/schemas/Trigger"}}},{"type":"object","required":["name","trigger","kind"],"properties":{"kind":{"type":"string","enum":["check_failed"]},"name":{"$ref":"#/components/schemas/CheckName"},"trigger":{"$ref":"#/components/schemas/Trigger"}}},{"type":"object","required":["paths","kind"],"properties":{"kind":{"type":"string","enum":["conflict"]},"paths":{"type":"array","items":{"$ref":"#/components/schemas/RepoPath"}}}},{"type":"object","description":"`on`, below it in its stack, conflicts, and it waits on that: it is not marked a\nconflict of its own (decision 143).","required":["on","kind"],"properties":{"kind":{"type":"string","enum":["conflict_below"]},"on":{"$ref":"#/components/schemas/ChangeRef"}}},{"type":"object","required":["kind"],"properties":{"kind":{"type":"string","enum":["candidate_unknown"]}}},{"type":"object","description":"The parent, `on`, is open but not in the train.","required":["on","kind"],"properties":{"kind":{"type":"string","enum":["parent_not_ready"]},"on":{"$ref":"#/components/schemas/ChangeRef"}}},{"type":"object","required":["on","kind"],"properties":{"kind":{"type":"string","enum":["parent_abandoned"]},"on":{"$ref":"#/components/schemas/ChangeRef"}}},{"type":"object","required":["on","kind"],"properties":{"kind":{"type":"string","enum":["dependency_not_landed"]},"on":{"$ref":"#/components/schemas/ChangeRef"}}},{"type":"object","description":"Another member of the unit it enters with, `on`, is not ready, for its own `blockers`.","required":["on","blockers","kind"],"properties":{"blockers":{"type":"array","items":{"$ref":"#/components/schemas/Blocker"}},"kind":{"type":"string","enum":["member_not_ready"]},"on":{"$ref":"#/components/schemas/ChangeRef"}}}],"description":"One reason a change may not enter the train, precise enough to show as it is."},"BoundInstallation":{"type":"object","description":"An installation of the instance's GitHub App bound to an organisation (`DESIGN.md §5.3`).","required":["installation_id","bound_at"],"properties":{"account":{"type":["string","null"],"description":"The GitHub account it is installed on; none for one bound before accounts were recorded."},"bound_at":{"type":"string","format":"date-time"},"installation_id":{"type":"integer","format":"int64"},"installed_by":{"type":["string","null"],"description":"The GitHub login of whoever installed it, as the binding recorded it; none for one bound\nbefore logins were recorded."}}},"BranchName":{"type":"string"},"Branches":{"type":"object","description":"`GET /repos/{slug}/branches`: the forge's branches, asked of it then, Berrit's own\n(`berrit/…`) left out: the default branch first, then the rest in byte order. Any of them\nopens in the Code tab.","required":["branches"],"properties":{"branches":{"type":"array","items":{"$ref":"#/components/schemas/BranchName"}}}},"Bundled":{"type":"object","description":"A change's current revision, as a bundle holds it.","required":["number","change_id","revision","commit"],"properties":{"change_id":{"$ref":"#/components/schemas/ChangeId"},"commit":{"$ref":"#/components/schemas/CommitId"},"number":{"$ref":"#/components/schemas/ChangeNumber"},"revision":{"$ref":"#/components/schemas/RevisionNumber"}}},"Candidate":{"type":"object","description":"The current revision rebased onto its target's projected tip (`DESIGN.md §3.6`).","required":["result","paths"],"properties":{"culprit":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"The change of the same repo whose patch makes the merge fail, when one is known."},{"type":"null"}]},"culprit_landed":{"type":"boolean","description":"Whether `culprit` has landed, so that the revision conflicts with the target's tip itself;\nfalse while it is ahead in the train (`DESIGN.md §3.6`), and false when no culprit, as an\nolder server answers without it."},"paths":{"type":"array","items":{"$ref":"#/components/schemas/RepoPath"},"description":"The paths that conflict; empty when clean."},"result":{"$ref":"#/components/schemas/CandidateResult"}}},"CandidateResult":{"type":"string","description":"Whether a candidate's rebase merged cleanly, or could not be tried: the revision is\nmissing on the forge, so the cache cannot have it (`DESIGN.md §5.2`).","enum":["clean","conflict","missing"]},"ChangeBundle":{"type":"object","description":"`GET /repos/{slug}/changes/{n}/bundle`: a change, or its stack, as a git bundle to amend or\nrebase and push again (decision 166).","required":["bundle","target","base","changes"],"properties":{"base":{"$ref":"#/components/schemas/CommitId","description":"The target's tip, which the bundle needs: a clone that has it fetches the bundle."},"bundle":{"type":"string","description":"The base64 of the bundle: the commits of `changes` above `base`, at most 8 MiB decoded."},"changes":{"type":"array","items":{"$ref":"#/components/schemas/Bundled"},"description":"Each change it holds the current revision of, a ref of the bundle at\n`refs/berrit/<change id>/<commit>`: the change asked, then those stacked on it."},"target":{"$ref":"#/components/schemas/BranchName"}}},"ChangeCheck":{"type":"object","description":"A check matching the change, at one trigger Berrit expects it at, and its latest\nexpectation: on the current revision for `push` and `approved`, on the train's candidate\nfor `train`.","required":["name","trigger","required"],"properties":{"app":{"oneOf":[{"$ref":"#/components/schemas/Email","description":"The address of the app whose result it is (`DESIGN.md §3.5`): no other app's answers it.\nNone when the check names no app, which no result meets."},{"type":"null"}]},"latest":{"oneOf":[{"$ref":"#/components/schemas/Expected","description":"None until Berrit expects it."},{"type":"null"}]},"name":{"$ref":"#/components/schemas/CheckName"},"required":{"type":"boolean"},"trigger":{"$ref":"#/components/schemas/Trigger"},"workflow":{"oneOf":[{"$ref":"#/components/schemas/Workflow","description":"The workflow of a run, a check Berrit starts on GitHub (`DESIGN.md §3.5`); none for a\ncheck Berrit does not start."},{"type":"null"}]}}},"ChangeDetail":{"allOf":[{"$ref":"#/components/schemas/ChangeSummary"},{"type":"object","required":["message","revisions","reviewers","team_reviewers","units","covering","checks","unexpected","stack","dependencies","dependents","drafts","may_vote","revising","users"],"properties":{"candidate":{"oneOf":[{"$ref":"#/components/schemas/Candidate","description":"The current revision's latest candidate, once one is computed."},{"type":"null"}]},"checks":{"type":"array","items":{"$ref":"#/components/schemas/ChangeCheck"},"description":"One per check matching the change and trigger Berrit expects it at. A `train` check of a\nchange no longer in the train reads the run it left on (`docs/ux.md §6.2`): the one that\nlanded it, or, until a revision is sent, the one that ejected it."},"config_error":{"type":["string","null"],"description":"The error of the configuration at the target's tip, if it has one: its files are\nbroken, and the nearest valid first-parent ancestor's is in force (`DESIGN.md §3.4`); or\nthey name what the organisation lacks, a team or enough members, and stay in force,\nwhat they lack naming nobody (`§5.5`). The rules are those in force either way."},"covering":{"type":"array","items":{"$ref":"#/components/schemas/ChangeNumber"},"description":"The other open changes whose requests with the stack below them hold it, in landing\norder: every one a hold on it withdraws (decision 85), nested ones too."},"dependencies":{"type":"array","items":{"$ref":"#/components/schemas/Dependency"},"description":"What it waits for, its parent included, while it is open."},"dependents":{"type":"array","items":{"$ref":"#/components/schemas/Dependency"},"description":"The open changes waiting for it."},"drafts":{"type":"integer","format":"int32","description":"How many drafts the caller has on it.","minimum":0},"land_now":{"oneOf":[{"$ref":"#/components/schemas/LandNow","description":"Land now as the caller may ask it (decision 148): an owner's or admin's, while the change\nis open, out of the train, taken in by no request above it, and held by nothing but its\nunit's unmet reviews and checks before the train; none else, and none while nothing holds it."},{"type":"null"}]},"may_lift":{"type":"array","items":{"$ref":"#/components/schemas/ReviewerId"},"description":"The required requests the caller may lift, while it is open (decision 170): whoever set\none, an owner or admin, and who answers for its owner, the person, or a named agent's\ndrivers, so that an agent lifts only its own (`berrit_core::review::lifts`)."},"may_vote":{"type":"boolean","description":"Whether the caller may vote on it, as publishing a review decides on an open change: one\nof its authors, its owner or whoever pushed a revision of it, or a person driving an agent\nthat is one, only while `review.self_approval` is on in the configuration at the target's\ntip; a named agent never on a change it, a driver of it or another agent of theirs wrote\n(`DESIGN.md §3.4`); anyone else always."},"message":{"type":"string","description":"The current revision's message."},"queue":{"oneOf":[{"$ref":"#/components/schemas/Queue","description":"The train it is in, while it is in one (`train`), so that its page asks for nothing more."},{"type":"null"}]},"review":{"oneOf":[{"$ref":"#/components/schemas/ReviewStatus","description":"The review check of the current revision, under the configuration at the target's tip;\nnone while the owner has no account, as their approvals cannot then be told apart."},{"type":"null"}]},"reviewers":{"type":"array","items":{"$ref":"#/components/schemas/Reviewer"},"description":"The reviewers in the order they were added, then whoever else voted."},"revising":{"type":"array","items":{"$ref":"#/components/schemas/RevisionNumber"},"description":"The revisions sent since its reviewers last had it, oldest first, while it is open: since a\nperson or a named agent other than its owner published a review on it, or it was returned,\nbut its first, which its send gave them. What `POST …/return` names, a revision paging nobody (decision\n156); none while nothing was sent since."},"revisions":{"type":"array","items":{"$ref":"#/components/schemas/RevisionSummary"}},"stack":{"$ref":"#/components/schemas/Stack"},"target_train":{"oneOf":[{"$ref":"#/components/schemas/TrainSummary","description":"The train into its target, while it is open (decision 124)."},{"type":"null"}]},"team_reviewers":{"type":"array","items":{"$ref":"#/components/schemas/TeamReviewer"},"description":"The teams asked to review, in the order they were asked."},"unexpected":{"type":"array","items":{"$ref":"#/components/schemas/CheckResult"},"description":"The results on the current revision and on the train's candidate that none of `checks`\nis there, by commit, name and app: posted, but not required. One a check will show once\nBerrit expects it is not among them."},"units":{"type":"array","items":{"$ref":"#/components/schemas/LandUnit"},"description":"The units the train would take it in with while it waits to enter (`DESIGN.md §3.7`),\nin landing order: its own while it asks alone, else one for each request with the stack\nbelow it that holds it and that no request above covers in turn, so the top of a line of\nrequests, or under a fork the top of each branch, any of which may take it in. None while\nnothing covers it, and once it is in the train, where its entry names its unit."},"users":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/User"},"propertyNames":{"type":"string"}}}}],"description":"`GET /repos/{slug}/changes/{n}`: everything the change page shows, in one answer."},"ChangeId":{"type":"string"},"ChangeNumber":{"type":"integer","format":"int32","description":"A change's repo-sequential number, `#142` to humans. Numbering starts at 1, and parsing\nstops at the largest `int4`, as Postgres keeps them: a larger number names no change.","minimum":0},"ChangePage":{"type":"object","description":"`GET /repos/{slug}/changes`: changes, most recently updated first.","required":["changes","users"],"properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/ChangeSummary"}},"next":{"type":["string","null"],"description":"The `after` of the next page; none on the last."},"users":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/User"},"propertyNames":{"type":"string"}}}},"ChangeRef":{"type":"string"},"ChangeRun":{"type":"object","description":"A run as its page shows it (`DESIGN.md §3.5`, `§7`): the check, its workflow and its latest\nexpectation as the change's checks have it, when Berrit started it, and GitHub's jobs of it,\nwhich Berrit reads from GitHub as the page asks and copies nowhere.","required":["change","title","state","check","jobs"],"properties":{"change":{"$ref":"#/components/schemas/ChangeNumber"},"check":{"$ref":"#/components/schemas/ChangeCheck","description":"The run, its `workflow` set: as the change's page lists it, its place and hold too."},"jobs":{"$ref":"#/components/schemas/Jobs"},"started_at":{"type":["string","null"],"format":"date-time","description":"When Berrit started it, then when GitHub did; none while it waits, or before it is\nexpected."},"state":{"$ref":"#/components/schemas/ChangeState","description":"The change's state: a run of a change no longer open is asked for again by nobody."},"title":{"type":"string","description":"The change's title, which the page is headed with."}}},"ChangeState":{"type":"string","enum":["open","landed","abandoned"]},"ChangeSummary":{"type":"object","description":"A change as a list shows it, at its current revision.","required":["number","change_id","title","owner","state","target","land","current_revision","created_at","updated_at","files","additions","deletions","unresolved_threads","blockers","attention","team_turn","agent_turn"],"properties":{"additions":{"type":"integer","format":"int32","minimum":0},"agent_turn":{"type":"array","items":{"$ref":"#/components/schemas/UserId"},"description":"The named agents the caller drives whose turn it is, while it is open (decision 163): what\nthe dashboard lists under Your agents."},"approval_required":{"type":"boolean","description":"Whether a review asked of the caller, or of a team of theirs, is required and not met yet,\nso that nothing lands without their approval (decision 170): what the dashboard asks\nfirst, its row's badge."},"attention":{"type":"array","items":{"$ref":"#/components/schemas/Turn"},"description":"Whose turn it is, longest waiting first."},"blockers":{"type":"array","items":{"$ref":"#/components/schemas/Blocker"},"description":"What keeps the change out of the train other than the request to land, which is the\nLand control's to make: in `DESIGN.md §3.7` order, so the first is the change's status\nword (`docs/ux.md §3.4`), and empty when requesting would admit it. Lists, stacks and\nthe change page compute it alike."},"branch":{"oneOf":[{"$ref":"#/components/schemas/BranchName","description":"The branch it was imported from, which it follows while open; none when it was sent\n(`DESIGN.md §3.2`)."},{"type":"null"}]},"change_id":{"$ref":"#/components/schemas/ChangeId"},"created_at":{"type":"string","format":"date-time"},"current_revision":{"$ref":"#/components/schemas/RevisionNumber"},"deletions":{"type":"integer","format":"int32","minimum":0},"ejection":{"oneOf":[{"$ref":"#/components/schemas/Ejection","description":"Why the train let it go, while that stands: until a new revision is sent, or it enters\nthe train again, as Land again asks (`docs/ux.md §6.2`, decision 99)."},{"type":"null"}]},"files":{"type":"integer","format":"int32","description":"What the current revision touches.","minimum":0},"land":{"$ref":"#/components/schemas/Land","description":"The land request in force (`DESIGN.md §3.7`): its own, or `stack` while it asks for none\nand an open change above it in its stack asks with the stack below it, which covers it."},"landed_commit":{"oneOf":[{"$ref":"#/components/schemas/CommitId"},{"type":"null"}]},"last_activity":{"oneOf":[{"$ref":"#/components/schemas/LastActivity","description":"The last thing that happened to it."},{"type":"null"}]},"number":{"$ref":"#/components/schemas/ChangeNumber"},"owner":{"$ref":"#/components/schemas/UserId"},"pull_request":{"oneOf":[{"$ref":"#/components/schemas/PullRequestLink","description":"Its pull request on GitHub, the mirror's or the one it was imported from, as the GitHub\napp last saw it open (`DESIGN.md §5.2`); none until the app has seen one."},{"type":"null"}]},"stack_place":{"oneOf":[{"$ref":"#/components/schemas/StackPlace","description":"Its place among the open changes of its stack, while it is open and not alone in it."},{"type":"null"}]},"stage":{"oneOf":[{"$ref":"#/components/schemas/Stage","description":"How far it is on its way to its target, a pure function of its state, its train entry,\nits ejection and its first blocker (`docs/ux.md §6.1`); none once abandoned."},{"type":"null"}]},"state":{"$ref":"#/components/schemas/ChangeState"},"target":{"$ref":"#/components/schemas/BranchName"},"team_turn":{"type":"array","items":{"$ref":"#/components/schemas/TeamName"},"description":"The caller's teams it waits on, while it is open and neither the caller's turn nor their\nown change: each asked to review it, and none of whose members has voted on its current\nrevision (`DESIGN.md §3.4`)."},"title":{"type":"string","description":"The first line of the current revision's message."},"train":{"oneOf":[{"$ref":"#/components/schemas/TrainSpot","description":"Its entry in its target's train, while it is in the train."},{"type":"null"}]},"unresolved_threads":{"type":"integer","format":"int32","description":"Published threads not resolved.","minimum":0},"updated_at":{"type":"string","format":"date-time"},"your_turn":{"oneOf":[{"$ref":"#/components/schemas/Turn","description":"Why it is the caller's turn, while it is."},{"type":"null"}]}}},"ChangedFile":{"type":"object","description":"A file a revision touches, or a stack view shows.","required":["path","status","additions","deletions","comment_count"],"properties":{"additions":{"type":"integer","format":"int32","minimum":0},"comment_count":{"type":"integer","format":"int32","description":"The comments on the file the caller sees, from every revision.","minimum":0},"deletions":{"type":"integer","format":"int32","minimum":0},"old_path":{"oneOf":[{"$ref":"#/components/schemas/RepoPath","description":"The path before a rename."},{"type":"null"}]},"path":{"$ref":"#/components/schemas/RepoPath"},"status":{"$ref":"#/components/schemas/PathStatus"}}},"CheckDef":{"type":"object","description":"One `[[check]]` entry.","required":["name","on","paths","timeout"],"properties":{"app":{"oneOf":[{"$ref":"#/components/schemas/Email","description":"The app whose result it is, by its address `<name>@apps.berrit`: the check is the pair\nof the app and the name (`DESIGN.md §3.5`, decision 79). None names no app, which is an\nerror at the tip and a check no result meets, as is an app the organisation lacks\n([`crate::config::ConfigError::CheckWithoutApp`]): the file stays in force, failing\nclosed, and nothing looser comes back."},{"type":"null"}]},"name":{"$ref":"#/components/schemas/CheckName"},"on":{"type":"array","items":{"$ref":"#/components/schemas/Trigger"},"uniqueItems":true},"paths":{"$ref":"#/components/schemas/Globs"},"required":{"type":"boolean"},"revert":{"oneOf":[{"$ref":"#/components/schemas/Workflow","description":"The workflow Berrit dispatches on the target when a landing fails, which makes the run a\nlanding step (`DESIGN.md §3.7`, decision 130): [`crate::config::Config::parse`] takes it\nonly of a run at `train` alone."},{"type":"null"}]},"timeout":{"type":"string","description":"Like `45m` or `2h`."},"workflow":{"oneOf":[{"$ref":"#/components/schemas/Workflow","description":"The workflow Berrit dispatches on GitHub for it, which makes it a run, the GitHub app's\n(decision 128): [`crate::config::Config::parse`] gives it that app, and refuses another."},{"type":"null"}]}},"additionalProperties":false},"CheckName":{"type":"string"},"CheckResult":{"type":"object","description":"An app's result of a check on a commit: what the app last posted, or what Berrit said at a\ndeadline the app did not meet.","required":["commit","name","status","updated_at"],"properties":{"app":{"oneOf":[{"$ref":"#/components/schemas/Email","description":"The address of the app whose result it is: the check is the pair of the app and the\nname. None only for what Berrit said at the deadline of a check that names no app."},{"type":"null"}]},"by":{"oneOf":[{"$ref":"#/components/schemas/UserId","description":"The app, by its user id, when it posted it; none when Berrit ended it at a deadline."},{"type":"null"}]},"commit":{"$ref":"#/components/schemas/CommitId"},"finished_at":{"type":["string","null"],"format":"date-time","description":"The first terminal status since it last ran; none while it runs."},"name":{"$ref":"#/components/schemas/CheckName"},"rerun":{"type":["string","null"],"description":"How the app that posted it can run it again: `job:<id>`, a job of GitHub Actions the\nGitHub app read. None for any other result, such as a commit status, which the GitHub\napp cannot run again (`DESIGN.md §3.5`)."},"started_at":{"type":["string","null"],"format":"date-time","description":"The first `running` since it last ended."},"status":{"$ref":"#/components/schemas/ResultStatus"},"summary":{"type":["string","null"]},"updated_at":{"type":"string","format":"date-time"},"url":{"oneOf":[{"$ref":"#/components/schemas/HttpUrl"},{"type":"null"}]}}},"CheckStatus":{"type":"string","description":"How an expectation stands: `Pending` until a result answers it, then the result's\nstatus. `Unreported` is one of a change that left the train before any result came,\nwhich nothing waits for any more, as the train's history shows it. `Refused` is a run\nwhose dispatch GitHub refused (`DESIGN.md §3.5`), an error GitHub never ran.","enum":["pending","running","passed","failed","error","unreported","refused"]},"CodeLine":{"type":"object","description":"One line of a file, without its line ending, with its token spans as a diff's side has\nthem: `[start, end, class]` in UTF-16 code units of `text`.","required":["number","text","spans"],"properties":{"number":{"type":"integer","format":"int32","description":"1-based.","minimum":0},"spans":{"type":"array","items":{"type":"array","items":false,"prefixItems":[{"type":"integer","format":"int32","minimum":0},{"type":"integer","format":"int32","minimum":0},{"type":"string","description":"What a span of code is. Text outside every span is plain, so plain is not a class.","enum":["keyword","string","comment","number","type","function","variable","punctuation","operator","constant","attribute","tag"]}]}},"text":{"type":"string"}}},"Comment":{"type":"object","required":["id","author","body","resolved","created_at","anchor"],"properties":{"anchor":{"$ref":"#/components/schemas/Anchor"},"author":{"$ref":"#/components/schemas/UserId"},"body":{"type":"string"},"created_at":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"mapped":{"oneOf":[{"$ref":"#/components/schemas/Mapped","description":"Where its lines sit on the revision asked for; none when none was, and for a comment\non a file or on the change."},{"type":"null"}]},"published_at":{"type":["string","null"],"format":"date-time","description":"None while it is a draft."},"resolved":{"type":"boolean"},"root_id":{"type":["string","null"],"format":"uuid","description":"The thread's first comment, for a reply."},"via":{"oneOf":[{"$ref":"#/components/schemas/Via","description":"Whom its author, an app, heard it from."},{"type":"null"}]}}},"Comments":{"type":"object","description":"`GET …/comments`: the change's published comments and the caller's drafts, oldest first.","required":["comments","users"],"properties":{"comments":{"type":"array","items":{"$ref":"#/components/schemas/Comment"}},"users":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/User"},"propertyNames":{"type":"string"}}}},"CommitId":{"type":"string"},"Config":{"type":"object","description":"A validated configuration: `berrit.toml`'s sections and `checks.toml`'s checks. Every section\nis optional; a missing one takes its default, and missing files are [`Config::default`].\nBuild one only with [`Config::parse`], which runs the checks across fields; deserialising a\n`Config` directly skips them.","properties":{"check":{"type":"array","items":{"$ref":"#/components/schemas/CheckDef"},"default":[]},"github":{"$ref":"#/components/schemas/GithubSettings","default":{"mirror_prs":true,"reviews_as_votes":true}},"review":{"$ref":"#/components/schemas/ReviewSettings","default":{"approval_after_edit":"keep","require_resolved_threads":true,"self_approval":false}},"rule":{"type":"array","items":{"$ref":"#/components/schemas/Rule"},"default":[{"approvers":["*"],"count":1,"paths":["**"]}]},"train":{"$ref":"#/components/schemas/TrainSettings","default":{"window":1}}},"additionalProperties":false},"ConfigCommit":{"type":"object","description":"The commit `PUT /repos/{slug}/config` landed on the default branch: its tip now, where the\nconfiguration in force is read.","required":["commit"],"properties":{"commit":{"$ref":"#/components/schemas/CommitId"}}},"Counts":{"type":"object","description":"How many lines a diff's hunks hold, and of them how many are added and deleted.","required":["lines","additions","deletions"],"properties":{"additions":{"type":"integer","format":"int32","minimum":0},"deletions":{"type":"integer","format":"int32","minimum":0},"lines":{"type":"integer","format":"int32","minimum":0}}},"Credential":{"type":"object","description":"What an act came through when it was not a session's (`DESIGN.md` decisions 119 and 162), by\nname: an agent, by its kind, its OAuth client's name now or `Agent` once it has none or is gone,\nor an API key, by its own now, its id once it has none or is gone; 64 characters at most. Its\nactor is the person all the same, judged by nothing of it, or the named agent a person drove.","required":["kind","name"],"properties":{"by":{"oneOf":[{"$ref":"#/components/schemas/UserId","description":"The person driving the named agent that acted, whose connection it came through (decision\n163): \"agent:dev-bot via Claude, by @chetan\". None, and left out, for a person's own act;\nnone from an older server."},{"type":"null"}]},"connection":{"type":["string","null"],"description":"An agent's: the name the person gave the connection it came through, while that stands\n(decision 162). None, and left out, for a key's, or once the connection is gone."},"kind":{"$ref":"#/components/schemas/CredentialKind"},"name":{"type":"string"}}},"CredentialKind":{"type":"string","description":"An agent, through the OAuth client it holds a token of, or a program, through an API key.","enum":["agent","key"]},"Days":{"type":"integer","format":"int32","description":"How many days back the train's numbers look: 1 to 365, 30 unless asked.","maximum":365,"minimum":1},"DepSource":{"type":"string","description":"Where a dependency comes from: the stack, a `Depends-On` trailer, or a person.","enum":["parent","trailer","manual"]},"DependenciesEdit":{"type":"object","description":"`POST /repos/{slug}/changes/{n}/dependencies`: changes, in any repo, that it must land\nafter, by hand. Only those added by hand are removed by hand: a `Depends-On` trailer goes\nwith a revision that drops it, and the parent with a revision sent onto another.","properties":{"add":{"type":"array","items":{"$ref":"#/components/schemas/ChangeRef"}},"remove":{"type":"array","items":{"$ref":"#/components/schemas/ChangeRef"}}},"additionalProperties":false},"Dependency":{"type":"object","description":"The other end of a dependency: the change waited for, or the one waiting.","required":["repo","number","source","landed","blockers"],"properties":{"blockers":{"type":"array","items":{"$ref":"#/components/schemas/Blocker"},"description":"As [`ChangeSummary::blockers`], so the row wears the change's word; none while `state`\nis none."},"landed":{"type":"boolean"},"number":{"$ref":"#/components/schemas/ChangeNumber"},"repo":{"$ref":"#/components/schemas/RepoSlug"},"source":{"$ref":"#/components/schemas/DepSource"},"state":{"oneOf":[{"$ref":"#/components/schemas/ChangeState","description":"None while no such change exists, and while its repo cannot be read (it clones, or its\nprovider fails): its row then has its number and title and wears no word."},{"type":"null"}]},"title":{"type":["string","null"],"description":"None while no such change exists: `Depends-On` may name one before it is sent."},"train_position":{"type":["integer","null"],"format":"int32","description":"As `state`, while it is in its train.","minimum":0}}},"Diff":{"type":"object","description":"`GET …/revisions/{r}/diff`: one file's diff, highlighted, and what it was taken against.\n\nIts offsets count UTF-16 code units, as the web's strings do: the intraline ranges of\n`file`'s lines and the spans of `highlight` alike.","required":["file","whole","highlight","interdiff"],"properties":{"file":{"$ref":"#/components/schemas/FileDiff","description":"Its hunks hold the lines `after` and `limit` ask for, every one by default, a hunk cut\nkeeping the whole hunk's starts and counts ([`FileDiff::window`])."},"highlight":{"$ref":"#/components/schemas/DiffHighlight","description":"The spans of the lines `file` holds on each side, and of those between."},"interdiff":{"$ref":"#/components/schemas/Interdiff"},"new_path":{"oneOf":[{"$ref":"#/components/schemas/RepoPath"},{"type":"null"}]},"old_path":{"oneOf":[{"$ref":"#/components/schemas/RepoPath","description":"The file's path on each side: none where there is no such file, different for a\nrename."},{"type":"null"}]},"whole":{"$ref":"#/components/schemas/Counts","description":"What the whole diff holds, whatever part of it `file` holds."}}},"DiffHighlight":{"type":"object","required":["old","new"],"properties":{"new":{"$ref":"#/components/schemas/Highlight"},"old":{"$ref":"#/components/schemas/Highlight"}}},"DiffLine":{"type":"object","description":"One line of a hunk. Line numbers are 1-based; a deleted line has no `new_no` and an\nadded one no `old_no`.","required":["kind","text","intraline"],"properties":{"intraline":{"type":"array","items":{"type":"array","items":false,"prefixItems":[{"type":"integer","format":"int32","minimum":0},{"type":"integer","format":"int32","minimum":0}]},"description":"The byte ranges `[start, end)` of `text` that differ from the line it is paired\nwith: sorted, disjoint and never empty or adjacent."},"kind":{"$ref":"#/components/schemas/LineKind"},"new_no":{"type":["integer","null"],"format":"int32","minimum":0},"old_no":{"type":["integer","null"],"format":"int32","minimum":0},"old_text":{"type":["string","null"],"description":"On a context line whose sides differ in their whitespace alone, the old side's text."},"text":{"type":"string","description":"The line without its `\\n` or `\\r\\n`; the new side's, on a context line."}}},"DraftCreated":{"type":"object","description":"The draft just saved.","required":["id"],"properties":{"id":{"type":"string","format":"uuid"}}},"DraftEdit":{"type":"object","description":"`PATCH /repos/{slug}/changes/{n}/comments/{id}`: a draft's new text.","required":["body"],"properties":{"body":{"type":"string"}},"additionalProperties":false},"EjectReason":{"oneOf":[{"type":"object","required":["paths","kind"],"properties":{"culprit":{"oneOf":[{"$ref":"#/components/schemas/ChangeRef"},{"type":"null"}]},"kind":{"type":"string","enum":["conflict"]},"paths":{"type":"array","items":{"$ref":"#/components/schemas/RepoPath"}}}},{"type":"object","required":["names","kind"],"properties":{"bisected":{"oneOf":[{"$ref":"#/components/schemas/ChangeRef","description":"When the train had to bisect to find it: the change whose run failed with it\nfurthest on, the end of the range it bisected."},{"type":"null"}]},"kind":{"type":"string","enum":["checks_failed"]},"names":{"type":"array","items":{"$ref":"#/components/schemas/CheckName"}}}},{"type":"object","description":"Held, abandoned or superseded by a new revision.","required":["kind"],"properties":{"kind":{"type":"string","enum":["dequeued"]}}},{"type":"object","description":"It left with `on`, ejected for another reason, as a member of `on`'s unit or stacked on\none. The machine names it only as part of a cascade; the worker gives each its reason.","required":["on","kind"],"properties":{"kind":{"type":"string","enum":["stacked"]},"on":{"$ref":"#/components/schemas/ChangeRef"}}}],"description":"Why the train let go of a change."},"Ejection":{"type":"object","description":"Why the train let go of a change, as its entry keeps it from the moment it did.","required":["reason","passed_alone","land"],"properties":{"behind":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"For a failure of its checks, the change whose landing made the commit its run's candidate\nstood on as it was ejected: what \"failed behind #m\" names (`docs/ux.md §6.2`). None when no\nlanding of the train's made it, as a tip pushed outside Berrit, and for any other reason."},{"type":"null"}]},"land":{"$ref":"#/components/schemas/Land","description":"The land request the ejection let go, which Land again asks again (decision 99): the\nchange's own while its entry was its own request's, `none` when it was another change's,\nwhich that change asks again."},"passed_alone":{"type":"boolean","description":"Every check named in a failure passed on the revision alone, at `push` or `approved`:\nit failed only on the candidate."},"reason":{"$ref":"#/components/schemas/EjectReason"}}},"Ejections":{"type":"object","description":"Ejections by their reason's kind.","required":["checks_failed","conflict","stacked"],"properties":{"checks_failed":{"type":"integer","format":"int32","minimum":0},"conflict":{"type":"integer","format":"int32","minimum":0},"stacked":{"type":"integer","format":"int32","minimum":0}}},"Email":{"type":"string"},"EntryKind":{"type":"string","description":"What a directory holds under a name. An executable is a file.","enum":["dir","file","symlink","submodule"]},"ErrorBody":{"type":"object","description":"A failed request's body: `{ \"error\": { \"code\", \"message\" } }` with the status its code\nimplies (`DESIGN.md §7`).","required":["error"],"properties":{"error":{"$ref":"#/components/schemas/ErrorDetail"}}},"ErrorCode":{"type":"string","description":"The `code` of an API error. Clients match on these, so a code is never renamed; new\ncodes are added only by the task that needs them.","enum":["not_found","forbidden","unauthenticated","invalid_body","conflict","identity_missing","dependency_cycle","config_invalid","forge_unreachable","tip_moved","identity_mismatch","remote_unreachable","invalid_remote","cannot_rerun","github_code_invalid","installation_bound","not_an_ancestor","unpaid","insufficient_scope","internal"]},"ErrorDetail":{"type":"object","required":["code","message"],"properties":{"code":{"$ref":"#/components/schemas/ErrorCode"},"message":{"type":"string","description":"For people; clients match on `code`."}}},"Expected":{"type":"object","description":"What Berrit expects of a check on a commit, and how the result answering it stands.","required":["commit","status","requested_at"],"properties":{"by":{"oneOf":[{"$ref":"#/components/schemas/UserId","description":"The app, by its user id, when its result answers it: none before one does, or when\nBerrit ended it at its deadline."},{"type":"null"}]},"commit":{"$ref":"#/components/schemas/CommitId"},"deadline":{"type":["string","null"],"format":"date-time","description":"None for a run not started, whose timeout counts from its start (decision 129)."},"finished_at":{"type":["string","null"],"format":"date-time"},"held_by":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"Of a run held, the change below it in its stack whose required run failed (decision 129)."},{"type":"null"}]},"not_started":{"oneOf":[{"$ref":"#/components/schemas/NotStarted","description":"Why it is not started, of a run Berrit has not started: wanted or held while it waits,\nor why it never will."},{"type":"null"}]},"place":{"type":["integer","null"],"format":"int32","description":"Of a run wanted, its place in the order the repository's waiting runs start, 1 the next,\nas `GET /repos/{slug}/runs` lists them; none otherwise, and where the page asks for none.","minimum":0},"requested_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"status":{"$ref":"#/components/schemas/CheckStatus","description":"`pending` until a result answers it."},"summary":{"type":["string","null"]},"url":{"oneOf":[{"$ref":"#/components/schemas/HttpUrl"},{"type":"null"}]}}},"FileDiff":{"type":"object","description":"What changed in one file. A side that does not exist is empty.\n\n`hunks` is empty when both sides have the same lines as [`line_diff`] splits them, or\nwhen either flag is set. So two different blobs with no hunks and neither flag differ\nonly in line endings (`\\r\\n` against `\\n`) or in the final newline, which the UI says;\nor, where whitespace is ignored, in their whitespace alone, which `hidden` counts.","required":["hunks","binary","truncated","old_lines","new_lines"],"properties":{"binary":{"type":"boolean","description":"A side has a NUL byte in its first 8 KiB; false when a side over [`MAX_BYTES`] was\nnot read, since then nothing was probed."},"hidden":{"type":"integer","format":"int32","description":"How many lines the diff takes as unchanged though their text differs: those whose\nwhitespace alone changed, where whitespace is ignored; none otherwise.","minimum":0},"hunks":{"type":"array","items":{"$ref":"#/components/schemas/Hunk"}},"new_lines":{"type":"integer","format":"int32","minimum":0},"old_lines":{"type":"integer","format":"int32","description":"How many lines each side has; both 0 when a side over [`MAX_BYTES`] was not read,\nthe git layer knowing its size from the object header.","minimum":0},"truncated":{"type":"boolean","description":"A side is over [`MAX_BYTES`] or [`MAX_LINES`]."}}},"Files":{"type":"object","description":"`GET …/revisions/{r}/files`: the files a revision touches, or a stack view shows (decision\n86), and against what.","required":["files","interdiff","states"],"properties":{"files":{"type":"array","items":{"$ref":"#/components/schemas/ChangedFile"}},"interdiff":{"$ref":"#/components/schemas/Interdiff","description":"`none` but against an earlier state of the stack (`from` with `against`), whose\ninterdiff the files are, their counts its (`DESIGN.md §3.10`)."},"states":{"type":"array","items":{"$ref":"#/components/schemas/StackState"},"description":"In a stack view, its earlier states, newest first: one per instant before the one shown\nat which a member's revision was sent; none elsewhere."}}},"FreeInstallations":{"type":"object","description":"What `POST /repos/{org}/github/installations` answers a code alone (T187): who the code's user\nis on GitHub; the installations GitHub names theirs that are bound to nobody, recorded as\ninstalled by them or not at all, and whose every repository they write, one of which they bind\nwith a code of its own; and the others GitHub names theirs, each with why not: bound to another\norganisation, installed by someone else, a repository they cannot write, or GitHub's refusal.\nOne bound to the organisation already is left out, but for one that records no installer, which\ntheir bind records, when they write it throughout (T184).","required":["login","free","refused"],"properties":{"free":{"type":"array","items":{"$ref":"#/components/schemas/UnclaimedInstallation"}},"login":{"type":"string","description":"The code's user's login on GitHub."},"refused":{"type":"array","items":{"$ref":"#/components/schemas/InstallationProblem"}}}},"GithubAppPage":{"type":"object","description":"The instance's GitHub App as GitHub shows it (`GET /app`): an organisation installs it from\n`<html_url>/installations/new`.","required":["slug","html_url"],"properties":{"html_url":{"type":"string"},"slug":{"type":"string"}}},"GithubSettings":{"type":"object","description":"What the GitHub app does where it serves the repository.","properties":{"at_once":{"oneOf":[{"$ref":"#/components/schemas/AtOnce","description":"How many runs Berrit keeps started for the changes to the target; none bounds nothing\n(`DESIGN.md §3.5`, decision 129)."},{"type":"null"}]},"mirror_prs":{"type":"boolean","description":"Whether every change is a pull request on GitHub (docs/apps.md, The pull request mirror).","default":true},"reviews_as_votes":{"type":"boolean","description":"Whether a review on GitHub by a member's connected account is their vote (`DESIGN.md\n§3.4`, decision 118).","default":true}},"additionalProperties":false},"Globs":{"type":"array","items":{"type":"string"}},"Handle":{"type":"string"},"Held":{"oneOf":[{"type":"object","description":"A landing step of the landing on `candidate` failed, and the reverts named failed or erred\ntoo: what the steps did may stand, which neither the target nor the candidate says.","required":["candidate","reverts","kind"],"properties":{"candidate":{"$ref":"#/components/schemas/CommitId"},"kind":{"type":"string","enum":["revert_failed"]},"reverts":{"type":"array","items":{"$ref":"#/components/schemas/CheckName"}}}},{"type":"object","description":"The target refused the push of `candidate` after its landing steps passed: they did what\nthe target does not hold, and their reverts ran on what it does.","required":["candidate","kind"],"properties":{"candidate":{"$ref":"#/components/schemas/CommitId"},"kind":{"type":"string","enum":["push_refused"]}}},{"type":"object","description":"The landing steps named of the landing on `candidate` did not end by their deadline: one\nstill running may do what it was asked, so that nothing is reverted under it, and the\nlanding waits for whoever releases the train once it ended.","required":["candidate","steps","kind"],"properties":{"candidate":{"$ref":"#/components/schemas/CommitId"},"kind":{"type":"string","enum":["step_overdue"]},"steps":{"type":"array","items":{"$ref":"#/components/schemas/CheckName"}}}}],"description":"Why a train is held (`DESIGN.md §3.7`, decision 130): what the owner or admin who releases it\nis told."},"Highlight":{"type":"object","description":"One side's token spans line by line, as [`crate::highlight::Highlighted`] holds them, each\nspan a `[start, end, class]` triple, from the line after the first `offset`. No lines for a\nside without a file, for a binary or truncated diff, which shows none, and for a side of which\na diff, or the range of it read, holds no line.","required":["offset","lines","truncated"],"properties":{"lines":{"type":"array","items":{"type":"array","items":{"type":"array","items":false,"prefixItems":[{"type":"integer","format":"int32","minimum":0},{"type":"integer","format":"int32","minimum":0},{"type":"string","description":"What a span of code is. Text outside every span is plain, so plain is not a class.","enum":["keyword","string","comment","number","type","function","variable","punctuation","operator","constant","attribute","tag"]}]}}},"offset":{"type":"integer","format":"int32","description":"How many of the file's lines come before the first `lines` holds.","minimum":0},"truncated":{"type":"boolean"}}},"Hook":{"type":"object","description":"A hook (`DESIGN.md §5.4`, decision 107): a URL Berrit posts its repository's activity to, in\norder, each as `GET /events` streams it, signed as Standard Webhooks signs. No answer shows\nits secret but the one that made it.","required":["id","url","kinds","created","state"],"properties":{"created":{"type":"string","format":"date-time"},"created_by":{"oneOf":[{"$ref":"#/components/schemas/User","description":"Who made it, a person or a program with their key; none once their account is gone."},{"type":"null"}]},"id":{"type":"string","format":"uuid"},"kinds":{"type":"array","items":{"$ref":"#/components/schemas/ActivityKind"},"description":"The kinds of activity it is sent; none: every kind."},"state":{"$ref":"#/components/schemas/HookState"},"url":{"type":"string"}}},"HookState":{"oneOf":[{"type":"object","description":"Every delivery so far was taken.","required":["state"],"properties":{"state":{"type":"string","enum":["delivering"]}}},{"type":"object","description":"The next delivery has failed since `since`, the latest time in the words `failure`, and\nis tried again after a backoff.","required":["since","failure","state"],"properties":{"failure":{"type":"string"},"since":{"type":"string","format":"date-time"},"state":{"type":"string","enum":["failing"]}}},{"type":"object","description":"Nothing has been sent since `since`, after a 410 or a day of failures, the latest in the\nwords `failure`; a watch's, too, by its maker's hand or as its owner may no longer read\nwhat it is on, saying why; until Resume starts it again at the newest activity.","required":["since","failure","state"],"properties":{"failure":{"type":"string"},"since":{"type":"string","format":"date-time"},"state":{"type":"string","enum":["paused"]}}}],"description":"How a hook's deliveries go."},"HttpUrl":{"type":"string"},"Hunk":{"type":"object","description":"A run of changed lines with their context. A start is 1-based; on a side with no lines\nin the hunk it is the line before, as in `git diff`.","required":["old_start","old_count","new_start","new_count","lines"],"properties":{"lines":{"type":"array","items":{"$ref":"#/components/schemas/DiffLine"}},"new_count":{"type":"integer","format":"int32","minimum":0},"new_start":{"type":"integer","format":"int32","minimum":0},"old_count":{"type":"integer","format":"int32","minimum":0},"old_start":{"type":"integer","format":"int32","minimum":0}}},"ImportCommit":{"type":"object","description":"A commit an import would make a change of.","required":["commit","subject"],"properties":{"change_id":{"oneOf":[{"$ref":"#/components/schemas/ChangeId","description":"The change id it carries, if any (`DESIGN.md §3.1`)."},{"type":"null"}]},"commit":{"$ref":"#/components/schemas/CommitId"},"subject":{"type":"string","description":"The first line of its message."}}},"ImportMode":{"type":"string","description":"How an import makes changes of a branch's commits (`DESIGN.md §3.2`): `one` change,\nthe squash Berrit writes, or a branch of one commit that carries an id kept as it is;\nor `each` commit a change, each kept as it is, the stack `send` would make.","enum":["one","each"]},"ImportOffer":{"type":"object","description":"A mode an import is offered in, and what it makes of the commits.","required":["mode","made"],"properties":{"made":{"$ref":"#/components/schemas/Made"},"mode":{"$ref":"#/components/schemas/ImportMode"}}},"ImportPreview":{"type":"object","description":"`GET /repos/{slug}/import?branch=&target=`: what importing a branch would make of its\ncommits above the target (`DESIGN.md §3.2`).","required":["commits","modes"],"properties":{"change":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"The open change at the branch's tip, which holds it."},{"type":"null"}]},"commits":{"type":"array","items":{"$ref":"#/components/schemas/ImportCommit"},"description":"`target..branch`, oldest first."},"modes":{"type":"array","items":{"$ref":"#/components/schemas/ImportOffer"},"description":"The modes the commits may be imported in, `one` first, and what each makes: `one`, and\n`each` when every commit carries a change id of its own and has one parent; for a branch\nwhose open change was made otherwise, those that go on as it was made."},"squash":{"oneOf":[{"$ref":"#/components/schemas/Message","description":"What the squash says, when `one` writes one: the current revision's title and body of\nthe change already squashed from the branch, or else the oldest commit's subject, and\nthe commits' messages, oldest first, a blank line between, after it."},{"type":"null"}]}}},"ImportRequest":{"type":"object","description":"`POST /repos/{slug}/import`: `branch`'s commits above `target` become changes in `mode`,\nor the next revisions of the changes made of them before (`DESIGN.md §3.2`). Answered as a\nsend is, its changes parent first, the one at the branch's tip last.","required":["branch","target","mode"],"properties":{"body":{"type":["string","null"],"description":"The squash's; absent, the preview's. Refused when nothing is squashed."},"branch":{"$ref":"#/components/schemas/BranchName"},"mode":{"$ref":"#/components/schemas/ImportMode"},"target":{"$ref":"#/components/schemas/BranchName"},"title":{"type":["string","null"],"description":"The squash's: one line; absent, the preview's. Refused when nothing is squashed."}},"additionalProperties":false},"InstallationListing":{"type":"object","description":"`GET /github/installation/repos?org=` (an organisation's owners and admins): the\ninstallations of the instance's GitHub App bound to the organisation, the repositories they\nmay reach, and the installations GitHub refused, each with its words, so that one GitHub\nrefuses hides none of the others (decision 104); those installed on GitHub that nobody\nbound, which the caller's GitHub account installed (decision 109); and where a Bind goes.","required":["installations","repos","problems","unclaimed","bind_url"],"properties":{"bind_url":{"type":"string","description":"GitHub's page authorising the app, which sends the person back to the app's callback URL\nwith a code and, as `state`, the organisation alone; there the code lists their\ninstallations that are bound to nobody, one of which they bind (decision 71, T187)."},"installations":{"type":"array","items":{"$ref":"#/components/schemas/BoundInstallation"}},"problems":{"type":"array","items":{"$ref":"#/components/schemas/InstallationProblem"}},"repos":{"type":"array","items":{"$ref":"#/components/schemas/InstallationRepo"}},"unclaimed":{"type":"array","items":{"$ref":"#/components/schemas/UnclaimedInstallation"}}}},"InstallationProblem":{"type":"object","description":"What GitHub said as it refused an installation the listing asked about.","required":["installation_id","said"],"properties":{"installation_id":{"type":"integer","format":"int64"},"said":{"type":"string"}}},"InstallationRepo":{"type":"object","description":"A repository the instance's GitHub App may reach through an organisation's installations.","required":["installation_id","github_id","html_url","may_run","full_name","clone_url","default_branch"],"properties":{"clone_url":{"type":"string"},"default_branch":{"type":"string"},"full_name":{"type":"string","description":"`owner/name`."},"github_id":{"type":"integer","format":"int64","description":"GitHub's id of the repository, which a rename or a transfer keeps."},"html_url":{"type":"string","description":"The installation's page on GitHub, where it is configured: under the account or the\norganisation it is installed on."},"installation_id":{"type":"integer","format":"int64"},"installed_by":{"type":["string","null"],"description":"The GitHub login of whoever installed it, as the binding recorded it; none for one bound\nbefore logins were recorded."},"may_run":{"type":"boolean","description":"Whether the installation accepted the Actions permission's write, without which GitHub\nrefuses to start a run (`DESIGN.md §3.5`)."}}},"Instance":{"type":"object","description":"`GET /instance`: the server's version, and the instance's GitHub App.","required":["version"],"properties":{"github_app":{"oneOf":[{"$ref":"#/components/schemas/GithubAppPage","description":"None when no GitHub App is configured, or GitHub has not said which it is."},{"type":"null"}]},"version":{"type":"string","description":"The commit the server was built from, or `unknown` for a build that does not say."}}},"Interdiff":{"type":"string","description":"What a diff was taken against.","enum":["none","exact","raw","empty"]},"Invitation":{"type":"object","description":"An invitation waiting for the caller, to an address that names them (decision 131), to join\norganisation `org`, named `name`, as `role`, and its team `team` when it names one: pending,\nunexpired, and from `inviter`, who is still a member of it.","required":["id","org","name","inviter","role"],"properties":{"id":{"$ref":"#/components/schemas/InvitationId"},"inviter":{"$ref":"#/components/schemas/Email"},"name":{"type":"string"},"org":{"$ref":"#/components/schemas/OrgSlug"},"role":{"$ref":"#/components/schemas/OrgRole"},"team":{"type":["string","null"],"description":"The team's name; none when it names no team, or its team is gone."}}},"InvitationId":{"type":"string"},"JobLog":{"oneOf":[{"type":"object","description":"The job runs: GitHub gives its log once it ends, and its steps say how it goes meanwhile.","required":["kind"],"properties":{"kind":{"type":"string","enum":["running"]}}},{"type":"object","description":"Kept: `lines` are those after its first `after`, of its `total`, as many as `limit` asked\nfor, 10,000 at most, or as fit in 1 MiB of what they say, a line longer than that served\nalone as its first 1 MiB.","required":["total","after","lines","groups","kind"],"properties":{"after":{"type":"integer","format":"int32","minimum":0},"cut":{"type":["integer","null"],"format":"int64","description":"How many bytes of the log came before those kept, which are its last 8 MiB from a\nline's start; none when it is kept whole.","minimum":0},"groups":{"type":"array","items":{"$ref":"#/components/schemas/LogGroup"},"description":"The groups the lines served are in, whole, in order."},"kind":{"type":"string","enum":["kept"]},"lines":{"type":"array","items":{"$ref":"#/components/schemas/LogLine"}},"next":{"type":["integer","null"],"format":"int32","description":"Where the next page starts, the line after the last served; none at the log's end.","minimum":0},"total":{"type":"integer","format":"int32","minimum":0}}},{"type":"object","description":"Not kept, for the reason `why` says; GitHub's page of the job may hold it still.","required":["why","kind"],"properties":{"kind":{"type":"string","enum":["gone"]},"why":{"$ref":"#/components/schemas/LogGone"}}}],"description":"A job's log, as Berrit keeps it once GitHub ended the job (`DESIGN.md §3.5`, decision 168): a\npage of its lines."},"JobStatus":{"type":"string","description":"How a job of a run stands (`DESIGN.md §3.5`): `running` until it completes, then `passed`\non success, `failed` on failure, `skipped` when GitHub skipped it or it concluded neutral,\nand `error` on any other conclusion.","enum":["running","passed","failed","skipped","error"]},"Jobs":{"oneOf":[{"type":"object","description":"GitHub has no run of it: Berrit has not started it, or GitHub refused to run it.","required":["kind"],"properties":{"kind":{"type":"string","enum":["none"]}}},{"type":"object","description":"GitHub's run of it, by its id, and its jobs, in GitHub's order.","required":["run","jobs","kind"],"properties":{"jobs":{"type":"array","items":{"$ref":"#/components/schemas/RunJob"}},"kind":{"type":"string","enum":["listed"]},"run":{"type":"integer","format":"int64","minimum":0}}},{"type":"object","description":"GitHub has a run of it, by its id, but did not say its jobs: GitHub's words.","required":["run","message","kind"],"properties":{"kind":{"type":"string","enum":["unread"]},"message":{"type":"string"},"run":{"type":"integer","format":"int64","minimum":0}}},{"type":"object","description":"GitHub has a run of it, by its id, which Berrit could not ask GitHub about: Berrit's words,\nas when the GitHub App no longer reaches the repository.","required":["run","message","kind"],"properties":{"kind":{"type":"string","enum":["unasked"]},"message":{"type":"string"},"run":{"type":"integer","format":"int64","minimum":0}}}],"description":"GitHub's jobs of a run, as GitHub lists them now."},"Land":{"type":"string","description":"A land request (`DESIGN.md §3.7`): none, for the change alone, or for it with the open\nchanges below it in its stack, which are then one unit.","enum":["none","alone","stack"]},"LandNow":{"type":"object","description":"Land now as the change page offers it (decision 148): the request it sends, the change's own\nin force or else `alone`, and what that lands the change over.","required":["land","over"],"properties":{"land":{"$ref":"#/components/schemas/Land"},"over":{"$ref":"#/components/schemas/Waived"}}},"LandRequest":{"type":"object","description":"`POST /repos/{slug}/changes/{n}/land`: the change's land request, which it enters the\ntrain by once it may (`DESIGN.md §3.7`); `none` holds it, withdrawing every request that\ncovers it.","required":["land"],"properties":{"land":{"$ref":"#/components/schemas/Land"},"now":{"oneOf":[{"$ref":"#/components/schemas/Reason","description":"Land now, an owner's or admin's word, and why (decision 148): the train's next move lets in\nwhat the request asks to land over its members' unmet reviews and `push` and `approved`\nchecks, or nothing is done (`conflict`) while anything else holds it. Never with `none`."},{"type":"null"}]}},"additionalProperties":false},"LandUnit":{"type":"object","description":"What one land request takes into the train as one (`DESIGN.md §3.7`): the change that asked,\nand its members not in the train yet, in stack order, it last.","required":["by","members"],"properties":{"by":{"$ref":"#/components/schemas/ChangeNumber"},"members":{"type":"array","items":{"$ref":"#/components/schemas/ChangeNumber"}}}},"Landing":{"allOf":[{"$ref":"#/components/schemas/Phase"},{"type":"object","required":["change","candidate"],"properties":{"candidate":{"$ref":"#/components/schemas/CommitId"},"change":{"$ref":"#/components/schemas/ChangeNumber"}}}],"description":"A landing whose landing steps began (`DESIGN.md §3.7`, decision 130): the change whose\ncandidate lands, everything ahead of it with it, and how far it has got, as its row keeps it."},"LastActivity":{"type":"object","description":"A change's latest activity, as a list's row says it.","required":["kind","at"],"properties":{"at":{"type":"string","format":"date-time"},"by":{"oneOf":[{"$ref":"#/components/schemas/UserId","description":"Who did it; none for what Berrit did by itself."},{"type":"null"}]},"kind":{"$ref":"#/components/schemas/ActivityKind"}}},"LastChange":{"type":"object","description":"A landed change, as the Code tab names the last one to change a path.","required":["number","title","landed_at"],"properties":{"landed_at":{"type":"string","format":"date-time"},"number":{"$ref":"#/components/schemas/ChangeNumber"},"title":{"type":"string","description":"The first line of its message."}}},"Line":{"type":"string"},"LineKind":{"type":"string","enum":["context","add","del"]},"LogGone":{"type":"string","description":"Why Berrit keeps no log of a job GitHub ended (`DESIGN.md §3.5`): it was kept 90 days\n(`expired`); it was among its organisation's oldest past their 1 GiB of logs\n(`over_budget`); or GitHub had none to give, as of a job it skipped (`missing`).","enum":["expired","over_budget","missing"]},"LogGroup":{"type":"object","description":"A group of a log's lines (`##[group]` to `##[endgroup]`), which a viewer folds: from its\nopening line, `start`, up to `end`, the line after its closing one, or the next group's\nopening line, or the log's end; counted from the log's first line, 0.","required":["title","start","end"],"properties":{"end":{"type":"integer","format":"int32","minimum":0},"start":{"type":"integer","format":"int32","minimum":0},"title":{"type":"string"}}},"LogLine":{"type":"object","description":"A line of a log: what it says, as GitHub gave it, secrets masked as GitHub masked them, and the\ntime it is stamped with, where it has one.","required":["text"],"properties":{"at":{"type":["string","null"],"format":"date-time"},"text":{"type":"string"}}},"Made":{"type":"string","description":"What an import makes of a branch's commits: the one commit Berrit writes, of a change of\nits own, or each commit as it is, a change of the id it carries.","enum":["squashed","kept"]},"MadeHook":{"type":"object","description":"A hook just made, and its secret: `whsec_`, then 24 random bytes in base64, which signs\nevery delivery and is never shown again.","required":["hook","secret"],"properties":{"hook":{"$ref":"#/components/schemas/Hook"},"secret":{"type":"string"}}},"MadeWatch":{"type":"object","description":"A watch just made, and its secret, as a hook's: never shown again.","required":["watch","secret"],"properties":{"secret":{"type":"string"},"watch":{"$ref":"#/components/schemas/Watch"}}},"Mapped":{"oneOf":[{"type":"string","enum":["same_revision","gone"]},{"type":"object","required":["line","end_line","moved"],"properties":{"end_line":{"type":"integer","format":"int32","minimum":0},"line":{"type":"integer","format":"int32","minimum":0},"moved":{"type":"boolean"}}}]},"Me":{"type":"object","description":"The caller: who their token says they are, with the name and image of their profile, their\norganisations and the invitations waiting for them: all the web app's shell asks besides the\nrepositories (decision 111). `GET /me`.","required":["id","handle","email","role","kind","name","orgs","invitations"],"properties":{"email":{"$ref":"#/components/schemas/Email"},"handle":{"$ref":"#/components/schemas/Handle"},"id":{"$ref":"#/components/schemas/UserId"},"image":{"type":["string","null"]},"invitations":{"type":"array","items":{"$ref":"#/components/schemas/Invitation"},"description":"The latest first."},"kind":{"$ref":"#/components/schemas/UserKind"},"name":{"type":"string"},"orgs":{"type":"array","items":{"$ref":"#/components/schemas/Membership"},"description":"By slug; an app's is its one."},"role":{"$ref":"#/components/schemas/Role"}}},"MemberVote":{"type":"object","description":"A team member's vote, as their team's request shows it.","required":["user","verdict","revision"],"properties":{"revision":{"$ref":"#/components/schemas/RevisionNumber","description":"The revision voted on."},"user":{"$ref":"#/components/schemas/UserId"},"verdict":{"$ref":"#/components/schemas/Verdict"}}},"Membership":{"type":"object","description":"An organisation of the caller's, their role in it, the name of its one owner, whom anyone\nelse asks to subscribe (decision 121), whether the caller pays it, its standing as\n`GET /repos/{org}/billing` answers it, and its seats (`DESIGN.md §5.6`).","required":["id","slug","name","role","pays","standing","seats"],"properties":{"id":{"$ref":"#/components/schemas/OrgId"},"name":{"type":"string"},"owner":{"type":["string","null"],"description":"None while it has none."},"pays":{"type":"boolean","description":"Whether the caller pays its subscription, which is still billed: Billing is theirs then too,\nfor the card (decisions 121, 125)."},"role":{"$ref":"#/components/schemas/OrgRole"},"seats":{"$ref":"#/components/schemas/Seats"},"slug":{"$ref":"#/components/schemas/OrgSlug"},"standing":{"$ref":"#/components/schemas/Standing"}}},"Message":{"type":"object","description":"An imported change's message as people edit it: what the squash Berrit writes says.","required":["title","body"],"properties":{"body":{"type":"string"},"title":{"type":"string","description":"One line."}}},"NewConfig":{"type":"object","description":"`PUT /repos/{slug}/config` (an owner or admin): the settings Berrit writes as `berrit.toml`\nand `checks.toml` on the default branch, the first line of the one commit it lands them in,\nand `base`, the tip the settings were read at: either file changed since is refused, never\noverwritten (`DESIGN.md §8.1`, decision 72). A null `base` says the form read no commit, as\non an empty repository: the save is then the branch's first commit, refused once it has one.","required":["config","title","base"],"properties":{"base":{"oneOf":[{"$ref":"#/components/schemas/CommitId","description":"Required though nullable, so that a client that forgot it is refused rather than taken\nfor one that read no commit."},{"type":"null"}]},"config":{"$ref":"#/components/schemas/Config"},"title":{"$ref":"#/components/schemas/Line"}},"additionalProperties":false},"NewDraft":{"type":"object","description":"`POST /repos/{slug}/changes/{n}/comments`: a draft, which only its author sees until\ntheir review publishes it. It is on lines `start_line..=end_line` of `path` on `side`, on\nthe file `path`, or, without a path, on the whole change.","required":["revision","body"],"properties":{"body":{"type":"string"},"end_line":{"type":["integer","null"],"format":"int32","minimum":0},"path":{"oneOf":[{"$ref":"#/components/schemas/RepoPath"},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/RevisionNumber"},"root_id":{"type":["string","null"],"format":"uuid","description":"The thread it replies to: a published comment that replies to none."},"side":{"oneOf":[{"$ref":"#/components/schemas/Side"},{"type":"null"}]},"start_line":{"type":["integer","null"],"format":"int32","minimum":0},"via":{"oneOf":[{"$ref":"#/components/schemas/Via","description":"Whom an app heard it from; only an app says so."},{"type":"null"}]}},"additionalProperties":false},"NewHook":{"type":"object","description":"`POST /repos/{slug}/hooks`: a hook to make.","required":["url"],"properties":{"kinds":{"type":"array","items":{"$ref":"#/components/schemas/ActivityKind"},"description":"The kinds of activity to send; none, or none given: every kind."},"url":{"type":"string","description":"`https://` to a public address."}},"additionalProperties":false},"NewInstallation":{"type":"object","description":"`POST /repos/{org}/github/installations`: binds an installation of the instance's GitHub App\nto the organisation, the one the app's callback URL names after an install, or the one picked\nafter a Bind, with the code GitHub gave whoever authorised the app, which proves what they may\nwrite (`DESIGN.md §5.3`, decision 71); or, naming none, lists what the code's user may bind\n([`FreeInstallations`]).","required":["code"],"properties":{"code":{"type":"string","description":"GitHub's single-use code, from the callback URL."},"installation_id":{"type":["integer","null"],"format":"int64","description":"The installation to bind; none to list the code's user's that are bound to nobody."}},"additionalProperties":false},"NewRepo":{"type":"object","description":"`POST /repos`: registers a repo in an organisation, once Berrit can reach it, which Berrit\nthen clones (the organisation's owners and admins).","required":["org","slug","remote_url","default_branch","provider"],"properties":{"default_branch":{"$ref":"#/components/schemas/BranchName"},"org":{"$ref":"#/components/schemas/OrgSlug"},"provider":{"$ref":"#/components/schemas/Provider"},"remote_url":{"type":"string","description":"Where Berrit fetches and pushes. It carries no password: a token belongs to the\nprovider."},"slug":{"$ref":"#/components/schemas/RepoSlug"}},"additionalProperties":false},"NewResult":{"type":"object","description":"`POST /repos/{slug}/checks`: an app's result of its check `name` on `commit`, replacing what\nit posted before.","required":["commit","name","status"],"properties":{"commit":{"$ref":"#/components/schemas/CommitId"},"name":{"$ref":"#/components/schemas/CheckName"},"status":{"$ref":"#/components/schemas/ResultStatus"},"summary":{"oneOf":[{"$ref":"#/components/schemas/Summary","description":"A few lines on how it went."},{"type":"null"}]},"url":{"oneOf":[{"$ref":"#/components/schemas/HttpUrl","description":"Where people see what ran."},{"type":"null"}]}},"additionalProperties":false},"NewWatch":{"type":"object","description":"`POST /me/watches`: a watch to make, on `repo` and its `change`, or on neither: your turn.","required":["url"],"properties":{"change":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"The change of `repo` to watch, by number."},{"type":"null"}]},"kinds":{"type":"array","items":{"$ref":"#/components/schemas/ActivityKind"},"description":"The kinds of activity to send; none, or none given: every kind."},"repo":{"oneOf":[{"$ref":"#/components/schemas/RepoName","description":"The repository to watch, named `org/repo`; none: every change while it is your turn."},{"type":"null"}]},"url":{"type":"string","description":"`https://` to a public address."}},"additionalProperties":false},"NotStarted":{"type":"string","description":"Why a run is not started. While it waits: `Wanted`, for its turn, or `Held`, a change below\nit in its stack having a failed required run on its current revision. For good:\n`Superseded` by a newer revision of its change, or a newer expectation of its check on its\ncommit; `Abandoned` with its change; `Landed`, its change having landed without it; `Left`,\nits candidate gone from the train.","enum":["wanted","held","superseded","abandoned","landed","left"]},"OrgId":{"type":"string"},"OrgKey":{"type":"object","description":"`GET /repos/{org}/key`: the organisation's SSH key (`DESIGN.md §5.2`, decision 46), which the\nforges of its repositories let write, and which signs every commit Berrit writes in them.","required":["public_key"],"properties":{"public_key":{"type":"string","description":"In OpenSSH form, as `authorized_keys` and forges take it."}}},"OrgRole":{"type":"string","description":"A member's role in an organisation, as better-auth's organization plugin names them, the\nlowest first. A `member` row may hold several, comma-separated, the highest of which is the\nrow's; a user with more than one row, which the plugin never makes, holds the lowest of theirs,\nso that a stray row grants nothing.","enum":["member","admin","owner"]},"OrgSlug":{"type":"string"},"Outlook":{"type":"string","description":"What happens when a subscription's period ends.","enum":["trial","renews","ends","lapses"]},"PastEntry":{"type":"object","description":"An entry that landed or was ejected.","required":["change","title","owner","state","checks","entered_at","finished_at"],"properties":{"candidate_commit":{"oneOf":[{"$ref":"#/components/schemas/CommitId"},{"type":"null"}]},"change":{"$ref":"#/components/schemas/ChangeNumber"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/TrainCheck"},"description":"The `train` expectations on the candidate, by check name, `unreported` where no app\nended it before the change left; none when no candidate was written."},"ejection":{"oneOf":[{"$ref":"#/components/schemas/Ejection","description":"Why it was ejected; none when it landed."},{"type":"null"}]},"entered_at":{"type":"string","format":"date-time"},"finished_at":{"type":"string","format":"date-time"},"landed_with":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"The change whose run landed it, when not its own: it landed as an ancestor of that\nrun's candidate, by the same fast-forward."},{"type":"null"}]},"owner":{"$ref":"#/components/schemas/UserId"},"state":{"$ref":"#/components/schemas/TrainEntryState"},"title":{"type":"string","description":"The first line of the current revision's message."}}},"PathStatus":{"type":"string","description":"What a revision did to a file, relative to its parent: a [`PathChange`] without its\ncontents.","enum":["added","modified","deleted","renamed"]},"Phase":{"oneOf":[{"type":"object","required":["phase"],"properties":{"phase":{"type":"string","enum":["steps"]}}},{"type":"object","required":["phase"],"properties":{"phase":{"type":"string","enum":["pushing"]}}},{"type":"object","required":["failed","phase"],"properties":{"failed":{"type":"array","items":{"$ref":"#/components/schemas/CheckName"}},"phase":{"type":"string","enum":["reverting"]}}}],"description":"How far a landing has got, as the row of the entry landing keeps it, written before whatever\nit does (`DESIGN.md §3.7`): its steps running, its candidate pushed once they passed, or, one\nhaving failed, their reverts running, after which it leaves the train for the steps named."},"Provider":{"oneOf":[{"type":"object","description":"The organisation's key over SSH: the forge must let it write. It takes no fields.","required":["kind"],"properties":{"kind":{"type":"string","enum":["ssh"]}}},{"type":"object","description":"A user and a token over HTTP. No response shows the token.","required":["user","token","kind"],"properties":{"kind":{"type":"string","enum":["token"]},"token":{"type":"string"},"user":{"type":"string"}}},{"type":"object","description":"The instance's GitHub App, through one of its installations, whose tokens are minted\nper operation and never stored: none while no installation bound to the organisation\nreaches the repository, which waits for one (decision 109), as Berrit alone sets it; a\nrequest names the installation, and one that names none is refused.","required":["kind"],"properties":{"installation_id":{"type":["integer","null"],"format":"int64"},"kind":{"type":"string","enum":["github_app"]}}}],"description":"How Berrit reaches a repo's forge (`DESIGN.md §5.2`, decision 45). Whatever the provider,\nBerrit signs what it writes with the organisation's key, `GET /repos/{org}/key`."},"ProviderKind":{"type":"string","description":"Which provider a repo uses, without its credentials.","enum":["ssh","token","github_app"]},"PullAuthor":{"type":"object","description":"Who opened a pull request, as GitHub names them.","required":["login","url"],"properties":{"login":{"type":"string"},"url":{"type":"string"}}},"PullRequest":{"type":"object","description":"`GET /repos/{slug}/pulls`: an open pull request on GitHub from a branch of the repository's\nown, other than Berrit's, which may be imported (`POST /import`).","required":["number","title","author","head","base","html_url","updated_at"],"properties":{"author":{"$ref":"#/components/schemas/PullAuthor"},"base":{"$ref":"#/components/schemas/BranchName","description":"The branch it goes into."},"change":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"The open change imported from `head`, if there is one."},{"type":"null"}]},"head":{"$ref":"#/components/schemas/BranchName","description":"The branch it is from."},"html_url":{"type":"string"},"number":{"type":"integer","format":"int64","minimum":0},"title":{"type":"string"},"updated_at":{"type":"string","format":"date-time"}}},"PullRequestLink":{"type":"object","description":"A change's pull request on GitHub: its number, its page as GitHub gives it, and the branch it\nis from.","required":["number","url"],"properties":{"head":{"oneOf":[{"$ref":"#/components/schemas/BranchName","description":"The mirror's branch, `berrit/pr/<first 12 of the change id>`, which Berrit keeps at the\ncurrent revision while the change is open (decision 123), or the one the change was\nimported from, its [`ChangeSummary::branch`]. None where the app named the pull request\nbefore it named the branch too (T251); it names both while the change is open."},{"type":"null"}]},"number":{"type":"integer","format":"int64","minimum":0},"url":{"$ref":"#/components/schemas/HttpUrl"}}},"PushRequest":{"type":"object","description":"`POST /repos/{slug}/push`: commits for review as a git bundle, received as a push of\n`refs/for/<target>` to Berrit's remote is (`DESIGN.md §5.7`, decision 166).","required":["target","bundle"],"properties":{"bundle":{"type":"string","description":"The base64 of `git bundle create change.bundle HEAD ^origin/<target>`: the commits above\nthe target's tip, each with a Change-Id, the bundle naming the stack's top alone; at most\n8 MiB decoded."},"target":{"$ref":"#/components/schemas/BranchName"}},"additionalProperties":false},"PushResponse":{"type":"object","description":"What a push over MCP made, as a push to Berrit's remote says it.","required":["changes","said"],"properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/SentChange"},"description":"Each change the push made, updated or found sent already, parent first."},"said":{"type":"string","description":"What the push says, a line each, as Berrit's remote prints it (`#142 new: …`)."}}},"Quantiles":{"type":"object","description":"The nearest-rank median and 95th percentile of `of` durations, in seconds.","required":["p50","p95","of"],"properties":{"of":{"type":"integer","format":"int32","minimum":0},"p50":{"type":"integer","format":"int64","minimum":0},"p95":{"type":"integer","format":"int64","minimum":0}}},"Queue":{"type":"object","description":"What is in a train and what tests it: what the train page shows of it besides its history,\nand what a change in it carries for its page (decision 111).","required":["entries","runs"],"properties":{"bisecting":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"While a run has failed and the change that made it fail is not known: the change whose\nrun that is. The culprit is among the entries up to it, which the train bisects."},{"type":"null"}]},"entries":{"type":"array","items":{"$ref":"#/components/schemas/TrainEntry"},"description":"Head first."},"landing":{"oneOf":[{"$ref":"#/components/schemas/Landing","description":"The landing under way once its steps began (`DESIGN.md §3.7`)."},{"type":"null"}]},"runs":{"type":"array","items":{"$ref":"#/components/schemas/TrainRun"},"description":"Its runs, in queue order: each tests the candidate of one entry, and so every entry up\nto it, all of which land by one fast-forward when it passes."}}},"Reason":{"type":"string"},"Refusal":{"type":"object","description":"Why a landing waits on the forge, in its own words (decision 147): what the forge and git said\nas the train's last wake failed while it was landing, when, and when the train tries again.","required":["said","at","retry_at"],"properties":{"at":{"type":"string","format":"date-time"},"retry_at":{"type":"string","format":"date-time"},"said":{"type":"string"}}},"Repo":{"type":"object","description":"A registered repo: `GET /repos`, `GET /repos/{slug}`. Its token is never shown: only which\nprovider holds its credentials, and whom they name.","required":["org","slug","remote_url","default_branch","provider","branches","landed","created_at"],"properties":{"branch_head":{"oneOf":[{"$ref":"#/components/schemas/CommitId","description":"Where the default branch pointed when Berrit last looked."},{"type":"null"}]},"branches":{"type":"array","items":{"$ref":"#/components/schemas/BranchName"},"description":"The branches Berrit tracks (`DESIGN.md §7`): the default branch first, then every\ntarget of an open change, in byte order."},"cloned_at":{"type":["string","null"],"format":"date-time","description":"When the cache's clone was made; until then, and again while it is made again, the repo\nis cloning and cannot be used."},"created_at":{"type":"string","format":"date-time"},"default_branch":{"$ref":"#/components/schemas/BranchName"},"github_id":{"type":["integer","null"],"format":"int64","description":"GitHub's id of the repository a `github_app` provider reaches, which a rename or a\ntransfer keeps: none until the installation's listing, Check access or a delivery of\nGitHub's names it (decision 104)."},"installation_id":{"type":["integer","null"],"format":"int64","description":"The GitHub App installation a `github_app` provider goes through."},"landed":{"type":"boolean","description":"Whether a change of it has landed, by the train or outside Berrit: until one has in any\nrepository of a scope, its dashboard is the first run (`docs/ux.md §6.1`)."},"last_check":{"oneOf":[{"$ref":"#/components/schemas/AccessCheck","description":"The last time Berrit asked the forge whether it could reach it, by registering the\nrepo or `POST /repos/{slug}/check`."},{"type":"null"}]},"org":{"$ref":"#/components/schemas/OrgSlug","description":"The organisation it belongs to, within which `slug` names it."},"provider":{"$ref":"#/components/schemas/ProviderKind"},"remote_url":{"type":"string"},"slug":{"$ref":"#/components/schemas/RepoSlug"},"token_user":{"type":["string","null"],"description":"The user a `token` provider signs in as; never its token."}}},"RepoConfig":{"type":"object","description":"`GET /repos/{slug}/config?branch=`: the configuration in force at the tip of a tracked\nbranch, the default branch when none is named.\n\nWhile either error is present the tip's configuration has an error. When its files are\nbroken, what is in force is that of the nearest first-parent ancestor whose configuration\nis valid, within 1,000 first-parent commits (`DESIGN.md §3.4`, decisions 40 and 55); when\nthey only name what the organisation lacks, a team or enough members, they stay in force,\nwhat they lack naming nobody (`§5.5`). Three readings: `config` null, nothing is in force\nand every open change is kept out of the train by `config_broken`; `in_force` null with\n`config` set, the defaults; `in_force` set, the files at that commit, the tip's included.","required":["owners","owners_errors","tip","tree"],"properties":{"config":{"oneOf":[{"$ref":"#/components/schemas/Config","description":"What is in force; none when nothing is."},{"type":"null"}]},"config_error":{"type":["string","null"],"description":"Why the tip's `berrit.toml` or `checks.toml` was rejected, or what they name that the\norganisation lacks."},"in_force":{"oneOf":[{"$ref":"#/components/schemas/CommitId","description":"The commit `config` was read from; none for the defaults, which no file says."},{"type":"null"}]},"owners":{"type":"array","items":{"$ref":"#/components/schemas/RepoPath"},"description":"The `OWNERS` files read at `in_force`, in path order."},"owners_errors":{"type":"array","items":{"type":"string"},"description":"Why the tip's `OWNERS` files were rejected, or what they name that the organisation\nlacks."},"tip":{"$ref":"#/components/schemas/CommitId","description":"The tip it was read at, which a save names as its `base`."},"tree":{"$ref":"#/components/schemas/TreeId","description":"The tip's tree, which the errors are about."}}},"RepoName":{"type":"string"},"RepoPatch":{"type":"object","description":"`PATCH /repos/{slug}`: what to change (the organisation's owners and admins). An absent field keeps its value; a provider\nreplaces the old one whole.","properties":{"default_branch":{"oneOf":[{"$ref":"#/components/schemas/BranchName"},{"type":"null"}]},"provider":{"oneOf":[{"$ref":"#/components/schemas/Provider"},{"type":"null"}]},"reclone":{"type":"boolean","description":"Rebuild the cache's clone from the forge, in the background; the repo reads as cloning\nuntil it is done."},"remote_url":{"type":["string","null"]}},"additionalProperties":false},"RepoPath":{"type":"string"},"RepoSlug":{"type":"string"},"Required":{"type":"object","description":"A review asked as required (decision 170, T286): of whom, and whose approval meets it, the\nperson or named agent asked, or the members of the team asked.","required":["who","by"],"properties":{"by":{"type":"array","items":{"$ref":"#/components/schemas/UserId"},"uniqueItems":true},"who":{"$ref":"#/components/schemas/ReviewerId"}}},"RequiredStatus":{"allOf":[{"$ref":"#/components/schemas/Required"},{"type":"object","required":["met"],"properties":{"met":{"type":"boolean"}}}],"description":"A required review as the check finds it, `by` only those of its own whose approval would\ncount, members who may vote on the change ([`may_vote_in`]), none where it could never be met:\nmet once one of them approved."},"Resolve":{"type":"object","description":"`POST /repos/{slug}/changes/{n}/threads/{root}/resolve`.","required":["resolved"],"properties":{"resolved":{"type":"boolean"}},"additionalProperties":false},"ResultStatus":{"type":"string","description":"What an app says of a check on a commit: `Running` until it ends as `Passed`, `Failed`\nor `Error`.","enum":["running","passed","failed","error"]},"ReviewRequest":{"type":"object","description":"`POST /repos/{slug}/changes/{n}/review`: publishes all the caller's drafts on the change,\nwith an optional vote and message, as one review.","properties":{"message":{"type":["string","null"]},"resolve":{"type":"array","items":{"type":"string","format":"uuid"},"description":"The threads, by root comment, that the review resolves."},"via":{"oneOf":[{"$ref":"#/components/schemas/Via","description":"Whom an app heard the message from; only an app says so, and then with no vote."},{"type":"null"}]},"vote":{"oneOf":[{"$ref":"#/components/schemas/Verdict","description":"An author cannot vote on their own change, nor a person driving an agent that is one,\nunless `review.self_approval` is on: its owner, or whoever pushed a revision of it."},{"type":"null"}]}},"additionalProperties":false},"ReviewSettings":{"type":"object","properties":{"approval_after_edit":{"$ref":"#/components/schemas/ApprovalAfterEdit","default":"keep"},"require_resolved_threads":{"type":"boolean","default":true},"self_approval":{"type":"boolean","default":false}},"additionalProperties":false},"ReviewStatus":{"type":"object","required":["rules","blocked_by","unresolved_threads","passes"],"properties":{"blocked_by":{"type":"array","items":{"$ref":"#/components/schemas/UserId"}},"passes":{"type":"boolean","description":"Whether the review check passes; the train reads nothing else."},"required":{"type":"array","items":{"$ref":"#/components/schemas/RequiredStatus"},"description":"One per review asked as required, in input order: one unmet holds the change whatever the\nrules count (decision 170); none from an older server."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/RuleStatus"},"description":"One per input rule, in input order."},"unresolved_threads":{"type":"integer","format":"int32","minimum":0}}},"Reviewer":{"type":"object","description":"A reviewer, or someone else who voted, and their current vote.","required":["user"],"properties":{"user":{"$ref":"#/components/schemas/UserId"},"vote":{"oneOf":[{"$ref":"#/components/schemas/Vote"},{"type":"null"}]}}},"ReviewerId":{"oneOf":[{"type":"object","required":["person"],"properties":{"person":{"$ref":"#/components/schemas/UserId"}}},{"type":"object","required":["team"],"properties":{"team":{"$ref":"#/components/schemas/TeamId"}}}],"description":"Whom a review was requested from: a person, or a team of the organisation (`DESIGN.md\n§3.4`), which is asked as a whole and whose turn it never is (`§3.9`)."},"ReviewerName":{"type":"string"},"ReviewersEdit":{"type":"object","description":"`POST /repos/{slug}/changes/{n}/reviewers`: whom to ask, whose approval to require, whose to\nrequire no longer, and whom to ask no longer (`DESIGN.md §3.4`).","properties":{"add":{"type":"array","items":{"$ref":"#/components/schemas/ReviewerName"}},"lift":{"type":"array","items":{"$ref":"#/components/schemas/ReviewerName"},"description":"Requests whose mark is lifted, still asked: only whoever marked it, the change's owner, or\nan owner or admin of the organisation lifts one, and only they take a required reviewer\noff with `remove`."},"remove":{"type":"array","items":{"$ref":"#/components/schemas/ReviewerName"}},"required":{"type":"array","items":{"$ref":"#/components/schemas/ReviewerName"},"description":"Asked as `add` asks, each request marked required: nothing lands until that person, a\nmember of that team or that agent approved, whatever the rules count (decision 170). One\nwhose approval could never count on the change is refused."}},"additionalProperties":false},"ReviewersEdited":{"type":"object","required":["unmatched_reviewers"],"properties":{"unmatched_reviewers":{"type":"array","items":{"$ref":"#/components/schemas/ReviewerName"},"description":"The reviewers to add whom the organisation has not, and those to remove whom the change\nhas not."}}},"RevisionKind":{"type":"string","description":"`Initial` for a change's first revision; `Rebase` when the patch is unchanged (a\nmessage-only change included); `Edit` when the patch changed.","enum":["initial","rebase","edit"]},"RevisionNumber":{"type":"integer","format":"int32","description":"A revision's number within its change. Numbering starts at 1.","minimum":0},"RevisionSummary":{"type":"object","required":["number","kind","message_changed","commit","parent","pushed_by","pushed_at"],"properties":{"commit":{"$ref":"#/components/schemas/CommitId"},"kind":{"$ref":"#/components/schemas/RevisionKind"},"message_changed":{"type":"boolean"},"number":{"$ref":"#/components/schemas/RevisionNumber"},"parent":{"$ref":"#/components/schemas/CommitId"},"pushed_at":{"type":"string","format":"date-time"},"pushed_by":{"$ref":"#/components/schemas/UserId"},"source_commit":{"oneOf":[{"$ref":"#/components/schemas/CommitId","description":"The branch tip it was squashed from when it was imported, whose results count for it;\nnone when it was sent (`DESIGN.md §3.2`, `§3.5`)."},{"type":"null"}]}}},"Role":{"type":"string","description":"What a user may do: better-auth's admin-plugin role, carried in every token's `role` claim.","enum":["user","admin"]},"Rule":{"type":"object","description":"When any touched path matches `paths`, `count` distinct `approvers` must approve.\n`approvers` is never empty: such a rule could never be satisfied.","required":["paths","approvers","count"],"properties":{"approvers":{"$ref":"#/components/schemas/ApproverSet"},"count":{"type":"integer","format":"int32","minimum":1},"paths":{"$ref":"#/components/schemas/Globs"}},"additionalProperties":false},"RuleStatus":{"type":"object","required":["rule","applies","have","need","satisfied_by"],"properties":{"applies":{"type":"boolean"},"files":{"type":"array","items":{"$ref":"#/components/schemas/RepoPath"},"description":"The files it applies to, those whose path its patterns match, a renamed one's old path\nor new, each at its path now and sorted by path, which the change page lists on asking\n(decision 144); none from an older server."},"have":{"type":"integer","format":"int32","minimum":0},"need":{"type":"integer","format":"int32","minimum":0},"rule":{"$ref":"#/components/schemas/Rule"},"satisfied_by":{"type":"array","items":{"$ref":"#/components/schemas/UserId"},"description":"The distinct counting approvers the rule admits, by id, in id order."}}},"RunCounts":{"type":"object","description":"Runs by how they ended (`RunOutcome`), and those still in flight.","required":["passed","failed","implied","given_up","in_flight"],"properties":{"failed":{"type":"integer","format":"int32","minimum":0},"given_up":{"type":"integer","format":"int32","minimum":0},"implied":{"type":"integer","format":"int32","minimum":0},"in_flight":{"type":"integer","format":"int32","minimum":0},"passed":{"type":"integer","format":"int32","minimum":0}}},"RunJob":{"type":"object","description":"A job of a run on GitHub, as Berrit reads its state, with GitHub's word for it.","required":["id","name","status","said","steps"],"properties":{"completed_at":{"type":["string","null"],"format":"date-time"},"id":{"type":"integer","format":"int64","description":"GitHub's id of it, by which its log is asked for.","minimum":0},"name":{"type":"string"},"said":{"type":"string","description":"GitHub's word for it: its conclusion once completed, else its status."},"started_at":{"type":["string","null"],"format":"date-time"},"status":{"$ref":"#/components/schemas/JobStatus"},"steps":{"type":"array","items":{"$ref":"#/components/schemas/RunStep"},"description":"Its steps, in GitHub's order, each read as a job is: how it goes while it runs, as GitHub\ngives its log only once it ends."},"url":{"oneOf":[{"$ref":"#/components/schemas/HttpUrl","description":"Its log on GitHub."},{"type":"null"}]}}},"RunRow":{"type":"object","description":"A run, of one check at one trigger on one commit of a change.","required":["change","title","target","name","trigger","commit","requested_at","status"],"properties":{"change":{"$ref":"#/components/schemas/ChangeNumber"},"commit":{"$ref":"#/components/schemas/CommitId"},"held_by":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"Of a run held, the change below it in its stack whose required run failed."},{"type":"null"}]},"name":{"$ref":"#/components/schemas/CheckName"},"not_started":{"oneOf":[{"$ref":"#/components/schemas/NotStarted","description":"Why it is not started, while it waits; none once started."},{"type":"null"}]},"place":{"type":["integer","null"],"format":"int32","description":"Of a run wanted, its place in the order the repository's waiting runs start, 1 the next:\nthe one place every page says.","minimum":0},"requested_at":{"type":"string","format":"date-time"},"stacked_on":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"The change below it in its stack, if it is stacked on one."},{"type":"null"}]},"started_at":{"type":["string","null"],"format":"date-time","description":"When Berrit started it; none while it waits."},"status":{"$ref":"#/components/schemas/CheckStatus","description":"How it stands: `pending` while it waits and until its app says it runs, `running` then."},"target":{"$ref":"#/components/schemas/BranchName"},"title":{"type":"string","description":"Its change's title."},"trigger":{"$ref":"#/components/schemas/Trigger"}}},"RunStep":{"type":"object","description":"A step of a job on GitHub, as Berrit reads its state, with GitHub's word for it.","required":["name","status","said"],"properties":{"completed_at":{"type":["string","null"],"format":"date-time"},"name":{"type":"string"},"said":{"type":"string"},"started_at":{"type":["string","null"],"format":"date-time"},"status":{"$ref":"#/components/schemas/JobStatus"}}},"Runs":{"type":"object","required":["waiting","started","counts"],"properties":{"counts":{"$ref":"#/components/schemas/RunsByState"},"started":{"type":"array","items":{"$ref":"#/components/schemas/RunRow"},"description":"The runs started that `[github] at_once` counts: of an open change's current revision or\nthe candidate it is in the train as, with no result of their check ended since they\nstarted."},"waiting":{"type":"array","items":{"$ref":"#/components/schemas/RunRow"},"description":"The runs not started that may still start, in the order they will: the wanted, then the\nheld."}}},"RunsByState":{"type":"object","description":"How many runs are started, and how many are not, by why: those waiting now, every one that\nended without starting, and every one whose dispatch GitHub refused.","required":["started","wanted","held","superseded","abandoned","landed","left","refused"],"properties":{"abandoned":{"type":"integer","format":"int32","minimum":0},"held":{"type":"integer","format":"int32","minimum":0},"landed":{"type":"integer","format":"int32","minimum":0},"left":{"type":"integer","format":"int32","minimum":0},"refused":{"type":"integer","format":"int32","minimum":0},"started":{"type":"integer","format":"int32","minimum":0},"superseded":{"type":"integer","format":"int32","minimum":0},"wanted":{"type":"integer","format":"int32","minimum":0}}},"Seats":{"type":"object","description":"An organisation's seats (decision 141): as many as its subscription bills, `bought`,\none where it has none; those its people hold, `used`; and those its invitations still open\nhold, `invited`, one each until answered. Where Berrit bills, the web app invites nobody beyond\n`bought`; apps hold none.","required":["bought","used","invited"],"properties":{"bought":{"type":"integer","format":"int32","minimum":0},"invited":{"type":"integer","format":"int32","minimum":0},"used":{"type":"integer","format":"int32","minimum":0}}},"SendCommit":{"type":"object","required":["commit","change_id"],"properties":{"change_id":{"$ref":"#/components/schemas/ChangeId"},"commit":{"$ref":"#/components/schemas/CommitId"}},"additionalProperties":false},"SendRequest":{"type":"object","description":"`POST /repos/{slug}/send`: registers commits pushed to the forge at\n`refs/berrit/<change_id>/<commit>` as changes and revisions (`DESIGN.md §5.2`).","required":["target","commits"],"properties":{"commits":{"type":"array","items":{"$ref":"#/components/schemas/SendCommit"},"description":"The stack, parent first."},"land":{"type":"boolean","description":"Whether a new change enters the train once it may; an existing change keeps its own."},"reviewers":{"type":["array","null"],"items":{"$ref":"#/components/schemas/ReviewerName"},"description":"Who reviews: absent, a new change gets suggested reviewers."},"target":{"$ref":"#/components/schemas/BranchName"}},"additionalProperties":false},"SendResponse":{"type":"object","required":["changes","unmatched_reviewers"],"properties":{"changes":{"type":"array","items":{"$ref":"#/components/schemas/SentChange"},"description":"One per commit sent, in the request's order."},"unfollowed":{"type":["string","null"],"description":"For an import from the web whose tip's change is someone else's, made for their address:\nthat Berrit follows the branch's moves once they import it or push it through the remote\n(`DESIGN.md §3.2`)."},"unmatched_reviewers":{"type":"array","items":{"$ref":"#/components/schemas/ReviewerName"},"description":"Reviewers, asked for or suggested, whom the organisation has not, and so were not added."}}},"SentChange":{"type":"object","description":"A change as a send left it. A commit sent before gives the change as it is.","required":["number","change_id","revision","kind","message_changed","state","url","created"],"properties":{"change_id":{"$ref":"#/components/schemas/ChangeId"},"created":{"type":"boolean","description":"Whether this send registered the revision: false when the commit was already the\nchange's current revision or its landed commit (`DESIGN.md §7`)."},"kind":{"$ref":"#/components/schemas/RevisionKind"},"message_changed":{"type":"boolean"},"number":{"$ref":"#/components/schemas/ChangeNumber"},"revision":{"$ref":"#/components/schemas/RevisionNumber"},"state":{"$ref":"#/components/schemas/ChangeState"},"url":{"type":"string","description":"The change's page: `BERRIT_PUBLIC_URL/r/<org>/<repo>/c/<number>`."}}},"SentRevision":{"type":"object","description":"Revision `revision` of change `number`.","required":["number","revision"],"properties":{"number":{"$ref":"#/components/schemas/ChangeNumber"},"revision":{"$ref":"#/components/schemas/RevisionNumber"}}},"Side":{"type":"string","description":"The side of a diff a comment's lines are on: the parent's file or the revision's.","enum":["old","new"]},"Stack":{"type":"object","description":"The changes that parent commits link the change with, in landing order: below it, its\nparent last; above it, what is stacked on it, each after the change it is stacked on. The\nwalk down goes through open changes and stops at the first that is not.","required":["ancestors","descendants"],"properties":{"ancestors":{"type":"array","items":{"$ref":"#/components/schemas/StackEntry"}},"descendants":{"type":"array","items":{"$ref":"#/components/schemas/StackEntry"}}}},"StackEntry":{"type":"object","required":["repo","number","title","state","target","waiting_for","blockers"],"properties":{"blockers":{"type":"array","items":{"$ref":"#/components/schemas/Blocker"},"description":"As [`ChangeSummary::blockers`], so the column and the Landing panel never disagree."},"number":{"$ref":"#/components/schemas/ChangeNumber"},"repo":{"$ref":"#/components/schemas/RepoSlug"},"state":{"$ref":"#/components/schemas/ChangeState"},"target":{"$ref":"#/components/schemas/BranchName","description":"The branch it lands on: a unit lands on one (`DESIGN.md §3.7`)."},"title":{"type":"string"},"train_position":{"type":["integer","null"],"format":"int32","description":"Its place in its target's train while it is in it, 1 at the head.","minimum":0},"waiting_for":{"type":"array","items":{"$ref":"#/components/schemas/ChangeRef"},"description":"Its explicit dependencies that have not landed."}}},"StackPlace":{"type":"object","description":"Where a change stands in its stack: `position` of `size` open changes, 1 at the bottom.","required":["position","size"],"properties":{"position":{"type":"integer","format":"int32","minimum":0},"size":{"type":"integer","format":"int32","minimum":0}}},"StackState":{"type":"object","description":"A stack as it stood at `at`, an instant at which a member's revision was sent: what\n`against` names in a stack view.","required":["at","before"],"properties":{"at":{"type":"string","format":"date-time"},"before":{"type":"array","items":{"$ref":"#/components/schemas/SentRevision"},"description":"What was sent next, which names the state: \"before #141 r2\"."}}},"Stage":{"oneOf":[{"type":"object","required":["failed","stop"],"properties":{"failed":{"type":"boolean"},"stop":{"type":"string","enum":["reviewed"]}}},{"type":"object","required":["failed","stop"],"properties":{"failed":{"type":"boolean"},"stop":{"type":"string","enum":["checks"]}}},{"type":"object","required":["failed","stop"],"properties":{"failed":{"type":"boolean"},"stop":{"type":"string","enum":["train"]}}},{"type":"object","required":["stop"],"properties":{"stop":{"type":"string","enum":["landed"]}}}],"description":"Where a change is on its way to its target, the rail of `docs/ux.md §6.1` after Sent, which\nevery change has passed: the stop it is at, and whether it failed there."},"Standing":{"oneOf":[{"type":"object","description":"The instance bills nobody.","required":["standing"],"properties":{"standing":{"type":"string","enum":["free"]}}},{"type":"object","description":"A subscription is in force until `until`, when `outlook` happens; its agent seats, those\nin force, seat its oldest `agent_seats` agents.","required":["until","outlook","agent_seats","standing"],"properties":{"agent_seats":{"type":"integer","format":"int32","minimum":0},"outlook":{"$ref":"#/components/schemas/Outlook"},"standing":{"type":"string","enum":["subscribed"]},"until":{"type":"string","format":"date-time"}}},{"type":"object","description":"No subscription is in force: none yet, or one that ended. It keeps its Billing and its\nsettings alone.","required":["standing"],"properties":{"standing":{"type":"string","enum":["unpaid"]}}}],"description":"Whether an organisation is served (`DESIGN.md §5.6`), and so may land (§3.7, condition 8)."},"SuggestedPerson":{"type":"object","description":"A person offered, and the places in `rules` of those they answer.","required":["user","answers"],"properties":{"answers":{"type":"array","items":{"type":"integer","minimum":0}},"user":{"$ref":"#/components/schemas/UserId"}}},"SuggestedReviewers":{"type":"object","description":"`GET /repos/{slug}/changes/{n}/reviewers/suggested`: whom Add a reviewer offers before anyone\nelse (decision 157), from the configuration at the change's target resolved against the\norganisation (`DESIGN.md §5.5`).","required":["rules","people","teams","users"],"properties":{"people":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedPerson"},"description":"The people they name, by the sum of the weights of the rules naming them, the heaviest\nfirst, then by email."},"rules":{"type":"array","items":{"$ref":"#/components/schemas/RuleStatus"},"description":"The rules that apply and are not met naming a member whose approval could still count,\nthe change's owner aside, and whoever pushed a revision of it while `review.self_approval`\nis off, in the review check's order."},"teams":{"type":"array","items":{"$ref":"#/components/schemas/SuggestedTeam"},"description":"The teams they name, by weight alike, then by name."},"users":{"type":"object","additionalProperties":{"$ref":"#/components/schemas/User"},"propertyNames":{"type":"string"}}}},"SuggestedTeam":{"type":"object","description":"A team offered, and the places in `rules` of those naming it that one of its members answers.","required":["id","name","answers"],"properties":{"answers":{"type":"array","items":{"type":"integer","minimum":0}},"id":{"$ref":"#/components/schemas/TeamId"},"name":{"$ref":"#/components/schemas/TeamName"}}},"Summary":{"type":"string"},"TeamId":{"type":"string"},"TeamName":{"type":"string"},"TeamReviewer":{"type":"object","description":"A team asked to review, by its name in the organisation, and the latest vote one of its\nmembers cast, standing: one on the current revision meets the request.","required":["id","name"],"properties":{"id":{"$ref":"#/components/schemas/TeamId"},"name":{"$ref":"#/components/schemas/TeamName"},"vote":{"oneOf":[{"$ref":"#/components/schemas/MemberVote"},{"type":"null"}]}}},"Train":{"allOf":[{"$ref":"#/components/schemas/Queue"},{"type":"object","required":["tip","window","history","users"],"properties":{"held":{"oneOf":[{"$ref":"#/components/schemas/Held","description":"What holds it, while something does: nothing runs or lands on it until an owner or admin\nreleases it (`DESIGN.md §3.7`)."},{"type":"null"}]},"history":{"type":"array","items":{"$ref":"#/components/schemas/PastEntry"},"description":"The last 50 entries to land or be ejected, the latest first."},"tip":{"$ref":"#/components/schemas/CommitId","description":"The target's head as Berrit last saw it."},"users":{"type":"object","description":"The owners of the changes it names who have an account.","additionalProperties":{"$ref":"#/components/schemas/User"},"propertyNames":{"type":"string"}},"window":{"$ref":"#/components/schemas/Window","description":"How many runs it keeps in flight at once: `[train] window` at the tip."}}}]},"TrainCheck":{"type":"object","description":"A check's latest expectation and how its result stands, as the train shows it.","required":["name","status","requested_at"],"properties":{"finished_at":{"type":["string","null"],"format":"date-time"},"name":{"$ref":"#/components/schemas/CheckName"},"requested_at":{"type":"string","format":"date-time"},"started_at":{"type":["string","null"],"format":"date-time"},"status":{"$ref":"#/components/schemas/CheckStatus"},"url":{"oneOf":[{"$ref":"#/components/schemas/HttpUrl"},{"type":"null"}]}}},"TrainEntry":{"type":"object","required":["position","change","title","owner","revision","state","unit","before","checks","entered_at"],"properties":{"before":{"type":"array","items":{"$ref":"#/components/schemas/TrainCheck"},"description":"The latest `push` and `approved` expectations on `revision` of the checks matching\nit, in declaration order, as its page's Checks panel shows them: what it passed before\nthe train, every required one among them, and how any optional one went."},"candidate_commit":{"oneOf":[{"$ref":"#/components/schemas/CommitId"},{"type":"null"}]},"change":{"$ref":"#/components/schemas/ChangeNumber"},"checks":{"type":"array","items":{"$ref":"#/components/schemas/TrainCheck"},"description":"The `train` expectations on the candidate, in declaration order."},"entered_at":{"type":"string","format":"date-time"},"owner":{"$ref":"#/components/schemas/UserId"},"position":{"type":"integer","format":"int32","description":"1 at the head.","minimum":0},"revision":{"$ref":"#/components/schemas/RevisionNumber","description":"The current revision: the one in the train."},"run":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"The change of the run that carries it: the run on its candidate, its own or, when it\nchanges nothing on the one ahead, that one's; else the nearest later entry's whose\ncandidate one tests; none while no run does."},{"type":"null"}]},"state":{"$ref":"#/components/schemas/TrainEntryState"},"title":{"type":"string","description":"The first line of the current revision's message."},"unit":{"$ref":"#/components/schemas/ChangeNumber","description":"The change whose land request entered it: its own, or the one above it in its stack that\nasked with the stack below it (`DESIGN.md §3.7`)."}}},"TrainEntryState":{"type":"string","description":"A stored train entry's state: `Queued` and `Testing` entries are in the train, `Testing`\nwhile a run is on its own candidate; `Landed` and `Ejected` have left it.","enum":["queued","testing","landed","ejected"]},"TrainNumbers":{"type":"object","description":"`GET /repos/{slug}/train/{branch}/numbers`: what the train did over the last `days`, or since\nits ledger began if that is later, every figure a count or a quantile of its rows over that\none span (`DESIGN.md §3.7`, decision 99). A figure of nothing, a ratio over no landing or a\nquantile of no entry, is null, never a zero that reads as a fact.","required":["days","landed","runs","ejected","retries"],"properties":{"days":{"$ref":"#/components/schemas/Days"},"ejected":{"$ref":"#/components/schemas/Ejections","description":"The entries ejected, by why; those dequeued, their authors' doing, are not counted."},"landed":{"type":"integer","format":"int32","description":"The entries that landed.","minimum":0},"ready_to_landed":{"oneOf":[{"$ref":"#/components/schemas/Quantiles","description":"Seconds from entering the train to landing, of each entry that landed."},{"type":"null"}]},"retries":{"type":"integer","format":"int32","description":"The entries that entered again on the revision an earlier ejection for failed checks let\ngo, and left since, landed or ejected: the author's retry (decision 99). Both the retry\nand that ejection are in the window: one whose ejection is older is not counted.","minimum":0},"runner_minutes_per_landed":{"type":["number","null"],"format":"double","description":"The minutes the train checks took on the runs' candidates, as their apps reported them,\nover the entries that landed; null while no result says both when it started and when\nit ended."},"runs":{"$ref":"#/components/schemas/RunCounts","description":"The runs that began, by how they ended."},"runs_per_landed":{"type":["number","null"],"format":"double","description":"The runs that began over the entries that landed."},"sent_to_landed":{"oneOf":[{"$ref":"#/components/schemas/Quantiles","description":"Seconds from the landed revision's sending to its landing, of each entry that landed."},{"type":"null"}]},"since":{"type":["string","null"],"format":"date-time","description":"Where the window starts while that is later than `days` ago: when the train's first run\nbegan, as no run before it was counted, or now, while it has run nothing. None while it\nstarts `days` ago."}}},"TrainRun":{"type":"object","description":"A run of the train: one candidate under test, or with a verdict.","required":["change","candidate","carries","since","failed"],"properties":{"candidate":{"$ref":"#/components/schemas/CommitId"},"carries":{"type":"array","items":{"$ref":"#/components/schemas/ChangeNumber"},"description":"Every change its candidate holds, the head first and `change` last: what lands if it\npasses."},"change":{"$ref":"#/components/schemas/ChangeNumber","description":"The change whose candidate it tests."},"failed":{"type":"boolean","description":"Whether its checks failed: the train then looks for the culprit among what it carries."},"refused":{"oneOf":[{"$ref":"#/components/schemas/Refusal","description":"While its candidate, passed, waits on the forge to land: what the forge said as the train\nlast tried (decision 147)."},{"type":"null"}]},"since":{"type":"string","format":"date-time","description":"When it began."}}},"TrainSettings":{"type":"object","properties":{"window":{"$ref":"#/components/schemas/Window","default":1}},"additionalProperties":false},"TrainSpot":{"type":"object","description":"A change's entry in its target's train.","required":["position","state"],"properties":{"candidate_commit":{"oneOf":[{"$ref":"#/components/schemas/CommitId","description":"The commit its `train` checks run on, once written."},{"type":"null"}]},"position":{"type":"integer","format":"int32","description":"1 at the head.","minimum":0},"reason":{"type":["string","null"]},"state":{"$ref":"#/components/schemas/TrainEntryState"}}},"TrainSummary":{"type":"object","description":"The train into a change's target as the change's page says it (decision 124): how many of its\nentries no run in flight carries, and the change whose candidate each run in flight tests, in\nqueue order.","required":["waiting","testing"],"properties":{"testing":{"type":"array","items":{"$ref":"#/components/schemas/ChangeNumber"}},"waiting":{"type":"integer","format":"int32","minimum":0}}},"Tree":{"type":"object","description":"`GET /repos/{slug}/tree/{branch}/{path}`: one directory at the tip of any branch the forge\nhas, its directories first, then the rest, each by name (`DESIGN.md §7`, decision 48).","required":["branch","commit","entries"],"properties":{"branch":{"$ref":"#/components/schemas/BranchName"},"commit":{"$ref":"#/components/schemas/CommitId","description":"The branch's tip, where the directory was read: as Berrit last saw it for a branch it\ntracks, else as the forge had it when asked."},"entries":{"type":"array","items":{"$ref":"#/components/schemas/TreeEntry"}},"last_change":{"oneOf":[{"$ref":"#/components/schemas/LastChange","description":"The change that landed as the newest commit to change the path, if a change did."},{"type":"null"}]},"path":{"oneOf":[{"$ref":"#/components/schemas/RepoPath","description":"None for the root."},{"type":"null"}]}}},"TreeEntry":{"type":"object","required":["name","kind"],"properties":{"kind":{"$ref":"#/components/schemas/EntryKind"},"name":{"type":"string"},"size":{"type":["integer","null"],"format":"int64","description":"A file's size in bytes; none for the other kinds.","minimum":0}}},"TreeId":{"type":"string"},"Trigger":{"type":"string","description":"When Berrit expects a check: on each pushed revision, once a revision is approved, or on\nthe train's candidate.","enum":["push","approved","train"]},"Turn":{"type":"object","description":"One user whose turn it is.","required":["user","reason","since","kind"],"properties":{"kind":{"$ref":"#/components/schemas/TurnKind"},"reason":{"type":"string"},"since":{"type":"string","format":"date-time"},"user":{"$ref":"#/components/schemas/UserId"}}},"TurnKind":{"type":"string","description":"How it is someone's turn (decision 142).","enum":["asked","due","watching"]},"UnclaimedInstallation":{"type":"object","description":"An installation of the instance's GitHub App that nobody bound: one GitHub announced, offered\nto whoever installed it, or one GitHub names a code's user's, which they may bind (decisions\n71 and 109).","required":["installation_id"],"properties":{"account":{"type":["string","null"],"description":"The GitHub account it is installed on."},"installation_id":{"type":"integer","format":"int64"}}},"User":{"type":"object","description":"A user as others see them, from better-auth's `user` table: `GET /users`. A person is known\nby their handle, shown as `@handle` (decision 131); a named agent by its slug in its\norganisation, in the handle's place (decision 163).","required":["id","handle","email","name","kind"],"properties":{"email":{"$ref":"#/components/schemas/Email"},"handle":{"$ref":"#/components/schemas/Handle"},"id":{"$ref":"#/components/schemas/UserId"},"image":{"type":["string","null"]},"kind":{"$ref":"#/components/schemas/UserKind"},"name":{"type":"string"}}},"UserId":{"type":"string"},"UserKind":{"type":"string","description":"Whether a user is a person, an app, a program acting through the API as itself, or a named\nagent, an organisation's own identity acting only as a person driving it makes it act\n(`DESIGN.md §5.3`, decision 163): better-auth's additional field, carried in every session\ntoken's `kind` claim.","enum":["person","app","agent"]},"Verdict":{"type":"string","description":"A reviewer's vote. Request changes is sticky until the same reviewer votes again.","enum":["approve","request_changes"]},"Via":{"type":"object","description":"Where an app heard what it posts, by the source's own name and a link to it: an app never\nacts for a person, and a name elsewhere is no Berrit user (`DESIGN.md §5.3`, decision 60).","required":["name","url"],"properties":{"name":{"$ref":"#/components/schemas/ViaName"},"url":{"$ref":"#/components/schemas/HttpUrl"}},"additionalProperties":false},"ViaName":{"type":"string"},"Vote":{"type":"object","required":["verdict","revision","at"],"properties":{"at":{"type":"string","format":"date-time"},"dismissed_by":{"oneOf":[{"$ref":"#/components/schemas/UserId","description":"The admin who dismissed it, if one did; a dismissed vote counts for nothing."},{"type":"null"}]},"github":{"oneOf":[{"$ref":"#/components/schemas/VoteFromGithub","description":"The review on GitHub that gave it, if one did (decision 118)."},{"type":"null"}]},"revision":{"$ref":"#/components/schemas/RevisionNumber","description":"The revision voted on."},"verdict":{"$ref":"#/components/schemas/Verdict"}}},"VoteFromGithub":{"type":"object","description":"A vote given on GitHub: GitHub's id of the review, and whether the GitHub account that gave it\nis still its voter's, while which alone it counts.","required":["review","connected"],"properties":{"connected":{"type":"boolean"},"review":{"type":"integer","format":"int64"}}},"Waived":{"type":"object","description":"What an owner's or admin's word lands a change over (decision 148): its review check, unmet,\nand the checks before the train it waits on, by name, apart, so that no check is the review.","required":["review","checks"],"properties":{"checks":{"type":"array","items":{"$ref":"#/components/schemas/CheckName"}},"review":{"type":"boolean"}}},"Watch":{"type":"object","description":"A watch (`DESIGN.md §5.4`, decision 167): a hook of the caller's own, or of the named agent\nthey made it as, on a change, a repository, or neither, every change while it is the owner's\nturn; sent what happens there that its owner may read when it is sent, as a hook is. No answer\nshows its secret but the one that made it.","required":["id","url","kinds","owner","created","state"],"properties":{"change":{"oneOf":[{"$ref":"#/components/schemas/ChangeNumber","description":"The change of that repository it is on."},{"type":"null"}]},"created":{"type":"string","format":"date-time"},"id":{"type":"string","format":"uuid"},"kinds":{"type":"array","items":{"$ref":"#/components/schemas/ActivityKind"},"description":"The kinds of activity it is sent; none: every kind."},"owner":{"$ref":"#/components/schemas/User","description":"Whose it is: the person, or the named agent they drove as they made it."},"repo":{"oneOf":[{"$ref":"#/components/schemas/RepoName","description":"The repository it is on; none: the changes whose turn is its owner's."},{"type":"null"}]},"state":{"$ref":"#/components/schemas/HookState"},"url":{"type":"string"},"via":{"oneOf":[{"$ref":"#/components/schemas/Credential","description":"The agent's connection, or the API key, it was made through, by name now, as an act's\n`via` reads (decision 119): it is sent nothing once that is disconnected or revoked. None\nfor one made signed in, which lives until it is deleted."},{"type":"null"}]}}},"Window":{"type":"integer","format":"int32","description":"How many runs a train keeps in flight at once: `[train] window` in `berrit.toml`, 1 to 8\n(`DESIGN.md §8.1`). It bounds the runs without a verdict, and so what a repository spends\non testing; it never says how many entries are tested, as a run tests everything up to its\ncandidate.","maximum":8,"minimum":1},"Workflow":{"type":"string"}},"securitySchemes":{"bearer":{"type":"http","scheme":"bearer","bearerFormat":"JWT"}}},"security":[{"bearer":[]}]}