Skip to content

build: TypeScript 7 - #1009

Merged
allisonmahmood merged 2 commits into
mainfrom
build/typescript-7
Oct 29, 2026
Merged

allisonmahmood merged 2 commits into
mainfrom
build/typescript-7

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

What changed

Patchy now compiles with TypeScript 7, the native compiler, and nothing in the repo reads TypeScript 6 any more. Type-checking the workspace is 6–12× faster, building it 6.5× faster, and new patch repos start on TypeScript 7.

Part of #985 (step 4 of 5). Stacked on #1000.

Look at

  • Effect diagnostics come from @effect/tsgo. Builds and pnpm typecheck run effect-tsgo tsc, TypeScript 7 with the Effect checker built in, so prepare no longer patches a compiler in the shared pnpm store. That patching was the trap where one worktree's install silently turned Effect rules off in another.
    • The rule set is unchanged, and a canary proved nodeBuiltinImport, globalDateInEffect, globalConsoleInEffect and preferSchemaOverJson still fail the build.
    • Turned off, each with a reason: tsgo's default unstableApiUsage, since effect/http and effect/sql are used on purpose (about 5,700 hits); suggestions in tsc output; and the new schemaClassObjectLiteral warning, until Effect checker: review schemaClassObjectLiteral's findings #1002.
    • The deliberate missing-PatchLock test keeps its suppression; its two comments swapped order for the Go checker.
  • The CLI's declarations (scripts/build-patchy-package.mjs).
    • TypeScript 7 emits them, reading workspace packages from source, and Rolldown bundles them. Only the files the bundle publishes must emit cleanly. The dev runtime's internals infer types TypeScript can't name in a declaration, and no published type reaches them.
    • The release's own dependencies (Preact, signals, PGlite) are explicitly external, so pnpm's NODE_PATH can't pull them inline.
    • The published .d.ts files import exactly what main's do: preact, preact/compat, preact/jsx-* and @preact/signals. server.ts and csv.ts joined the build's entries.
  • Tests that read TypeScript's API. The generated-client type tests and the client facade test run the real tsc on a temp directory (test/typescript.ts), and esbuild strips the types the generated-client tests execute.
  • New patch repos scaffold typescript@^7.0.2. The offline test registry packs TypeScript 7's platform binary for this machine and skips the other platforms'. TypeScript 7 exits 1, not 2, on type errors. Publishing still accepts TypeScript 6 until the next PR.

Same 16-core machine and script as the baseline in #985, medians, uncached, with equal or higher load during these runs:

TS 6 + ESLint (main) TS 7 + Oxlint (this stack)
Type-check every project 151 s 25.5 s
Type-check the tests program 87 s 7.1 s
pnpm typecheck 142 s 20.9 s
pnpm build 75 s 11.6 s
pnpm lint 38 s 11.6 s
patchy --version 0.35 s 0.20 s
CLI tarball 35.1 MB 22.5 MB
Patch repo tsc --noEmit (3 real repos) 2.4 / 2.9 / 1.2 s 0.39 / 0.35 / 0.24 s
Patch repo lint 1.3 / 1.1 / 0.6 s 0.06 / 0.05 / 0.06 s

How it was verified

  • pnpm typecheck exits 0, and pnpm build, pnpm lint and pnpm format:check pass.
  • The lockfile holds only [email protected]: no TypeScript 6, typescript-eslint, @effect/language-service or rollup-plugin-dts.
  • pnpm test:packed-cli-e2e and pnpm test:packed-preact-e2e pass locally. Real scaffolded repos install typescript@^7.0.2 from npm and type-check with it.
  • Passing suites: the TypeScript-sensitive ones (125 tests: scaffold, publish, client and generated-client types, generated server, parsers, lint rules), plus the offline tier 1 init that runs a TypeScript 7 typecheck.
  • Three real patch repos type-check under TypeScript 7 and lint clean under the scaffold's Oxlint with no code changes.
  • The full CLI suite has the same stray-GET / stub-server failures on this loaded machine as main, so CI is the oracle for those.

Release impact

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

Build tooling, plus the scaffold's TypeScript range for new repos. Existing patch repos and their publishing are untouched here.

  • What does a revert leave behind? Patch repos created in between scaffold TypeScript 7, which the release before still publishes: it never gated TypeScript.
  • Does the release before it still work with that? Yes.

Made by Claude Opus 5.5 (Claude Code in T3 Code); reviewed by GPT 6.1 Sol.

@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:core Touches the core 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:m 100-500 changed lines labels Oct 29, 2026
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
New patch repos start on TypeScript 7 since #1009; this makes it the bar
for anything published. Publish reads the version in the repo's
node_modules/typescript, the compiler it runs, and refuses one outside
the release's accepted range (^7.0.2) with toolchain_unsupported, before
it syncs the description or runs config, Vite or the typecheck. The
refusal names `pnpm add --save-dev 'typescript@^7.0.2'` and points at the
patchy-preact skill, which now carries the scaffold's .oxlintrc.json for
moving lint off typescript-eslint, which can't run beside TypeScript 7.

Dev and refresh only warn: an existing TypeScript 6 repo keeps running
locally, and published patches are untouched. As people's agents next
publish them, they move.

Part of #985.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review (GPT 6.1 Sol, xhigh) and what changed:

  1. A compiler that didn't finish passed the type tests. test/typescript.ts ignored spawnSync's status, signal and error, so empty output read as no errors. A SIGKILLed tsc returned [] for invalid TypeScript. The helper now throws on a spawn error, a signal, or a nonzero exit without error TS diagnostics (c270b9f).

Nothing else blocked. Sol confirmed these:

  • Every workspace directory selects TypeScript 7.0.2.
  • The public declarations match main's once internal aliases and formatting are normalised.
  • An uncached build, the declaration build, pnpm typecheck and pnpm lint exit 0.
  • The Docker, CI, dev-loop, rollback and build-cache surfaces need nothing more.

@github-actions github-actions Bot added size:l 501-1,000 changed lines and removed size:m 100-500 changed lines labels Oct 29, 2026
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked c270b9fd04a9db559625f661ba331f1a5e3c0182 (base 17b02802f4c31eee7245dee211c9d9626386208d, origin/refactor/effect-crypto) in a detached acceptance checkout, on fresh packed-CLI fixtures and brightline, by GPT 6.1 Sol in the Codex harness through T3 Code. I did not write this change.

Done means — #985, step 4

  • TypeScript 7, Oxlint, and enforced Effect rules: passed. effect-tsgo tsc --version reports 7.0.2+effect-tsgo.0.62.0; plain tsc reports 7.0.2. Package scripts that run tsc now invoke effect-tsgo tsc; the declaration emitter uses native TypeScript 7. TURBO_FORCE=true pnpm typecheck passed all 24 tasks with zero cached tasks, rebuilding the server and CLI. pnpm build, pnpm lint, formatting and infrastructure synth passed.
  • The rules really stop builds: passed. Added a temporary source file under core containing a node:fs import and console/JSON/Date use inside Effect.gen. The package build exited 1 and root typecheck exited 2, reporting all four configured errors below. Removed the probe and its emitted files; restored typecheck passed and the tracked checkout is clean.
  • No old compiler/lint/declaration dependencies: passed. Parsed the lockfile's resolved package inventory: only [email protected]; no TypeScript 6, typescript-eslint, @effect/language-service, or rollup-plugin-dts packages.
  • Published declarations and fresh consumers: passed. Inspected all 9 declaration files in the actual release tarball. Their only external imports are preact, preact/compat, preact/jsx-dev-runtime, preact/jsx-runtime, and @preact/signals; no @patchy/* or effect. Fresh packed CLI tier 1 and tier 2 repos installed TypeScript 7.0.2 from npm from the scaffold's ^7.0.2 range. Typecheck, lint and publish passed; the separate untouched tier 2 starter also passed all three. Packed Preact consumer checks passed.
  • Compiler-dependent tests: passed. Generated-client, facade, scaffold, publish and parser suites passed within the offline run. Independently exercised the new compiler helper: valid source accepted, invalid source rejected, and a simulated SIGKILL throws instead of reporting success.
  • Speed claim: plausible. One uncached root typecheck took 12.030 s on this shared machine, Node 26.12.1. This is a spot check, not a reproduction of the PR's benchmark medians. TypeScript 6 publish refusal and the final finished-stack benchmark belong to step 5, outside this PR's scope.
Compiler canary and suite evidence
Temporary source diagnostics:
error TS377057 ... effect(nodeBuiltinImport)
error TS377065 ... effect(globalConsoleInEffect)
error TS377026 ... effect(preferSchemaOverJson)
error TS377069 ... effect(globalDateInEffect)

Uncached typecheck: 24 successful / 24; 0 cached; elapsed 12.030 s
Build: 20 successful / 20
Offline: 239 files passed, 1 failed; 2533 tests passed, 1 failed (#895 below)
Postgres concurrency: 3 files, 28 tests passed
Browser: 81 passed
Packed CLI, packed tier 2, packed Preact, Linux installer, cleanup harness: passed
Isolated InvocationLocal recheck: 1 file, 4 tests passed

Golden journeys

  • Sign in; log a machine in: passed. Signed-out company tools return 401; member sessions open them. Packed real-server tests cover login confirmation, whoami, logout and server-side key revocation.
  • Publish a page: passed. Packed file publishing, served content, discovery, deletion, retirement and restore passed against the built server.
  • Share and unshare: passed. Brightline's kickoff page returned signed-out 200 after public sharing, then 401 after returning to company sharing.
  • Find and open a tool: passed. Jordan searched Home for Kudos and opened its frame.
  • Use a tier 1 tool live: passed. Jordan sent kudos to Priya; it appeared on Priya's already-open page without reload.
  • Use a tier 2 tool: passed. Sample deals loaded; Jordan moved Saltwater Hotels from Lead to Discovery and back, with Allison's open board updating both times. Spend rejected Allison approving his own newly submitted request: “You can't approve your own request.” No uncaught page errors. Packed tier 2 additionally passed two-viewer sync, lost-reply retry, shared resources, files, CSV and tier changes.
  • Invite and join: passed through automated coverage. Local company invitation/join/revoke/reactivation suites passed; the head's clerk-live CI job passed. No additional live invitation email was sent locally.

Rollback answers: match the diff. No migrations, stored-data changes or infrastructure changes. The earlier CLI invokes the consumer's installed compiler and does not gate its major version, so newly scaffolded TypeScript 7 repos remain publishable after reverting this PR. Head CI's rollback rehearsal passed.

Not run

  • External Clerk, Attio, Pidgeon and content-store suites were not run locally; this acceptance used disposable local services. Head CI passed Clerk; Attio/Pidgeon jobs were still pending at this check. All main CI checks, including Node 22/24/26 tests, browser, packed journeys and three-platform install, passed: CI run.

Notes

  • The full local offline run reproduced known flaky flaky: supervised workerd diagnostics misses invocation settlement deadline under load #895: InvocationLocal.test.ts missed log.begin's settlement deadline and raised UnsettledInvocation. It passed all four cases on the isolated rerun. This is the documented failure, not a clean full local test run; the head's three Node CI test jobs passed.
  • Surface audit: CLI/scaffold/declarations and the dev build/run path applied. Wire routes, vocabulary, migrations, company-resource locking, served markup, reverse-state design and package layout did not change.
  • All throwaway instances and browsers started for this run were stopped. No PR code, branch, body or labels were changed.

allisonmahmood added a commit that referenced this pull request Oct 29, 2026
New patch repos start on TypeScript 7 since #1009; this makes it the bar
for anything published. Publish reads the version in the repo's
node_modules/typescript, the compiler it runs, and refuses one outside
the release's accepted range (^7.0.2) with toolchain_unsupported, before
it syncs the description or runs config, Vite or the typecheck. The
refusal names `pnpm add --save-dev 'typescript@^7.0.2'` and points at the
patchy-preact skill, which now carries the scaffold's .oxlintrc.json for
moving lint off typescript-eslint, which can't run beside TypeScript 7.

Dev and refresh only warn: an existing TypeScript 6 repo keeps running
locally, and published patches are untouched. As people's agents next
publish them, they move.

Part of #985.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Rebased onto #994's final head (dc83ce9), which changed only editUses.ts and its test. git range-diff shows every commit of this PR unchanged (=): 9afa182..c270b9f → 04b3f75..6def2cd. The acceptance verdict above covers the same patches. At the top of the stack, pnpm build, pnpm typecheck and pnpm lint pass on the rebased branches.

Base automatically changed from refactor/effect-crypto to main October 29, 2026 10:22
allisonmahmood and others added 2 commits October 29, 2026 11:22
The workspace compiles with TypeScript 7.0.2, the native compiler, and
nothing in it reads TypeScript 6 any more.

- Effect diagnostics come from @effect/tsgo. Builds and `pnpm typecheck`
  run `effect-tsgo tsc`, TypeScript 7 with the Effect checker built in,
  so `prepare` no longer patches a compiler in the shared pnpm store. The
  rule set is unchanged; tsgo's unstableApiUsage is off (effect/http and
  effect/sql are used on purpose), suggestions stay out of tsc's output,
  and its new schemaClassObjectLiteral warning is off until #1002.
- The CLI's declarations are emitted by TypeScript 7 and bundled by
  Rolldown. Only the files the bundle publishes must emit cleanly, and
  the release's own dependencies (Preact, signals, PGlite) stay imports
  whatever NODE_PATH says. server.ts and csv.ts join the build's entries.
- The tests that type-checked through TypeScript 6's API run the real
  `tsc` on a temp directory (test/typescript.ts), and esbuild strips the
  types the generated-client tests execute.
- New patch repos scaffold typescript ^7.0.2; the offline test registry
  packs TypeScript 7's platform binary for this machine and skips the
  rest. TypeScript 7 exits 1, not 2, when it reports errors.
- Dependabot moves typescript with @effect/tsgo, whose Effect-patched
  builds support exact TypeScript versions.

Part of #985.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Review found the helper reading no output as no errors, so a compiler
killed by a signal or failing to start passed every type test. It now
throws on a spawn error, a signal, or a nonzero exit without diagnostics.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@allisonmahmood
allisonmahmood merged commit 40127c4 into main Oct 29, 2026
22 checks passed
@allisonmahmood
allisonmahmood deleted the build/typescript-7 branch October 29, 2026 10:36
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
New patch repos start on TypeScript 7 since #1009; this makes it the bar
for anything published. Publish reads the version in the repo's
node_modules/typescript, the compiler it runs, and refuses one outside
the release's accepted range (^7.0.2) with toolchain_unsupported, before
it syncs the description or runs config, Vite or the typecheck. The
refusal names `pnpm add --save-dev 'typescript@^7.0.2'` and points at the
patchy-preact skill, which now carries the scaffold's .oxlintrc.json for
moving lint off typescript-eslint, which can't run beside TypeScript 7.

Dev and refresh only warn: an existing TypeScript 6 repo keeps running
locally, and published patches are untouched. As people's agents next
publish them, they move.

Part of #985.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
## What changed

Patches now publish on TypeScript 7. Publishing a patch repo still on
TypeScript 6 stops before anything runs, with the exact steps for the
builder's agent: upgrade TypeScript, and move lint from ESLint to
Oxlint, because typescript-eslint can't run beside TypeScript 7.
Published patches keep running untouched, and `patchy dev` and `patchy
refresh` only warn. Each repo moves the next time someone publishes it.

Closes #985 (step 5 of 5). Stacked on #1009.

## Look at

- **The gate (`toolchainProcess.ts`, `repoBuild.ts`).** Publish reads
the version in the repo's `node_modules/typescript`, the compiler it
actually runs, rather than the declared range. It checks that against
the release's `typescript.accepted` (`^7.0.2`, served by `GET
/api/release`) right after the release check, before it syncs the
description or runs config, Vite or the typecheck. The refusal reuses
`toolchain_unsupported`, exit 1 and the existing `--json` failure shape:

> This repo has TypeScript 6.0.3; this release publishes only TypeScript
^7.0.2 (tested against 7.0.2). Run: pnpm add --save-dev
'typescript@^7.0.2'. typescript-eslint doesn't run beside TypeScript 7:
if the lint script runs ESLint, move it to Oxlint as
.agents/skills/patchy-preact/SKILL.md says.

- **The lint move (`patchy-preact` skill).** The skill now carries the
scaffold's `.oxlintrc.json` and what to remove. A test fails if the
documented config drifts from what `patchy init` writes.
- **Docs.** ADR-0004 now treats TypeScript as a publish gate, and the
CLI README and `docs/product.md` follow. `docs/product.md` also drops a
stale "by TypeScript AST" left from #994.

## How it was verified

- The new `cliRepoBuild` case runs against a release that requires
`typescript@^99`:
  - `refresh` exits 0 with the warning.
- `publish --json` exits 1 with `toolchain_unsupported` and the upgrade
line.
- The only API calls during publish are `/api/me` and `/api/release`,
and `patchy.config.ts` is unchanged.
- `cliRepoBuild` (13), `initProject` (15) and `packages/sdk` (34) pass.
`pnpm lint`, `pnpm typecheck:tests` and the CLI's `effect-tsgo`
typecheck exit 0.
- The upgrade path is real: three of the company's own patch repos (52,
40 and 25 files) type-check under `[email protected]`, and lint clean
under the scaffold's Oxlint config, with no code changes (see #985).
- Not covered by a test: `patchy dev`'s warning. It rides the same
`typescriptRefusal` check and the warnings list dev already prints.

## Release impact

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

A patch repo on TypeScript 6 can't publish until it moves: `pnpm add
--save-dev 'typescript@^7.0.2'`, then, if its lint runs ESLint, the
Oxlint config from the `patchy-preact` skill. The refusal says exactly
that, so a builder's agent can do it unaided. Running patches, local dev
and refresh are unaffected. Deploying this needs a What's new line
telling builders their next publish asks for the move.

- **What does a revert leave behind?** Patch repos moved to TypeScript 7
and Oxlint, which the release before publishes fine: it never gated
TypeScript.
- **Does the release before it still work with that?** Yes.

Made by Claude Opus 5.5 (Claude Code in T3 Code); reviewed by GPT 6.1
Sol.

Co-authored-by: Claude Opus 5.5 <[email protected]>
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
… 7 (#1046)

## What changed

This adds release 22's What's new entry, written from `a2d1331`. It
covers everything merged since release 21's `through` (`f30d8fe`), and
sets the `patchy` release to `0.22.0` in `packages/patchy/package.json`
and `CURRENT_RELEASE`. With this release, patch repos move to TypeScript
7 and Oxlint, and Patchy's crypto runs through one Effect service.

| Change | PRs |
| --- | --- |
| Improved: Your agent checks patches several times faster. New repos
use TypeScript 7 and Oxlint, the patchy download is a third smaller, and
an existing repo's next publish asks it to move over | #989, #994,
#1009, #1010 |
| Behind the scenes: Patchy itself builds with TypeScript 7 and Oxlint |
#989, #1009 |
| Behind the scenes: Encryption, signing and ids go through one place,
with tests proving stored values still open | #1000, #1041, #1042 |

One merged PR gets no line: #971 is release 21's own entry.

## Look at

- **The entry**, at the top of `releases` in
`packages/core/src/whatsNew.ts`. It tells builders that their next
publish of an existing repo will ask them to move to TypeScript 7, and
that live patches keep working. That's the one behaviour change people
will meet.
- **Rollback safety, from the live commit `2f9f7c1` (release 21) to
`a2d1331`:**
- No PR in the range is labelled `one-way`, and none has a migration or
an infrastructure change.
- Every stored format is unchanged: ids, tokens, digests, sealed
credentials, file handles and index names. The crypto PRs prove this
with known-answer tests.
- #1010 is Breaking for builders: publishing a TypeScript 6 repo is
refused, with the command to fix it. A rollback lifts that refusal, and
doesn't strand anyone.
  - `rollback-rehearsal` passed on every landed head.

**Rollback line:** If this release misbehaves, roll back to `2f9f7c1`
(release 21).

## How it was verified

- **Tests.** `whatsNew.test.ts`, `WhatsNewPages.test.ts` and
`schemas.test.ts` pass (21 tests), and prettier passes on the changed
files.
- **The stack.** All seven PRs were Sol-reviewed with every finding
fixed, and each got an acceptance PASS or PASS with notes. Each landed
after a rebase onto `main` that left it unchanged (range-diff `=`), with
all 12 required checks passing. #1000's one red run was the known Fleet
flake #1012, and it passed on rerun.
- **Deploy state.** The live commit, pinned from `/healthz/deep`, is
`2f9f7c1` (release 21). The Deploy run updated last succeeded, and none
is unfinished.

## Release impact

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

Text and version numbers only. The `0.22.0` bump tells CLIs and patch
repos installed before this deploy to upgrade, as every release does.

- **What does a revert leave behind?** Nothing.
- **Does the release before it still work with that?** Yes.

Made by Claude Opus 5.5 (Claude Code in T3 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:core Touches the core 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:l 501-1,000 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant