Skip to content

chore(deps): move the Effect checker to 0.68 - #1425

Merged
allisonmahmood merged 2 commits into
mainfrom
build/effect-tsgo-0.68
Nov 18, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
build/effect-tsgo-0.68

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Nov 13, 2026 •

Copy link
Copy Markdown
Owner

What changed

Builds were stuck on the Effect checker @effect/tsgo 0.62.0. Newer releases renamed the rule that keeps JSON.parse and JSON.stringify out of Effect code, and the old name failed every build. This moves the checker to 0.68.1 and renames the rule, so it checks exactly what it checked before. Nothing changes for people using Patchy.

Supersedes #1381, whose lint, release-tarball, server-image, cli-smoke, tier2-smoke and browser jobs all failed on the same build error.

Look at

The renamed rule. @effect/tsgo split preferSchemaOverJson into globalJsonInEffect, which checks JSON inside Effect code as the old rule did, and globalJson, which checks the rest of a file. With the old name still in tsconfig.base.json, every effect-tsgo tsc program fails with exit code 2. From #1381's lint job:

warning TS377158: Effect diagnostic rule `preferSchemaOverJson` is deprecated; use `globalJsonInEffect` or `globalJson` instead. effect(deprecatedRuleName)
@patchy/sql#build:  ERROR  command (packages/sql) pnpm run build exited (2)

Both tsconfigs now use globalJsonInEffect (error in the base config, off for tests, as before). globalJson stays at its default, off: it would flag 137 places in package source, in code the rule set has never checked. Turning it on is a separate decision.

The per-file directives. In a // @effect-diagnostics directive, the old name no longer turns anything off. With only the tsconfigs renamed, packages/execution fails on 0.68.1:

src/inspection.ts(87,15): error TS377157: This Effect code uses `JSON.stringify`, which throws instead of failing with a typed error. [...] effect(globalJsonInEffect)

Renaming preferSchemaOverJson:off to globalJsonInEffect:off in all twelve directives fixes it, and each keeps its written reason. No other diagnostic is new, and no rule is turned off.

The compiled output doesn't change. Each package with an effect-tsgo tsc build was compiled with both the 0.62.0 and the 0.68.1 binaries into separate output folders. The 1,756 files across 20 packages are byte-identical, and the only thing 0.62.0 reports is that it doesn't know the new rule name.

How it was verified

  • pnpm typecheck --force on 0.68.1 (every package build, typecheck:tests, infra, the dev runner and the CLI): 25 of 25 tasks pass. Before the directive rename, @patchy/execution#build failed as shown above.
  • pnpm verify on a shared machine under heavy load (load average 66 to 74): format, lint, typecheck, synth, postgres-concurrency and tier2-smoke pass, and every package builds inside cli-smoke and browser. The remaining failures are timeouts, or come from that shell's node being a system Node with no npm beside it (install, cli-smoke's install line, install.test.ts). Neither can come from a change whose compiled output is byte-identical. Reruns: install.test.ts passes 9 of 9 with the pinned Node 24 first on PATH. Of the 15 test files that timed out, 9 passed on a batch rerun, and the other 6 each passed on their own. With Node 24 first on PATH, test:packed-cli-e2e, test:packed-preact-e2e and test:packed-install-e2e all pass.
  • pnpm install --frozen-lockfile accepts the lockfile, which changes only the @effect/tsgo entries.

TypeScript stays at 7.0.2. Every checker from 0.62.0 to 0.68.1 supports 7.0.2, 7.1.0-beta and one 7.1.0-dev nightly, and 7.0.2 is the newest stable release. 0.68.1 is the newest checker that pnpm's one-day minimumReleaseAge allows. It adds only quick-fix and --tsrs-lint changes on top of 0.68.0.

Release impact

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

A dev dependency and compile-time rule names only. The emitted JavaScript and declarations are byte-identical, and typescript and Effect don't move.

  • What does a revert leave behind? Nothing. It puts back the old checker and the old rule name.
  • Does the release before it still work with that? Yes. What ships is the same code.

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

🤖 Generated with Claude Code

@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 size:s Under 100 changed lines labels Nov 13, 2026
@allisonmahmood allisonmahmood changed the title build(deps): move the Effect checker to 0.68 chore(deps): move the Effect checker to 0.68 Nov 13, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Code review (GPT 6.1 Sol, xhigh) at a1aac4ec: no blocker, and no loss of existing enforcement.

Checked and held: globalJsonInEffect keeps every check preferSchemaOverJson made and also catches an aliased JSON.stringify; the twelve directive edits are exact renames that keep their reasons; no other configured rule was renamed, removed or changed its default; api and core emit byte-identical output on both checker versions (124 and 388 files); typescript 7.0.2 is the newest stable version 0.68.1 supports; the lockfile moves only the checker and its platform packages.

