Skip to content

feat(cli): published patches use TypeScript 7 - #1010

Merged
allisonmahmood merged 1 commit into
mainfrom
feat/patches-on-typescript-7
Oct 29, 2026
Merged

allisonmahmood merged 1 commit into
mainfrom
feat/patches-on-typescript-7

Conversation

@allisonmahmood

@allisonmahmood allisonmahmood commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner

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 refactor(cli): parse patch sources without the TypeScript API #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 Move to TypeScript 7 #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

  • 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.

@github-actions github-actions Bot added area:server Touches the server area area:cli Touches the cli area area:docs Touches the docs area size:m 100-500 changed lines labels Oct 29, 2026
@allisonmahmood
allisonmahmood force-pushed the feat/patches-on-typescript-7 branch from 9b7a3c8 to e22290c Compare October 29, 2026 01:20
@allisonmahmood

Copy link
Copy Markdown
Owner Author

Review (GPT 6.1 Sol, xhigh): no findings. Sol verified these:

  • The gate checks the exact compiler path publish runs, including through pnpm symlinks, and prereleases follow the semver range.
  • Pending publish recovery runs before the gate and keeps saved replies.
  • Refresh and new dev starts carry the warning in text and JSON.
  • The old ESLint scaffold really breaks under TypeScript 7, and the documented Oxlint move works, hooks rules and nested globs included.
  • The docs, ADR and skill are aligned, and the rollback answers match.

Rebased onto #1009's review fix (now e22290c).

@allisonmahmood

allisonmahmood commented Oct 29, 2026 •

Copy link
Copy Markdown
Owner Author

Acceptance: PASS with notes

Checked e22290c93f9f8b0a2fdd381dff770a20c9f586b9 (base c270b9fd04a9db559625f661ba331f1a5e3c0182, build/typescript-7) on a fresh team instance, by GPT 6.1 Sol in Codex through T3 Code. Used the packed head CLI for behavior checks and the base CLI for recovery and rollback checks.

Done means

  • TypeScript 7/Oxlint throughout the stack: passed. The lockfile contains only [email protected]; scripts use effect-tsgo tsc, and the Effect diagnostic configuration is retained. Local verification results below; head CI is green, including all three Node test versions, lint/typecheck, browser, packed CLI/tier 2 and rollback rehearsal.
  • patchy init creates TypeScript 7/Oxlint repos: passed for fresh tier 1 and tier 2 repos. Both publishes succeeded and returned warnings: []; the fresh tier 2 repo also passed standalone typecheck and lint. Ada wrote notes and Ben read them through the published page.
  • TypeScript 6 publish refuses with an actionable migration: passed. Downgraded a scaffold to actual [email protected], restored main's ESLint config and packages, and confirmed its original typecheck/lint worked. Head publish then returned exit 1 with kind: "local", code: "toolchain_unsupported" and the exact diagnostic below. Four refusals made only GET /api/me and GET /api/release: no description writes or publish requests. Config containing a sentinel throw was never executed; config and local metadata remained byte-identical.
  • The refusal and referenced skill suffice to migrate: passed. Ran the stated TypeScript upgrade, removed the three named ESLint packages and config, installed Oxlint, copied .oxlintrc.json from the installed skill and changed the lint script. pnpm typecheck, pnpm lint and publish all exited 0 without source changes; publish created version 2 with no warnings. The published page still read the earlier note and accepted a new one.
  • Comparable stack measurements are posted beside the baseline: passed, in #985's measurements comment, measured at the stack's compiler change (build: TypeScript 7 #1009). I did not rerun performance measurements during this acceptance.

Golden journeys

  • Publish a page: passed. Packed CLI published an HTML file; Ben saw it on Home and opened its actual heading. Retire and delete each removed its content; restore after each returned it at the same address.
  • Tier 1 and tier 2 publishing: passed. Both fresh scaffolds published without warnings and worked in Chromium for Ada and Ben, including writes and reads across viewers. The migrated tier 1 repo worked too. Screenshots below show Ben's persisted notes.
  • Existing published patches: passed. The tier 1 page kept working while its repo was on TypeScript 6/ESLint and fresh publish was refused.
  • Local dev/refresh: passed. On TypeScript 6, both commands exited 0 and carried the same advisory in text and JSON warnings. A TypeScript 6 tier 2 dev session also executed create/list handlers successfully across its two persona origins; all dev sessions were stopped.
  • Pending publish recovery: passed. The base CLI published a TypeScript 6 tier 2 repo; I interrupted local result application after server acceptance, leaving its real pending request. Head recovered the exact saved server reply (version 2), cleared the pending slot and did not execute deliberately broken config. The following fresh publish was refused with toolchain_unsupported.
Exact refusal and compact command evidence
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.

TS 6 + ESLint: typecheck 0; lint 0
publish --json: exit 1; stdout empty
  {ok:false, kind:"local", code:"toolchain_unsupported", error:<exact message above>}
publish: exit 1; same diagnostic
refresh / refresh --json: exit 0; advisory present
new dev starts, text / --json: exit 0; advisory present

After the documented migration:
typecheck 0; lint 0; publish 0; version 2; warnings []

Fresh tier 1: publish 0; warnings []
Fresh tier 2: typecheck 0; lint 0; publish 0; warnings []
Base TS 6 pending publish -> head recovery: exit 0; exact saved reply
Next fresh TS 6 publish: exit 1; toolchain_unsupported
Base CLI publishing migrated TS 7 + Oxlint repo: exit 0

Migrated tier 1: Ben reads Ada's persisted notes

Fresh tier 2: Ben reads a note written through its server handler

Surfaces: CLI text/JSON, ADR-0004, CLI README, product docs and the generated project skill apply and agree. No wire-schema, migration, company-resource, served-page policy or package-layout changes.

Rollback answers: match the diff. There are no migrations, new stored shapes or infrastructure changes. Migrated repos keep TypeScript 7/Oxlint; the base CLI successfully published that migrated repo. The Breaking box is correct: existing TypeScript 6 repos need action at their next fresh publish. Existing hosted versions and pending publish recovery continue working. No one-way label is needed.

Not run

  • Independent performance benchmarks at this exact head; the issue’s comparative measurements were taken at build: TypeScript 7 #1009. Live Clerk was not repeated locally; its head CI check passed.

Notes

  • The benchmark evidence predates this final publish-gate commit. No behavioral failures were found in this acceptance.

Local verification

pnpm verify: all ten suites passed — format, lint, typecheck, offline infrastructure synth, 2,536 offline tests, 28 Postgres-concurrency tests, packed CLI/Preact, Linux install, tier 2 smoke and 81 Chromium tests. pnpm build also passed (20 tasks, cached). A scratch fixture compiled with ordinary TypeScript 7 and failed with effect-tsgo tsc on the configured globalRandomInEffect diagnostic, confirming the Effect checker still fails compilation. No local flakes occurred.

The throwaway instance, patch dev processes and temporary base checkout were removed. The head checkout remains detached and clean; no PR code, branch, body or labels were changed.

@allisonmahmood
allisonmahmood force-pushed the feat/patches-on-typescript-7 branch from e22290c to d77d0f7 Compare October 29, 2026 02:50
@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 (=): e22290c → d77d0f7. 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 build/typescript-7 to main October 29, 2026 10:36
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
allisonmahmood force-pushed the feat/patches-on-typescript-7 branch from d77d0f7 to 294857d Compare October 29, 2026 10:36
@allisonmahmood
allisonmahmood merged commit d53727b into main Oct 29, 2026
23 checks passed
@allisonmahmood
allisonmahmood deleted the feat/patches-on-typescript-7 branch October 29, 2026 10:46
allisonmahmood added a commit that referenced this pull request Oct 29, 2026
…1041)

## What changed

#1000 moved the crypto that Effect's own `Crypto` covers. The rest still
called `node:crypto` directly: sealing integration credentials, signing
file links, HKDF for agent connections, the management secret check, and
reading Clerk's JWT key. Now those take `Cryptography` from the
environment. It's a new `@patchy/core` service, and its
`NodeCryptography.layer` is the one place they reach Node. Nobody using
Patchy sees a difference.

Part of #1039. Stacked on #1010.

## Look at

- **Stored values still open, through the code that reads them:**
- An integration credential sealed by the old code decrypts through
`CredentialKeys`.
- A retry copy sealed the old way, with HKDF info, connection-id AAD and
layout as before, refreshes through `AgentConnections.refresh`.
- The file handle `Files` issues equals the old HMAC of the same key and
binding, cut to 24 bytes.
- Changing the HKDF info or the truncation fails these tests. I checked
both.
- HMAC-SHA256 and HKDF also match the RFC 4231 and RFC 5869 test
vectors.
- **Errors keep their shape:**
- A failed seal is still `CredentialEncryptionFailed` with a redacted
cause.
- A failed open is still `CredentialDecryptionFailed`, with no cause,
and still a 503.
  - A retry copy that won't open is still a defect.
  - A bad `CLERK_JWT_KEY` still fails at boot as that setting.
- **One change from #1039's plan:**
- `NodeCryptography.layer` requires nothing, the way Effect splits
`Crypto` from `NodeCrypto`. Entrypoints and test layers provide it
beside `NodeCrypto`, with no ordering between them.
  - The plan had it built on Effect's `Crypto`.
- **One behaviour gets stricter.** A file handle whose MAC is the wrong
length is now refused. Before, Node's `timingSafeEqual` threw on it.

## How it was verified

- `pnpm check`: format, lint, typecheck and synth pass.
- Tests:
- Every suite passes except the CLI suites' stray `GET /` flake on this
shared machine, which also fails on the base branch. CI decides those.
- The affected suites pass: auth, credentials, files, management and
`Cryptography` (309 tests).

## Release impact

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

This is an internal refactor. Every stored format is unchanged, and the
known-answer tests above prove it for the sealed ones.

- **What does a revert leave behind?** Nothing new. Values sealed or
signed in between use the same formats as before.
- **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:cli Touches the cli area area:docs Touches the docs area area:server Touches the server area size:m 100-500 changed lines

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move to TypeScript 7

1 participant