markdown · 26025 bytes Raw Blame History

Changelog

All notable changes to shithub are documented here. This project follows Keep a Changelog conventions and Semantic Versioning.

Pre-1.0 versioning: minor versions may break the API. The stability contract begins at v1.0.0; until then, expect changes between minor releases.

Unreleased

Added

  • REST API contract (S50 §0). GET /api/v1/meta returns the server's version stamp and a list of feature capability strings for client-side feature detection. Every /api/v1/* response now carries X-RateLimit-Limit, X-RateLimit-Remaining, X-RateLimit-Reset, and (when PAT-authenticated) X-OAuth-Scopes. The 403 scope-reject response also carries X-Accepted-OAuth-Scopes. Operators tune the API rate-limit budgets via ratelimit.api.authed_per_hour / ratelimit.api.anon_per_hour (defaults: 5000 / 60).
  • Pagination helper internal/web/handlers/api/apipage — emits canonical RFC 8288 Link headers (first/prev/next/last) with absolute URLs rooted at the configured public base URL.
  • REST: user emails (S50 §1). GET /api/v1/user/emails lists the authenticated user's emails. Optional ?verified=true|false filter. Scope: user:read.
  • REST: user SSH keys (S50 §1). GET/POST /api/v1/user/keys and GET/DELETE /api/v1/user/keys/{id} expose CRUD for git authentication keys. Signing keys are tracked separately by a new kind column on user_ssh_keys and remain on the HTML surface for now. Scopes: user:read for GETs, user:write for mutations.
  • Capabilities: user-emails, ssh-keys added to /api/v1/meta response.
  • REST: repos core (S50 §2). GET /api/v1/user/repos, GET /api/v1/users/{username}/repos, GET /api/v1/orgs/{org}/repos, GET /api/v1/repos/{owner}/{repo}, POST /api/v1/user/repos, POST /api/v1/orgs/{org}/repos, PATCH /api/v1/repos/{owner}/{repo} (description, has_issues, has_pulls, archived, visibility), and DELETE /api/v1/repos/{owner}/{repo} (soft-delete). Visibility-aware listing: a user's /users/{u}/repos shows private rows only to that user; an org's /orgs/{o}/repos shows private rows only to members. Single-repo GETs 404 for callers who can't see the row (no existence leak).
  • Capability: repos added to /api/v1/meta.
  • REST: issues + comments + lock (S50 §3). GET /api/v1/repos/{o}/{r}/issues (with ?state= filter and Link:-header pagination), GET /api/v1/repos/{o}/{r}/issues/{number}, POST /api/v1/repos/{o}/{r}/issues, PATCH /api/v1/repos/{o}/{r}/issues/{number} (title/body author-gated, state/state_reason policy-gated), GET / POST /api/v1/repos/{o}/{r}/issues/{number}/comments, PATCH / DELETE /api/v1/repos/{o}/{r}/issues/comments/{cid}, PUT / DELETE /api/v1/repos/{o}/{r}/issues/{number}/lock.
  • REST: repo labels (S50 §3). GET / POST /api/v1/repos/{o}/{r}/labels and GET / PATCH / DELETE /api/v1/repos/{o}/{r}/labels/{name}.
  • Capabilities: issues, labels added to /api/v1/meta.
  • REST: milestones + assignees (S50 §3 follow-up). Full CRUD for /api/v1/repos/{o}/{r}/milestones (with ?state= filter on list and live open_issues/closed_issues counters on every response), plus GET /api/v1/repos/{o}/{r}/assignees (repo owner + collaborators eligible for issue assignment). Scope: repo:read on GETs, repo:write on mutations. Mutations gate on ActionIssueLabel.
  • Issue PATCH extensions. PATCH /api/v1/repos/{o}/{r}/issues/{n} now accepts labels, assignees, and milestone fields with GitHub-style full-replace semantics. Each gates on its own policy action (ActionIssueLabel / ActionIssueAssign) so a caller missing one capability gets a clean 403 rather than a partial update. Unknown label names or assignee usernames → 422; cross-repo milestone ids → 422.
  • Capabilities: milestones, assignees added to /api/v1/meta.
  • Reach: internal/web/handlers/api.resolveAPIRepo now resolves both user-owner and org-owner repos — check-runs and every later batch implicitly gain org-repo support.

