Skip to content

feat(integrations): patches read GitHub CI, logs and pull requests - #1451

Merged
allisonmahmood merged 6 commits into
mainfrom
t3/github-reads
Nov 14, 2026
Merged

allisonmahmood merged 6 commits into
mainfrom
t3/github-reads

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Nov 14, 2026 •

Copy link
Copy Markdown
Owner

Follows #1448, which has merged. The two ship in one release: #1448 makes GitHub connections, and this is what patches read from them.

What changed

A GitHub connection had nothing to read. Patch code now has twelve fixed, read-only operations on one: repositories, workflows, runs and their jobs, a job's log, a commit's checks, and pull requests with their files and reviews. Builders' agents read the real connection while they build, and each read shows on the connection's page.

Closes #1441.

Look at

What a patch gets, from patch code through the client over a scripted GitHub: a run list, the failing job, the end of its log, a pull request's review count, and a repository outside the connection.

{
  "runs": { "complete": true, "runs": [
    { "id": 3003, "title": "Retry the webhook queue", "branch": "queue-retry", "status": "in_progress", "conclusion": null },
    { "id": 3002, "title": "Bump the payments client", "branch": "main", "status": "completed", "conclusion": "failure" },
    { "id": 3001, "title": "Add the export endpoint", "branch": "main", "status": "completed", "conclusion": "success" } ] },
  "failingJob": { "id": 7002, "name": "test (node 24)", "steps": ["Run tests: failure"] },
  "log": { "truncated": true, "size": 1221075, "textBytes": 1048576, "lastLines": [
    "2026-11-14T09:02:58.000Z ✗ payments client > retries a declined card",
    "  AssertionError: expected 2 retries, got 0",
    "2026-11-14T09:02:59.000Z ##[error]Process completed with exit code 1." ] },
  "pull": { "number": 42, "title": "Bump the payments client", "reviews": { "approved": 1, "changesRequested": 1, "complete": true } },
  "outsideTheSet": { "code": "not_found", "message": "docs isn't one of this connection's repositories. An admin adds repositories on the connection's page." }
}

Each read shows on the connection's page. This page is the real Calls tab over rows a harness wrote in the shape the dev door writes them; the door's own recording is covered by a test in DevReads.test.ts.

A GitHub connection's Calls tab with six Dev calls

The repository boundary. Every call looks the repository up in the connection's current set before GitHub is asked, and addresses it by numeric id. An installation token reads any public repository anywhere (shown on #1439), so this check is what keeps a patch to its connection: the test asks for a public repository outside the set and asserts not_found with no request sent.

Job logs are read from GitHub's log store by Patchy itself: the redirect must be https, on the default port, to the one host pattern shown on #1439; Patchy asks for one byte to learn the length, then the closed range for the end, and accepts only an exact 206. Neither request carries the token or follows a redirect, and the signed URL never leaves the host. The tests cover a store that ignores the range, changes between the two requests, redirects, or answers from another host.

On real GitHub, through the development App installed on one public repository:

  • The live tier read it on every route, the job log through the log store: GitHub live run: 12 reads., Tests 1 passed.
  • pnpm dev up github seeded a connection from that installation in 12 seconds.
  • A fresh agent with only the Patchy skill, asked as a person would for a CI dashboard and a pull-request board, built and published both in about three minutes and 48 tool calls. Its five refused commands were the launcher's own approval limits. Both pages showed the repository's real runs and pull requests; they are real data, so they aren't attached. The agent had no failed run among the latest to try, so the dashboard's failure view was then called on an older failed run: it returned the failing job, its failing step and the end of the real log.
  • Check runs were asked of GitHub for two branches with / in their names, one with four parts, with the slashes kept: both answered. An unknown branch answered 422, as the code reads it.

How it was verified

  • pnpm check at the head: format, lint, typecheck and synth pass, and 336 of 337 test files (3,700 of 3,701 tests). The one failure was a 5-second timeout in PatchesApi.test.ts, which this branch doesn't touch, on a loaded machine; the file passes run alone, 67 of 67.
  • pnpm verify ran before the review fixes: every stage passed except one test timeout in a suite this branch doesn't touch (Fleet.test.ts), on a loaded machine; the file passes run alone, 43 of 43.
  • Tests are offline, against a scripted GitHub. The runs on real GitHub above were made at f6ef89a9, before the rebase onto main, which changed none of this branch's files.

Not checked:

  • The live tier has not run in CI. GitHub live is written and skips: it needs the CI App registered and installed on a Patchy-owned test repository, and the secrets docs/DEVELOPMENT.md lists. The run above used the development App by hand.
  • A private repository, and an organization's installation, with this code. GitHub: a development App, and a probe of the facts the integration plan rests on #1439 showed GitHub's side of both.
  • An empty job log answering 416 is still assumed, not shown.

Release impact

  • Breaking — requires action from anyone already running this
  • Not breaking — no action required

No migration and no new setting. The operations are new; nothing existing changes shape. The host-secret keys #1448 adds are what turn GitHub on.

One-way with #1448: production can't roll back past this release while a patch version declares a GitHub connection or calls these operations.

  • What does a revert leave behind? Patch versions built against the GitHub client, and recent-call rows for GitHub reads.
  • Does the release before it still work with that? Not for those patch versions: it has no GitHub operations to serve them. Everything else works. Fix forward instead.

Review

GPT 6.1 Sol reviewed the branch. Fixed in f6ef89a9: a pull-request listing could hand out a cursor its own decoder refused past page 3,000; exactly 100 reviews read as incomplete (it now follows GitHub's Link header); completeness at exactly one page was untested for jobs and checks; and two skills were out of date.

Not acted on:

  • Cursors are not signed. As for the other integrations, a cursor names only another page of a list its caller may already read, so altering one gains nothing.
  • The repository name a patch asked for is recorded in recent calls even when it isn't in the connection. It is what an admin needs to see why a call was refused, and it is bounded by the repository-name pattern.
  • Jobs, checks, workflows and reviews are one page of 100, flagged incomplete past that. A run with more than 100 matrix jobs can't be read in full yet.

Built by Claude Opus 5.5 (xhigh) and reviewed by GPT 6.1 Sol (xhigh) in T3 Code, directed by Claude Fable 5.2.

🤖 Generated with Claude Code

@allisonmahmood allisonmahmood added the one-way Rolling production back past this PR would break the release before it label Nov 14, 2026
@github-actions github-actions Bot added area:server Touches the server area area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:integrations Company connections and integration implementations area:ui Portal and first-party browser pages, shared rendering and styles size:xl Over 1,000 changed lines; review in multiple passes labels Nov 14, 2026
@allisonmahmood
allisonmahmood force-pushed the t3/github-ci-pr-dashboard branch from 74d2e89 to 9b13ec1 Compare November 14, 2026 22:41
Base automatically changed from t3/github-ci-pr-dashboard to main November 14, 2026 23:23
allisonmahmood and others added 6 commits November 15, 2026 00:24
The runtime and dev-read grammar gain GitHub's read operations: repositories,
workflows, runs and their jobs, a job's log, a commit's check runs, and pull
requests with their files and reviews. Each takes a repository by its name in
the connection and plain filters, never a path, query string or search, and
answers Patchy's own trimmed records, every list with `complete`.

New bounds in the registry: `runtime.github.bytes` for arguments,
`github.list.items` for lists without a cursor and `github.log.bytes` for the
end of a log. The runtime and the callback gateway hold GitHub's arguments to
their bound and keep the operations to tier 2 actions, as for every
connection.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…uests

A GitHub connection could be connected but read nothing. Now a tier 2 action
reads it through `ctx.connections.<alias>`: `repos`, `workflows`, `runs` with
their jobs, `jobs.log`, `commits.checks` and `pulls` with files and reviews.

- Every call holds one of the installation's slots across its token and its
  reads, has its caller checked again once it holds it, and looks the
  repository's name up in the connection's current set before GitHub hears
  anything. Requests address the repository by numeric id; an answer naming
  another repository is refused.
- A cached token GitHub refuses with a 401, or a 403 that isn't a limit
  answer, is dropped and the read runs once more with one minted then; a
  refused fresh token ends the call unavailable. A limit answer writes the
  installation's cooldown first, as for mints.
- `jobs.log` reads GitHub's redirect itself, only to the log store's host
  pattern over https, asks the store for the length and then the closed range
  of the log's end pinned to its ETag, with no token, cookie or trace context
  and no redirect followed, and refuses anything else. The signed URL stays in
  the host; the text is inert data, never logged.
- Every list says whether it's complete; cursors are bound to the connection,
  the repository's id and the arguments.
- `patchy dev` reads live through the instance's dev door (ADR-0013), each
  read a Dev call on the connection's page. `readsLive` now counts GitHub
  declarations, so dev asks for its machine key.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
`pnpm test:github` reads a Patchy-owned test repository through the CI App on
every by-id route the reads use, the job log through the log store's redirect,
and checks a run of one repository is not found under another's id. It notices
a route or the log host changing only when it runs, and skips without the CI
App's settings and the test installation. The `GitHub live` workflow runs it on
main and on this repository's pull requests that touch GitHub; it is never a
required check.

The scripted GitHub's connection seed becomes `save`, which both tiers start
from.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
- `docs/product.md` gains Reading GitHub: the twelve operations, the set
  check, by-id addressing, the token retry, reviews, completeness and the log's
  two closed ranges; the GitHub connection section and the Integrations lede
  stop saying the reads come later.
- ADR-0013 is amended: GitHub reads live in dev, with no revision.
- The `patchy-github` project skill teaches the reads, their records, paging
  and `complete`, untrusted logs, people by login and id, dev and refusals.
- The global `patchy` skill's Building a tool section names GitHub among the
  connections a handler reaches, with `skills-lock.json` refreshed; the loop
  skill, the SDK's capability catalogue, the glossaries, the README, ADR-0004,
  the CLI README and DEVELOPMENT.md follow.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…that left

`dense` had a GitHub connection connected, paused, suspended on GitHub and
needing attention for an uninstalled App, but none for the other two reasons a
GitHub connection needs attention. An offline GitHub connection that needs
attention now names its `reason`: `uninstalled` (as before), `permissions`,
paused by a Test that found the installation no longer grants Actions, or
`left`, a repository gone from the installation, which stays connected.
`dense` gains `github/design-system` and `github/marketing` for them.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
A pull-request listing no longer hands out a cursor past the last page a
cursor may name; it stops there and says the list is incomplete. Reviews
carry no total, so whether more follow is read from GitHub's Link header:
exactly one page of them is complete. Jobs and checks are tested at
exactly a page and one past it. The GitHub skill and the dev-loop skill
say what reads live in dev and what is retried.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked 526486387643f887ff0985cae75d777fbedf008a (base 5b2b939a1479a22276285bae02fea7c2ab030a12, main) on fresh github and team scenarios, by GPT-6.1 Sol in the Codex harness (T3 Code). I did not write this change.

git range-diff f6ef89a9~6..f6ef89a9 52648638~6..52648638 marks all six commits =: their patches are unchanged by the rebase. This is a new run at the detached head, with the tests and product checks below rerun here. The previous verdict's results are not counted as this run's passes.

Done means

  • A fresh agent builds both boards showing real data: not rerun. The PR's author reports that journey on the previous head; the unchanged range supports retaining that evidence, but I did not independently reproduce the fresh-agent build. On this head, the generated dashboard/board client checks passed, and my temporary tier 2 patch read real run and pull-request records through patchy dev.
  • A patch reads a job log's end and says when its start was cut: passed. The generated dev client returned a nonempty real job log within the byte bound, with a boolean truncation flag. The rerun scripted tests verify the tail and final line of a log larger than the bound, UTF-8 boundaries, short/empty logs, exact ranges, changed logs, ignored ranges, redirects and foreign hosts. The live sample does not establish truncation of a large real log.
  • An outside repository, including a public one, returns not_found: passed. The real dev client refused an invented repository outside the selected set. Scripted tests additionally prove that both unselected and unrelated public repositories are refused before any upstream request, and reject wrong-repository run/job references and mismatched response identities.
  • Every list says whether it is complete: passed. The live repository/run/pull/job answers carried boolean flags. Scripted coverage reran for all list shapes, the run and file caps, exact-page boundaries, reviews' next-page header and cursor binding.
  • Builders read the real connection and each read appears on its page: passed. A freshly initialized tier 2 patch declared github/platform; its generated client made five successful reads and one refused outside-set read. The connection's Calls page returned 200 and showed all six operations marked Dev. Real names, titles, log text and identifiers were inspected only in memory, without attaching or transcribing them.

Golden journeys and regression risks

  • GitHub offered only with its App: passed on fresh instances. With the App configured, the catalogue offered GitHub and the seeded connection read successfully. With an empty temporary XDG_CONFIG_HOME and all five App settings empty, GitHub disappeared from the catalogue and CLI discovery. Connect GET/POST, start and callback returned 404; setup returned to Integrations. The five existing integrations stayed offered and their connect pages returned 200.
  • Sign in, publish and find/open a page: passed locally. The installed scenario CLI published a synthetic page; a signed-out reader got the 401 door with the sign-in header and private/no-store policy. A second company member found it on Home and in search, then opened its frame.
  • Share/unshare and reverse lifecycle: passed locally. Company → public allowed a signed-out reader; public → company restored the door. Retire → restore and delete → restore removed and restored the frame at its existing address. Deleted-file restoration used its retained patch reference, as the CLI contract requires.
  • Live tools and tier 2 execution: passed via this head's runtime suites and CI. Local suites cover runtime admission, callbacks, subscriptions, production execution, clients and generated server wiring. CI's Firefox browser suite and packed tier 2 smoke passed, including two-viewer subscription behaviour. The named Kudos, New Business and Spend scenario interactions were not manually replayed here.
  • Machine login and invitation flows: outside this diff's behaviour changes; not replayed locally. CI's live Clerk and packed CLI checks passed.

Rollback answers: match the diff. There is no migration, infrastructure change or new host setting in this PR. It adds operations/client contracts that newly published versions can rely on, plus recent-call rows. The previous release cannot serve versions using these reads; the body correctly states the joint release with the connection change and the fix-forward floor. The one-way label is present. CI's rollback rehearsal passed.

Evidence rerun at this head

Using Node 24 and repository-pinned pnpm, one suite at a time:

GitHub suites + DevReads:                  6 files,  78 tests passed
Shared API/runtime/SDK/connection suites: 43 files, 441 tests passed
Client/guest/dev-resource/scenario suites: 7 files, 126 tests passed
Server-watch suite, alone:                1 file,    9 tests passed
Total:                                  57 files, 654 tests passed
Real product probe:
repositories, completed run, pull request and jobs: valid records
completeness flags: present
job log: nonempty and bounded
outside-set repository: not_found
Calls page: five successful Dev reads and one refused Dev read

Not run

  • The fresh-agent board-building trial described above; no independent new-head reproduction of that author-supplied evidence.
  • All twelve operations against live GitHub, a private repository, an organization's installation, a real empty-log 416, or live slash-containing refs. The small real sample deliberately limited shared installation usage; offline coverage is separate evidence. CI's GitHub live tier skipped because its CI App is not configured.
  • Full pnpm verify locally; the broader runtime, browser, platform, build and install matrix is taken from CI attached to this head.
  • A new visual capture of the unchanged dense connection states; no screenshots containing real GitHub data were taken or uploaded.

Notes

  • All CI checks finished: every executed check passed. Broader evidence relied on CI for the Node/Bun offline matrix, both browser suites, packed CLI/tier 2 smoke, platform installs, live Clerk, concurrency, lint/typecheck/synth, server image and rollback rehearsal. GitHub, Attio and IMAP live tiers skipped.
  • No review submissions or inline findings were present when checked.
  • Both throwaway instances and the patch dev session are down. The PR's code, branch, description and labels were left untouched; nothing was pushed or merged.

Checked by GPT-6.1 Sol (xhigh) in the Codex harness, through T3 Code.

@allisonmahmood
allisonmahmood merged commit b653816 into main Nov 14, 2026
29 checks passed
@allisonmahmood
allisonmahmood deleted the t3/github-reads branch November 14, 2026 23:40
allisonmahmood added a commit that referenced this pull request Nov 15, 2026
#1456)

## What changed

This adds release 44's What's new entry, written from `b653816`. It
covers everything merged since release 43's `through` (`1cbd39f`), and
sets the `patchy` release to `0.44.0` in `packages/patchy/package.json`
and `CURRENT_RELEASE`.

| Change | PRs |
| --- | --- |
| New: Connect GitHub | #1448, #1451 |
| New: Pin patches to your sidebar | #1437 |
| Improved: Patchy works in Firefox | #1427 |
| Improved: Your agent's Patchy skill keeps up | #1446 |
| Fixed: Dialogs close in Firefox | #1427 |
| Fixed: Publishing a tool no longer fails by chance | #1444 |
| Behind the scenes: agents read what each tier means before picking one
| #1438 |

#1445 is CI only and has no line. #1422 is release 43's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`.
- **GitHub is announced because this deploy makes it available.** The
production App is registered and its five settings are in place, so
GitHub is offered in Integrations once this ships. The code was run
against real GitHub before it merged (#1451). One check stays open on
#1440: someone who administers a repository without owning its
organization. That case fails closed until it is shown.
- **One test changed with it.** With GitHub off, a test searched the
whole catalogue page for the word "GitHub". The entry puts that word in
the What's new bell on every page, so the test now checks for the
catalogue's own GitHub card and link instead.
- **`pidgeon-suite` and `pidgeon-live` are red for a reason outside this
release:** Pidgeon is retiring the API the integration calls (#1457).
Neither is a required check, and this release neither fixes nor worsens
it.
- **Rollback safety, from the live commit `5decfef` (release 43) to this
PR's merge.** #1448 and #1451 are labelled `one-way`; the rest are not,
and each says release 43 reads what it leaves.
- #1448 adds migration 43's three tables and five host settings. Release
43 ignores both, and the rollback rehearsal passed on #1448's head.
  - #1437 adds a personal pins table that release 43 never reads.
- A patch version that declares a GitHub connection is what release 43
can't read. None can exist before this release.

If this release misbehaves, roll back to `5decfef` (release 43) while no
patch version declares a GitHub connection. Once one does, rolling back
past #1448 would break that patch, because release 43 can't read a
`github` declaration; fix forward instead.

## How it was verified

`pnpm format:check`, the What's new tests, the API suites and GitHub's
page tests pass locally.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

- **What does a revert leave behind?** Nothing: the entry and the
version number are in the tree.
- **Does the release before it still work with that?** Yes.

Written by Claude Fable 5.2 in Claude Code, through T3 Code.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Co-authored-by: Claude Fable 5.2 <[email protected]>
allisonmahmood added a commit that referenced this pull request Nov 19, 2026
…1426)

## What changed

Effect moves from 4.0.5 to 4.1.4 (`effect`, `@effect/platform-node`,
`@effect/sql-pg`, `@effect/sql-pglite`, `@effect/vitest`). People using
Patchy see no difference. Nothing stored changes: tokens, digests, HMACs
and sealed values are still made and checked by the same `node:crypto`
code. This supersedes #1380, whose CI was red because 4.1 stores
`HttpApiSchema.status` where our `refuse()` didn't look, so every
refusal answered 400.

Beside the Effect group, the lockfile moves only ws, to 8.23.0, which
`@effect/platform-node-shared` 4.1.4 pins exactly. undici 8.12.4 and
PGlite 0.5.16, which the 4.1 packages need, are already on main from
#1424, so the workspace holds one PGlite again.

## Look at

**Crypto.** 4.1 replaces `effect/Crypto` with per-family services and
drops crypto from the runtime `*Services` bundles. The `Cryptography`
seam stays as it was. `NodeCryptography.layer` now also provides
Effect's `SecureRandom` and `Digest`, using Effect's own Web Crypto
layers: no new dependency, nothing at import time, and the same
behaviour on Node and Bun. Every entrypoint and test layer already
provides it, so "provide `NodeCryptography.layer`" stays the one rule.
The seven direct `effect/Crypto` users take `SecureRandom` or `Digest`
instead. `@patchy/limits` can't depend on core, so `Digest` is what it
uses. AGENTS.md, the service-conventions spec and the oxlint messages
say this now.

**Refusal statuses.** 4.1's `HttpApiSchema.status` writes a key
annotation, which `SchemaAST.resolveAt` doesn't read. HttpApi's own
reader, `getStatusErrorSchema`, is internal and missing from the
published types, so `respond.ts` follows its rules exactly:
1. The last check that sets a status wins, looking into check groups
too.
2. Otherwise the schema's own annotation counts, and an explicit
`undefined` clears the status.
3. Otherwise the key annotation counts.
4. With none of those, the status is 500.

`respond.test.ts` compares each case with HttpApi's own reader. One
consequence: a schema with no status now answers 500, where it used to
answer 400. No current refusal schema lacks one.

**Request targets.** 4.1's server adapter turns an absolute-form target
into its path, and sets `Host` to the target URL's host, which drops
userinfo and the scheme's default port. The door's `Host` gate then saw
a cleaned-up host, so `POST http://<public host>/mcp` and `POST
https://user@<public host>/mcp` reached the bearer check instead of
answering 421. `RequestTrust.requestAuthority` now reads the target and
the `Host` fields from the Node request as the client sent them
(`request.source`). Sources without raw fields, such as a web `Request`
or the in-memory test client, keep the old reading. I also checked
everything else that reads the target or `Host`:
- The API guard, serving and the portal resolve `request.url` against
the configured origin, and compare `Origin` rather than `Host`. They
don't trust the target's authority, and the rewrite makes an absolute
target reduce to its path.
- The CLI dev server's DNS-rebinding guard compares `Host`. Browsers
send origin-form, which the adapter leaves alone, so the guard still
does its job.
- Two private listeners now accept an absolute-form target where they
used to refuse it before authentication, and the behaviour stays as it
is. The callback gateway (`CallbackGatewayApi.ts`) used to answer `POST
https://anything/callback` with 200 `invalid_request`; now it reaches
the bearer and identity checks. The supervisor's callback proxy
(`supervisor.ts`) looks up its callback path from the rewritten target.
Neither grants anything the checks behind it don't already require.

**Oversized uploads.** Under 4.1, an undeclared (chunked) body over its
cap is answered instead of reset. But the adapter then keeps reading up
to 256 KiB more with no deadline, so a sender that stalled kept its
connection until the runtime's own timeout. A declared length over the
cap had the same problem below 256 KiB, on origin/main as well.

A size refusal now closes the connection, through one hook:
`closeAfterAnswer` in `@patchy/api`. It adds `Connection: close` to the
current request's answer, and the adapter then ends the socket and
destroys it within its 500 ms grace. Measured here, the server closed it
about 7 ms after answering, on Node and on Bun. Every capped reader runs
the hook, for a cap crossed mid-stream and for a declared length over
the cap. Each keeps its existing status and body:
- `readBody`, for every JSON API route that reads one: 400 "Malformed
request body." mid-stream, 413 declared.
- The 16 form readers in auth and portal, through `capBody(maxBytes)`:
beta links, device login, the OAuth token request and consent answer,
machines, shortcuts, logout, terms, What's new, patch pages, sharing,
home (two), feedback, user lifecycle, and pinning. Their declared-length
prechecks run the hook too.
- The runtime's call, file and stage readers (413), and the
subscriptions stream (413).
- The callback gateway: the file bound and the byte budget answer, as
before, with a 200 refusal body.
- The supervisor's callback proxy (413).

One reader is left out: the MCP door reads a chunked body to its end by
design, so its refusal is unchanged. The device start, device poll and
shortcuts descriptions, and `docs/API.md`, say what the code does.
Nothing is stored on any refusal.

**Row ids.** 4.1's `SecureRandom.uuidV7` counts within a millisecond: 42
counter bits and 32 random. #214's contract test pins 74 random bits per
id, and Effect's own docs say a monotonic id reveals the one minted
before it. So `TableOperations` builds the UUIDv7 itself from the Effect
clock and 16 bytes from `SecureRandom`, clamping the timestamp to the
48-bit field as 4.0 did.

**Other behaviour 4.1 changed that tests asserted:**
- A failed migration step is a typed `MigrationError` (`kind: "Failed"`)
instead of a defect. Startup still fails and the process exits.
- The CLI parser now splits `-json=true` into `-j -s -o -n`, so
`jsonRequested` stops treating it as `--json`. A global flag's bad value
(`--log-level loud`) now goes through Effect's usage path like any other
parse error. That made the entrypoint's `InvalidValue` catch dead, so it
is gone. Under `--json` stdout stays empty; without it, usage comes
before the one line, as ADR-0004 allows.

**Mechanical.** `SqlClient.make` takes a `driver`, and `sql.insert`
takes a non-empty array. `docs/API.md` drops the eight duplicate
`RuntimeFailure_N` components that differed only by status.

**On top of the GitHub integration.** Everything on main since #1427 was
written against 4.0.5: the GitHub App connection (#1448) and its reads
(#1451), workerd binding its own port (#1444), CLI refresh (#1446) and
sidebar pins (#1437). Checked against each 4.1 change:
- **Crypto.** None of it uses `effect/Crypto`. `Cryptography` gains
`rsaSha256Sign` for the App's JWT, which runs on `node:crypto` like the
rest, and `NodeCryptography.layer` still provides it beside
`SecureRandom` and `Digest`.
- **Statuses.** It adds no routes and no status-bearing refusal schemas.
GitHub's refusals reach clients through the existing connection pages,
`ConnectionsApi` (whose declared errors HttpApi encodes itself) and the
runtime, which takes its status from the error. The GitHub, connections
and dev-read suites assert those statuses over `HttpApiTest` and real
sockets, and pass on 4.1.
- **Body reads.** The one new body read is the pin form, which provided
`MaxBodySize` directly. It now goes through `capBody`. GitHub's connect
flow adds none: its filter is a GET, and its choices post through the
connection page's existing form read, which #1434 caps.
- **Targets and `Host`.** The GitHub sign-in's redirect URI is built
from the configured origin, and nothing new reads `Host`.
- **The rest.** Nothing new calls `SqlClient.make`, the Migrator,
`uuidV7` or `ws`, and no new flag uses a single-dash long spelling.

**On top of Pidgeon's new API.** #1458 rewrote the Pidgeon integration
against 4.0.5, and nothing in it needed a 4.1 change:
- Its crypto goes through `Cryptography`.
- It adds no routes, status-bearing refusal schemas, body reads or CLI
flags. Its connect page posts through the connection page's existing
form read, which #1434 caps.
- It doesn't call `SqlClient.make`, the Migrator or `uuidV7`.
- Its migration `0044_pidgeon_drafts` joins the record behind this
branch's, and the record and upgrade tests pass.

## How it was verified

**Red, then green, on Effect 4.1.4:**

| Case | At 8980889 | Now |
| --- | --- | --- |
| `RequestTrust.test.ts`, the gate behind the real `NodeHttpServer`
adapter: `POST http://cloud.patchyhq.com/mcp` | passed the gate | 421 |
| `McpDoor.test.ts`, the whole server: `POST http://user@<host>/mcp` |
400 (past the gate) | 421 |
| Same tests: origin form, the door's own absolute target (200), two
`Host` fields | — | unchanged |
| `AuthApi.socket.test.ts` (JSON) and `AuthPages.socket.test.ts` (form):
an unterminated 8 KiB chunked upload | 400, connection still open at 3
s, on Node and Bun | 400, then closed, on Node and Bun |
| `AuthApi.socket.test.ts`: `Content-Length: 8192` sent with no body
(open on origin/main too) | 413, still open at 3 s, on Node and Bun |
413, then closed |
| `RuntimeApi.test.ts`: a call streamed just past its cap, a stage
upload streamed past its cap, and a stage upload declared past it | 413,
still open at 3 s, on Node and Bun | 413, then closed |
| `RuntimeStreamApi.test.ts`: a subscriptions body streamed past its cap
| 413, still open at 3 s, on Node and Bun | 413, then closed |
| `CallbackGatewayApi.test.ts`: a callback file body streamed past its
bound | 200 refusal, still open at 3 s, on Node and Bun | 200 refusal,
then closed |
| `respond.test.ts`: a status set inside a check group | 409 | 403, as
HttpApi |
| UUIDv7 contract: a clock at −1 ms | timestamp field all ones | 0 |

**Suites:**
- On the head rebased onto main at 2a17d16, which now carries the
Effect checker at 0.68 (#1425), `pnpm check` passes in full (3741
offline tests).
- `pnpm verify` on the previous head, on main at 47deb91:
- Pass in the full run: format, lint, typecheck, synth, the offline
tests on Node (3732) and Bun (3405), postgres-concurrency and install.
- Pass rerun alone: cli-smoke, tier2-smoke and the Chromium browser
suite (189). In the full run they couldn't find the browser builds that
Playwright 1.65 (from #1424) asks for; once installed, all three pass.
- Could not start: the Firefox suite, because Firefox there lacks the
system libraries it needs. CI's required `browser-firefox` job covers
it, and it passed in an earlier round (186 tests).
- The suites the Pidgeon rewrite touches pass on Node and on Bun (646
tests across 72 files each): all of `packages/integrations` and
`packages/api`, the CLI's `pidgeon`, dev-resource and dev-preparation
tests, and the server's migration record test.
- The GitHub integration's suites, run alone on 4.1, pass on Node (361
tests across 27 files, with portal and the CLI's repo, global-CLI and
dev-resource files) and on Bun (286 tests across 24 files; the CLI files
run on Node only). They cover:
- `github/Connections.test.ts`: connecting through the App against a
stub GitHub on real sockets.
  - `github/Operations.test.ts`: the reads.
  - `github/Pages.test.ts`: the connect pages.
- `github/Source.test.ts` and `Generate.test.ts`: the source and
generated tables.
- `ConnectionsApi.test.ts`, `ConnectionPages.test.ts` and
`DevReads.test.ts`, with their status assertions.
  - `NodeCryptography.test.ts`, including RS256 signing.
- Each rebase took main's lockfile and regenerated it with `pnpm
install`; it differs from main's only in the Effect group and ws.
- `install.test.ts` builds its PATH from the running Node, so these runs
put the repo's pinned Node 24 first.
- The supervisor's callback proxy gets the same hook, but has no socket
test: reaching it needs a live workerd resident to register the callback
path and capability.
- Not checked: the server image (`server-image` needs Docker; CI runs
it), live Clerk, and a deploy.

## Release impact

- [ ] **Breaking** — requires action from anyone already running this
- [x] **Not breaking** — no action required

This is a dependency bump, and the stored formats and the API's statuses
and bodies are unchanged. Three things a client could notice:
- An oversized chunked upload now gets its refusal and a closed
connection, where it used to get a reset.
- A declared length over a cap gets its 413 and a closed connection,
where the connection used to stay open.
- The undocumented single-dash `-json=<b>` spelling is no longer read as
`--json`. `--json` and `--json=<b>` are unchanged.

- **What does a revert leave behind?** Nothing: no migration, no new
stored shape. Ids, tokens, digests and sealed values are made the same
way on both sides.
- **Does the release before it still work with that?** Yes.

Built by Claude Opus 5.5 in T3 Code via Claude Code.

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

area:ci CI, shared testing infrastructure, development scripts and tooling area:cli Touches the cli area area:docs Touches the docs area area:integrations Company connections and integration implementations area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles one-way Rolling production back past this PR would break the release before it size:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GitHub: what patches read from a connection (CI, logs, pull requests)

1 participant