Skip to content

feat(primitives): add persistent tables to patches - #214

Merged
allisonmahmood merged 4 commits into
mainfrom
sdk/198-tables
Sep 12, 2026
Merged

allisonmahmood merged 4 commits into
mainfrom
sdk/198-tables

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Sep 10, 2026 •

Copy link
Copy Markdown
Owner

Patches need structured data that survives new published versions without breaking older open versions.

This adds patch-owned tables with additive provisioning at publish, cumulative owner-visible inventory, and seven viewer-bound runtime operations. Incompatible changes are refused before content writes and rechecked under the patch lock. Indexed list queries use storage-column ordering, and reads enforce the 8 MiB limit before materialization. Index-size feasibility checks run at publish only; runtime writes rely on PostgreSQL's own B-tree limit, mapped to too_large, without additional CHECK constraints.

Stacked on #213 (sdk/197-runtime); this PR intentionally targets that branch, not main. Files, shared-table uses, and higher tiers remain outside this change.

Closes #198.

Verification

  • pnpm lint
  • pnpm typecheck
  • pnpm test — 461 tests across 48 files
  • pnpm format:check
  • Actual-handler EXPLAIN ANALYZE over 100,000 rows: default pagination uses a backward index scan reading 101 rows; equality lookup uses an index scan reading one row.
  • Postgres/PGlite contracts cover additive provisioning, old-version writes after omission/index addition, native index-key overflow and rollback, bounded reads, readiness upgrades, and claimed-placement refusals. UUIDv7 coverage checks timestamp, version, variant, and random fields.
  • Real HTTP + CLI smoke over disposable Postgres during implementation.

Implemented with OpenAI GPT-6 Astra in Oh My Pi.

@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 size:l 501-1,000 changed lines labels Sep 10, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Astra review

Reviewed origin/sdk/197-runtime...HEAD (d18e4f9 → b259032) against #198 and its referenced SDK spec §§4, 8 and 12. One pass, no subagents; merge blockers only.

Standards

1. [P2 — method] Make tables.list actually use its indexes

TableOperations.ts:551–555 and 628–635.

The query construction defeats the indexes provisioned for the two ordinary list paths:

  • Non-null equality uses IS NOT DISTINCT FROM, which becomes a filter rather than a B-tree index condition. A lookup for one title scans every row.
  • Default newest-first listing orders by the createdAt output alias produced by to_char, while the window orders by the underlying timestamp. This introduces an additional sort and processes the entire table before the page limit. DESC NULLS LAST also prevents the built-in ascending index from satisfying the window ordering through a backward scan, even though both system columns are non-null.

Evidence: exercised the actual handlers, captured their SQL, and ran EXPLAIN (ANALYZE, BUFFERS) against 100,000 PGlite rows. Equality scanned 100,000 rows and discarded 99,999. The default 100-row page scanned all 100,000 and spilled a 4,496 KiB sort. Using ordinary equality and qualified storage-column ordering changed those plans to index scans visiting one and 101 rows respectively.

Fix: emit = for non-null equality and IS NULL for null; order by qualified storage columns, using index-compatible ordering for the non-null system keys, before formatting timestamps. Preserve the cursor/null contract. This is a merge-blocking method judgment, not a style violation: the advertised indexed pagination currently incurs whole-table work on ordinary reads.

Spec

No separate merge-blocking intent or YAGNI findings. Files, uses, and higher tiers remain refused as #198 requires.

Verification: all 86 tests across the eight focused Primitives, publish/content, runtime, API-schema and company-database test files passed. The query-plan probe above is additional evidence; no implementation files changed.

Summary: Standards: 1 finding — indexed lists perform whole-table scans/sorts. Spec: 0 findings — no separate blocker.

@allisonmahmood allisonmahmood left a comment

Copy link
Copy Markdown
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code review — PR 214 vs #198

Fixed point: sdk/197-runtime (d18e4f9). Commits: 75fe247, 23c26a1, b259032.

Reviewed along Standards, Spec (#198 + spec §4/§8/§12 and the tables/publish decisions), Effect service conventions, ADR-0009, hit-every-surface, tests, and method/YAGNI.


Spec

Against #198 (“tables, provisioned additively at publish”) and spec §4 / tables-half of §8 / §12.

MISSING: none. @patchy/primitives with CONTEXT.md, additive diff + provision under withPatchLock, seven tables.* operations, publish provisioned / unused / schemaRevision, has_primitives, owner GET /api/patches/:patchId/inventory, mutations through RuntimeLog, public versions not_available_on_public, unique-on-existing refused, unused-table sentence, no FKs, one-statement DDL, config-driven §12 bounds, files/uses/tier 1 still refused.

PARTIAL: CREATE SCHEMA lives in Inventory.ensurePatch (still under withPatchLock). Unshare warning hardcodes 0 declaring patches because #200 uses are refused — equivalent for this ticket.

CREEP:

  1. 2,000-byte index-key ceiling — not in #198 or §12 (row 1 MB, batches 1000/8 MB, list 100/1000, result 8 MB). Tables.ts INDEX_KEY_MAX_BYTES, validateData preflight, ADD CONSTRAINT patchy_index_size_* CHECK, write-path IndexKeyTooLarge.
  2. 1597-column cumulative not_additive limit — schemas.ts + Tables.ts; not on §4’s refusal list (it is Postgres’s 1600-column ceiling minus the three system columns).
  3. Ticket 1 tables shape tightened — 63-char names, 32-column indexes, int32, calendar ISO, NUL/surrogate filters.

WRONG:

  1. id is not a UUIDv7 generator. Spec §4 / #179: “System columns id (UUIDv7 text, server-generated)”. TableOperations.ts newId mashes Clock.currentTimeMillis().toString(16) with slices of randomUUID() and a forced 7. It matches a v7 regex (the contract asserts that) but is not RFC 9562 rand_a / rand_b.
  2. New non-unique indexes install a write rule old tabs never saw. #179 refuses unique-on-existing “because old writers would start failing on a rule they never saw”; #166: “an old bundle must still be able to insert.” Provision still adds CHECK (pg_column_size(ROW(...)) <= 2000) when adding an allowed non-unique index (Tables.ts ~528–533), so an old insert of previously legal wide text can fail too_large.

Standards

No UI-consistency findings. TableOperations.make is the right shape: one consumer (server wiring into Runtime.layer) stays a module. Tables as a service is justified (Patches + env-acquired Inventory/Config). Namespace imports, inline Context.Service, make/layer, catchTags, and no domain runPromise look right. ADR-0009 in record/provision: platform patch-row lock first; withPatchLock only for existing inventory or introducing tables; primitive-free creates skip withCompany.

  1. HARD — packages/primitives/src/TableOperations.ts ~233–240. sqlFailure wraps a native CHECK SqlError as new InvalidRow({ table, problem: "invalid value" }) with no cause. UniqueViolation / IndexKeyTooLarge in the same mapper keep it. effect-service-conventions: wrapping a real failure must preserve cause. Same gap at ~600–602: cursor decode uses mapError(() => new InvalidCursor(...)) and drops the parse failure.
  2. JUDGEMENT — packages/patches/src/Patches.ts ~770–774. Preflight tables.validate runs under withCompany after the platform transaction ends, with no withPatchLock. ADR-0009: inventory reads take the same patch lock as provisioning. Provision re-checks under the lock, so this is an unlocked existing-inventory scan, not the commit path.
  3. JUDGEMENT — GET /api/patches/:patchId/inventory has schemas, handler, and docs/API.md, but no CLI --json command. YAGNI may apply: this CLI is still file-only. Issue 198 did not ask for patchy tables.
  4. JUDGEMENT — Duplicated Code. PATCHY_RUNTIME_ROW_BYTES is read separately in Tables.ts ~445, TableOperations.ts ~108–110, and Runtime.ts.
  5. JUDGEMENT — Mysterious Name. PgCompanyDatabases.ts upgradeReady maps failures with operation: "initialize" (~181–184). Same discriminator as first-time inventory init, not an upgrade.

Method and YAGNI

Intent: a patch declares tables; publish additively provisions real Postgres (never JSONB, never drops); old open versions keep working; agents get named refusals instead of migrations.

Method: packages/primitives diffs the manifest against company-DB inventory, emits one-statement DDL under withPatchLock, then Runtime handlers run the seven ops against the loaded version’s tables.

That is the shape #198 asked for. The spine is the right size: unused ≠ drop, ops bind to the loaded manifest, primitive-free creates never touch a company DB, not_additive names object / change / fix.

What grew past the constraint is a second limiter in front of Postgres: hashed CHECK constraints, pg_column_size(ROW(...)) with TOAST-forcing casts, and a 2,000-byte product ceiling, plus extra internal error types (ItemLimit, IndexKeyTooLarge) that restate wire too_large. Hashed index names are justified (63-byte identifier limit in one schema namespace). The CHECKs are not: btree already rejects oversized keys (54000, already mapped). Publish preflight of existing keys can stay as not_additive; runtime can map 54000 to TooLarge. That also removes the old-writer footgun in Spec WRONG #2.

Inventory.upgrade on ready Postgres placements is a necessary bugfix (CREATE TABLE IF NOT EXISTS will not add ref_table). PGlite ensureReady returns a ready placement without upgrade — a persisted pre-ref_table dir will fail ref columns.

readInventory / provision treat CompanyDatabaseNotReady as empty. GET inventory already refuses source_unavailable. Only a missing placement (status: null) is empty; a claimed placement is not. Unlikely to bite the same patch under the platform row lock, but fail closed anyway.

Verdict: slightly overbuilt. The product is real Postgres tables with an additive inventory. The surprising extra is wrapping btree in CHECKs so a 2,000-byte ceiling can be ours instead of Postgres’s.


Tests / surfaces

Done-when cases are mostly covered on both Postgres and PGlite via shared contracts (additions, refusals, rename sentence, omitted defaults, old insert omitting a later column, cursor-ahead, getMany order + dangling null, serialize two publishes, revision-only-on-change, primitive-free skip). Unique insertMany race is correctly Postgres-only.

Gap: no runtime call through an old loaded manifest after the table was omitted from a newer version. withTable resolves via binding.manifest.tables, so it should work; #198’s “old tab whose version still defines an omitted table keeps reaching it” is the product promise and is unproven.

operationsContract.ts packs insert/get/list/cursors/uniques/old-writer/delete into one it.effect. Focused, but heavy.

Wire, docs, CONTEXT-MAP, docs/product.md § Primitives, README layout, ADR-0004, skill + skills-lock.json, Dockerfile copy of primitives all landed. No patchy tables CLI, as specified.


Summary: Spec — 3 creep, 2 wrong (worst: CHECK on new indexes breaking old writers). Standards — 1 hard, 4 judgements (worst: dropped cause on wrapped SQL). Method is the one #198 asked for; the CHECKs are the piece I would delete before merge.

@allisonmahmood

Copy link
Copy Markdown
Owner Author

Astra and grok review disposition

Fixed and pushed in f28a63c.

Fixed

  • Astra: indexed list queries. Non-null equality now uses =, null uses IS NULL, and ordering/seek predicates reference storage columns rather than formatted timestamp aliases. Storage ordering and LIMIT happen before formatting. The non-null built-in keys allow a backward index scan; nullable-key cursor semantics remain intact.
  • grok: index-size CHECKs and old writers. Deleted the CHECK DDL, generated constraint names, and CHECK-specific runtime classification. Native B-tree SQLSTATE 54000 maps to too_large with its cause, without claiming a 2,000-byte runtime limit. Tests prove old writers can insert/update compressible 8,192-character values after a non-unique index is added, while native oversized incompressible keys fail and roll back.
  • UUIDv7. Replaced string splicing with explicit RFC 9562 field packing: 48-bit Unix milliseconds, version 7, variant 10, and independently random rand_a/rand_b bits. Tests inspect the fields and timestamp, not just a regex.
  • Dropped causes. InvalidRow preserves the immediate wrapped SQL error; InvalidCursor preserves the decode error. Direct validation failures can still originate without a cause.
  • Ready-directory upgrades. PGlite now explicitly upgrades an already-ready persisted directory. A close/reopen regression proves existing inventory survives and ref targets can be stored. PostgreSQL and PGlite upgrade failures now use operation: "upgrade", distinct from initialization.
  • Claimed placements. Only a genuinely absent placement (status: null) means empty inventory. Claimed placements fail closed during inventory reads, preflight, and final recording. Regressions cover both before-upload refusal and a state change after upload.
  • Old version after table omission. Added runtime coverage proving the latest manifest cannot read/write the omitted table while the older loaded manifest still can. Updated API/product docs and this PR description to remove the deleted runtime ceiling.

Kept, with reasons

  • Publish-time index-size preflight: retained the conservative 2,000-byte estimate as not_additive before upload, as requested. It installs no write rule; PostgreSQL alone governs runtime index-key acceptance.
  • 1,597 cumulative user columns: PostgreSQL supports 1,600 physical columns and we reserve three system columns. Early refusal avoids a late DDL failure.
  • Wire representability checks: kept 63-character names to prevent identifier truncation, 32-column indexes for PostgreSQL's index limit, int32 for SQL integer, calendar-valid ISO timestamps to avoid normalization, and NUL/surrogate checks because PostgreSQL text/jsonb cannot represent those inputs.
  • Inventory.ensurePatch owns CREATE SCHEMA: it already runs under the typed patch lock and owns the shared namespace; moving that statement would duplicate ownership.
  • Zero declaring patches in unshare warnings: accurate while all uses declarations remain refused; dependency counting belongs with feat(primitives): shared tables, read-only across patches #200.
  • Preflight lock arrangement: Inventory.read already acquires the same company patch lock as provisioning, while its caller holds the platform row lock. The later data-feasibility scan is deliberately advisory, not an unlocked multi-query inventory snapshot. Final provisioning re-reads and revalidates under both locks before DDL.
  • No inventory CLI command: feat(primitives): tables, provisioned additively at publish #198 requests the owner HTTP endpoint; the CLI remains file-only. Adding table/repo commands here would expand scope.
  • Per-capability row-limit configuration: all readers use the same environment key; this follows the existing Effect Config convention without introducing a cross-package configuration service.
  • Typed ItemLimit/IndexKeyTooLarge failures: they preserve item/table context and native causes while sharing the wire too_large code; no extra product limit remains.
  • Combined operation contract: retained its stateful transition coverage; query-plan and UUID checks are separate focused cases.

Verification and merge readiness

  • Local: pnpm lint, pnpm typecheck, pnpm format:check, and pnpm test passed — 461 tests / 48 files. Focused review regressions: 68 tests / 6 files.
  • Actual-handler EXPLAIN ANALYZE on 100,000 rows: default pagination uses a backward index scan reading 101 rows; equality lookup uses an index scan reading one row. These are asserted regression checks, not inferred plans.
  • CI run 34512477046 completed successfully for exactly f28a63c. All seven reported checks are green: lint, test (22), test (24), cli-smoke, clerk-live, dependency-review, and label.
  • GitHub reports no separately configured required-check subset. The PR is MERGEABLE / CLEAN, still based on sdk/197-runtime at d18e4f9. No new review findings appeared during verification.

No unresolved blockers. Ready to merge into the stacked base; not merged.

Implement #198 with cumulative inventory, seven bound runtime operations, and Postgres/PGlite contracts.
Encode schema boundaries, preflight index and row expansion limits, and bound read and batch result collection. Refs #198.
Address Astra and grok review: use storage-column index ordering, remove index-size CHECKs, generate RFC 9562 UUIDv7 IDs, preserve causes, and fail closed during incomplete placement readiness.
@allisonmahmood
allisonmahmood merged commit c8bfbbf into main Sep 12, 2026
7 of 14 checks passed
@allisonmahmood
allisonmahmood deleted the sdk/198-tables branch September 12, 2026 11:48
allisonmahmood added a commit that referenced this pull request Sep 12, 2026
Patches can persist table rows, but cannot yet store named files
independently of published versions.

Extend the existing additive provisioning path with file stores and add
put/get/list/delete operations. Immutable objects and serialized index
updates preserve previous files on failed writes; authenticated byte
routes enforce size limits and no-store responses. Omitting a store or
cleaning up a version keeps its files intact.

**Stacked on #214 (`sdk/198-tables`).** This PR targets that branch and
should merge after it.

Closes #199.

### Verification
- Full offline suite: 477 tests passed; post-review focused checks: 108
tests passed.
- Typecheck, lint, and formatting passed.
- Real-server smoke covered a 20 MiB binary round-trip, overflow
refusal, authorization, retention, and logging.
- Independent standards and spec reviews have no remaining findings.

Implemented with GPT-6 Astra in the Oh My Pi harness.
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:server Touches the server area size:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(primitives): tables, provisioned additively at publish

1 participant