Added (internal)

  • REST: pull requests core (S50 §4). GET /api/v1/repos/{o}/{r}/pulls with ?state= and ?draft= filters, GET /api/v1/repos/{o}/{r}/pulls/{number}, POST /api/v1/repos/{o}/{r}/pulls, PATCH /api/v1/repos/{o}/{r}/pulls/{number} (title/body author-gated, state via ActionPullClose, draft→ready author-only), GET /api/v1/repos/{o}/{r}/pulls/{number}/commits, GET /api/v1/repos/{o}/{r}/pulls/{number}/files, PUT /api/v1/repos/{o}/{r}/pulls/{number}/merge (honoring the repo's default merge method and the optional sha head guard). Reviews + comments + reviewers + update-branch + auto-merge land in a follow-up.
  • Capability: pulls added to /api/v1/meta.
  • REST: PR reviews + inline comments + requested reviewers (S50 §4b). GET / POST /api/v1/repos/{o}/{r}/pulls/{number}/reviews (events APPROVE / REQUEST_CHANGES / COMMENT, with pending-draft attachment on submit), GET / POST /api/v1/repos/{o}/{r}/pulls/{number}/comments (inline review comments with file_path / side / position anchoring, pending drafts, in_reply_to_id threading), and GET / POST / DELETE /api/v1/repos/{o}/{r}/pulls/{number}/requested_reviewers (by user_id or username).
  • Capability: pr-reviews added to /api/v1/meta.
  • REST: search (S50 §5). GET /api/v1/search/repositories, GET /api/v1/search/issues?type=issue|pr, and GET /api/v1/search/code over the existing FTS corpus. Canonical gh-shaped envelope { total_count, incomplete_results, items } with Link: pagination. Anonymous callers allowed (visibility filter inside the search package narrows to public). ?q= honors the existing operator vocabulary (repo:, is:, state:, author:, phrase). The search/commits and search/users endpoints, plus the sort=/order= knobs, are deferred to follow-ups.
  • Capability: search added to /api/v1/meta.
  • REST: orgs (S50 §7). GET /api/v1/user/orgs (self), GET /api/v1/users/{username}/orgs (public; shithub has no hidden membership distinction in v1), GET /api/v1/orgs/{org} (single fetch; 404 for soft-deleted), GET /api/v1/orgs/{org}/members. Scope: user:read.
  • Capability: orgs added to /api/v1/meta.
  • REST: repo webhooks (S50 §8). Full CRUD over a repo's webhook subscriptions: GET/POST /api/v1/repos/{o}/{r}/hooks, GET/PATCH/DELETE /api/v1/repos/{o}/{r}/hooks/{id}. Deliveries read-side: GET /api/v1/repos/{o}/{r}/hooks/{id}/deliveries (paginated; Link: headers) and GET /api/v1/repos/{o}/{r}/hooks/{id}/deliveries/{did} (full transcript). POST .../deliveries/{did}/redeliver re-enqueues. Scope: repo:write; role floor: settings:general. Webhook secrets are write-only — set on create, rotated via PATCH's secret field, never echoed back. Create-time SSRF gate rejects loopback / private / disallowed-port targets so misconfigurations surface synchronously instead of as silent delivery failures.
  • Capability: webhooks added to /api/v1/meta.
  • REST: branches + tags (S50 §9). Read-only ref enumeration: GET /api/v1/repos/{o}/{r}/branches (paginated; each entry carries protected reflecting the longest-prefix match against the configured branch-protection rules, plus is_default), GET /api/v1/repos/{o}/{r}/branches/{name} (slashes in branch names accepted verbatim or URL-encoded), and GET /api/v1/repos/{o}/{r}/tags (paginated). Scope: repo:read. Empty / uninitialised repos return [] rather than 404.
  • Capabilities: branches, tags added to /api/v1/meta.
  • REST: repo collaborators (S50 §10). GET /api/v1/repos/{o}/{r}/collaborators (list), GET .../collaborators/{username} (204 membership probe), GET .../collaborators/{username}/permission (permission level — "none" when not a collaborator), PUT .../collaborators/{username} (add / upgrade, body {"role": "..."} accepting both shithub names and gh-style aliases pull/push), DELETE .../collaborators/{username} (remove). Scope: repo:read on GETs, repo:write on mutations; mutations layer ActionRepoAdmin on top. Refuses (422) to enrol the repo owner.
  • Capability: collaborators added to /api/v1/meta.
  • REST: commits (S50 §11). Read-only git history surface: GET /api/v1/repos/{o}/{r}/commits (paginated; honours ?sha=, ?path=, ?author=, ?since=, ?until=) and GET /api/v1/repos/{o}/{r}/commits/{sha} (full commit detail with committer/parents/tree + per-file status and additions/deletions, plus a rollup stats object). Backed by internal/repos/git.Log / git.GetCommit — the response stays in lock-step with the bare repository. Scope: repo:read. Empty repos return []; the single-commit GET accepts any unambiguous SHA prefix.
  • Capability: commits added to /api/v1/meta.
  • GPG keys + commit signature verification (S51). Full vertical: upload OpenPGP public keys at Settings → SSH and GPG keys; shithub parses the armored block (RSA≥2048, ECC, multi-subkey, encryption-only all accepted) and stores primary + subkey fingerprint index. A background worker eagerly backfills verification rows for the uploader's existing commits across every repo, and the shithubd gpg-backfill-all admin subcommand performs the once-off bulk walk on deploy. Signed commits + annotated tags render a green Verified pill on the commit list, single-commit, and tag list pages; the popover surfaces the signer, key id, and verified-at timestamp. The reason enum mirrors GitHub's documented set (valid, unsigned, unknown_key, bad_email, unverified_email, expired_key, not_signing_key, malformed_signature, invalid). REST surface: GET/POST/DELETE /api/v1/user/gpg_keys[/{id}] with the gh-exact JSON shape (split can_encrypt_comms / can_encrypt_storage, both public_key and raw_key, subkeys-as-nested-objects, emails[].verified cross-checked against the user's verified-email set). Scopes: user:read for GETs, user:write for mutations. Existing /api/v1/repos/{o}/{r}/commits[/{sha}] responses now carry a verification object with the same shape gh emits. Migrations: 0068_user_gpg_keys.sql, 0069_user_gpg_subkeys.sql, 0070_commit_verification_cache.sql.
  • Capability: gpg-keys added to /api/v1/meta.
  • REST: rulesets (S50 §9). Three read-only endpoints synthesizing GitHub's modern rulesets shape from shithub's existing branch_protection_rules rows: GET /api/v1/repos/{o}/{r}/rulesets (list), GET /api/v1/repos/{o}/{r}/rulesets/{id} (single), GET /api/v1/repos/{o}/{r}/rules/branches/{branch} (rules applying to a branch — every matching pattern, not just the longest-match the pre-receive enforcer uses). One protection row maps to one ruleset; each configured field projects as a typed rule (pull_request, non_fast_forward, deletion, required_signatures, required_status_checks). Scope: repo:read. Cross-repo lookups 404. Mutating rulesets via REST is a future surface — for now use the web UI at Settings → Branches.
  • Capability: rulesets added to /api/v1/meta.
  • REST: repo contents (S50 §12). GET /api/v1/repos/{o}/{r}/contents/{path}[?ref=] returns either a directory listing (dirs first, then files alphabetically) or a single file with base64-encoded content, encoding, size, and a binary flag (UTF-8 validity check). Files over 1 MiB come back as truncated: true with empty content — clients fall through to the raw download path. Scope: repo:read. Empty /contents path returns the repo root.
  • Capability: contents added to /api/v1/meta.
  • REST: forks (S50 §13). GET /api/v1/repos/{o}/{r}/forks (paginated; per-row visibility filter so private forks of public repos only surface to authorized viewers) and POST /api/v1/repos/{o}/{r}/forks (fork into the authenticated user's namespace; optional name/visibility body). Reuses the existing internal/repos/fork orchestrator and enqueues the on-disk clone via the repo:fork_clone worker, so the response returns immediately with init_status: "init_pending". Org-target forks land in a follow-up.
  • Capability: forks added to /api/v1/meta.
  • REST: notifications (S50 §14). User-scoped inbox surface: GET /api/v1/notifications (defaults to unread only; ?all=true includes read; paginated with Link: headers), GET /api/v1/notifications/threads/{id} (single fetch with existence-leak-safe cross-user 404), PATCH /api/v1/notifications/threads/{id} (mark read/unread — empty body / unread:false → read; unread:true flips back), and PUT /api/v1/notifications (mark all read). Scopes: user:read on GETs, user:write on mutations. All routes are implicitly scoped to the authenticated user.
  • Capability: notifications added to /api/v1/meta.
  • REST: watching / subscriptions (S50 §15). Per-repo watch-level management mirroring GitHub's /repos/{o}/{r}/subscription shape: GET .../subscribers (paginated watcher list excluding ignore and suspended users), GET .../subscription (viewer's level + explicit flag distinguishing the implicit participating default from an explicit choice), PUT .../subscription (set all / participating / ignore), and DELETE .../subscription (revert to implicit). Reuses internal/social.SetWatch / UnsetWatch and socialdb.ListWatchersForRepo. Scope: repo:read on GETs, user:write on mutations.
  • Capability: watching added to /api/v1/meta.
  • REST: events / activity (S50 §16). Read-only activity feed over domain_events: GET /api/v1/repos/{o}/{r}/events (paginated; returns every event for the repo, gated by ActionRepoRead) and GET /api/v1/users/{username}/events (paginated; only public=true rows — matches gh, which never surfaces private-repo activity on a user feed). Scope: repo:read / user:read. Reuses the existing socialdb.ListEventsForRepo and socialdb.ListPublicEventsForActor queries.
  • Capability: events added to /api/v1/meta.
  • REST: followers / following (S50 §17). GET /api/v1/users/{username}/followers and GET /api/v1/users/{username}/following (both paginated; Link: headers), plus the authenticated-user-scoped GET /api/v1/user/following/{target} (204/404 membership probe matching gh), PUT /api/v1/user/following/{target} (follow), and DELETE (unfollow). Self-follow returns 422. Reuses internal/social.FollowUser / UnfollowUser so the follow rate-limit and followed_user domain event stay in one place. Org-follow variants remain on the HTML surface.
  • Capability: followers added to /api/v1/meta.
  • REST: actions workflow runs (S50 §18). Read-only access to the Actions run history: GET /api/v1/repos/{o}/{r}/actions/runs (paginated; filterable by workflow_file, head_ref, actor, event, status, conclusion), GET /api/v1/repos/{o}/{r}/actions/runs/{run_id} (single run; existence-leak-safe cross-repo 404), and GET /api/v1/repos/{o}/{r}/actions/runs/{run_id}/jobs (job-index-ordered jobs list with needs_jobs graph). Reuses the existing actionsdb.ListWorkflowRunsForRepo / GetWorkflowRunByID / ListJobsForRun queries. Scope: repo:read. Lifecycle controls (cancel / rerun / approve) remain on the actions-lifecycle routes; this surface is read-only.
  • Capability: actions-runs added to /api/v1/meta.
  • REST: stargazers + starred lists (S50 §19). GET /api/v1/repos/{owner}/{repo}/stargazers paginates the users who starred a repo (scope: repo:read); private-repo lists are gated by ActionRepoRead. GET /api/v1/users/{username}/starred paginates the repos a user has starred (scope: user:read); cross-user views post-filter private repos the caller can't see. Both endpoints emit standard Link: pagination headers and recency-sort by starred_at DESC. The S26 caller-self star routes (/api/v1/user/starred and /api/v1/user/starred/{o}/{r}) are unchanged.
  • Capability: stargazers added to /api/v1/meta.
  • REST: issue events / timeline (S50 §20). GET /api/v1/repos/{owner}/{repo}/issues/{number}/events returns the issue's recorded timeline (every closed / reopened / labeled / unlabeled / milestoned / demilestoned / locked / unlocked / referenced / merged / push event), with actor_username LEFT-joined and the raw event meta payload preserved verbatim. Paginated with the standard Link: headers, sorted oldest-first. Scope: repo:read.
  • Capability: issue-events added to /api/v1/meta.
  • Device-code login (S50 §1, RFC 8628). POST /login/device/code issues a fresh authorization grant for a non-browser client (CLI / TV / IoT). POST /login/oauth/access_token polls for the user's approval and, on success, mints a PAT bound to the requested scopes. The browser-facing verification page is served at GET /login/device (CSRF-protected). The matching CLI endpoints are CSRF-exempt. client_id is enforced against an allowlist (default: shithub-cli); requested scopes go through the standard pat.ValidScope filter so unknown scopes fail cleanly with invalid_scope. The minted PAT is disclosed exactly once — subsequent exchanges of the same device_code return invalid_grant even after successful approval. RFC 8628 §3.5 error semantics (authorization_pending, slow_down, access_denied, expired_token) are honored.
  • Capability: device-code added to /api/v1/meta.
  • REST: actions workflows + workflow_dispatch (S50 §13 part 1). GET /api/v1/repos/{o}/{r}/actions/workflows lists the workflows discovered in .shithub/workflows/ at the repo's default-branch HEAD (or ?ref=); GET .../workflows/{id_or_file} fetches a single workflow by basename, full path, or a deterministic 64-bit hash of the path. POST .../workflows/{file}/dispatches triggers workflow_dispatch with optional ref and a typed inputs map (choice / boolean / string with required/default enforcement, same semantics as the HTML "Run workflow" button). Workflow_dispatch input validation now lives in a shared internal/actions/dispatch package consumed by both the REST and HTML surfaces. Enable/disable knobs are deferred to a follow-up (needs a new workflow_disabled table); every listed workflow is reported as state: "active" for now.
  • Capability: actions-workflows added to /api/v1/meta.
  • REST: actions lifecycle + artifacts + job logs (S50 §13 part 2). New migration 0064_workflow_disabled adds a per-workflow disable knob; trigger.Enqueue now consults it and short-circuits matching events for disabled workflows. The list endpoint surfaces this as "state": "disabled". REST additions: PUT /api/v1/repos/{o}/{r}/actions/workflows/{file}/enable and .../disable, DELETE /api/v1/repos/{o}/{r}/actions/runs/{run_id} (cascades through jobs/steps/log-chunks/artifacts; object-store cleanup is async best-effort), GET /api/v1/repos/{o}/{r}/actions/runs/{run_id}/artifacts + GET .../actions/artifacts/{aid} + GET .../actions/artifacts/{aid}/zip (streams from object store) + DELETE .../actions/artifacts/{aid}, GET /api/v1/repos/{o}/{r}/actions/jobs/{job_id}/logs (assembled transcript with ##[group]/##[endgroup] step markers).
  • Capabilities: actions-artifacts, actions-job-logs added to /api/v1/meta.
  • REST: actions secrets + variables (S50 §13 part 3). New internal/auth/sealbox package owns the server's X25519 keypair and exposes NaCl SealedBox decode. Clients fetch the public key via GET /api/v1/repos/{o}/{r}/actions/secrets/public-key (and the org analog), encrypt the secret value with crypto_box_seal, and PUT the base64 ciphertext + key_id. Server validates key_id, decrypts in memory, then re-encrypts with the shared storage AEAD for at-rest persistence — plaintext never reaches postgres. Secrets CRUD: GET .../secrets, GET .../secrets/{name}, PUT .../secrets/{name}, DELETE .../secrets/{name}. Variables CRUD (plaintext, ${{ vars.NAME }} namespace): GET/POST .../variables, GET/PATCH/DELETE .../variables/{name}. Both surfaces have repo- and org-scoped variants. Operator setup: SHITHUB_ACTIONS__SECRETS__BOX_PRIVATE_KEY_B64 carries the X25519 private key (32 bytes base64); unset means auto-generated-per-process with a loud warning at startup, which is dev-only behavior.
  • Capabilities: actions-secrets, actions-variables added to /api/v1/meta.
  • REST: actions caches (S50 §13 part 4 — §13 closure). New migration 0065_workflow_caches adds the workflow_caches table keyed on (repo_id, cache_key, cache_version, git_ref) with size + last_accessed_at + object_key columns and a unique constraint. REST surface: GET /api/v1/repos/{o}/{r}/actions/caches (paginated; optional ?key= and ?ref= filters; standard Link: headers; sorted recency-DESC by last_accessed_at), DELETE .../actions/caches/{cache_id} (single delete with cross-repo 404 guard + best-effort async S3 cleanup), DELETE .../actions/caches?key=...[&ref=...] (bulk delete by key; idempotent — 204 even with zero matches). The runner-side upload protocol that POPULATES this table is a future sprint; this REST surface lands first so operators have an audit + purge seat for when caches arrive.
  • Capability: actions-caches added to /api/v1/meta.
  • REST: repos follow-ups (S50 §2 closure). GET /api/v1/repos/{o}/{r}/readme[?ref=] returns the repo's README as a base64-encoded blob with download_url for the raw bytes (capped at 1 MiB to match the HTML render cap; prefers .md/.markdown over plain text when multiple READMEs exist). PUT /api/v1/repos/{o}/{r}/topics and DELETE .../topics replace and clear the topic set atomically (server-side normalization: lowercase, dedup; constraints: max 20, 1–50 chars of [a-z0-9-]). POST .../merge-upstream fast-forwards a fork's default branch to its upstream — refuses non-forks with 422 and divergent forks with 409 (users must reconcile locally). Scopes: repo:read on README, repo:write on topics and merge-upstream.
  • Capabilities: readme, topics, merge-upstream added to /api/v1/meta.

Added (internal)

  • issues.Edit orchestrator wraps UpdateIssueTitleBody with markdown re-render + cross-reference re-indexing. Used by the new PATCH-issue endpoint; available for the HTML edit flow when it lands.

Changed

  • JSON error envelope on /api/v1/*. 401 and 403 responses now emit {"error": "..."} with Content-Type: application/json (previously text/plain). Existing 4xx/5xx responses from the handler bodies are unchanged.

0.1.0 — TBD (operator fills in cutover date)

The first public release of shithub. Pre-1.0: there is no backward-compatibility promise yet. Migrations are forward-only; schema may change between minor versions.

Initial public surface

  • Identity — signup, email verification, password reset, TOTP 2FA + recovery codes, SSH keys, scoped PATs, sessions with per-account epoch invalidation.
  • Repositories — create, fork, archive, transfer, soft-delete with grace, rename with redirects, visibility toggles, branch protection, default-branch swap, topics, README/license/ .gitignore templates.
  • Git — bare repos on disk; HTTPS smart-HTTP push/pull; pre/post-receive hook integration.
  • Code browsing — tree, blob (chroma syntax highlighting), raw, blame, commit history, individual commit views, branch/tag listings, compare views, file finder.
  • Issues + PRs — full CRUD; reviews; required-reviewer enforcement; status-check gates; three merge methods.
  • Social — stars, watches, forks, /explore, stargazer/ watcher lists.
  • Search — code, repo, user, issue.
  • Notifications — in-app inbox, email fan-out, one-click unsubscribe.
  • Orgs + teams — roles, invitations, one-level nesting, max-of-sources policy.
  • Webhooks — HMAC-signed delivery, exponential backoff, auto-disable, SSRF defense, redelivery UI.
  • Observability — structured logs, Prometheus metrics, optional OTel tracing, Sentry-protocol error reporting.
  • Operations — Ansible playbook, systemd units, Caddy edge, WireGuard mesh for monitoring, Postgres WAL archive + daily logical backups to Spaces, cross-region DR, restore drill.
  • Public landing page on / for anonymous viewers; signed-in viewers get a quick-link dashboard.
  • Lightweight status page at docs.<host>/status.html.
  • Cutover artifacts under deploy/cutover/.
  • Public docs site built with mdBook.
  • Operator runbooks for incidents, backups, restore, upgrade, rollback, rotate-secrets, rotate-keys, regenerate-akc, drain-workers, read-only-mode, day-one.
  • a11y tooling (pa11y + axe) and k6 load-test scenarios.
  • THIRD_PARTY_NOTICES.md with a CI-verified generator.

Known gaps at v0.1.0

  • SSH git transport (HTTPS only)
  • Actions / CI runner
  • Packages, Releases, Pages, Projects, Gists
  • GraphQL API (only a small REST surface today)
  • Activity feed UI

These are all on the post-MVP roadmap.

View source
1 # Changelog
2
3 All notable changes to shithub are documented here. This project
4 follows [Keep a Changelog](https://keepachangelog.com/en/1.1.0/)
5 conventions and [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
7 Pre-1.0 versioning: minor versions may break the API. The
8 stability contract begins at v1.0.0; until then, expect changes
9 between minor releases.
10
11 ## [Unreleased]
12
13 ### Added
14
15 - **REST API contract (S50 §0).** `GET /api/v1/meta` returns the
16 server's version stamp and a list of feature capability strings
17 for client-side feature detection. Every `/api/v1/*` response
18 now carries `X-RateLimit-Limit`, `X-RateLimit-Remaining`,
19 `X-RateLimit-Reset`, and (when PAT-authenticated) `X-OAuth-Scopes`.
20 The 403 scope-reject response also carries
21 `X-Accepted-OAuth-Scopes`. Operators tune the API rate-limit
22 budgets via `ratelimit.api.authed_per_hour` /
23 `ratelimit.api.anon_per_hour` (defaults: 5000 / 60).
24 - **Pagination helper** `internal/web/handlers/api/apipage`
25 emits canonical RFC 8288 Link headers (`first`/`prev`/`next`/`last`)
26 with absolute URLs rooted at the configured public base URL.
27 - **REST: user emails (S50 §1).** `GET /api/v1/user/emails` lists
28 the authenticated user's emails. Optional `?verified=true|false`
29 filter. Scope: `user:read`.
30 - **REST: user SSH keys (S50 §1).** `GET/POST /api/v1/user/keys`
31 and `GET/DELETE /api/v1/user/keys/{id}` expose CRUD for git
32 authentication keys. Signing keys are tracked separately by a
33 new `kind` column on `user_ssh_keys` and remain on the HTML
34 surface for now. Scopes: `user:read` for GETs, `user:write` for
35 mutations.
36 - **Capabilities:** `user-emails`, `ssh-keys` added to
37 `/api/v1/meta` response.
38 - **REST: repos core (S50 §2).**
39 `GET /api/v1/user/repos`, `GET /api/v1/users/{username}/repos`,
40 `GET /api/v1/orgs/{org}/repos`,
41 `GET /api/v1/repos/{owner}/{repo}`,
42 `POST /api/v1/user/repos`,
43 `POST /api/v1/orgs/{org}/repos`,
44 `PATCH /api/v1/repos/{owner}/{repo}` (description, has_issues,
45 has_pulls, archived, visibility), and
46 `DELETE /api/v1/repos/{owner}/{repo}` (soft-delete).
47 Visibility-aware listing: a user's `/users/{u}/repos` shows
48 private rows only to that user; an org's `/orgs/{o}/repos`
49 shows private rows only to members. Single-repo GETs `404`
50 for callers who can't see the row (no existence leak).
51 - **Capability:** `repos` added to `/api/v1/meta`.
52 - **REST: issues + comments + lock (S50 §3).**
53 `GET /api/v1/repos/{o}/{r}/issues` (with `?state=` filter and
54 `Link:`-header pagination),
55 `GET /api/v1/repos/{o}/{r}/issues/{number}`,
56 `POST /api/v1/repos/{o}/{r}/issues`,
57 `PATCH /api/v1/repos/{o}/{r}/issues/{number}` (title/body
58 author-gated, state/state_reason policy-gated),
59 `GET / POST /api/v1/repos/{o}/{r}/issues/{number}/comments`,
60 `PATCH / DELETE /api/v1/repos/{o}/{r}/issues/comments/{cid}`,
61 `PUT / DELETE /api/v1/repos/{o}/{r}/issues/{number}/lock`.
62 - **REST: repo labels (S50 §3).**
63 `GET / POST /api/v1/repos/{o}/{r}/labels` and
64 `GET / PATCH / DELETE /api/v1/repos/{o}/{r}/labels/{name}`.
65 - **Capabilities:** `issues`, `labels` added to `/api/v1/meta`.
66 - **REST: milestones + assignees (S50 §3 follow-up).** Full CRUD
67 for `/api/v1/repos/{o}/{r}/milestones` (with `?state=` filter
68 on list and live `open_issues`/`closed_issues` counters on
69 every response), plus `GET /api/v1/repos/{o}/{r}/assignees`
70 (repo owner + collaborators eligible for issue assignment).
71 Scope: `repo:read` on GETs, `repo:write` on mutations.
72 Mutations gate on `ActionIssueLabel`.
73 - **Issue PATCH extensions.** `PATCH /api/v1/repos/{o}/{r}/issues/{n}`
74 now accepts `labels`, `assignees`, and `milestone` fields with
75 GitHub-style full-replace semantics. Each gates on its own
76 policy action (`ActionIssueLabel` / `ActionIssueAssign`) so a
77 caller missing one capability gets a clean 403 rather than a
78 partial update. Unknown label names or assignee usernames →
79 422; cross-repo milestone ids → 422.
80 - **Capabilities:** `milestones`, `assignees` added to
81 `/api/v1/meta`.
82 - **Reach:** `internal/web/handlers/api.resolveAPIRepo` now
83 resolves both user-owner and org-owner repos — check-runs and
84 every later batch implicitly gain org-repo support.
85
86 ### Added (internal)
87
88 - **REST: pull requests core (S50 §4).**
89 `GET /api/v1/repos/{o}/{r}/pulls` with `?state=` and `?draft=`
90 filters,
91 `GET /api/v1/repos/{o}/{r}/pulls/{number}`,
92 `POST /api/v1/repos/{o}/{r}/pulls`,
93 `PATCH /api/v1/repos/{o}/{r}/pulls/{number}` (title/body
94 author-gated, state via `ActionPullClose`, draft→ready
95 author-only),
96 `GET /api/v1/repos/{o}/{r}/pulls/{number}/commits`,
97 `GET /api/v1/repos/{o}/{r}/pulls/{number}/files`,
98 `PUT /api/v1/repos/{o}/{r}/pulls/{number}/merge` (honoring
99 the repo's default merge method and the optional `sha`
100 head guard). Reviews + comments + reviewers + update-branch +
101 auto-merge land in a follow-up.
102 - **Capability:** `pulls` added to `/api/v1/meta`.
103 - **REST: PR reviews + inline comments + requested reviewers (S50 §4b).**
104 `GET / POST /api/v1/repos/{o}/{r}/pulls/{number}/reviews`
105 (events `APPROVE` / `REQUEST_CHANGES` / `COMMENT`, with
106 pending-draft attachment on submit),
107 `GET / POST /api/v1/repos/{o}/{r}/pulls/{number}/comments`
108 (inline review comments with file_path / side / position
109 anchoring, `pending` drafts, `in_reply_to_id` threading), and
110 `GET / POST / DELETE /api/v1/repos/{o}/{r}/pulls/{number}/requested_reviewers`
111 (by `user_id` or `username`).
112 - **Capability:** `pr-reviews` added to `/api/v1/meta`.
113 - **REST: search (S50 §5).** `GET /api/v1/search/repositories`,
114 `GET /api/v1/search/issues?type=issue|pr`, and
115 `GET /api/v1/search/code` over the existing FTS corpus.
116 Canonical gh-shaped envelope `{ total_count,
117 incomplete_results, items }` with `Link:` pagination.
118 Anonymous callers allowed (visibility filter inside the search
119 package narrows to public). `?q=` honors the existing operator
120 vocabulary (`repo:`, `is:`, `state:`, `author:`, phrase). The
121 `search/commits` and `search/users` endpoints, plus the
122 `sort=`/`order=` knobs, are deferred to follow-ups.
123 - **Capability:** `search` added to `/api/v1/meta`.
124 - **REST: orgs (S50 §7).** `GET /api/v1/user/orgs` (self),
125 `GET /api/v1/users/{username}/orgs` (public; shithub has no
126 hidden membership distinction in v1),
127 `GET /api/v1/orgs/{org}` (single fetch; 404 for soft-deleted),
128 `GET /api/v1/orgs/{org}/members`. Scope: `user:read`.
129 - **Capability:** `orgs` added to `/api/v1/meta`.
130 - **REST: repo webhooks (S50 §8).** Full CRUD over a repo's
131 webhook subscriptions: `GET/POST /api/v1/repos/{o}/{r}/hooks`,
132 `GET/PATCH/DELETE /api/v1/repos/{o}/{r}/hooks/{id}`. Deliveries
133 read-side: `GET /api/v1/repos/{o}/{r}/hooks/{id}/deliveries`
134 (paginated; `Link:` headers) and
135 `GET /api/v1/repos/{o}/{r}/hooks/{id}/deliveries/{did}` (full
136 transcript). `POST .../deliveries/{did}/redeliver` re-enqueues.
137 Scope: `repo:write`; role floor: settings:general. Webhook
138 secrets are write-only — set on create, rotated via PATCH's
139 `secret` field, never echoed back. Create-time SSRF gate
140 rejects loopback / private / disallowed-port targets so
141 misconfigurations surface synchronously instead of as silent
142 delivery failures.
143 - **Capability:** `webhooks` added to `/api/v1/meta`.
144 - **REST: branches + tags (S50 §9).** Read-only ref enumeration:
145 `GET /api/v1/repos/{o}/{r}/branches` (paginated; each entry
146 carries `protected` reflecting the longest-prefix match against
147 the configured branch-protection rules, plus `is_default`),
148 `GET /api/v1/repos/{o}/{r}/branches/{name}` (slashes in branch
149 names accepted verbatim or URL-encoded), and
150 `GET /api/v1/repos/{o}/{r}/tags` (paginated). Scope: `repo:read`.
151 Empty / uninitialised repos return `[]` rather than `404`.
152 - **Capabilities:** `branches`, `tags` added to `/api/v1/meta`.
153 - **REST: repo collaborators (S50 §10).**
154 `GET /api/v1/repos/{o}/{r}/collaborators` (list),
155 `GET .../collaborators/{username}` (204 membership probe),
156 `GET .../collaborators/{username}/permission` (permission
157 level — `"none"` when not a collaborator),
158 `PUT .../collaborators/{username}` (add / upgrade, body
159 `{"role": "..."}` accepting both shithub names and gh-style
160 aliases `pull`/`push`),
161 `DELETE .../collaborators/{username}` (remove). Scope:
162 `repo:read` on GETs, `repo:write` on mutations; mutations
163 layer `ActionRepoAdmin` on top. Refuses (422) to enrol the
164 repo owner.
165 - **Capability:** `collaborators` added to `/api/v1/meta`.
166 - **REST: commits (S50 §11).** Read-only git history surface:
167 `GET /api/v1/repos/{o}/{r}/commits` (paginated; honours
168 `?sha=`, `?path=`, `?author=`, `?since=`, `?until=`) and
169 `GET /api/v1/repos/{o}/{r}/commits/{sha}` (full commit detail
170 with committer/parents/tree + per-file `status` and
171 `additions`/`deletions`, plus a rollup `stats` object). Backed
172 by `internal/repos/git.Log` / `git.GetCommit` — the response
173 stays in lock-step with the bare repository. Scope:
174 `repo:read`. Empty repos return `[]`; the single-commit GET
175 accepts any unambiguous SHA prefix.
176 - **Capability:** `commits` added to `/api/v1/meta`.
177 - **GPG keys + commit signature verification (S51).** Full
178 vertical: upload OpenPGP public keys at
179 `Settings → SSH and GPG keys`; shithub parses the armored
180 block (RSA≥2048, ECC, multi-subkey, encryption-only all
181 accepted) and stores primary + subkey fingerprint index. A
182 background worker eagerly backfills verification rows for the
183 uploader's existing commits across every repo, and the
184 `shithubd gpg-backfill-all` admin subcommand performs the
185 once-off bulk walk on deploy. Signed commits + annotated tags
186 render a green **Verified** pill on the commit list,
187 single-commit, and tag list pages; the popover surfaces the
188 signer, key id, and verified-at timestamp. The `reason` enum
189 mirrors GitHub's documented set (`valid`, `unsigned`,
190 `unknown_key`, `bad_email`, `unverified_email`, `expired_key`,
191 `not_signing_key`, `malformed_signature`, `invalid`). REST
192 surface: `GET/POST/DELETE /api/v1/user/gpg_keys[/{id}]` with
193 the gh-exact JSON shape (split `can_encrypt_comms` /
194 `can_encrypt_storage`, both `public_key` and `raw_key`,
195 subkeys-as-nested-objects, `emails[].verified` cross-checked
196 against the user's verified-email set). Scopes: `user:read`
197 for GETs, `user:write` for mutations. Existing
198 `/api/v1/repos/{o}/{r}/commits[/{sha}]` responses now carry a
199 `verification` object with the same shape gh emits.
200 Migrations: `0068_user_gpg_keys.sql`,
201 `0069_user_gpg_subkeys.sql`,
202 `0070_commit_verification_cache.sql`.
203 - **Capability:** `gpg-keys` added to `/api/v1/meta`.
204 - **REST: rulesets (S50 §9).** Three read-only endpoints
205 synthesizing GitHub's modern rulesets shape from shithub's
206 existing `branch_protection_rules` rows:
207 `GET /api/v1/repos/{o}/{r}/rulesets` (list),
208 `GET /api/v1/repos/{o}/{r}/rulesets/{id}` (single),
209 `GET /api/v1/repos/{o}/{r}/rules/branches/{branch}` (rules
210 applying to a branch — every matching pattern, not just the
211 longest-match the pre-receive enforcer uses). One protection
212 row maps to one ruleset; each configured field projects as a
213 typed rule (`pull_request`, `non_fast_forward`, `deletion`,
214 `required_signatures`, `required_status_checks`). Scope:
215 `repo:read`. Cross-repo lookups 404. Mutating rulesets via
216 REST is a future surface — for now use the web UI at
217 `Settings → Branches`.
218 - **Capability:** `rulesets` added to `/api/v1/meta`.
219 - **REST: repo contents (S50 §12).**
220 `GET /api/v1/repos/{o}/{r}/contents/{path}[?ref=]` returns
221 either a directory listing (dirs first, then files
222 alphabetically) or a single file with base64-encoded
223 `content`, `encoding`, `size`, and a `binary` flag (UTF-8
224 validity check). Files over 1 MiB come back as
225 `truncated: true` with empty content — clients fall through
226 to the raw download path. Scope: `repo:read`. Empty `/contents`
227 path returns the repo root.
228 - **Capability:** `contents` added to `/api/v1/meta`.
229 - **REST: forks (S50 §13).**
230 `GET /api/v1/repos/{o}/{r}/forks` (paginated; per-row
231 visibility filter so private forks of public repos only
232 surface to authorized viewers) and
233 `POST /api/v1/repos/{o}/{r}/forks` (fork into the
234 authenticated user's namespace; optional `name`/`visibility`
235 body). Reuses the existing `internal/repos/fork` orchestrator
236 and enqueues the on-disk clone via the
237 `repo:fork_clone` worker, so the response returns
238 immediately with `init_status: "init_pending"`. Org-target
239 forks land in a follow-up.
240 - **Capability:** `forks` added to `/api/v1/meta`.
241 - **REST: notifications (S50 §14).** User-scoped inbox surface:
242 `GET /api/v1/notifications` (defaults to unread only;
243 `?all=true` includes read; paginated with `Link:` headers),
244 `GET /api/v1/notifications/threads/{id}` (single fetch with
245 existence-leak-safe cross-user 404),
246 `PATCH /api/v1/notifications/threads/{id}` (mark read/unread
247 — empty body / `unread:false` → read; `unread:true` flips
248 back), and `PUT /api/v1/notifications` (mark all read).
249 Scopes: `user:read` on GETs, `user:write` on mutations. All
250 routes are implicitly scoped to the authenticated user.
251 - **Capability:** `notifications` added to `/api/v1/meta`.
252 - **REST: watching / subscriptions (S50 §15).** Per-repo
253 watch-level management mirroring GitHub's
254 `/repos/{o}/{r}/subscription` shape:
255 `GET .../subscribers` (paginated watcher list excluding
256 `ignore` and suspended users), `GET .../subscription`
257 (viewer's level + `explicit` flag distinguishing the
258 implicit `participating` default from an explicit choice),
259 `PUT .../subscription` (set `all` / `participating` /
260 `ignore`), and `DELETE .../subscription` (revert to implicit).
261 Reuses `internal/social.SetWatch` / `UnsetWatch` and
262 `socialdb.ListWatchersForRepo`. Scope: `repo:read` on GETs,
263 `user:write` on mutations.
264 - **Capability:** `watching` added to `/api/v1/meta`.
265 - **REST: events / activity (S50 §16).** Read-only activity feed
266 over `domain_events`: `GET /api/v1/repos/{o}/{r}/events`
267 (paginated; returns every event for the repo, gated by
268 `ActionRepoRead`) and `GET /api/v1/users/{username}/events`
269 (paginated; only `public=true` rows — matches gh, which never
270 surfaces private-repo activity on a user feed). Scope:
271 `repo:read` / `user:read`. Reuses the existing
272 `socialdb.ListEventsForRepo` and
273 `socialdb.ListPublicEventsForActor` queries.
274 - **Capability:** `events` added to `/api/v1/meta`.
275 - **REST: followers / following (S50 §17).**
276 `GET /api/v1/users/{username}/followers` and
277 `GET /api/v1/users/{username}/following` (both paginated;
278 `Link:` headers), plus the authenticated-user-scoped
279 `GET /api/v1/user/following/{target}` (204/404 membership
280 probe matching gh), `PUT /api/v1/user/following/{target}`
281 (follow), and `DELETE` (unfollow). Self-follow returns 422.
282 Reuses `internal/social.FollowUser` / `UnfollowUser` so the
283 follow rate-limit and `followed_user` domain event stay in
284 one place. Org-follow variants remain on the HTML surface.
285 - **Capability:** `followers` added to `/api/v1/meta`.
286 - **REST: actions workflow runs (S50 §18).** Read-only access to
287 the Actions run history:
288 `GET /api/v1/repos/{o}/{r}/actions/runs` (paginated; filterable
289 by `workflow_file`, `head_ref`, `actor`, `event`, `status`,
290 `conclusion`),
291 `GET /api/v1/repos/{o}/{r}/actions/runs/{run_id}` (single
292 run; existence-leak-safe cross-repo 404), and
293 `GET /api/v1/repos/{o}/{r}/actions/runs/{run_id}/jobs`
294 (job-index-ordered jobs list with `needs_jobs` graph). Reuses
295 the existing `actionsdb.ListWorkflowRunsForRepo` /
296 `GetWorkflowRunByID` / `ListJobsForRun` queries. Scope:
297 `repo:read`. Lifecycle controls (cancel / rerun / approve)
298 remain on the actions-lifecycle routes; this surface is
299 read-only.
300 - **Capability:** `actions-runs` added to `/api/v1/meta`.
301 - **REST: stargazers + starred lists (S50 §19).**
302 `GET /api/v1/repos/{owner}/{repo}/stargazers` paginates the users
303 who starred a repo (scope: `repo:read`); private-repo lists are
304 gated by `ActionRepoRead`. `GET /api/v1/users/{username}/starred`
305 paginates the repos a user has starred (scope: `user:read`);
306 cross-user views post-filter private repos the caller can't see.
307 Both endpoints emit standard `Link:` pagination headers and
308 recency-sort by `starred_at DESC`. The S26 caller-self star
309 routes (`/api/v1/user/starred` and `/api/v1/user/starred/{o}/{r}`)
310 are unchanged.
311 - **Capability:** `stargazers` added to `/api/v1/meta`.
312 - **REST: issue events / timeline (S50 §20).**
313 `GET /api/v1/repos/{owner}/{repo}/issues/{number}/events` returns
314 the issue's recorded timeline (every `closed` / `reopened` /
315 `labeled` / `unlabeled` / `milestoned` / `demilestoned` /
316 `locked` / `unlocked` / `referenced` / merged / push event), with
317 `actor_username` LEFT-joined and the raw event `meta` payload
318 preserved verbatim. Paginated with the standard `Link:` headers,
319 sorted oldest-first. Scope: `repo:read`.
320 - **Capability:** `issue-events` added to `/api/v1/meta`.
321 - **Device-code login (S50 §1, RFC 8628).**
322 `POST /login/device/code` issues a fresh authorization grant for
323 a non-browser client (CLI / TV / IoT). `POST /login/oauth/access_token`
324 polls for the user's approval and, on success, mints a PAT bound
325 to the requested scopes. The browser-facing verification page is
326 served at `GET /login/device` (CSRF-protected). The matching CLI
327 endpoints are CSRF-exempt. `client_id` is enforced against an
328 allowlist (default: `shithub-cli`); requested scopes go through
329 the standard `pat.ValidScope` filter so unknown scopes fail
330 cleanly with `invalid_scope`. The minted PAT is disclosed exactly
331 once — subsequent exchanges of the same `device_code` return
332 `invalid_grant` even after successful approval. RFC 8628 §3.5
333 error semantics (`authorization_pending`, `slow_down`,
334 `access_denied`, `expired_token`) are honored.
335 - **Capability:** `device-code` added to `/api/v1/meta`.
336 - **REST: actions workflows + workflow_dispatch (S50 §13 part 1).**
337 `GET /api/v1/repos/{o}/{r}/actions/workflows` lists the workflows
338 discovered in `.shithub/workflows/` at the repo's default-branch
339 HEAD (or `?ref=`); `GET .../workflows/{id_or_file}` fetches a
340 single workflow by basename, full path, or a deterministic
341 64-bit hash of the path. `POST .../workflows/{file}/dispatches`
342 triggers `workflow_dispatch` with optional `ref` and a typed
343 `inputs` map (choice / boolean / string with required/default
344 enforcement, same semantics as the HTML "Run workflow" button).
345 Workflow_dispatch input validation now lives in a shared
346 `internal/actions/dispatch` package consumed by both the REST
347 and HTML surfaces. Enable/disable knobs are deferred to a
348 follow-up (needs a new `workflow_disabled` table); every listed
349 workflow is reported as `state: "active"` for now.
350 - **Capability:** `actions-workflows` added to `/api/v1/meta`.
351 - **REST: actions lifecycle + artifacts + job logs (S50 §13 part 2).**
352 New migration `0064_workflow_disabled` adds a per-workflow
353 disable knob; `trigger.Enqueue` now consults it and short-circuits
354 matching events for disabled workflows. The list endpoint surfaces
355 this as `"state": "disabled"`. REST additions:
356 `PUT /api/v1/repos/{o}/{r}/actions/workflows/{file}/enable` and
357 `.../disable`,
358 `DELETE /api/v1/repos/{o}/{r}/actions/runs/{run_id}` (cascades
359 through jobs/steps/log-chunks/artifacts; object-store cleanup is
360 async best-effort),
361 `GET /api/v1/repos/{o}/{r}/actions/runs/{run_id}/artifacts` +
362 `GET .../actions/artifacts/{aid}` +
363 `GET .../actions/artifacts/{aid}/zip` (streams from object store) +
364 `DELETE .../actions/artifacts/{aid}`,
365 `GET /api/v1/repos/{o}/{r}/actions/jobs/{job_id}/logs` (assembled
366 transcript with `##[group]`/`##[endgroup]` step markers).
367 - **Capabilities:** `actions-artifacts`, `actions-job-logs` added to
368 `/api/v1/meta`.
369 - **REST: actions secrets + variables (S50 §13 part 3).**
370 New `internal/auth/sealbox` package owns the server's X25519
371 keypair and exposes NaCl `SealedBox` decode. Clients fetch the
372 public key via
373 `GET /api/v1/repos/{o}/{r}/actions/secrets/public-key` (and the
374 org analog), encrypt the secret value with `crypto_box_seal`, and
375 PUT the base64 ciphertext + key_id. Server validates key_id,
376 decrypts in memory, then re-encrypts with the shared storage
377 AEAD for at-rest persistence — plaintext never reaches postgres.
378 Secrets CRUD: `GET .../secrets`, `GET .../secrets/{name}`,
379 `PUT .../secrets/{name}`, `DELETE .../secrets/{name}`. Variables
380 CRUD (plaintext, `${{ vars.NAME }}` namespace): `GET/POST
381 .../variables`, `GET/PATCH/DELETE .../variables/{name}`. Both
382 surfaces have repo- and org-scoped variants. Operator setup:
383 `SHITHUB_ACTIONS__SECRETS__BOX_PRIVATE_KEY_B64` carries the
384 X25519 private key (32 bytes base64); unset means
385 auto-generated-per-process with a loud warning at startup, which
386 is dev-only behavior.
387 - **Capabilities:** `actions-secrets`, `actions-variables` added to
388 `/api/v1/meta`.
389 - **REST: actions caches (S50 §13 part 4 — §13 closure).** New
390 migration `0065_workflow_caches` adds the `workflow_caches` table
391 keyed on `(repo_id, cache_key, cache_version, git_ref)` with
392 size + last_accessed_at + object_key columns and a unique
393 constraint. REST surface:
394 `GET /api/v1/repos/{o}/{r}/actions/caches` (paginated; optional
395 `?key=` and `?ref=` filters; standard `Link:` headers; sorted
396 recency-DESC by `last_accessed_at`),
397 `DELETE .../actions/caches/{cache_id}` (single delete with
398 cross-repo 404 guard + best-effort async S3 cleanup),
399 `DELETE .../actions/caches?key=...[&ref=...]` (bulk delete by
400 key; idempotent — 204 even with zero matches). The runner-side
401 upload protocol that POPULATES this table is a future sprint;
402 this REST surface lands first so operators have an audit + purge
403 seat for when caches arrive.
404 - **Capability:** `actions-caches` added to `/api/v1/meta`.
405 - **REST: repos follow-ups (S50 §2 closure).**
406 `GET /api/v1/repos/{o}/{r}/readme[?ref=]` returns the repo's
407 README as a base64-encoded blob with `download_url` for the raw
408 bytes (capped at 1 MiB to match the HTML render cap; prefers
409 `.md`/`.markdown` over plain text when multiple READMEs exist).
410 `PUT /api/v1/repos/{o}/{r}/topics` and
411 `DELETE .../topics` replace and clear the topic set atomically
412 (server-side normalization: lowercase, dedup; constraints: max
413 20, 1–50 chars of `[a-z0-9-]`). `POST .../merge-upstream`
414 fast-forwards a fork's default branch to its upstream — refuses
415 non-forks with 422 and divergent forks with 409 (users must
416 reconcile locally). Scopes: `repo:read` on README,
417 `repo:write` on topics and merge-upstream.
418 - **Capabilities:** `readme`, `topics`, `merge-upstream` added to
419 `/api/v1/meta`.
420
421 ### Added (internal)
422
423 - `issues.Edit` orchestrator wraps `UpdateIssueTitleBody` with
424 markdown re-render + cross-reference re-indexing. Used by the
425 new PATCH-issue endpoint; available for the HTML edit flow when
426 it lands.
427
428 ### Changed
429
430 - **JSON error envelope on `/api/v1/*`.** `401` and `403`
431 responses now emit `{"error": "..."}` with
432 `Content-Type: application/json` (previously `text/plain`).
433 Existing `4xx`/`5xx` responses from the handler bodies are
434 unchanged.
435
436 ## [0.1.0] — TBD (operator fills in cutover date)
437
438 The first public release of shithub. Pre-1.0: there is no
439 backward-compatibility promise yet. Migrations are forward-only;
440 schema may change between minor versions.
441
442 ### Initial public surface
443
444 - **Identity** — signup, email verification, password reset, TOTP
445 2FA + recovery codes, SSH keys, scoped PATs, sessions with
446 per-account epoch invalidation.
447 - **Repositories** — create, fork, archive, transfer, soft-delete
448 with grace, rename with redirects, visibility toggles, branch
449 protection, default-branch swap, topics, README/license/
450 .gitignore templates.
451 - **Git** — bare repos on disk; HTTPS smart-HTTP push/pull;
452 pre/post-receive hook integration.
453 - **Code browsing** — tree, blob (chroma syntax highlighting),
454 raw, blame, commit history, individual commit views, branch/tag
455 listings, compare views, file finder.
456 - **Issues + PRs** — full CRUD; reviews; required-reviewer
457 enforcement; status-check gates; three merge methods.
458 - **Social** — stars, watches, forks, `/explore`, stargazer/
459 watcher lists.
460 - **Search** — code, repo, user, issue.
461 - **Notifications** — in-app inbox, email fan-out, one-click
462 unsubscribe.
463 - **Orgs + teams** — roles, invitations, one-level nesting,
464 max-of-sources policy.
465 - **Webhooks** — HMAC-signed delivery, exponential backoff,
466 auto-disable, SSRF defense, redelivery UI.
467 - **Observability** — structured logs, Prometheus metrics,
468 optional OTel tracing, Sentry-protocol error reporting.
469 - **Operations** — Ansible playbook, systemd units, Caddy edge,
470 WireGuard mesh for monitoring, Postgres WAL archive + daily
471 logical backups to Spaces, cross-region DR, restore drill.
472 - **Public landing page** on `/` for anonymous viewers; signed-in
473 viewers get a quick-link dashboard.
474 - **Lightweight status page** at `docs.<host>/status.html`.
475 - **Cutover artifacts** under `deploy/cutover/`.
476 - **Public docs site** built with mdBook.
477 - **Operator runbooks** for incidents, backups, restore, upgrade,
478 rollback, rotate-secrets, rotate-keys, regenerate-akc,
479 drain-workers, read-only-mode, day-one.
480 - **a11y tooling** (pa11y + axe) and **k6 load-test scenarios**.
481 - **THIRD_PARTY_NOTICES.md** with a CI-verified generator.
482
483 ### Known gaps at v0.1.0
484
485 - SSH git transport (HTTPS only)
486 - Actions / CI runner
487 - Packages, Releases, Pages, Projects, Gists
488 - GraphQL API (only a small REST surface today)
489 - Activity feed UI
490
491 These are all on the post-MVP roadmap.
492
493 [Unreleased]: https://shithub.sh/shithub/shithub/compare/v0.1.0...trunk
494 [0.1.0]: https://shithub.sh/shithub/shithub/releases/tag/v0.1.0