Skip to content

Close the recall gap of the ai pack (36% → 82% breaking recall) - #83

Merged
lucasbraum merged 7 commits into
mainfrom
lucasbraum/upt-13-close-the-recall-gap-of-the-ai-pack
Oct 12, 2026
Merged

lucasbraum merged 7 commits into
mainfrom
lucasbraum/upt-13-close-the-recall-gap-of-the-ai-pack

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 12, 2026 •

Copy link
Copy Markdown
Collaborator

Closes UPT-13. The ai pack's breaking recall goes from 36% to 82%, with precision still 100%.

Before / after

Pack Breaking recall Overall recall Breaking precision
ai 6 → 7 36% (4/11) → 82% (9/11) 77% → 89% 100% → 100%
zod 3 → 4 71.25% → 73.75% — 100% → 100%
stripe 90% → 90% 100% → 100%
react 69% → 69% 100% → 100%
vitest 50% → 50% 100% → 100%

Pack

ai >=6 <7 → >=7 <8. A recall fix for an existing verified pack, plus one core fix in check that also helps zod.

What and why

Of the 7 breaking sites missed in miurla/morphic, these are fixed:

  • 3 × tool-context in lib/tools/__tests__/fetch-error.test.ts. Core bug, fix(check). When check runs on named packages, it builds its program from files that import the package (decision 0013). Files that import those files never entered the program, even though compile.ts's filesToCheck is meant to check them. This test calls fetchTool.execute(...) from lib/tools/fetch.ts without importing ai. importersOf now finds direct importers only (one level, not a transitive closure) and keeps those that import something whose declaration depends on the package, directly or through other top-level declarations in the same file. scopedImporters passes them as extra roots, cheapest first, while the heap estimate stays within +20% of the scoped baseline. The heap estimate, cache key and compiled file list all see the same roots.
  • 2 × ToolLoopAgent<never, ResearcherTools, never>. New breaking rule agent-type-arguments. AI SDK 7 inserted RUNTIME_CONTEXT as the third type parameter of ToolLoopAgent, Agent and ToolLoopAgentSettings, moving OUTPUT to fourth. The code still compiles, so neither the type diff nor the compiler reports it. These two truth sites move from generic to the new rule in a commit of their own, which quotes the 6.0.180 and 7.0.130 signatures.

Deprecated misses also fixed (overall recall only):

  • 2 × on-step-end: onStepFinish inside ...(cond && { … }), inside researchAgent.stream({ … } as Parameters<…>). The option rules now read spread objects, unwrap as/satisfies, and treat x.stream()/x.generate() as agent calls, but only in files that import from ai. Those text-matched agent-call findings are always deprecated (possible impact), never breaking. A test pins this, and the pack test JSON shows both morphic sites as on-step-end, deprecated.

Still missed, on purpose:

  • 2 breaking, both labelled generic: researcher.ts:3 (importing a new local type) and search.ts:214 (a comma added at the end of an object). The upgrade had to make these edits because of other changes; neither breaks on its own, so no rule can flag it.
  • 5 deprecated sites in test files that only call vi.mock('ai') and never import it: out of scope here. That needs core usage scanning to treat mocks as uses.

Memory: scoped program size before / after

Heap is scopedMemoryEstimate. Files are the reachable source and declaration graph the program loads. "Unbounded" means every direct importer; "bounded" is what ships.

Workspace · package roots importers added files heap estimate (MB)
PATH packages/engine · zod 6 19 (36 unbounded) 265 → 289 (+9.1%) 694 → 823 (+18.6%; unbounded +41.6%)
PATH packages/designer · zod 1 5 (11 unbounded) 262 → 298 (+13.7%) 642 → 720 (+12.1%; unbounded +25.2%)
PATH packages/designer · react 25 19 358 → 377 (+5.3%) 854 → 963 (+12.8%)
PATH packages/schema · zod 15 11 233 → 251 (+7.7%) 699 → 763 (+9.2%)
PATH packages/viewer · react 16 12 309 → 323 (+4.5%) 764 → 834 (+9.2%)
PATH packages/server · zod 5 1 346 → 346 (0%) 724 → 729 (+0.7%)
alanagoyal@22aa5f1 · react 123 45 1391 → 1409 (+1.3%) 1537 → 1741 (+13.3%)
alanagoyal@22aa5f1 · @supabase/supabase-js 4 1 1454 → 1454 (0%) 1025 → 1030 (+0.5%)
alanagoyal@22aa5f1 · openai 3 0 540 → 540 (0%) 727 → 727 (0%)
morphic · ai 47 38 2212 → 2279 (+3.0%) 1308 → 1504 (+15.0%)

PATH is a pnpm monorepo on TypeScript 7 and is measured per workspace, as check scopes it. alanagoyal depends on neither ai nor zod, so it's measured on its own heavily imported packages; react is the worst case there.

Unbounded, PATH/engine grew +42% heap and designer +25%. The suggested semantic bound (only importers taking a package-dependent export) brought engine down only to +33%, because those importers really do use zod schemas. The growth came from a few importers that drag in a whole SDK: step-plugins/prompt/index.ts alone adds 131 files and 2 MB of declarations. Hence the cost budget on top of the semantic filter. Recall was re-measured with the bound: ai keeps its full gain (82%); zod keeps 2 of its 3 extra sites (73.75% instead of 75% unbounded). The budget adds up to ~1 s of planning on morphic (about 1,300 files).

Determinism and reporting of the cap (0eb647f)

  • Deterministic: the cap is +20% of the same scoped program's heap estimate, computed from file sizes and imports only. scopedImporters reads no free or total memory and runs before memoryPolicy, so the same commit selects the same importers on any machine and in CI. importer-cap.test.ts runs check twice, with reported free memory at 6 GB and 96 GB, and asserts the same files left out and the same findings. Making the cap scale with free memory fails the test.
  • Never silent: CheckReport.importersNotAnalyzed lists, per workspace, the dropped files and the line N importing files not analyzed (memory cap); findings in them may be missed. fix copies it into FixReport, which is stored as report.json. The check summary prints the line per workspace (--details adds the file list), the fix summary prints it as Coverage, and the HTML report lists every file. docs/architecture.md documents both.

Sources

The meta.sources of the ai pack (migration guide 6 → 7, ai 7.0.0 changelog), and the published declarations of [email protected] and [email protected] for the type parameters.

Rules and behavior notes

  • agent-type-arguments (new, breaking, detect only, goes to the agent): a ToolLoopAgent/Agent/ToolLoopAgentSettings imported from ai with 3 or more type arguments.
  • on-end, on-step-end, instructions, telemetry (existing, deprecated, rewrite): now also found in spread objects, behind as/satisfies. on-end and on-step-end are also found in agent stream/generate calls.

Ground-truth repositories

Unchanged: vercel/chatbot@77d362e (27 findings) and miurla/morphic@989a056 (34 findings). The only edit moves 2 morphic sites from generic to agent-type-arguments.

uptide pack test output

uptide pack test ai · verified
fixtures      8 cases, 26 sites · pass
ground truth
  vercel/chatbot@77d362e596e2                  ai 6.0.116 → 7.0.9  predicted 27, expected 27, false positives 0, false negatives 0
    with @ai-sdk/provider 3.0.3 → 4.0.1, @ai-sdk/react 3.0.118 → 4.0.10
  miurla/morphic@989a05697d97                  ai 6.0.180 → 7.0.66  predicted 27, expected 34, false positives 0, false negatives 7
    with @ai-sdk/anthropic 3.0.77 → 4.0.38, @ai-sdk/gateway 3.0.114 → 4.0.52, @ai-sdk/google 3.0.73 → 4.0.42, @ai-sdk/openai 3.0.63 → 4.0.39, @ai-sdk/openai-compatible 2.0.47 → 3.0.30, @ai-sdk/react 3.0.182 → 4.0.69, ai-sdk-ollama 3.8.4 → 4.0.0

  rule                         precision  recall    tp   fp   fn
  agent-type-arguments              100%    100%     2    0    0
  full-stream                       100%    100%    12    0    0
  generic                           100%      0%     0    0    2
  instructions                      100%    100%    12    0    0
  is-step-count                     100%     89%     8    0    1
  on-end                            100%     43%     3    0    4
  on-step-end                       100%    100%     2    0    0
  removed-experimental-option       100%    100%     1    0    0
  telemetry                         100%    100%     3    0    0
  telemetry-metadata                100%    100%     2    0    0
  tool-context                      100%    100%     4    0    0
  total-usage                       100%    100%     2    0    0
  ui-message-stream                 100%    100%     3    0    0
  overall (sites)                   100%     89%    54    0    7
  breaking (sites)                  100%     82%     9    0    2

false negatives (7)
  miurla/morphic@989a05697d97  lib/agents/__tests__/researcher.test.ts:10  is-step-count
  miurla/morphic@989a05697d97  lib/agents/researcher.ts:3  generic
  miurla/morphic@989a05697d97  lib/streaming/__tests__/create-chat-stream-response.test.ts:79  on-end
  miurla/morphic@989a05697d97  lib/streaming/__tests__/create-chat-stream-response.test.ts:94  on-end
  miurla/morphic@989a05697d97  lib/streaming/__tests__/create-ephemeral-chat-stream-response.test.ts:62  on-end
  miurla/morphic@989a05697d97  lib/streaming/__tests__/create-ephemeral-chat-stream-response.test.ts:88  on-end
  miurla/morphic@989a05697d97  lib/tools/search.ts:214  generic

PASS ai: verified

pnpm uptide pack test (every pack) passes. verification.json rewritten with --write for ai and zod.

How it was verified

  • check.test.ts: a file that imports nothing from the package reads a removed property through a local wrapper. The test fails on main and passes here.
  • importers.test.ts: importersOf returns direct importers only, never the importers of an importer, and with packages it drops an importer that takes only an unrelated export.
  • ai.test.ts: fixture cases agent-type-arguments and spread-options, each with keep sites. Agent-call sites are asserted deprecated.
  • pnpm lint, pnpm typecheck and pnpm test are clean on macOS. Three tests used to fail locally because os.tmpdir() is /var/… while real paths are /private/var/… (workspace-source, scaffold, release). Both vitest configs now set TMPDIR to its realpath, which is a no-op on Linux CI.

Checklist

  • Every rule and note comes from a source listed in meta.sources
  • Every rule that rewrites or detects has a fixture case, with a site it must leave alone (keep)
  • Ground truth: public repositories at the commit before their upgrade; expected findings read from their own upgrade commit and the compiler, never copied from Uptide's output
  • At least two public repositories for verified
  • pnpm uptide pack test ai passes and its output is pasted above; verification.json written with --write
  • pnpm lint && pnpm typecheck && pnpm test pass
  • Changeset added
  • No private code, names or paths anywhere: fixtures are synthetic, ground truth is public

🤖 Generated with Claude Code

lucasbraum and others added 7 commits October 11, 2026 18:16
…budget

Named checks build their program from the files that import the packages
(decision 0013). The files importing those see the package's types too, but
never entered the program: morphic's fetch-error.test.ts calls
`fetchTool.execute(...)` from lib/tools/fetch.ts without importing `ai`, and
its three AI SDK 7 compile errors went unreported, although `filesToCheck`
already meant to check such importers.

`importersOf` finds direct importers only (one level, never a closure) and,
given the packages, keeps those that import something whose declaration
depends on one of them. `scopedImporters` adds them as roots, cheapest first,
while the scoped heap estimate stays within 20% of the roots' own; the
estimate, the cache key and the compiled file list all see the same roots.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
…the runtime context

AI SDK 7 inserted RUNTIME_CONTEXT as the third type parameter of
`ToolLoopAgent`, `Agent` and `ToolLoopAgentSettings`, moving OUTPUT to fourth.
`ToolLoopAgent<never, Tools, never>` still compiles, so neither the type diff
nor the compiler reports it. The new breaking rule `agent-type-arguments`
detects references to those types imported from `ai` with three or more
type arguments (type references and `new` with explicit arguments) and
leaves two-argument uses and other libraries' `Agent` alone.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
… agent calls

The option rules only read the top-level properties of an object literal
passed directly to an `ai` function. morphic's `onStepFinish` sits in
`...(isUsageLogging() && { onStepFinish })` inside `researchAgent.stream({...}
as Parameters<...>)`, three layers away.

- options inside spread object literals (`&&`, `||`, `??`, `?:`) are read;
- `as`, `satisfies` and parentheses around the options are unwrapped;
- `x.stream({...})` and `x.generate({...})` count as agent calls for
  `onFinish`/`onStepFinish`, only in a file that imports from `ai`. The
  receiver's type is out of reach from the text, so these stay deprecated
  findings (possible impact), never breaking; a test pins that.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
…nt-type-arguments

Two miurla/morphic sites were expected under `generic`, which the ground
truth reserves for sites no rule covers:

  lib/agents/researcher.ts:168  agent: ToolLoopAgent<never, ResearcherTools, never>
  lib/types/agent.ts:23         export type ResearcherAgent = ToolLoopAgent<never, ResearcherTools, never>

The upgrade commit (miurla/morphic@0ec2ca7) rewrote both to
`ToolLoopAgent<never, ResearcherTools, ResearcherRuntimeContext>` because
the third type parameter changed meaning. From the published declarations
(dist/index.d.ts):

ai 6.0.180:
  declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends Output = never> implements Agent<CALL_OPTIONS, TOOLS, OUTPUT>
  interface Agent<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends Output = never>
  type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet = {}, OUTPUT extends Output = never>

ai 7.0.130:
  export declare class ToolLoopAgent<CALL_OPTIONS = never, TOOLS extends ToolSet$1 = {}, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = never> implements Agent<CALL_OPTIONS, TOOLS, RUNTIME_CONTEXT, OUTPUT>
  interface Agent<CALL_OPTIONS = never, TOOLS extends ToolSet$1 = {}, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = never>
  type ToolLoopAgentSettings<CALL_OPTIONS = never, TOOLS extends ToolSet$1 = {}, RUNTIME_CONTEXT extends Context = Context, OUTPUT extends Output = never>

The sites, lines and sources are unchanged; only the rule they are filed
under moves from `generic` to `agent-type-arguments`.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
`uptide pack test --write` against the ground truth:
- ai: breaking recall 0.3636 → 0.8182, precision 1, 0 false positives
- zod: breaking recall 0.7125 → 0.7375, precision 1, 0 false positives
  (direct importers of scoped roots now compiled)

stripe, react and vitest are unchanged.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
… cap's determinism

The importer cap is relative to the scoped program's own heap estimate
(+20%), computed from the files' sizes and imports alone: `scopedImporters`
reads no free or total memory, and runs before `memoryPolicy` does. The same
repository at the same commit selects the same importers on any machine. A
new test runs `check` twice with the reported free memory at 6 GB and 96 GB
and asserts the same importers left out and the same findings; making the cap
scale with free memory fails it.

What the cap leaves out is no longer silent. `CheckReport.importersNotAnalyzed`
(copied to `FixReport`, so into the stored report.json) names, per workspace,
the files and the line "N importing files not analyzed (memory cap); findings
in them may be missed". The check summary prints that line per workspace (the
file list under --details), the fix summary prints it as Coverage, and the
HTML report lists every file. docs/architecture.md describes both.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
…S.md

On macOS os.tmpdir() is /var/folders/..., a symlink to /private/var/...,
while realpath, the compiler and import.meta.url report the /private form.
Three tests compared the two and failed locally (workspace-source's hoisted
links, scaffold's formatter run, release-plan's entry guard in a spawned
script). About 80 test files create temp dirs with mkdtempSync(join(tmpdir()))
directly, so both vitest configs set TMPDIR to realpathSync(tmpdir()) once:
os.tmpdir() reads TMPDIR on every call, and spawned children inherit it. A
no-op where /tmp is already real (Linux CI).

turbo writes AGENTS.md at the repository root during builds; it is ignored.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum merged commit bda0b35 into main Oct 12, 2026
8 checks passed
@lucasbraum
lucasbraum deleted the lucasbraum/upt-13-close-the-recall-gap-of-the-ai-pack branch October 12, 2026 03:21
@uptide-release uptide-release Bot mentioned this pull request Oct 12, 2026
lucasbraum pushed a commit that referenced this pull request Oct 12, 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]

### Patch Changes

- [#83](#83)
[`bda0b35`](bda0b35)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Find more of what
an upgrade breaks. Named checks now also compile the files that directly
import a package's importers when what they import depends on the
package, within a 20% memory budget relative to the same program's
estimate (the same files on every machine), so a test calling a wrapped
tool's `execute` is reported. Files the budget leaves out are named per
workspace in the check and fix summaries, `report.json` and the HTML
report. The `ai` pack flags `ToolLoopAgent`, `Agent` and
`ToolLoopAgentSettings` type arguments, whose third position is now the
runtime context, and finds renamed options inside spread objects, behind
`as`/`satisfies`, and in an agent's `stream`/`generate` calls. Breaking
recall: `ai` 36% → 82%, `zod` 71% → 74%, with no false positives.

- [#84](#84)
[`5c59257`](5c59257)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Yarn 2 and 3
lockfiles: follow dependency references written without the `npm:`
protocol, so a moved package's own subtree is recognized. `fix` no
longer rejects a new major that swaps its dependencies (for example
`cmdk` 0.2 → 1.0 replacing `@radix-ui/*` 1.0.0 with 1.1.x) as "changed
resolutions outside the dependency subtree", and importer resolutions in
these lockfiles are now compared too. Changes reached only from packages
that did not move are still rejected. The report lists each allowed
transitive change under the package that moved it.
  
A root `resolutions`, `overrides` or `pnpm.overrides` entry that pins a
package the upgrade moves now stops the run before the baseline and the
install, naming the entry, instead of failing after the install (on
medusa: 33 s instead of 11 min). With Yarn 2+, a moved package whose
range the plan rewrote is pinned to the exact planned version too (it
resolved the newest match before).
  
Temporary clones are removed on exit, including after a failed or
interrupted run. `--keep-temp` (or `--debug`, which also prints every
phase) keeps one; `--keep` still works as before.

- [#85](#85)
[`0af3fed`](0af3fed)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Fix a 0.7.4
regression: when a workspace declares the upgraded package both in
`peerDependencies` and in `dependencies` or `devDependencies`, the
widened peer range (for example `^18.3.1 || ^19.0.0`) replaced the
installable range in the install and in the check that follows it. With
Yarn it is no lockfile descriptor, so the check read an old copy and
`fix` stopped with "Requested [email protected], but … resolved 17.0.2". Peer
ranges are now only validated and widened in the manifest:
`dependencies`, `devDependencies` and `optionalDependencies` alone feed
the install, `yarn set resolution` and the check.

- [#86](#86)
[`191c89e`](191c89e)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Fix `uptide pr
--yes` opening a ready-for-review pull request when `--draft` is
omitted. New pull requests now default to drafts, matching `fix --pr
--yes` and the migration report's instructions.

- [#81](#81)
[`ac01a01`](ac01a01)
Thanks [@lucasbraum](https://github.com/lucasbraum)! - Respect the
repository's JavaScript compiler setting when selecting scoped analysis
roots. This prevents an `escapedName` crash during upgrades in mixed
TypeScript/JavaScript monorepos while preserving analysis of enabled
JavaScript files.

Co-authored-by: uptide-release[bot] <338861287+uptide-release[bot]@users.noreply.github.com>
lucasbraum added a commit that referenced this pull request Oct 15, 2026
…8) (#151)

## Pack

`redis` (node-redis), `>=4 <6` → `>=5 <7`, for
[UPT-58](https://linear.app/uptide/issue/UPT-58/pack-redis-node-redis-4-5-and-5-6).
ioredis is a separate pack (#129).

**One pack, two rule sets.** 4 → 5 and 5 → 6 are separate rule sets, and
an upgrade gets the sets of the majors it crosses: 4 → 6 gets both, 5 →
6 never sees a 4 → 5 site. It is one pack and not two because pack
lookup is one pack per package, and because 4.7 → 6.x in one step is the
most common real upgrade (Dependabot offers it to every 4.x user; 3 of
the 6 upgrades found did it). The gate is `appliesTo` in `index.ts`:
detection, `ruleOf` and notes check the crossed majors, and `transform`
refuses a 4 → 5 rewrite on code already on 5.

**Status: candidate.** `verification.json` records candidate; since #154
pack test accepts a record that claims less than the run measures.

## Sources

Pinned at node-redis `b64bacb`, read 2026-10-14: `docs/v4-to-v5.md`,
`docs/v5-to-v6.md`, `docs/RESP.md`; release notes `[email protected]` and
`[email protected]`; published declarations of @redis/client 1.6.1 / 5.12.1 /
6.3.0, @redis/search and @redis/time-series. Release group: the five
`@redis/*` packages `redis` pins at its own version. `@redis/graph` is
gone in 5.

## Rules and behavior notes

**4 → 5**
- `legacy-mode`: compiler + detect; assisted (`client.legacy()`).
- `command-options`: `commandOptions()`, `isolated`, `executeIsolated`;
compiler + detect; assisted (`withCommandOptions`, `createClientPool`).
- `scan-iterators`: detect only; **rewrite** to a nested loop, declined
when the body `break`s/`continue`s the loop.
- `keep-alive`: compiler + detect; **rewrite** `keepAlive: N` →
`keepAlive: true, keepAliveInitialDelay: N`.
- `scan-cursor`: string cursors; compiler + detect (`cursor !== 0` never
ends in JS); assisted.
- `number-replies`: boolean → number replies; compiler; assisted.
- `renamed-exports`: 17 enums → constants, `SearchOptions` →
`FtSearchOptions`; **rewrite**: import under the old local name,
declined when the file uses a member whose name or value changed
(compared member by member in the declarations) or uses the name as a
type.
- `deep-imports`: `@redis/*/dist` internals; compiler only; assisted.
- `graph-removed`: compiler + detect; assisted, a decision for the
owner.
- `quit-disconnect` (deprecated): **rewrite** to `close()`/`destroy()`,
only where the result is unused.
- `set-expiration` (deprecated): `EX`/`PX`/… → `expiration`; assisted.
Not in the guide; from the declarations.
- Notes: `search-dialect-2` (finding at query calls without `DIALECT`),
`pipeline-discards-unwritten`, `node-18` (decisions).

**5 → 6**
- `client-type`: `RedisClientType` is invariant in RESP and clients
default to RESP3, so a client typed `RedisClientType` /
`ReturnType<typeof createClient>` breaks. **Not in the guide**; seen in
all four real upgrades that reached 6; assisted.
- `unstable-resp3`: compiler + detect; **rewrite**: delete the option.
- `sentinel-node-command-options`: compiler; assisted.
- Notes: `client-defaults` (finding + decision at each inline-options
client that leaves RESP, command timeout, keep-alive delay or
maintNotifications to the 6 default; the instructions pin the 5 defaults
per client, as the ioredis pack does), `node-20`,
`plain-object-replies`.

## Ground-truth repositories

Drafted with `pnpm packs:truth` (each repository's own compiler and
merged upgrade), reviewed by hand, and **committed in ffb4f90 before the
first score (71a2172 before the rebases on main)**.

| Repository | Hop | Pinned | Upgrade | Sites |
|---|---|---|---|---|
| deanmoses/tacocat-gallery-sam (`app`) | 4.6.12 → 5.10.0 | `34e1176` |
PR #83 | 4 |
| swoofer/mcp-coordinator | 5.12.1 → 6.2.0 | `8b337f0` | PR #251 | 2 |
| deanmoses/tacocat-gallery-sam (`app`) | 5.12.1 → 6.2.1 | `30724e2` |
PR #133 | 2 |
| UNN-Devotek/FCM-Fallout-Chat-Mod (`backend`) | 4.7.1 → 6.0.0 |
`2801904` | PR #125 | 9 |
| tearingItUp786/blog | 4.7.0 → 6.0.0 | `bb88f3a` | #223 + `092ea34` | 5
|

**One change after the first score:** FalkorDB/falkordb-ts (4.7.1 →
5.10.0, 20 sites, the richest 4 → 5 upgrade found) was in the committed
truth, but the first run could not score it at all. Its `package.json`
declares `workspaces: ["./packages/*"]` matching no directory, and
`check` refuses the repository. It is removed (437e129), and none of its
sites was ever scored. Also screened out: stamp (needs Node ≥ 24.15),
semaphore-chat (lockfile outside the project directory), about 30
bump-only upgrades. Details in RESEARCH.md.

## `uptide pack test` output

```
uptide pack test redis · verified, recorded candidate
fixtures      12 cases, 27 sites · pass
ground truth
  deanmoses/tacocat-gallery-sam@34e11760f6e7   redis 4.6.12 → 5.10.0  predicted 4, expected 4, false positives 0, false negatives 0
  swoofer/mcp-coordinator@8b337f0a081d         redis 5.12.1 → 6.2.0  predicted 3, expected 2, false positives 1, false negatives 0
  deanmoses/tacocat-gallery-sam@30724e21efd6   redis 5.12.1 → 6.2.1  predicted 2, expected 2, false positives 0, false negatives 0
  UNN-Devotek/FCM-Fallout-Chat-Mod@280190489fac redis 4.7.1 → 6.0.0  predicted 5, expected 9, false positives 0, false negatives 4
  tearingItUp786/blog@bb88f3afc40d             redis 4.7.0 → 6.0.0  predicted 1, expected 5, false positives 1, false negatives 5

  rule                         precision  recall    tp   fp   fn
  client-defaults                     0%      0%     0    4    2
  client-type                       100%     33%     2    0    4
  generic                            50%    100%     2    2    0
  renamed-exports                   100%    100%     2    0    0
  scan-cursor                       100%     30%     3    0    7
  overall (sites)                    87%     59%    13    2    9
  behavior notes (sites)             50%     50%     2    2    2
  breaking (sites)                  100%     61%    11    0    7

false positives (2)
  swoofer/mcp-coordinator@8b337f0a081d  src/infra/redis.ts:50  client-defaults (deprecated)
  tearingItUp786/blog@bb88f3afc40d  app/utils/redis.server.ts:15  client-defaults (deprecated)

✗ verification.json does not match this run: `uptide pack test redis --write` records it
FAIL redis
```

**Why the record says candidate.** Today's gate (≥ 2 repos, 0 breaking
false positives) computes `verified`, and the stricter UPT-48 gate is
not on main yet. The evidence is thin exactly where it matters most. The
core 4 → 5 API changes (`command-options`, `legacy-mode`,
`scan-iterators`, `number-replies`, `keep-alive`) have **no real site**
in the ground truth. The 4 → 5 rule set rests on one 4 → 5 repository (4
sites) plus the scan-cursor sites of the two 4 → 6 repositories. Three
rewrites (`scan-iterators`, `keep-alive`, `unstable-resp3`) never met a
real site, and under UPT-48 they would run as assisted. So I have not
run `--write`, and CI's Pack test will flag the record as stale until
this is decided: rebase on UPT-48 and re-score, or find a scorable 4 → 5
upgrade with those changes.

**The 7 breaking false negatives are all outside the rules' reach:**
- blog (5): its files reach the client through a local module and a
local `RedisScanClient` type, so `check` reports no compile error there.
- FCM and tacocat 5 → 6 (4 client-type): the repositories' own `tsc`
reports TS2322, `check` doesn't. Those lines already had a different
TS2322 at the installed version, so they were most likely subtracted as
pre-existing. Not confirmed in the engine.

**Behavior:** the two `client-defaults` false positives are clients
whose repositories kept the RESP3 default without pinning it.

## Engine follow-ups found here (not in this PR)

- `check` refuses a repository whose `workspaces` patterns match nothing
(FalkorDB).
- Compile errors in files that use the client without importing the
package go unreported (blog).
- Pre-existing errors seem to be subtracted by location, which hides a
new error at the same line (FCM, tacocat).

## Checklist

- [x] Every rule and note comes from a source listed in `meta.sources`.
`client-type` and `set-expiration` come from the published declarations,
which are listed.
- [x] Every rule that rewrites or detects has a fixture case, with a
site it must leave alone (`keep`)
- [x] Ground truth: public repositories at the commit before their
upgrade; expected findings read from their own upgrade commit and the
compiler, never copied from Uptide's output
- [x] At least two public repositories for `verified`; otherwise the
pack ships as a candidate. Five scored; kept as a candidate on purpose,
see above.
- [ ] `pnpm uptide pack test redis` passes and its output is pasted
above; `verification.json` written with `--write`. Intentionally not
written yet.
- [x] `pnpm lint && pnpm typecheck` pass; `vitest run src/packs` in core
(259 tests) passes. The full `pnpm test` was not run locally.
- [x] Changeset added
- [x] No private code, names or paths anywhere: fixtures are synthetic,
ground truth is public

🤖 Generated with [Claude Code](https://claude.com/claude-code)

---------

Signed-off-by: Lucas Braum <[email protected]>
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

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant