Repository navigation
feat(packs): migration packs as a public, testable contract - #38
Merged
Merged
Conversation
…implement it Pack (meta with sources and maintainer, rules that claim check's findings and rewrite one site, behavior notes with how they are reported, agent instructions) on top of MigrationPack. check, fix, list and verify take their packs from a generated registry, verified ones only. Zod's rules carry their own rewrite; stripe declares the rules its evidence classifies. Outputs on the storefront fixture and the corpus unchanged. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi Signed-off-by: Claude <[email protected]>
pack new scaffolds a pack that lints and passes its tests as written and registers it. pack test runs its fixtures, then check with the pack on each ground-truth repository (fetched shallow at the pinned commit, installed with scripts off, cached), and prints precision and recall per rule, overall and for breaking findings, with every false positive and false negative. --json for CI. pnpm uptide runs the CLI from source. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi Signed-off-by: Claude <[email protected]>
… Packs workflow docs/packs.md with zod as the reference; CONTRIBUTING.md "Write a pack"; a pack pull request template and the pack request issue form; ADR 0015; packs/queue.json from public npm data (pnpm packs:queue); a Packs workflow that runs pack test for every pack with the ground-truth cache. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi Signed-off-by: Claude <[email protected]>
pnpm packs:truth lists, for one public repository, the diagnostics its own TypeScript reports with the target linked in and not without it (errors and deprecations), and the lines its upgrade commit changed. Ground truth can name a project directory inside the repository; an install whose lockfile was already out of sync falls back to an unfrozen install, scripts still off. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi Signed-off-by: Claude <[email protected]>
zod: AwesomeIntune, PATH and band-sdk-typescript at the commit before their zod 4 upgrade; stripe: unkey and saas-starter before their stripe-node majors; both also scored on the storefront fixture. No false positive among breaking findings (zod 57 sites, recall 76%; stripe 18 sites, recall 90%). Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi Signed-off-by: Claude <[email protected]>
9 tasks done
lucasbraum
pushed a commit
that referenced
this pull request
Oct 7, 2026
main is this branch's base (#38, squash-merged) plus #40: the result keeps this branch's tree and applies #40's changes on top. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi Signed-off-by: Claude <[email protected]>
Merged
lucasbraum
pushed a commit
that referenced
this pull request
Oct 8, 2026
This PR was opened by the [Changesets release](https://github.com/changesets/action) GitHub action. When you're ready to do a release, you can merge this and publish to npm yourself or [setup this action to publish automatically](https://github.com/changesets/action#with-publishing). If you're not ready to do a release yet, that's fine, whenever you add more changesets to main, this PR will be updated. # Releases ## [email protected] ### Minor Changes - [#39](#39) [`b9f9974`](b9f9974) Thanks [@lucasbraum](https://github.com/lucasbraum)! - A verified migration pack for the AI SDK (`ai`) 6 → 7: the renamed options (`system` → `instructions`, `onFinish` → `onEnd`, `onStepFinish` → `onStepEnd`, `experimental_telemetry` → `telemetry`), `stepCountIs` → `isStepCount`, `fullStream` → `stream`, `totalUsage` → `usage` and the removed `experimental_*` options are rewritten by rule; telemetry `metadata`, tool `context` and the stream result helpers go to the agent with the guide; what the compiler cannot see (telemetry registration, results that now cover every step, rejected system messages) is listed for review. Scored against vercel/chatbot and miurla/morphic at the commit before their own upgrade: no false positive. `uptide pack test` gains `--update-fixtures`, fixture markers take the compiler's `message`, and ground-truth repositories can use bun. - [#39](#39) [`b9f9974`](b9f9974) Thanks [@lucasbraum](https://github.com/lucasbraum)! - `check` and `fix` upgrade a package together with the packages that must move with it, using the groups `list` already draws (family, peer link, shared pin), each at the version that agrees with the target. `fix ai` also bumps `@ai-sdk/react`, `@ai-sdk/provider` and the installed `@ai-sdk/*` providers in one install and one commit; check's plan, the fix summary and the PR description say which and why, and `fix` stops before changing anything when a member has no release that agrees. npm and pnpm installs resolve the exact version first, so a `^` range keeps the version the target pins. Ground-truth entries take `with`, the packages the real upgrade moved, and `pack test` fails when check would leave one behind. - [#38](#38) [`adaf8f9`](adaf8f9) Thanks [@lucasbraum](https://github.com/lucasbraum)! - Migration packs are a public, testable contract (docs/packs.md). `uptide pack new` scaffolds a pack (an example rule, a fixture pair, a test, empty ground truth) and registers it; `uptide pack test` scores packs against their fixtures and against public repositories at the commit before their upgrade, with precision and recall per rule, every false positive and false negative, and `--json` for CI. A pack is labeled verified only with ground truth from at least two public repositories and no false positive among its breaking findings; otherwise it ships as a candidate and `check`, `list` and `fix` treat the dependency as generic. ### Patch Changes - [#44](#44) [`b4cc21f`](b4cc21f) Thanks [@lucasbraum](https://github.com/lucasbraum)! - `check` no longer dies with "Manipulation error: A syntax error was inserted." on packages whose type aliases give their type parameters defaults (`type-fest` 4 → 5, `i18next` 23 → 26): the alias body is read after the parameter list, not at the first default's ` = `, so these aliases are compared by the checker instead of breaking the comparison program. - [#40](#40) [`3e3a5fa`](3e3a5fa) Thanks [@lucasbraum](https://github.com/lucasbraum)! - `fix` verifies with the repository's own TypeScript (its `node_modules/typescript`, or an ancestor's) or the bundled one, and never with a TypeScript that `NODE_PATH` or Node's global folders happen to provide. A machine with a global TypeScript 6 made verification report TS5107 deprecations the repository never sees. - [#37](#37) [`3e7f744`](3e7f744) Thanks [@lucasbraum](https://github.com/lucasbraum)! - Gemini is labelled experimental: in `fix --help`, in the `LLM:` line `fix` prints, and in the docs. Its evaluation runs on the storefront fixture failed on service errors (HTTP 503/429), so its migration quality is not established yet. Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What and why
Packs were knowledge only the runner's authors could add, and the
verifiedlabel rested on one synthetic fixture. This makes a pack a public contract anyone, or a scheduled agent, can meet and test:packages/core/src/packs/contract.ts,docs/packs.md, zod as the reference): metadata (package, from/to ranges, sources, maintainer), mechanical rules (detect = the check findings a rule claims by kind/symbol, plus an optional sourcedetect;rewriteat one reported site), behavior notes with how each is reported (finding/decision/test-follow-up), agent instructions, fixtures, ground truth.definePackbuilds the runner's hooks from that alone. Zod and stripe implement it by hand. Zod's rules now carry their ownrewrite; stripe declares the rules its evidence classifies.check,fix,listandverifytake packs from a generated registry instead of two hard-coded lists.uptide pack new <pkg> --from <range> --to <range>scaffolds the pack, one example rule, a fixture pair, a test, empty ground truth and a verification record, and registers it. Its output passespnpm lintandpnpm testas written.uptide pack test [pkg]runs the fixtures, thencheckwith the pack on every ground-truth repository. It prints precision and recall per rule, overall and for breaking findings, and lists every false positive and false negative asrepo file:line rule(plus sites reported under another rule). It exits 1 on any false positive among breaking findings, a failing fixture, or a staleverification.json. Flags:--json,--offline,--fixtures-only,--write.pnpm uptideruns the CLI from source.directorycovers a project below the repo root, andfixtureentries for repositories in this tree are scored but never counted. Repos are fetched shallow at that commit, installed with scripts off (falling back to an unfrozen install, still scripts off, when the lockfile was already out of sync), and cached in~/.cache/uptide/ground-truth.pnpm packs:fetch [--corpus]fills the cache, reusingfixtures/corpus.json.pnpm packs:truthdrafts the expected findings from two non-Uptide sources: the repository's own TypeScript (errors and deprecations new with the target linked) and its upgrade commit's diff.statusOf,recordedStatus,activePacks) and docs: verified needs ground truth from ≥2 public repos, no false positive among breaking findings, and at least one breaking finding predicted. Otherwise the pack is a candidate: it ships,pack testscores it, and check/list/fix treat the dependency as generic. The CLI reads the recordedverification.json, which is tied to the ground truth's sha256. CI fails when that record no longer matches the evidence..github/workflows/packs.ymlrunspack test --jsonfor every pack with the ground-truth cache restored. It always reports (passing without work when neither packs nor the engine they depend on changed), so it can be a required check.?template=pack.md), the "Pack request" issue form, ADR 0015, andpacks/queue.jsonbuilt bypnpm packs:queuefrom public npm data. Ranking is weekly downloads × breaking majors in 2 years (capped at 3), leaving out tooling and packages reached transitively (> 50k weekly downloads per dependent).packages/core/src/packs/tooling/scaffold.test.tsscaffolds a toy pack in a miniature checkout, lints it with the checkout's biome, runs its generated test with vitest, adds a rule plus fixture, and gets a passingpack test.How it was verified
check zod stripe --jsononfixtures/repos/storefrontis identical tomain(timings stripped), and so is the text output andlist. On the corpus,liston supabase@53a637a andcheck pinoon documenso@80823ed are identical betweenmainand this branch when run at the same moment. The assertion is also permanent: the storefront fixture is a ground-truth entry of both packs, andverification.jsonrecords precision and recall, so any change in what check reports there makes the record stale and fails the Packs job.web/) and nextjs/saas-starter, plus storefront. Both verified.The per-rule false positives under
genericare real sites reported under another rule (the full lists of misses and "reported under another rule" are in thepack testoutput). Stripe and zod still file some sites under the compiler code instead of their own rule; changing that would change theircheckplan output, which this PR keeps identical.pnpm lintandpnpm typecheckare clean, and every new test passes. Two tests fail here exactly as they do on unmodifiedmain:fix.test.ts > checks workspace source under its own resolution mode(TS5107moduleResolution=node10deprecation from the installed TypeScript) andcli.test.ts > uptide verify > ends with the summary….Checklist
pnpm lint && pnpm typecheckpass;pnpm testpasses except the two failures shared withmain.changeset/packs-public-contract.md, minor)🤖 Generated with Claude Code
https://claude.ai/code/session_01B2T8GmEVnZwfNrugajEMqi
Generated by Claude Code