Skip to content

feat(packs): vitest 4 → 5 verified pack - #63

Merged
lucasbraum merged 3 commits into
mainfrom
claude/pensive-galileo-trhvvi
Oct 10, 2026
Merged

lucasbraum merged 3 commits into
mainfrom
claude/pensive-galileo-trhvvi

Conversation

@lucasbraum

Copy link
Copy Markdown
Collaborator

Supersedes #57.

Pack

vitest, >=4 <5 → >=5 <6. Status: verified (2 public repos, 100% precision on breaking findings, recall 50%). The only breaking false positive in #57 (libs/image-utils/src/jest_pdf_snapshot.ts:42) is gone since #60 folds missing-member diagnostics (TS2339/TS2551) into one finding at the repository's own declaration. Rules, expectations, ground truth and companions are unchanged from #57.

Changes over #57:

  • The README edit that joined two lines is undone (the line limit no longer counts the packs table).
  • verification.json, packs/queue.json and the changeset say verified; the README packs table is regenerated (pnpm docs:packs; --check and pnpm docs:links pass).
  • Tests that used vitest as the example of a package without a pack (packages/cli/src/cli.test.ts, packages/core/src/fix/isolate.test.ts) use lodash instead, since vitest now has a verified pack. Only the example package changed.

Sources

No official codemod exists for this major.

Rules and behavior notes

Rules: matcher-types, jest-dom-matchers, bench-api, removed-entrypoints (rewrites four entry points), removed-entrypoints-manual, sequential-removed. Behavior notes: coverage-patterns (also a finding), clear-mocks-default, test-name-pattern, inline-projects-extend, hoisted-calls-top-level, mock-behavior, assertion-timing, pretty-format-output, fake-timers-temporal, artifact-locations, config-resolution, browser-mode, environment-requirements, node-api.

Ground-truth repositories

  • votingworks/vxsuite @ 5cb3c7d9c1abc891e7b12de57c0278790dd6160a, upgrade commit bb04c5fb01aa9bcd285170d2277df04ad5d7e09c (vitest 4.1.11 → 5.0.2, with @vitest/coverage-istanbul): 30 expected findings.
  • vitorvasc/opentelemetry-ecosystem-explorer @ 46d5b37d00bb (directory ecosystem-explorer), upgrade PR head 2b0497b35d0e49dbeeb0d6174ad09aed03d46697 (4.1.11 → 5.0.0): 2 expected findings.

Dropped candidates are listed in #57 (siemens/element cannot install from a public registry; the others are version-only bumps).

uptide pack test output

uptide pack test vitest · verified, recorded candidate   (before --write; now recorded verified)
fixtures      5 cases, 17 sites · pass
ground truth
  votingworks/vxsuite@5cb3c7d9c1ab             vitest 4.1.11 → 5.0.2  predicted 15333, expected 30, false positives 15319, false negatives 16
    with @vitest/coverage-istanbul 4.1.11 → 5.0.2
  vitorvasc/opentelemetry-ecosystem-explorer@46d5b37d00bb vitest 4.1.11 → 5.0.0  predicted 3621, expected 2, false positives 3619, false negatives 0

  rule                         precision  recall    tp   fp   fn
  bench-api                          15%     67%     2   11    1
  coverage-patterns                 100%      0%     0    0   13
  generic                             0%    100%     0 18927    0
  jest-dom-matchers                 100%     85%    11    0    2
  matcher-types                     100%    100%     3    0    0
  overall (sites)                     0%     50%    16 18938   16
  breaking (sites)                  100%     50%    16    0   16

PASS vitest: verified

(The ~18,900 generic (unverified) lines are omitted; the 11 bench-api false positives are unverified inferred sites, not breaking.)

Existing packs, rerun, all unchanged:

zod     verified  overall 100% / 84%, breaking 100% / 71%  (PASS)
stripe  verified  overall 100% / 90%, breaking 100% / 90%  (PASS)
ai      verified  overall 100% / 77%, breaking 100% / 36%  (PASS)
react   verified  breaking 100% / 69% (89 sites, 0 false)  (PASS)

Environment note: tldraw (react) pins Yarn Berry and the sandbox yarn is classic, so the react run used a corepack shim on PATH (sandbox only). With that shim on PATH, stripe's nextjs/saas-starter failed to install (MODULE_NOT_FOUND); stripe passes without the shim. Environment issues, not regressions.

pnpm lint, pnpm typecheck and pnpm test pass.

What is not covered

  • Pack detect runs only on files that import the package, so these expected sites are missed: 13 bare-directory coverage.include/exclude entries in configs that import a shared defineConfig wrapper, and jest-dom imports in two setup files that import nothing from vitest. Breaking recall is 50%.
  • check could not resolve imports in 69 of 71 vxsuite files (workspace packages are not built), so only a few of the 169 compiler diagnostics are visible there.
  • bench-api misses the describe wrapper at render_ballot.bench.ts:16.
  • Rules and notes with no evidence in either repo, resting on fixtures and the guide only: removed-entrypoints*, sequential-removed, nested vi.mock, and all behavior notes except coverage-patterns.
  • The two repos are one monorepo and one small app; a third that really migrated would make "verified" stronger.

Tooling friction

  • pnpm uptide check from source fails inside its worker (Cannot find module .../packages/core/src/errors.js); pnpm build and the dist CLI work. pack test is unaffected.
  • pnpm packs:truth requires full 40-character SHAs and prints the new path with the old line number for moved files.
  • A corepack shim on PATH fixes Yarn Berry repos but breaks the pnpm install of nextjs/saas-starter in the same run; the packs had to be run with and without it.
  • vitest.dev is not reachable from the sandbox.

🤖 Generated with Claude Code

https://claude.ai/code/session_01NwSXH7Dy3r4KjJhwKYBuxT


Generated by Claude Code

A candidate pack for Vitest 4 → 5, scored against votingworks/vxsuite and
vitorvasc/opentelemetry-ecosystem-explorer at the commit before their own
upgrade. Rules: matcher-types, jest-dom-matchers, bench-api,
removed-entrypoints (rewritten for the four with a drop-in path),
removed-entrypoints-manual, sequential-removed; behavior notes for what the
compiler cannot see, and coverage-patterns found from source. One false
positive among breaking findings keeps it a candidate.

The README packs table is regenerated, and one line of the documentation list
is joined so the README stays within its 150-line test.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YNCujWu9MXTm48xoYVKHJC
Signed-off-by: Claude <noreply@anthropic.com>
The vitest pack is scored against votingworks/vxsuite and
vitorvasc/opentelemetry-ecosystem-explorer: with missing-member diagnostics
folded into the declaration (#60), its one breaking false positive is gone, so
breaking precision is 100% over two public repositories (recall 50%). The
queue entry, verification.json, changeset and README packs table say verified.
The README documentation list is back to its original line break; the line
limit no longer counts the packs table.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwSXH7Dy3r4KjJhwKYBuxT
Signed-off-by: Claude <noreply@anthropic.com>
vitest now has a verified pack, so the tests that stood a package without one
in for the generic tier use lodash instead.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01NwSXH7Dy3r4KjJhwKYBuxT
Signed-off-by: Claude <noreply@anthropic.com>
@lucasbraum lucasbraum added the pack-candidate Migration pack proposed by the daily pack task label Oct 10, 2026 — with Claude

Copy link
Copy Markdown
Collaborator Author

Rerun of pack test with this PR's 3 commits cherry-picked onto current main (c0f8a70, which adds #62 after this PR's base 7ec02e0). CI on the PR head is green, there are no review comments, and the PR has no conflict. Nothing to push.

  • vitest: PASS, verified. Numbers are identical to the PR body: breaking 100% precision / 50% recall (16 tp, 0 fp, 16 fn). The same 16 false negatives, and the same 11 unverified bench-api sites.
  • zod: breaking 100% / 71%, overall 100% / 84%. Unchanged.
  • stripe: PASS, 100% / 90%. Unchanged.
  • ai: PASS, breaking 100% / 36%, overall 100% / 77%. Unchanged.
  • react: FAIL in this sandbox only. The tldraw install fails because the repo pins yarn@4.7.0 and the sandbox global is Yarn 1.22.22 (environment issue, no corepack shim used this time). Without tldraw: breaking 100% / 80% (57 tp, 0 fp). The one non-breaking generic false positive is at excalidraw CollabError.tsx:22. Not a regression from this PR.

packs:fetch also ended with an ELIFECYCLE on one unrelated ground-truth install; the vitest repos installed fine.


Generated by Claude Code

@lucasbraum
lucasbraum marked this pull request as ready for review October 10, 2026 16:31
@lucasbraum
lucasbraum merged commit 8dcf5fb into main Oct 10, 2026
9 checks passed
@lucasbraum
lucasbraum deleted the claude/pensive-galileo-trhvvi branch October 10, 2026 16:31
@uptide-release uptide-release Bot mentioned this pull request Oct 10, 2026
lucasbraum pushed a commit that referenced this pull request Oct 10, 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
## uptide@0.7.0

### Minor Changes

- [#60](#60)
[`7ec02e0`](7ec02e0)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - `check` reports
one breaking finding when a member the target no longer sees was
declared by
your own code in an augmentation: a custom matcher on the global
`jest.Matchers` in a test
setup file, or an interface augmented in a `declare module "x"` block.
The finding is anchored
at that declaration (the `declare global` block, or the augmented
interface), where the one
edit is, and the call sites that fail (TS2339, TS2551) are listed under
it as evidence, in the
terminal, the HTML report and the JSON report. Before, each call site
was a breaking finding
of its own next to the declaration. The README's line budget no longer
counts the generated
  "Verified packs" table, which grows one row per pack.

- [#64](#64)
[`86b24d2`](86b24d2)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Plan peer
blockers before cloning or installing, suggest explicit compatible peer
upgrades, and add repeatable `--allow-peer` with visible package-manager
overrides and PR risks. Reject npm lockfiles that disagree with
committed manifests before starting a migration.
  
Collect peer blockers across the complete upgrade group and print one
complete retry command. Include explicitly allowed peer packages in the
old/new lockfile subtree union while retaining strict rejection of
unrelated resolution changes.
  
Accept same-content lockfile deduplication and descriptive metadata
updates only when outside resolutions stay identical, and disclose
accepted housekeeping in the fix report and PR description.

- [#63](#63)
[`8dcf5fb`](8dcf5fb)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - A verified
migration pack for Vitest 4 → 5, scored against votingworks/vxsuite and
vitorvasc/opentelemetry-ecosystem-explorer at the commit before their
own upgrade. It is verified
with two public repositories and no false positive among breaking
findings (recall 50%). Sites it finds: custom matchers declared on the
global
`jest.Matchers` or on a one-parameter `Assertion<T>`, `import
'@testing-library/jest-dom/vitest'`
registrations whose types stop reaching `expect`, the removed `bench`
export, bare-directory
`coverage.include` and `coverage.exclude` entries, and the removed
`vitest/*` entry points
(`vitest/coverage`, `vitest/reporters`, `vitest/environments` and
`vitest/snapshot` are
rewritten). What the compiler cannot see (mock history cleared by
default, `testNamePattern`
joined with " > ", hoisted `vi.mock` calls, un-awaited assertions,
timers, report locations,
  browser mode) is listed for review.

### Patch Changes

- [#62](#62)
[`c0f8a70`](c0f8a70)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Preserve partial
version ranges such as `^18`, `~18.2`, and `18.x` when fixing packages
and their companions, including workspace manifests and pnpm catalogs.
Reject unsupported complex ranges before cloning or spending on assisted
fixes, with the declaration location and an installed-version
replacement suggestion.

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pack-candidate Migration pack proposed by the daily pack task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants