gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Main branchmainfe209ffeMerge branch 'w56-owner-members' into mainGitoriamain/docs/apps-api.md

27.6 KB

  1. # Gitoria apps API: the contract (gitoria#38, children #40–#47)
  2. Version 1.10, 2026-11-23. Open points decided by the external reviewer (the reference for open questions, review: docs/apps-api-review.md). v1.2.1 is live (#40–#44, #46); the v1.3 additions come with #47. This file is the contract that gitoria is built against and Kunibert codes against.
  3. Marks: **[OPEN]** = the name or value may still change; everything else is fixed. Any change comes as a new version
  4. of this file with a changelog line at the bottom, announced to Kunibert.
  5. ## 0. Words
  6. - **App**: an outside program connected to ONE repo by that repo's owner. It acts under its own bot name and never as a person.
  7. - **Key** `gak_` + 40 hex: long-lived, given once at connect time, kept by the app. It is used only to get tokens.
  8. - **Token** `gat_` + 40 hex: short-lived (1 hour), used for every API call and for git fetch.
  9. - **Secret**: 64 hex, given once at connect time. It signs the events. Gitoria never sends it again.
  10. - **API base** `{api}`: comes in the connect answer and in every event (`repo.api`). Never build it yourself.
  11. Today it is `https://<slug>.gitoria.worldapi.org/api`; for an organization repo it is `https://<org>.gitoria.worldapi.org/api/<repo>`.
  12. - **PR number** `N`: 1, 2, 3 … per repo. It never changes and is never reused (#40).
  13. ## 1. Connecting (#41)
  14. Two ways. Both end with the app holding `key`, `secret` and `api`.
  15. **A. Connect flow** (the tickets connect shape, with gitoria as the server):
  16. 1. The app sends the owner's browser to
  17. `https://<repo host>/settings/apps/connect?app=<name>&hook=<receiver URL>&return=<URL>&state=<random>`.
  18. `<repo host>` is the repo's address; an organization repo uses `/<repo>/settings/apps/connect`.
  19. 2. Gitoria signs the person in, checks that they own the repo, shows "Connect <name> to <repo>?", and on Yes
  20. redirects to `return?code=<one-time code>&state=<same state>`. The code works once and for 5 minutes.
  21. 3. The app's SERVER calls `POST {repo address}/api/apps/exchange` with `{"code":"…"}` (no auth). The answer:
  22. `{"key":"gak_…","secret":"<64 hex>","api":"https://…/api","repo":{"id":"…","full":"kunibert-test"},"app":{"id":"…","name":"Kunibert"}}`.
  23. 4. Gitoria sends a `ping` event at once.
  24. **B. Manual**: the owner opens Settings → Apps → Add, types a name and the receiver URL, and sees the key and the
  25. secret once. This is the way for a conductor chat (`https://<hyperconductor>/api/push/<chatId>`).
  26. **Allowed URLs** (`hook` and `return`), no redirects followed: `https://` with host `worldapi.org` or one of its subdomains, or a URL
  27. that starts with one of the HyperConductor bases configured in gitoria, exactly as written there, plain `http` included
  28. (the same list tickets uses in `TICKETS_PUSH_ALLOWED`, e.g. `http://100.77.141.84:8100`). The configured bases are listed in README.
  29. Anything else → 400 `invalid_url`.
  30. Re-connecting the same app name to the same repo replaces the old key and secret. The owner can remove an app (key and
  31. tokens die at once) or rotate its secret (Settings → Apps).
  32. ## 2. Tokens (#42)
  33. `POST {api}/apps/token` with `Authorization: Bearer gak_…` → `200 {"token":"gat_…","expires":"2026-11-02T07:00:00Z"}`.
  34. The token lives 1 hour. Get a new one whenever you need it; old ones keep working until they expire.
  35. - API: `Authorization: Bearer gat_…`.
  36. - git over HTTPS: Basic auth, user `app` (any name is accepted), password `gat_…`.
  37. Example: `git -c http.extraHeader="Authorization: Basic $(printf 'app:%s' "$TOKEN" | base64 -w0)" fetch <clone URL> …`
  38. The token is **read-only**: fetch and clone work, a push is refused (403).
  39. - A token works for its own repo only. For any other repo every route answers 404, the same as for a repo that does not exist.
  40. ## 3. Git (#40, #42)
  41. - Clone URL: `repo.clone` in every event (today `https://<slug>.gitoria.worldapi.org/<slug>.git`).
  42. - PR head: **`refs/pull/N/head`**. Gitoria keeps it pointing at the PR's head commit.
  43. - Base: **`refs/heads/<target>`** (`pull.baseRef`). `pull.mergeBase` is the merge-base sha at the time of the event.
  44. - Shallow fetch works: protocol v2 (`git -c protocol.version=2`) with `--depth` and `--deepen` (checked live 2026-11-02).
  45. - An event is sent only after `refs/pull/N/head` points at `pull.head`, so a fetch right after the event finds the commit.
  46. - What a PR is in gitoria: a commit whose subject starts `|||PR ` (target = main branch) or `|||PR|<branch>] ` on a source branch.
  47. Title = the rest of the subject; body = the rest of that commit's message.
  48. ## 4. Events (#43)
  49. `POST <receiver URL>`, body = JSON (UTF-8), headers:
  50. | header | value |
  51. |---|---|
  52. | `Content-Type` | `application/json` |
  53. | `User-Agent` | `gitoria` |
  54. | `X-Push-Event` | the event name below |
  55. | `X-Push-Delivery` | uuid; the SAME on a retry or redelivery |
  56. | `X-Push-Signature-256` | `sha256=` + hex HMAC-SHA256(key = the secret's 64 hex characters as ASCII bytes, raw body bytes) |
  57. Delivery: any 2xx within 10 seconds counts as delivered. Otherwise gitoria retries after 1 min, 5 min, 30 min, 2 h and 6 h,
  58. then marks the delivery `failed`. Redirects are not followed. Order is not guaranteed: trust `pull.head`
  59. and the `time` field, and treat a repeated `X-Push-Delivery` as already handled. A receiver should answer at once and work afterwards.
  60. Common body for every event:
  61. ```json
  62. { "event": "pull_request", "action": "opened", "delivery": "<uuid>", "time": "2026-11-02T06:00:00Z",
  63. "repo": { "id": "…", "full": "kunibert-test", "private": false, "api": "https://…/api", "clone": "https://…/kunibert-test.git" },
  64. "app": { "id": "…", "name": "Kunibert" },
  65. "sender": { "id": "…", "name": "Caramboleyo" } }
  66. ```
  67. `sender` = the gitoria user who caused the event (the pusher, the commenter, the person who merged); `null` if gitoria itself caused it.
  68. The **pull** object (in every PR event, and from `GET {api}/pulls/N`):
  69. ```json
  70. { "number": 3, "title": "…", "body": "…", "draft": false, "state": "open",
  71. "author": { "id": "…", "name": "…" }, "source": "feature-x", "target": "main",
  72. "head": "<40 hex>", "ref": "refs/pull/3/head", "baseRef": "refs/heads/main", "base": "<target tip sha>", "mergeBase": "<sha>",
  73. "tickets": ["gitoria.worldapi.org#12"], "url": "https://…/pulls/3", "created": "…", "updated": "…",
  74. "statuses": [status…], "required": [{"app":{"id":"…","name":"Kunibert"},"context":"kunibert"}],
  75. "approvers": [{"user":{"id":"…","name":"Caramboleyo"}}],
  76. "approvals": [{"user":{"id":"…","name":"Caramboleyo"},"head":"<40 hex>","created":"2026-11-15T06:00:00Z","current":true}] }
  77. ```
  78. - `statuses` (v1.3): every status on the CURRENT `head`, from every app (see `status` in §5).
  79. - `required` (v1.4): what the owner marked "required before merge", each as app + context. For reading only: it explains why Merge is off.
  80. - `approvers` (v1.6): the people the owner listed as required approvers, each `{"user":{"id":"…","name":"…"}}`. This is separate from `required`, which retains its app + context shape.
  81. - `approvals` (v1.6): people's approvals for this PR, including earlier heads: `{"user":{"id":"…","name":"…"},"head":"<40 hex>","created":"<ISO UTC time>","current":true|false}`. A push makes an earlier approval stale (`current:false`); it no longer counts. A person can withdraw their current-head approval. Apps cannot approve as people.
  82. - These fields are additive: readers ignoring the new fields keep working. The v1.5.1 shapes of `pull.required` and `checks_failed` detail rows are unchanged.
  83. - `state`: `open` | `closed` | `merged`.
  84. - `draft`: gitoria has no drafts, so it is always `false`.
  85. - `author`: the gitoria user who pushed the `|||PR` commit; `id` is `null` and `name` is the commit author when gitoria cannot tell.
  86. - `tickets`: the tickets this PR names in its title or body, as `project#n`. An explicit `project#12` is always listed.
  87. A bare `#12` is listed only when the repo is connected to tickets, because only then does gitoria know the project.
  88. Read the tickets from tickets with your own token. Gitoria serves no ticket content.
  89. Events:
  90. | `X-Push-Event` | `action` | extra fields | when |
  91. |---|---|---|---|
  92. | `ping` | — | — | right after connecting, and on "Send ping" in Settings |
  93. | `pull_request` | `opened` | `pull` | a new `|||PR` commit appears |
  94. | `pull_request` | `reopened` | `pull` | a closed PR's branch comes back with its `|||PR` commit |
  95. | `pull_request` | `synchronize` | `pull`, `before`, `after`, `forced` (bool) | the PR's branch moves (new commits or a force-push) |
  96. | `pull_request` | `closed` | `pull` (state `closed`) | branch deleted, or the `|||PR` commit gone from it |
  97. | `pull_request` | `merged` | `pull` (state `merged`), `mergeCommit` | Merge button, or a push that puts the PR into its target |
  98. | `review_requested` | `requested` | `pull` | a person clicks "Review again" on the PR page |
  99. | `review_comment` | `created` | `pull`, `thread`, `comment` | a person replies in one of YOUR threads |
  100. | `pull_comment` | `created` | `pull`, `comment` | a person writes in the PR's conversation (for example `@kunibert reset`) |
  101. | `review_thread` | `resolved` / `unresolved` | `pull`, `thread` | a person resolves or reopens one of YOUR threads |
  102. | `pull_request` | `ready` | `pull` | reserved, only once drafts exist |
  103. An app gets no events about its own actions. The common body (with `repo.api`, `repo.clone` and `app`) comes with EVERY event, `ping` included.
  104. ## 5. Back-channel (#44, #46). Every route: `Authorization: Bearer gat_…`; answers are JSON
  105. | route | request | answer |
  106. |---|---|---|
  107. | `GET {api}/pulls?state=open\|all&cursor=&limit=` | — | `{"pulls":[pull…],"next":"<cursor>"\|null}` |
  108. | `GET {api}/pulls/N` | — | `pull` |
  109. | `POST {api}/pulls/N/reviews` | `{"head":"<sha>","verdict":"approve"\|"request_changes"\|"comment","body":"…","comments":[{"path":"lib/a.hl","line":42,"body":"…"}]}` | `201 {"review":{"id","verdict","head","created"},"threads":[{"id","path","line"}]}` |
  110. | `GET {api}/pulls/N/reviews?cursor=&limit=` | — | `{"reviews":[{"id","verdict","head","body","created"}…],"next":…}` (your own reviews, newest first) |
  111. | `GET {api}/pulls/N/threads?cursor=&limit=` | — | `{"threads":[thread…],"next":…}` (your own threads only) |
  112. | `POST {api}/pulls/N/threads/:id/replies` | `{"body":"…"}` | `201 {"comment":comment}` |
  113. | `POST {api}/pulls/N/threads/:id/resolve` | `{"resolved":true\|false}` | `200 {"thread":thread}` |
  114. | `GET {api}/pulls/N/comments?cursor=&limit=` | — | `{"comments":[comment…],"next":…}` (the PR's conversation, oldest first) |
  115. | `POST {api}/pulls/N/comments` | `{"body":"…"}` | `201 {"comment":comment}` (in the PR's conversation) |
  116. | `PUT {api}/statuses/<sha>` | `{"context":"kunibert","state":"pending"\|"success"\|"failure"\|"error","title":"…","summary":"…","url":null}` | `200 {"status":{…,"updated"}}` |
  117. | `GET {api}/statuses/<sha>` (v1.3) | — | `{"statuses":[status…]}`: every context on that sha, from every app; 404 for a sha this repo does not have |
  118. | `GET {api}/deliveries?cursor=` | — | `{"deliveries":[{"id","event","action","time","status":"delivered"\|"pending"\|"failed","tries","lastCode"}],"next":…}` |
  119. | `POST {api}/deliveries/:id/redeliver` | — | `202` |
  120. - `status` = `{"context","state","title","summary","url","head","updated","app":{"id","name"}}`. Reading shows all apps' statuses; an app writes only its own.
  121. - `outdated` = the thread was written on an older head than the PR's current one (`thread.head != pull.head`), even when its
  122. file and line did not change. It is not line tracking; an app that wants that compares the file itself.
  123. - `thread` = `{"id","path","line","head":"<sha it was written on>","outdated":bool,"resolved":bool,"comments":[comment…]}`.
  124. - `comment` = `{"id","seq","author":{"type":"app"\|"user","id","name"},"body","created"}`. `seq` is an integer that grows strictly
  125. within a repo (over all comments of all PRs), so it works as a watermark. `id` is an opaque string: do not compare it.
  126. `created` has milliseconds (`2026-11-02T06:00:00.123Z`). Lists are ordered by `seq`.
  127. - **Review**: `head` may be the PR's current head or ANY earlier head of this PR. The line check uses the diff of that `head`;
  128. if it is not the current head, the review's threads are `outdated` at once. Only a sha that was never a head of this PR
  129. gets `409 stale_head` (nothing stored). Your current verdict on a PR is your latest review; a `comment` review does not
  130. clear an earlier `request_changes`. `line` is a line number on the NEW side (the file at `head`) that lies inside a hunk of `git diff -M -U3 <mergeBase> <head>` (an added line or a
  131. context line). `path` is the new-side path, after a rename. `<mergeBase>` is computed when the review arrives:
  132. `git merge-base <current target tip> <head>`, not the value from an older event.
  133. If any inline comment points at another line, the WHOLE review is refused: `422 invalid` with
  134. `details: [{"index":2,"path":"…","line":7,"reason":"line_not_in_diff"\|"no_such_file"}]`. Send it again without those comments,
  135. or put them in the body. At most 100 inline comments per review. Gitoria shows the review under the app's name with an "app" mark.
  136. - **Status**: one status per (head sha, app, context): an app writes and replaces only its own; another app may use the same context name without touching it. `error` = the app could not do its check (shown apart from `failure`;
  137. it does not count as `success`). Setting no status at all is allowed too. A newer PUT replaces the older one. If the owner set "required before merge"
  138. for that app + context, the Merge button stays off until that status is `success` on the PR's current head (#46).
  139. - Bodies (review, comment, status summary) are Markdown, up to 65,536 characters. Gitoria shows them escaped (no raw HTML).
  140. - Paging: pass `next` as `cursor`. `limit` defaults to 50 and is at most 100.
  141. ## 6. Errors and limits (#47)
  142. Every error: `{"error":{"code":"…","message":"…","details":…}}`.
  143. | HTTP | code |
  144. |---|---|
  145. | 400 | `invalid_json`, `invalid_url` |
  146. | 401 | `unauthorized` (missing, unknown or expired token: get a new token) |
  147. | 403 | `app_token_required` (valid user token on an app-only route), `forbidden` (§7: an app token on the merge route; a user who may not push) |
  148. | 404 | `not_found` (also: another repo, a removed app) |
  149. | 409 | `stale_head`, `conflict` (merge refusal, with `details.reason`; see §7) |
  150. | 413 | `too_large` (request body over 1 MB) |
  151. | 422 | `invalid`, `checks_failed` (with `details`; see §7) |
  152. | 429 | `rate_limited`, with a `Retry-After` header (seconds) |
  153. Limits per app: 300 reads and 60 writes per minute.
  154. ## 7. User tokens (gtr_) (v1.5.1: #48, W49)
  155. A user access token is `gtr_` + 40 hex. It has no expiry. Its user is a **member** of a repo when it may read AND push there
  156. (owner, repo member or organization member). Member reads never reveal whether a repo or a PR exists to non-members: a valid
  157. token of a non-member gets 404 `not_found`, also on public repos. This is on purpose, not a bug.
  158. Repository ownership and members (v1.8, #55): use the main site's `/api/repos/:slug` paths with `Authorization: Bearer gtr_…`. POST and DELETE both take the exact display name in a JSON body; member names never appear in route paths. For an organization repository, replace `:slug` with its full `org/repo` slug (two path segments); confirmation also uses `org/repo`.
  159. | route | body | answer |
  160. |---|---|---|
  161. | `GET /api/repos/:slug/members` | — | `200 ["Display name", …]`, owner or repository/organization member |
  162. | `POST /api/repos/:slug/members` | `{"name":"Display name"}` | `200` list of names, owner only |
  163. | `DELETE /api/repos/:slug/members` | `{"name":"Display name"}` | `200` list of names, owner only |
  164. | `POST /api/repos/:slug/owner` | `{"name":"New owner's display name","confirm":"exact/full-slug"}` | `200` repository row, owner only |
  165. These routes refuse app tokens with 403 `forbidden`, missing/unknown user tokens with 401 `unauthorized`, visible repos without permission with 403, and unknown or private repos invisible to the user with 404. Names must resolve to exactly one user; unknown or ambiguous names and self-transfer return 422 `invalid` with `details.field = "name"`. Missing or wrong transfer confirmation returns 422 with `details.field = "confirm"`. Transfer leaves the repo address, organization, forwards and attached data unchanged, removes the new owner from the repository member list, and preserves other memberships. The former owner retains access only through existing repository or organization membership.
  166. Organization and move operations (v1.9, W56): these calls require only `Authorization: Bearer gtr_…`, with no browser cookie or login. Organization membership routes are owner-only, including GET.
  167. | route | JSON body | success |
  168. |---|---|---|
  169. | `POST /api/orgs` | `{"name":"team","title":"Optional display title","private":false}` | `201` organization row, owned by the token user |
  170. | `GET /api/orgs/:org/members` | — | `200 ["Display name", …]` |
  171. | `POST /api/orgs/:org/members` | `{"name":"Display name"}` | `200` updated names |
  172. | `DELETE /api/orgs/:org/members` | `{"name":"Display name"}` | `200` updated names |
  173. | `POST /api/orgs/:org/owner` | `{"name":"New owner","confirm":"exact-org-slug","stayMember":true}` | `200` organization row |
  174. | `POST /api/repos/:slug/move` | `{"org":"destination-org","name":"optional-new-repo-name"}` | `200` repository row, including `clone` with its new clone URL |
  175. Organization rows include `id`, `slug`, display-name `owner`, `title`, `heading`, visibility and `address`. Creation uses existing slug/title rules: invalid fields return 422 `invalid`, taken names return 409 `conflict`. The token user must already have a display name. Organization transfer requires the current owner and exactly one matching display name, refuses self-transfer, and requires exact slug confirmation (422, `details.field = "confirm"` otherwise). `stayMember` defaults to false and must be a Boolean when supplied. With true, the former owner is added to the organization member list in the same operation; without it, existing memberships and other rights are preserved. The new owner is removed from the organization's member list. Repositories retain their individual owners until separately transferred.
  176. Moves require the repository owner and membership or ownership in the destination organization (403 otherwise). For an organization repository, use its full `org/repo` slug as two path segments. Omitted `name` retains the existing repository name. Moves use the same operation as Settings Rename: existing addresses forward, Git aliases and repository membership follow, attached records stay associated, and an effectively private repo stays private when changing organizations. Repository rows now include the additive `clone` field. The Settings destination select lists organizations owned by or containing the user.
  177. Missing/unknown user tokens return 401; app tokens return 403. Non-owners of visible organizations receive 403; unknown organizations or private ones invisible to the token user receive 404. Member display names use the same exact-name resolution as Settings. The organization's transfer form is under Settings on its organization address (`https://<org>.<host>/settings`).
  178. Reads (W49, live dab74b0): `GET {api}/pulls`, `{api}/pulls/N`, `{api}/pulls/N/reviews`, `{api}/pulls/N/threads`,
  179. `{api}/pulls/N/comments`, `{api}/statuses/<sha>`. Shapes, order and paging are the same as for apps. A user sees every app's
  180. reviews and threads; an app still sees only its own. User-token reads are not rate-limited by the apps API (the app limits of §6
  181. count apps only). Back-channel writes, `GET {api}/deliveries`, redelivery and `POST {api}/apps/token` stay app-only.
  182. Merge (#48, live 1a687b1): `POST {api}/pulls/N/merge`, `Authorization: Bearer gtr_…`. Body optional: empty, or
  183. `{"head":"<40 hex>"}` = the PR head the caller looked at. No other fields (always a merge commit with the message
  184. `Merge branch '<source>' into <target>`; no method, no message).
  185. The OR rule is the creator's recorded decision in [gitoria#52](https://tickets.worldapi.org/gitoria.worldapi.org/52) and DECISIONS.md "PR approvals": "PR merges should not be possible without his or my approval" and "yes add the approve button for people". It applies only when the owner adds person entries. App-only repos keep the approve + success review workflow and their existing required-status rule; person approvals do not bypass app-only requirements. With person entries, merge is allowed when (there is at least one required app context AND all required app contexts are `success` on the head) OR (at least one listed person approved this PR's current head). With people only, a listed person's approval is required. With nothing required, merge behaves as before.
  186. | HTTP | code | meaning |
  187. |---|---|---|
  188. | 200 | — | `{"merged":true,"mergeCommit":"<sha>","pull":{…}}`; `pull` has the shape of `GET {api}/pulls/N`, read after the merge |
  189. | 400 | `invalid_json` | the body is not a JSON object |
  190. | 401 | `unauthorized` | missing or unknown token ("a user access token is required") |
  191. | 403 | `forbidden` | an app token ("apps cannot merge"), or a user who may read but not push |
  192. | 404 | `not_found` | repo not visible to this user, or no such PR |
  193. | 405 | `invalid` | not POST |
  194. | 409 | `conflict` | not merged; `details = {"reason":"…"}`: `head_mismatch` (re-read the PR and retry), `already_merged`, `branch_gone`, `target_missing`, `merge_conflict` (message names up to 5 files), `target_moved` (retry), or `git_error` (could not read/write) |
  195. | 413 | `too_large` | body over 1 MB |
  196. | 422 | `invalid` | `head` is not 40 hex characters (`details`: field `head`) |
  197. | 422 | `checks_failed` | required checks are not success; `details` is a list of `{"app":{"id":"…","name":"…"},"context":"…","state":"missing"}` for each missing or failed context; state is `missing` when no status exists, otherwise `pending`, `failure` or `error`. The message still names each as `<app> · <context> (<state>)`. |
  198. When person entries exist and neither alternative is met, `error.approval` is present next to `error.details`:
  199. ```json
  200. {"error":{"code":"checks_failed","message":"Not merged: … or an approval from Caramboleyo.","details":[{"app":{"id":"…","name":"Kunibert"},"context":"kunibert","state":"pending"}],"approval":{"users":[{"id":"…","name":"Caramboleyo"}],"state":"missing"}}}
  201. ```
  202. `details` remains app + context + state only (empty for person-only requirements). `approval` is omitted on app-only errors and when either alternative is met. Readers ignoring the new fields keep working.
  203. Event: `pull_request` action `merged`, `sender` = the merging user (never an app).
  204. A valid user token on an app-only route (any write of §5, deliveries, redelivery or `POST {api}/apps/token`) gets 403
  205. `app_token_required` with the message `this route needs an app token (gat_); user tokens (gtr_) can read pulls, reviews,
  206. threads, comments and statuses and merge with POST /pulls/N/merge`. Missing, unknown or expired tokens stay 401 `unauthorized`.
  207. ## 8. Anonymous reads (v1.6, gitoria#51)
  208. A request with **no `Authorization` header at all** may read two routes of a **public** repo, answered exactly as for a member (same JSON, same 404 for an unknown PR or sha):
  209. `GET {api}/pulls/N` and `GET {api}/statuses/<sha>`.
  210. A private or missing repo answers 404 `not_found` ("no such repository"), the same body for both, so nobody learns that a private repo exists.
  211. Anonymous reads are not rate-limited and not counted in the app limits (the same data is on the public PR page).
  212. A request that carries any token keeps the member rules of §7: a valid `gtr_` of a non-member is 404, an unknown token is 401. The PR list `GET {api}/pulls`, reviews, threads, comments, writes, merge and deliveries still need a token (401 without).
  213. Repository names (v1.7, #53): the repo JSON, connect answer's `repo`, and event `repo` gain an additive `title` string (optional display name, at most 80 characters; `""` when unset). Existing `slug` and `full` fields remain address names. A rename keeps `repo.id`, connected apps and PR numbers. Newly created events carry the new `repo.full`, `repo.api` and `repo.clone`; already queued deliveries retain their original payload. Old Git URLs and API bases continue through the existing forward. Old page addresses show the existing “moved to” view with a link.
  214. Creation (v1.7): `POST /api/repos` accepts optional `title` (plain text, at most 80 characters). Its existing `name` field still means Address. An empty or omitted `name` is derived from `title`: lowercase ASCII letters and digits, runs of other characters replaced by one hyphen, with edge hyphens trimmed. Explicit addresses retain their existing validation and uniqueness checks. Organizations have the same optional Name/display field and owner editing; changing Name alone does not change an address.
  215. ## Changelog
  216. - v1.7 2026-11-15: #53 adds `repo.title`, separate creation Name/Address fields, organization names, Settings display name and address rename; repo ids stay stable and old Git URLs/API bases keep working.
  217. - v1.6 2026-11-15: #52 adds separate `pull.approvers`, `pull.approvals` and `error.approval` fields; `pull.required` and error `details` retain their v1.5.1 app-only shapes. The recorded OR rule applies only with person entries. Readers ignoring new fields keep working.
  218. - v1.6 2026-11-12: §8 anonymous reads of `GET {api}/pulls/N` and `GET {api}/statuses/<sha>` on public repos (#51); private or missing repos are 404.
  219. - v1.5.1 2026-11-05: valid user tokens on app-only routes get 403 `app_token_required`; unmet required checks get 422
  220. `checks_failed` with app, context and state in `details`; every 409 merge refusal carries `details.reason`.
  221. - v1.5 2026-11-05 (reviewed by the external reviewer): §7 user tokens: members merge with gtr_ (#48, deploy 1a687b1) and read pulls, reviews,
  222. threads, comments, statuses (W49, deploy dab74b0); known deviations (401 for gtr_ on app routes, 409 for failed required checks) stated.
  223. - v0 2026-11-02: first contract (Gitoria), before any code.
  224. - v1 2026-11-02 (Kunibert's points): `comment.seq` watermark and ms `created`; `GET …/pulls/N/comments`; exact diff for the line check
  225. (`-M -U3`, new-side path, merge-base at review time); explicit `project#n` listed without a tickets connection; common body on `ping`;
  226. status state `error`.
  227. - v1.4 2026-11-02 (security, decided by the external reviewer): statuses are keyed by (sha, app, context), so no app can replace another app's status;
  228. "required before merge" names app + context; `required` on the pull = `[{"app":{"id","name"},"context"}]`. A removed app's required entry
  229. stays unmet until the owner changes it. The PUT is unchanged.
  230. - v1.3.1 2026-11-02 (Kunibert's question): stated what `outdated` means (written on an older head), as built in #44.
  231. - v1.3 2026-11-02 (Kunibert's wish, decided by the external reviewer): `GET {api}/statuses/<sha>` lists all contexts on a sha; `status` carries `app`;
  232. the pull object gets `statuses` (current head, all apps) and `required` (read-only). Built with #47.
  233. - v1.2.1 2026-11-02: clarified the HMAC key = the secret string's ASCII bytes (not hex-decoded).
  234. - v1.2 2026-11-02 (external reviewer): review on any earlier head (outdated threads, 409 only for a foreign sha); bodies 65,536; current verdict
  235. = latest review, `GET …/pulls/N/reviews`; shallow fetch (v2 depth/deepen) stated; open points closed (retries, `context`, limits, drafts).
  236. - v1.1 2026-11-02 (Apollo): the configured HyperConductor bases are allowed exactly as written, plain http included; https only for worldapi.org.
  237. - v1.8 (2026-11-23): user-token repository member management and confirmed ownership transfer (#55).
  238. - v1.9 (2026-11-23): token-only organization creation, members, confirmed ownership transfer with stayMember, and repository moves; additive owner on organization rows and clone on repository rows.
  239. - v1.10 (2026-11-23): member deletion takes JSON {name} on /members; path-based member deletion is removed. Organization creation and membership changes publish privacy-scoped live updates.

Branches

Latest commits

  • fe209ffeMerge branch 'w56-owner-members' into mainGitoria
  • fa0754c8|||PR repository owner transfer and members API (#55)mre
  • 8862e537Merge branch 'w55-rename-org' into mainGitoria
  • 014d2b7fOne immutable readers snapshot per move for the left-organization event (#53)mre
  • 1859d506Decide who hears a repo left its organization by its readers before the move (#53)mre
  • 499f25f2Review fixes for the Settings organization move (#53)mre
  • ed3b922b|||PR move a repository into an organization in Settings (#53)mre
  • 74ec2af8Merge branch 'w54-repo-rename-pr' into mainGitoria
  • 9f7ce8d8Preserve rename compatibility and live page titlesmre
  • c3d95b6e|||PR separate names and addresses, rename repositories in Settings (#53)mre
  • ce08920dMerge branch 'w52c-header-phone' into mainGitoria
  • 0bab9e46|||PR header: ident status wraps on phones instead of clippingmre
  • e7af3eceMerge branch 'w52b-approval-followup' into mainGitoria
  • c01e66c6|||PR approvals follow-up: live Merge after status writes, helpers (#52)mre
  • 841da497Merge branch 'w53-pulls-speed-pr' into mainGitoria
  • 80307ae2|||PR pulls page cache: live PR numbers, complete scans onlymre
  • 69141f65|||PR pulls page: cache the git part per repo by branch tipsmre
  • 155861f6Merge branch 'w52-person-approval' into mainGitoria
  • b5435de8|||PR person approvals: second Kunibert round (#52)mre
  • 3a8b2fb8|||PR person approvals: Kunibert review fixes (#52)mre