Skip to content

Fix list accuracy for legacy tooling and private registries - #9

Merged
lucasbraum merged 7 commits into
mainfrom
codex/list-accuracy-round-two
Oct 4, 2026
Merged

lucasbraum merged 7 commits into
mainfrom
codex/list-accuracy-round-two

Conversation

@lucasbraum

@lucasbraum lucasbraum commented Oct 4, 2026 •

Copy link
Copy Markdown
Collaborator

uptide list retains incomplete registry results and recognizes real tooling usage without hiding application code. Public packages no longer disappear under a shared discovery deadline, and formatter/linter ignore settings no longer turn used runtime dependencies into “Possibly unused”.

Discovery and classification

  • Fetch abbreviated registry metadata with 16 concurrent requests, a fresh 10-second timeout per attempt (including response bodies), and one retry on timeout/5xx. Block a host only after 401/403/405. Preserve npm configuration precedence, scoped registries, ${ENV} tokens and host/path-scoped credentials without storing or printing secrets.
  • Retain unknown latest versions and incomplete HTML rows; exit 2 for real discovery failures. Explain auth required, access denied, timeout, not found and other failures; deduplicate by package and collapse repeated host/reason diagnostics. Summary labels use the shared actual reason, or bare “not checked” when mixed.
  • Treat Git/GitHub, file/link/workspace and HTTP(S) sources—including aliases targeting them—as intentional skips with exit 0. Resolve registry aliases by real name, preserve local usage, and support pnpm/Yarn alias locks and pnpm default/named catalogs.
  • Detect tool rc files, generic package.json configuration keys, installed bins (including collisions), hook/task commands, Karma mappings/auto-loading, required direct dependencies/peers, stylesheet imports and HTML node_modules assets. Parse configuration statically without executing it.
  • Read legacy lint-staged linters maps and current flat configs in JSON/YAML/JS/ESM/TS/package.json. Ignore globs are neither commands nor source exclusions. Members keep independent classification/evidence; a group header follows its lead while independently used members remain in their own section. JSON and check --group keep every member.
  • Keep Possibly unused collapsed with cautious wording and reasons. Render sequential HTML section numbers and preserve offline/CSP/privacy behavior.

Source scan scope and safety

Only root/nested .gitignore, built-in directories (node_modules, .git, coverage, dist, build, bower_components, vendor) and generated-file patterns (*.min.js, *.bundle.js, *.map) exclude source. Tool ignores never exclude application code: .prettierignore, .eslintignore, .stylelintignore, standard.ignore and lint-staged ignore describe tool scopes only.

Dependency-name text and lexical gates select full syntax-parser candidates. Calls, value references and shadowing still use syntax analysis. Batches of at least 32 candidates / 8 MB use up to four CPU workers; smaller batches avoid startup overhead. --verbose shows all five phase timings, file/worker counts and skips by reason.

When Git rules exclude more than 50% of candidate application sources, terminal summary, HTML, JSON and verbose output warn with the matching patterns and counts. Candidates are counted before text/lexer filtering, excluding built-in/generated artifacts, declaration files and tool configs. Git-ignored subtrees are audited by filenames only, without reading/parsing source; built-in excluded directories remain unenumerated. Warning-only runs still exit 0. Long warnings wrap rather than truncating the responsible rule.

Regression fixtures and performance

  • tool-ignore-scope: .prettierignore contains **/*.js, with additional blanket tool settings. nanoid, jquery, pdfjs-dist and axios each remain Used with 1 file / 1 call. Removing all tool ignores produces identical usage counts.
  • legacy-lint-staged: the requested husky → lint-staged legacy config gives prettier both lint-staged command and config file .prettierrc, even as a peer of an unused lead. Uncalled pretty-quick remains possibly unused.
  • Synthetic fixture comparison from the hook/Karma round: Tooling 10 → 37, Possibly unused 32 → 5; remaining entries are deliberate controls. These older fixtures explicitly invoke pretty-quick, unlike the exact legacy fixture above.
  • Local delayed registry: 80/80 packages resolve, 80 requests, at most 16 in flight, 220 ms latency per response. Scoped registry + ${ENV} auth is exercised through core and the bundled CLI. Source fixtures cover all requested non-registry types, registry aliases and catalogs.

Re-ran the unchanged scan benchmark on Node 22 with fixed registry responses to isolate scan work:

Repository Previous tool-ignore scan (7b2ce1b) Corrected scan Sources read Full parses Workers
webpack v5.50.0 0.730 s 1.154 s 4,793 (was 660) 490 0
Synthetic: 1,844 sources + 1,293 assets 0.779 s 1.132 s 744 (was 544) 160 4

The synthetic scan now reads the 200 additional application files previously hidden by standard.ignore. All 160 usage files / 160 calls survive, with all 1,293 assets processed. Of 1,044 application-source candidates, 300 are Git-ignored; 800 vendor/bower sources are excluded by built-in rules. The earlier unoptimized synthetic scan was 13.542 s. These are local synthetic measurements, not a claim about the unavailable private AngularJS application.

Reproduce with pnpm build then node scripts/list-scan-benchmark.mjs /path/to/webpack-v5.50.0. The script creates/removes a temporary synthetic tree and does not contact a registry. Earlier live registry runs and complete fixture before/after tables are recorded in the fixture README, including webpack's 93 dependencies / 73 outdated / one intentional GitHub skip / zero discovery failures.

Validation

  • Build, typecheck, lint and frozen-lockfile install pass.
  • 778 core + 267 CLI tests pass (1,045 total); 15 opt-in network tests are skipped.
  • Broad-ignore coverage: 50%, 75%, 100%, whole ignored directories, combined patterns, nested negation, no false warning from text/lexer gates, summary/verbose/HTML/JSON, and unchanged exit 0.
  • Parallel/sequential output parity, bundled worker against a mock registry, TTY/plain snapshots, scoped-auth privacy, intentional source skips, malformed manifests, and full group membership are covered.
  • Public-tree filename scan passes. Packaged Node 22 Docker smoke and Node 20/22 CI are running on the latest update.

Includes documentation, reproducible benchmarks and a core/CLI patch changeset. Based on main after #8 (21fad7a).

@lucasbraum
lucasbraum merged commit b2068c7 into main Oct 4, 2026
4 checks passed
@lucasbraum
lucasbraum deleted the codex/list-accuracy-round-two branch October 4, 2026 23:30
lucasbraum added a commit that referenced this pull request Oct 4, 2026
The repository declared `[email protected]` after npm had published `0.3.0`,
so pending minor changesets would calculate a lower release. Align the
CLI manifest with npm, correct the repository metadata for provenance,
and publish only versions already committed at the checked-out ref.

- npm verification (`npm view <name> versions --json` and `npm view
<name> dist-tags`): `uptide` latest is `0.3.0`, next is
`0.2.0-next.20261003172442`; private `@uptide/core` returns E404 and
stays at `0.1.0`. Internal links use `workspace:*` and need no range
changes.
- Require an explicit version for latest and next; fail before
installation on a manifest mismatch with “Merge the version PR first”.
Neither workflow rewrites versions. Both require main; latest retains
its public-repository guard and provenance requirements. There is no
default version.
- Both workflows create `vX.Y.Z` and a GitHub Release at the published
`${{ github.sha }}` after a successful non-dry-run publish. Next
releases are marked as prereleases. Publish jobs have `contents: read` /
`id-token: write`; only the separate release jobs have `contents:
write`.
- Replace all former-owner references across package metadata, tests,
consent links, issue templates, examples, action documentation, and the
conduct-report link with `uptide-dev/uptide`. The requested old-owner
grep now returns no matches.
- Embed the CLI manifest version at build time for `--version`, HTML and
telemetry. Regression tests change the manifest after bundling and
verify all three retain the build version.
- Configure `@changesets/changelog-github` for `uptide-dev/uptide` and
document `GITHUB_TOKEN` for PR/commit links. A direct generator check
for commit `b2068c7` produced its PR #9 link without running `changeset
version`.
- Remove private-core entries from four existing mixed changesets, which
Changesets rejects. CLI bump types and descriptions remain intact. No
new changeset; `changeset version` was not run.

### Existing npm release

Verified [npm 0.3.0
provenance](https://registry.npmjs.org/-/npm/v1/attestations/[email protected])
identifies `71e3ebf33cfc2de044fd64cb97bedca0abc4e066`, and verified that
commit exists locally. Created and pushed annotated tag `v0.3.0` at
exactly that commit; the remote peeled tag matches. Created a [draft
GitHub
Release](https://github.com/uptide-dev/uptide/releases/tag/untagged-27262a653142ddcf0218)
with a short manual summary. No history was rewritten and the draft has
not been published.

### Validation

Local `pnpm lint`, `pnpm typecheck`, and `pnpm test` pass: 1,053 tests
passed (778 engine + 275 CLI), 15 opt-in tests skipped. Release-guard
tests cover main-only next releases, required versions,
post-publish/dry-run gating, target SHA and least-privilege job
permissions. The current commit's denylist-backed public check passed in
CI on Node 20 and 22; [remaining CI
jobs](https://github.com/uptide-dev/uptide/actions/runs/37244830163) are
running. The previous commit's complete CI, including both smoke jobs,
passed.

### `pnpm changeset status --verbose`

```text
> [email protected] changeset /Users/Deskfy/Desktop/code/uptide-versions
> changeset status --verbose

🦋 changeset v3.0.3

Packages to be bumped:
- minor
  - uptide -> 0.4.0
    - .changeset/check-first-screen.md
    - .changeset/command-follows-dist-tag.md
    - .changeset/first-public-release.md
    - .changeset/fixture-casts-and-helper-placement.md
    - .changeset/generic-tier-and-plan.md
    - .changeset/list-accuracy-private-registry.md
    - .changeset/nest-discovery-and-html.md
    - .changeset/one-publish-gate.md
    - .changeset/quick-discovery-explicit-analysis.md
    - .changeset/quiet-model-providers.md
    - .changeset/quiet-tides-observe.md
    - .changeset/registry-rate-limit.md
    - .changeset/tagline.md
    - .changeset/verify-safety.md
```
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