Skip to content

feat(list): priorities with reasons, family and shared-pin groups, filterable HTML tiles - #20

Merged
lucasbraum merged 3 commits into
mainfrom
feat/list-priorities
Oct 6, 2026
Merged

lucasbraum merged 3 commits into
mainfrom
feat/list-priorities

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 6, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

uptide list now opens with PRIORITIES: what to upgrade first, why, and the exact command. Two grouping bugs are fixed, and the HTML report's tiles filter the table. Everything is deterministic: no LLM calls in list.

Priorities

The rules live in one module, packages/core/src/list/priorities.ts, with a unit test per signal. Weights are documented in docs/priorities.md.

Signal Source Example reason
security one POST to npm's /-/npm/v1/security/advisories/bulk with every public package's installed versions; private registries and scopes are never sent; 5 s deadline; on failure the heading says "advisories not checked" and the run goes on 2 advisories (1 high), fixed in 3.1.2
deprecated the abbreviated packument discovery already fetches (no extra request) deprecated: <registry message, truncated>
unsupported the full document's time map, fetched only for packages with a newer major (5 s deadline) 4.x line unsupported since 2025-03, 37 files to touch
blocking an installed peer range holds another outdated package back blocks ai 7
behind 2+ majors 3 majors behind, 2 files to touch
effort files + calls/10 from the usage scan, halved by a verified pack tiebreaker

Ranking is security > deprecated > unsupported > blocking > behind, with the cheaper upgrade first among equals. A group is a single row, ranked by its most urgent member.

Two choices to review:

  • Within a group, moving together isn't urgent. A member that moves with, or holds back, another member of the same group doesn't make the group urgent; that is just what the group says. Otherwise every peer-coupled group would be a priority (the synthetic Nest fixture showed "blocks @nestjs/common 12" inside @nestjs/*).
  • Cheap batch. When nothing is urgent, the terminal says so and suggests minor/patch upgrades with no urgent signal touching at most 3 files each. A group joins only if all its members qualify.

Runtime over dev

  • Classification: each package is runtime if it's in dependencies/optionalDependencies (or is a peer of one) and isn't tooling. Otherwise it's dev: only in devDependencies, or tooling. JSON: packages[].kind.

  • Ranking: a dev package's advisory drops one severity step, and runtime wins ties:

    runtime critical > runtime high ≥ dev critical > runtime moderate ≥ dev high

    So a high advisory in a runtime dependency outranks a critical one in a dev-only test runner: both rank 5.3, and runtime wins the tie. A dev critical still outranks a runtime moderate.

  • Wording: dev rows say dev · in the reason.

Smallest fix

For a security row, the fix is the lowest stable version above the installed one that none of its advisories covers:

  • fixed in 2.29.4 (patch, same major);
  • needs 9.0.0 (major);
  • no fixed version yet.

At equal urgency, same-major fixes rank above major-only ones. The row's command checks that version, e.g. uptide check moment --target [email protected]. The recorded advisory ranges are tested in priorities.test.ts and priorities-fixture.test.ts.

--no-advisories

--no-advisories, or "advisories": false in uptide.config.json, means no request is ever made to npm's advisory endpoint. The heading then says advisories not checked (turned off with --no-advisories) (or … in uptide.config.json). The config file accepts advisories only as a boolean, and the credential checks still apply to the whole file.

Terminal

  • PRIORITIES is the first section, with at most 5 rows (--all shows every row).
  • Each row has the name, the reason and the exact command. The command moves to its own line when it wouldn't fit, so it is never clipped.
  • Next points to the top priority, then to the cheap batch, then to the old fallback.

Grouping bugs

  • Families: a scope (not @types) is one group named @scope/* whatever its members' versions.

  • Across scopes: the registry data does not match the brief's "peer link" for ai + @ai-sdk/*. Their only peer is zod. What links them is a shared pin: [email protected] and @ai-sdk/[email protected] both pin @ai-sdk/provider 1.1.3, and their latest versions both pin 4.0.22, so upgrading one alone leaves two copies. Packages now group across scopes when:

    • a peer range of one's latest version needs the other at its latest ("peer link"); or
    • they pin the same exact dependency version and move it together ("shared <dep>").

    The group is named ai + @ai-sdk/* and shows its reason.

  • Holding back is not grouping: an installed peer range that holds another package back is a blocking signal, not a group link. Otherwise React's ecosystem would fold into one group on its way to 19; the radix fixture covers this.

  • Fixtures: fixtures/repos/list-accuracy/radix-family and ai-sdk-link, each with real npm metadata recorded once in registry.json and served offline.

HTML report

  • Tiles as filters: Outdated, Major, Minor, Patch, Groups, Tooling, Priority, Verified and Possibly unused are <button aria-pressed> toggles. Click again, click Outdated, or use Clear to reset. The active tile is visibly pressed, and the filter is kept in #filter=<name>, so a link reopens the same view.
  • Counts: "13 major, but only 6 in PACKAGES" wasn't a counting bug. PACKAGES only ever listed used, ungrouped majors; the rest sat in GROUPS, TOOLING and POSSIBLY UNUSED. Every package is now one row in one section, and each filter opens the collapsed sections it needs, so a tile's count is exactly the number of rows it shows. For Groups, it's the number of group sections. html/list.test.ts asserts this for every tile, and it was checked in a browser on the fixtures (all 9 tiles).
  • Priorities block at the top, with the same reasons as the terminal.
  • Still offline: one file, no external scripts; the inline script is pinned by the CSP hash. Keyboard: native buttons with a focus ring, and Clear returns focus to the tiles.

Network and privacy

list now sends public packages' names and installed versions to npm's advisory endpoint, unless --no-advisories or the config key turns it off. README, SECURITY.md, docs/cli.md and the privacy statement in --help say so.

Output (synthetic fixture)

fixtures/repos/list-accuracy/priorities is a synthetic app of public npm packages at versions with known advisories, a deprecation and a dev-only dependency. Its registry and advisory responses were recorded once. pnpm exec tsx scripts/render-report-previews.ts <dir> reproduces the output below and the screenshots.

uptide list · synthetic-priorities · npm · 412ms

5 outdated   2 major   2 minor   1 patch   0 groups   0 tooling

PRIORITIES  most urgent first · advisories checked for 5 packages
  moment         2 advisories (2 high), fixed in 2.29.4 (patch, same major)
    uptide check moment --target [email protected]
  lodash         6 advisories (3 high), fixed in 4.18.0 (minor, same major)
    uptide check lodash --target [email protected]
  jsonwebtoken   3 advisories (1 high), needs 9.0.0 (major)
    uptide check jsonwebtoken --target [email protected]
  minimist       dev · 1 advisory (1 critical), fixed in 1.2.6 (patch, same major)
    uptide check minimist --target [email protected]
  uuid           1 advisory (1 moderate), needs 11.1.1 (major)
    uptide check uuid --target [email protected]

PACKAGES
  jsonwebtoken   8.5.1 → 9.0.3    major       1 file   1 call
  uuid           3.4.0 → 14.0.2   major ×11   1 file   1 call
  + 3 minor/patch · --all

Usage is a syntax scan, no type analysis.
Generic analysis is the default; verified means a migration pack is available.
Next  uptide check moment --target [email protected]

Priorities

The synthetic Nest report, opened from #filter=tooling: the collapsed Tooling section opens and shows its 19 rows, matching the tile.

Tooling filter

Mobile, opened from #filter=priority

Timing on real repositories

Validated locally on two real repositories; only timings are published, no output and no package names. uptide list --json, before and after, interleaved, 5 runs each:

before (median) after (median)
repository 1 2.84 s (1.91–3.09) 3.23 s (2.17–3.32)
repository 2 2.59 s (2.43–2.82) 2.90 s (2.70–3.76)

Most of the difference is the extra registry work (the advisory POST, plus the full documents for packages with a newer major), which overlaps the existing request pool. Registry latency dominated the spread in these runs.

Tests

  • core 814 passed, cli 315 passed; typecheck and biome clean.
  • New: priorities.test.ts (each signal, ranking, groups, cheap batch), families.test.ts (both fixtures), groups.test.ts (@types excluded, workspaces kept apart, peerBlocks), and the HTML tile-count test.
  • Request-count tests now count requests by kind: the abbreviated packument, the full document for publish dates, and no advisory POST for private registries.
  • Snapshots changed for the new PRIORITIES section and the Nest family (10 members, now including @nestjs/cli and @nestjs/schematics).

🤖 Generated with Claude Code

…lterable HTML tiles

Priorities (packages/core/src/list/priorities.ts, docs/priorities.md):
deterministic signals per outdated package, no LLM call. Known advisories
for the installed version from one POST to npm's bulk advisory endpoint
(public packages only; 'advisories not checked' on failure, never fatal),
a deprecated installed version and every published version from the
packument discovery already fetches, the support window from the full
document's time map (only for packages with a newer major), peer ranges
holding another upgrade back, majors behind, and effort from the usage
scan (halved by a verified pack). Ranked security > deprecated >
unsupported > blocking > behind, cheaper first among equals; a group is
one row. When nothing is urgent, a cheap batch of minor/patch upgrades
touching few files.

Groups: a scope is one family whatever its members' versions (@types
excepted), and packages also group across scopes when a peer range of
one's latest version needs the other, or both pin the same exact
dependency version that their latest versions move together (ai and
@ai-sdk/* share @ai-sdk/provider; they have no peer link). An installed
peer range that holds another package back is a blocking signal, not a
group, so React's ecosystem does not fold into one group. Every group
carries its reason.

Terminal: PRIORITIES first, at most five rows with the reason and the
exact command (on its own line when it would not fit), and Next points to
the top priority or the cheap batch.

HTML: a Priorities block, and tiles (Outdated, Major, Minor, Patch,
Groups, Tooling, Priority, Verified, Possibly unused) that filter the
rows, toggle or Clear, with the filter in the URL hash. Each package is
one row in one section, so a tile's count is the rows it shows: the 13
majors of the header include grouped, tooling and possibly-unused rows
that PACKAGES never listed.

README, SECURITY.md and the privacy statement name the advisory request.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum force-pushed the feat/list-priorities branch from fcee0fb to 3e3bb79 Compare October 6, 2026 03:57
lucasbraum and others added 2 commits October 5, 2026 21:05
Runtime over dev: each package is runtime (dependencies, optionalDependencies,
or a peer of one) unless it is tooling, else dev (packages[].kind). A dev
package's advisory drops one severity step, and runtime wins ties, so a high
advisory in a runtime dependency outranks a critical one in a dev-only test
runner; dev rows say 'dev · ' in the reason.

The smallest fix: the lowest stable version above the installed one that none
of its advisories covers, said as 'fixed in 3.2.5 (patch, same major)' or
'needs 4.1.11 (major)'. Same-major fixes rank above major-only ones at equal
urgency, and the row's command checks that version (--target).

--no-advisories, or "advisories": false in uptide.config.json, never sends
installed versions to npm's advisory endpoint; PRIORITIES says why advisories
were not checked. The config file accepts advisories only as a boolean.

A synthetic fixture (fixtures/repos/list-accuracy/priorities: public packages
with recorded registry and advisory responses) drives the tests, the report
previews (scripts/render-report-previews.ts) and the screenshots in
docs/screenshots/pr-20, which contain no real project's data.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
Signed-off-by: Lucas Braum <[email protected]>
@lucasbraum
lucasbraum merged commit 197a414 into main Oct 6, 2026
5 checks passed
@lucasbraum
lucasbraum deleted the feat/list-priorities branch October 6, 2026 04:15
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