Two nits, fixed in c77d8ce5 (comments only):

  • tsconfig.test.json said a tsconfig's plugin settings replace the base's. The checker merges the severity maps, so a rule left out there keeps the base's setting.
  • tsconfig.base.json still named the retired rule in a comment.

One finding not fixed here, on purpose. The review rates leaving the new whole-file rule globalJson off as should-fix, because console, dates, randomness, timers, fetch and UUIDs all have their whole-file rule on. This PR keeps the enforced rule set exactly as it was: turning globalJson on flags 137 places in package source and 656 in tests, which is a change of its own and not a version bump. The base config's comment now states the exception. Whether to adopt globalJson, and the other new off-by-default rule effectTryWithoutCatch, is a separate decision.

allisonmahmood and others added 2 commits November 18, 2026 22:30
@effect/tsgo renamed preferSchemaOverJson to globalJsonInEffect, which
checks JSON.parse and JSON.stringify inside Effect code as before, and
added globalJson for the rest of a file. The old name in tsconfig is now
a deprecation warning that fails every build, and in a per-file
`@effect-diagnostics` directive it no longer turns anything off.

Rename it in both tsconfigs and in the twelve directives. globalJson
stays off, its default, so the rule set checks what it checked before.
TypeScript stays 7.0.2, the newest stable release the checker supports.

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

Review follow-up. The base comment no longer names the retired rule, and
the test config's comment no longer says its plugin settings replace the
base's: the checker merges the severity maps.

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

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked b219ac96584ea0a9290fde5ee017716ed3fe14ed (base 93a489851e8e7093059c450afaeb2ccc8950798a) on team and brightline, by GPT 6.2 Sol in T3 Code.

Done means

  • Rebased lockfile: passed. On Node 24 and pnpm 12.20.0, both pnpm install --frozen-lockfile and plain pnpm install succeeded and left the lockfile byte-identical to the committed file. The frozen install passed pnpm's supply-chain policy check with the repo's release-age setting.
  • Head checks: passed. pnpm check passed format, lint, typecheck, synth and tests. All 25 typecheck tasks and all 3,728 tests in 336 files passed, including the offline GitHub and Pidgeon suites.
  • Diagnostic enforcement: passed. The two config maps and all 12 directives matched the base after normalizing the rule rename. A JSON.parse inside Effect.gen and an unsuppressed copy of the existing JSON.stringify each failed with TS377157 effect(globalJsonInEffect). Clean package typechecks passed after removing the probes. The same JSON probe passed under the test config, and JSON outside Effect passed under the package config.
  • Compiler output: passed. With head sources held fixed, 0.62.0 and 0.68.1 emitted 1,824 byte-identical files across 20 compiler-built packages, including JavaScript, declarations and maps. The older checker emitted with its expected unknown-rule warning against the head config. The byte comparison covers compiler output for identical input sources.

Golden journeys

  • Sign in and publish a page: passed. Ada published a tier 1 HTML file with the packed CLI. Ben saw the signed-out door (401), returned to the same patch after sign-in (200), saw the page in its frame and on Home, and got the door again after sign-out (401). Retiring showed the notice in place of the frame, and restoring returned the page at the same address.
  • Log a machine in: passed. Ada confirmed the CLI's handoff in the browser, whoami named the confirmed machine and logout revoked it.
  • Invite and join: passed. Ada invited a new person who joined Acme Co and reached Home. Ada also revoked a pending invitation and deactivated and reactivated Ben.
  • Share and unshare: passed. The kickoff brief answered 401 while company-only, rendered for a signed-out reader after sharing (200), and answered 401 for a fresh signed-out request after switching back. The first browser retained its previously cached public response within the documented cache window.
  • Find and open a tool and use it live: passed. Jordan found Kudos through Home search and opened its frame. The kudos he sent appeared on Priya's open wall without a reload.
  • Use a tier 2 tool: passed. Jordan moved a sample New Business deal from Lead to Discovery and back on Allison's open board. Spend returned own_approval when Jordan tried to approve his own request.
  • Built release journey: passed. pnpm test:packed-tier2-e2e ran the compiled server and release CLI through init, publish, two-viewer sync, mutation retry, sharing, files, member lookup and CSV.

Rollback answers: Match the diff. Reverting restores the previous checker, configs and directives together. The preceding release can use the same persisted state and wire contracts.

Not run

  • Full local pnpm verify and live integration checks. Local acceptance used pnpm check, the packed tier 2 suite and the offline scenarios above.

Notes

  • GitHub Actions checks were still pending on this head when the verdict was posted. Local acceptance above passed.

@allisonmahmood
allisonmahmood merged commit f32691c into main Nov 18, 2026
28 checks passed
@allisonmahmood
allisonmahmood deleted the build/effect-tsgo-0.68 branch November 18, 2026 23:09
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:server Touches the server area size:s Under 100 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant