Skip to content

chore(deps): move to stable Effect 4.0.0 - #473

Merged
allisonmahmood merged 1 commit into
mainfrom
deps/effect-4
Oct 2, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
deps/effect-4

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 2, 2026 •

Copy link
Copy Markdown
Owner

Effect 4.0.0 shipped on Oct 1 and we were on 4.0.0-rc.117. Dependabot never opened a PR for rc.118 or 4.0.0 (its effect group hasn't run since #375), so this is by hand.

rc.118 removed the effect/unstable/* export paths. 462 imports across 185 files move to effect/http, effect/sql, effect/cli, effect/process, effect/reactivity, effect/encoding and effect/http-api (renamed from httpapi). Two API renames reached us:

  • Schema.isLengthBetween is now Schema.isBetweenLength (packages/api).
  • effect/Encoding was split into per-format modules, so the member directory cursor uses effect/encoding/Base64Url.

One behavior change broke tests, not production. HttpRouter.serve now builds its app in a forked memo map and hands the context it built, router included, to the layers around it (rc.117 kept the router private). HttpApiTest.groups captures its surrounding context, so in a suite that also serves on a socket the in-memory client registered its routes on the server's router and failed with "Method 'POST' already declared for route '/api/publish'" (11 tests in PatchesApi and SdkApi). Fixtures.ownRouter drops that router before the client builds its own, and replaces SdkApi's fresh-memo-map workaround, which no longer helped. In production, apps/server and the dev server put nothing that registers routes beside serve, and shared services are still provided outside it, so they're built once.

The rest of the rc.118 and 4.0.0 notes either don't touch our code (Schema.brand, partition order and Scope.close needing a Closeable all typecheck clean) or are covered by tests. For example, @effect/sql-pg now fails a transaction whose COMMIT comes back as ROLLBACK after a caught statement error, and no caller relies on the old silent rollback.

With Effect stable, the release-candidate handling AGENTS.md asked us to drop goes away: the minimumReleaseAgeExclude list, the effect-rc-bump label step and the AGENTS.md runbook. The Dependabot effect group stays (comments rewritten), because the packages still release in lockstep and the overrides make a lone bump fail. AGENTS.md now notes that effect/http, effect/http-api, effect/sql and effect/cli are still @stability unstable, so a minor Effect release can break them.

Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via codex.

@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:primitives Patch tables and files 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 Oct 2, 2026
Base automatically changed from deps/pnpm-11-28 to main October 2, 2026 14:28
effect and @effect/* move from 4.0.0-rc.117 to 4.0.0. Dependabot never
opened a pull request for rc.118 or 4.0.0, so this is by hand.

rc.118 removed the effect/unstable/* export paths: modules now import
from effect/http, effect/sql, effect/cli, effect/process,
effect/reactivity, effect/encoding and effect/http-api (renamed from
httpapi). It also renamed Schema.isLengthBetween to isBetweenLength and
split effect/Encoding into per-format modules; the directory cursor now
uses effect/encoding/Base64Url.

HttpRouter.serve now hands the context it built, router included, to the
layers around it. HttpApiTest captures its surrounding context, so in a
suite that also serves on a socket the in-memory client registered its
routes on the server's router and failed on the duplicates.
Fixtures.ownRouter drops that router before the client builds its own;
it replaces SdkApi's fresh memo map workaround.

With Effect stable, the release-candidate handling goes: the
minimumReleaseAgeExclude list, the effect-rc-bump label step and the
AGENTS.md runbook. The Dependabot effect group stays, because the
packages still release in lockstep and one bumped alone fails install.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
@allisonmahmood
allisonmahmood merged commit c57de3b into main Oct 2, 2026
16 of 18 checks passed
@allisonmahmood
allisonmahmood deleted the deps/effect-4 branch October 2, 2026 14:55
allisonmahmood added a commit that referenced this pull request Oct 2, 2026
`Fixtures.ownRouter` (from #473) inferred its requirements as `unknown`, which the
test typecheck reports in every suite that uses it.

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 2, 2026
… no accounts (#475)

Building Patchy Cloud was slower and less trustworthy than it should be,
for us and for agents. `pnpm test` took 8 minutes locally and 12.6 in
CI, almost all of it one file. Tests were never typechecked, and 256
errors were hiding there. `main` went red twice this week from a flaky
fleet test. A fresh clone couldn't start `pnpm dev` without Clerk keys.
And an agent had to read a 1,585-line DEVELOPMENT.md before starting
anything.

This makes the checks fast enough to run constantly and honest enough to
believe, puts them behind one command, and lets anyone run the whole
loop with no accounts.

**Faster**
- `cli.test.ts` (732 of the 759 seconds in CI's test job) is split into
eight files along its `describe` blocks, so vitest runs them in
parallel.
- Every vitest run and dev start rebuilt the packed CLI release (~16 s).
It is now reused when nothing it reads has changed: every module-graph
file, the workspace manifests and the lockfile, plus a check that every
output it made is still there.
- `pnpm typecheck` compiles each package once, through its build,
instead of building and then checking again.

**Honest**
- `tsconfig.test.json` typechecks every test and harness file, keeping
Effect's correctness rules and dropping its style rules. Fixing the 256
errors turned up three real test bugs: the dev-resources handlers ran
with `admin` undefined, a RuntimeApi test never sent the header it
claimed to check, and an ESLint test hook did nothing. #474 tracks a
fourth: typed file-route tests never send the file name.
- The fleet flake's cause: the test's clock barrier counted the
replenish loop's 5 s sleep as a lease renewal, so under load fake time
outran the renewal loop until the lease expired. The barrier now waits
for the renewal loop only. Instrumenting it showed two fibers handing
out tokens before the fix and one after.
- Cold PGlite operation tests and packed `patchy dev` starts get budgets
that survive a loaded run.
- pnpm 11.28 links skipped optional platform packages (e.g.
`lightningcss-darwin-x64`) to the workspace root, and the CLI suites'
offline registry was tarring the whole checkout because of it. That
failed whenever another suite wrote into the repo mid-archive. The
registry now accepts a package only when its name matches.
- Migrations come from one record, `apps/server/src/migrations.ts`, for
the server, the dev runner and the test template, with a test that ids
are unique and gap-free. New tests fail when `docs/API.md` or the global
skill's lock hash goes stale. The API.md test already caught #473
leaving it unrendered (same content, new order), so it is re-rendered
here.
- A `flaky` label, and DEVELOPMENT says to check it before treating a
red check as yours.

**One command**
- `pnpm check` runs format, lint, typecheck and the offline tests. `pnpm
verify` adds every acceptance suite CI runs except live Clerk, and
`--changed` skips them for docs-only or runner-only changes. These
replace `test:all`.
- CI now runs the tier 1/2 browser suite as a `browser` job, everything
except the one native-print test, which needs a display. The suite had
never run in CI, and five problems surfaced, all fixed:
- one test had drifted since #429 (Runtime refuses tier 1 `server.call`
with `access_denied`);
- an online-retry test raced the shell's up-to-30-second backoff.
Pinning `Math.random` to the worst case reproduces CI's failure exactly;
the test now steps the page clock;
- the harness proxy piped streams with `pipe`, so a host that died
mid-stream left the browser's stream open and silent forever. A SIGKILL
restart reproduces CI's failure. The proxy now uses `pipeline`, which
resets the stream as real ingress would;
- the harness lost a bind race when another process took its reserved
port. It now relaunches on a fresh port;
- native printing shared a test with unrelated sandbox and download
checks. It has its own `@print` test now, so the rest runs in CI.
- The ruleset is unchanged, so `browser` is not a required check.

**Local loop**
- `pnpm dev` signs people in as dev personas, and `--clerk` opts into
Clerk. Existing instances keep Clerk. Plain instances now listen on
loopback only.
- `pnpm dev shot <person> <path>` writes a full-page PNG of what that
person sees, patch frames included, and prints the status and any
browser errors.
- `pnpm dev up` adopts a running plain instance instead of refusing.

**Docs and skills**
- DEVELOPMENT.md goes from 99 KB to an 18 KB runbook. Running the server
by hand, the execution fleet and the spike deploy move to OPERATIONS.md.
The dev-loop skill goes from 18 KB to 3 KB, and README's "Try it" needs
no Clerk.
- Removed the vendored Clerk skills (billing, orgs, webhooks, custom UI,
setup, router) and the general Neon skill. The repo doesn't use what
they cover, and their descriptions triggered on common words.

| | Before | After |
| --- | --- | --- |
| `pnpm test`, 16-core machine | 498 s, failed on a timeout | ~185 s,
passing |
| `pnpm test` step in CI | 758 s | 580–611 s (a 4-core runner is now
CPU-bound, not waiting on one file) |
| One small test file | 19 s | ~4 s |
| `pnpm typecheck` in CI | 122 s, tests unchecked | 101 s, tests
included |
| `pnpm typecheck`, warm, local | — | 4 s |
| `pnpm dev`, cold | needed Clerk keys | 6 s |

## How it was verified

- On the final head:
  - CI is green on every job.
- Locally, `pnpm check` passes and `pnpm test:browser` passes 53/53. Two
more 53/53 runs were just before the rebase onto Effect 4.0.0.
  - Earlier on the branch, `pnpm verify` ran every suite.
- Fleet: 19/19 tests, plus 15 of 15 runs of the flaky case under
parallel load.
- Each browser flake was reproduced on the old code before its fix:
worst-case jitter, a SIGKILL restart, a blocked port.
- By hand:
- `pnpm dev` with personas, then `pnpm patchy publish`, with `curl`
showing 401 anonymous and 200 as `[email protected]`.
  - `pnpm dev --clerk` refuses on a personas instance.
  - `pnpm dev up` adopts the plain instance and keeps its data.
- `pnpm dev shot jordan /brightline/new-business` captures the tier 2
board with no errors.

## Release impact

- [ ] **Breaking**
- [x] **Not breaking**: development tooling, tests and docs. The server
only moves its migration record into a module; product behaviour is
unchanged.

Follow-ups: making `browser` a required check is a ruleset change for
you.

## Review

GPT 6.1 Sol (codex) reviewed three times.
- **First pass:** five real issues, all fixed:
  - the release cache ignored workspace manifests;
  - a cache hit accepted missing outputs;
- the test tsconfig dropped the base config's Effect correctness rules;
- `verify --changed` skipped suites that share the runner's Postgres
settings;
  - the `@print` tag hid unrelated browser checks.
- **Second pass:** confirmed all five fixes.
- **Third pass:** reviewed the CI-driven fixes and the rebase onto
Effect 4.0.0 and found nothing.

Made by Claude Opus 5.5 via Claude Code; reviewed by GPT 6.1 Sol via
codex.

---------

Co-authored-by: Claude Opus 5.5 (1M context) <[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:primitives Patch tables and files area:server Touches the server area area:ui Portal and first-party browser pages, shared rendering and styles size:xl Over 1,000 changed lines; review in multiple passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant