Skip to content

[pull] main from pnpm:main - #466

Merged
pull[bot] merged 10 commits into
dwongdev:mainfrom
pnpm:main
Aug 1, 2026
Merged

pull[bot] merged 10 commits into
dwongdev:mainfrom
pnpm:main

Conversation

@pull

@pull pull Bot commented Aug 1, 2026 •

Copy link
Copy Markdown

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? 💖 Please sponsor : )

zkochan and others added 10 commits August 1, 2026 12:37
A registry version that carried no `dist.integrity` was recorded in the
lockfile with a bare tarball URL and no hash, and `--lockfile-only` never
computed one — so the very first `pnpm install --frozen-lockfile` over
that lockfile failed with `ERR_PNPM_MISSING_TARBALL_INTEGRITY`. Two
independent gaps produced it, and both are closed here.

First, `dist.shasum` was ignored. pnpm's `getIntegrity` promotes the
legacy hex digest to a `sha1-` SRI string when `dist.integrity` is
absent, which is what pins every version published before subresource
integrity — the whole of `https://node-registry.bit.cloud/`, for one.
pacquet parsed the field and dropped it, leaving those versions unpinned
and diverging from the lockfile the TypeScript CLI writes for the same
graph. `dist_integrity` now mirrors `getIntegrity`, including the
`ERR_PNPM_INVALID_TARBALL_INTEGRITY` failure for a shasum that is not a
hex digest. It also restores the stronger of the two behaviours: a
registry-published hash pins the bytes, where hashing whatever arrived
pins nothing.

Second, `--lockfile-only` skipped the `PrefetchingResolver` wholesale,
and that wrapper owns `populate_missing_integrity` — the only path that
hashes a tarball no registry hash covers. Background prefetching and
integrity completion are now separate concerns: the wrapper always sits
in the resolver chain, and `prefetch_downloads` turns off only the
speculative download. A run that materializes nothing (`--lockfile-only`)
or only part of the graph (a filtered workspace selection) still fetches
the few tarballs whose hash the lockfile cannot be written without, which
is what pnpm does with `resolutionNeedsFetch` under `dryRun`.

Closes #13547
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
Every projected numeric network value carries the engine default when
unset, and Bit merges the projection over its own global network
config - without knowing which values are explicit it either forwards
defaults as overrides or forwards nothing.
… during version picking (#13504)

Resolution re-derived the same data once per dependency edge instead of
once per packument:

- filterPkgMetadataByPublishDate ran on every pick (every edge) with
  minimumReleaseAge active — the default since it is 1440 min — parsing
  a Date per version and rebuilding the versions map each time. It is
  now memoized per packument object in a WeakMap, keyed by cutoff and
  trusted versions so one packument served under different policies
  still filters per policy. Sharing the returned object is safe: callers
  already shared the inner version manifests, and the packument objects
  the resolver passes in are themselves cached and treated as read-only.

- pickPackageFromMeta re-parsed version strings and ranges on every
  satisfies/maxSatisfying call. Parsed SemVer and Range instances are
  now cached in capped Maps (cleared at 50k entries so long-lived
  processes cannot grow them without bound), and maxSatisfying/
  minSatisfying are replaced with loops that reuse the caches. The
  dist-tag repopulation loop in the publish-date filter likewise
  compares already-parsed instances instead of calling semver.gt on
  strings.

- Concurrent offline picks of one package all miss the pre-queue
  in-memory cache check, then each re-read and re-parsed the mirror
  behind the per-package limiter (176 of 1311 loads on the benchmark
  fixture were duplicates). The limiter callback now re-checks the
  cache; offline entries are always disk-sourced, so this is equivalent
  to arriving after the first caller cached it.

- clearMeta condensed every version object through ramda's curried
  pick; a direct field loop does the same with no per-field dispatch.
  The presence check via undefined-comparison matches the previous
  behavior because version objects come from JSON, which cannot encode
  undefined.

Resolution of the 1246-package benchmark fixture is 12.5% faster on
top of current main (4.27s -> 3.73s, hyperfine, offline hot cache);
the resulting lockfile is byte-identical. Attribution: filter
memoization -11%, semver caches -4%, the rest ~-1%.
Stream lazy child resolution through caches and share ancestry, missing-peer summaries, package
data, and dependency paths across repeated peer contexts. Retain only discovery nodes needed as
peer providers instead of occurrence state for every cache-served visit.

Index peer-provider children once per evolving workspace graph so cached peer lookup and lazy
provider previews avoid repeatedly scanning every dependency edge.

Recursively hoist nested conflict roots so the hoisted linker does not expand a small dependency
graph into deeply repeated node_modules paths.

Add a deterministic integrated benchmark that compares the peer-heavy resolver against main and
TypeScript pnpm while enforcing byte-identical lockfiles.

Closes #13540.
…!` helpers (#13277)

web_auth_fake! emitted its whole surface — FakeHost with its eight capability
impls, both reporters, every set_* setter, and the message queries — into every
test and silenced the unused ones with allow(dead_code), noise that can also
mask a genuinely dead helper.

Keep only the thread-local statics and reset() as the always-present core and
generate each optional helper from a named macro argument, with a catch-all
compile_error! arm for a mistyped name. Each test names exactly the helpers it
drives, so nothing is unused and no dead_code allow is needed. Call sites in
network-web-auth, auth-commands, cli, and publish name their helpers, and
CODE_STYLE_GUIDE.md documents the convention with login_fake! as the reference.

Pacquet-only test-infrastructure and guide change; no user-visible surface, no
TypeScript counterpart, and no changeset.
The peer-heavy scenario asserted that pacquet resolves the fixture at least
10x faster than the TypeScript CLI. That headroom was measured against a base
that still re-filtered the packument and re-parsed semver ranges once per
dependency edge on the offline hot-cache path. #13504 removed that
per-edge work, so the same 401-package DAG now resolves in ~2.9s instead of
~34.4s and the ratio fell to ~1.7x, failing the benchmark on main.

Tie the floor to what the assertion is actually for: a peer-resolution blowup
of the kind #13540 tracked runs slower than the TypeScript CLI (7.0s
versus 2.9s, ~0.4x), so 1.25x clears the run-to-run noise while still catching
it, and no longer breaks whenever the TypeScript resolver gets faster.

Co-authored-by: Claude Opus 5 (1M context) <[email protected]>
…odules (#13551)

resolve_peers.rs carried the public entry points, workspace orchestration,
peer-hoist discovery, the walker, cache matching, child realization, final
dep-path construction, cycle analysis, graph construction, and the standalone
peer-context utilities in one 3,934-line file, with a 2,434-line test module
beside it.

Keep resolve_peers.rs as the facade holding the options/result types and the
two public entry points, and move the implementation into resolve_peers/:
discovery.rs (the hoist-loop discovery engine and its persistent caches),
walker.rs (Walker, its state, walk, resolve_node, and peer resolution),
cache.rs (purePkgs and peersCache matching, deferred child resolution, child
realization, retention decisions), finalize.rs (pending-edge repair, SCC cycle
analysis, final depPath recomputation, graph construction), and context.rs
(parent references, shared ancestor chains, link remapping, peer-suffix
parsing, range matching).

Walker stays one struct; its inherent impl is divided across the modules with
`pub(super)` visibility, so every cross-module item stays private to
resolve_peers and the crate's public API is unchanged. The unit tests that
drive one module's internals move next to it, with the shared tree builders
lifted into a test_support module; the end-to-end peer-resolution tests stay
at the facade.

Pure code movement: no behavior, allocation, cloning, dispatch, or traversal
change, and release builds use `lto = "fat"` with `codegen-units = 1`, so the
module boundaries cannot shift inlining either.

Closes #13548.
…ropping data (#13559)

The peer-heavy resolver fixture has a wide run-to-run spread — a local 15-run
pass measured a ~15% coefficient of variation on an idle machine, with the slow
samples scattered through the sequence rather than clustered at the start, so
the noise is runner contention rather than a cold cache. Three CI runs against
that spread produced a 2.83s outlier on #13551 that lifted the pacquet
mean to 2.15s while its fastest run sat at 1.54s, inside main's range.

Compare the cross-engine gate on each target's fastest run instead of its mean.
Contention only ever adds time, so the minimum is the sample least perturbed by
a noisy neighbour; this is already the statistic the workflow reports to
Bencher, for the same reason. Raise the scenario to nine runs so that minimum
has a good chance of landing on an uncontended run, and surface both mean and
min in the diagnostics table.

The gate is a correctness check, not a measurement, and it was costing us the
measurement: asserting mid-job aborted before the Bencher upload and dropped
every scenario's data point for the whole run. That is why this benchmark has
almost no history on bencher.dev — the two main pushes after it was added both
failed on the since-recalibrated 10x floor, so only one point was ever
published. Record the verdict, let the upload proceed, and re-raise the failure
afterwards.

Pacquet-only benchmark-harness and CI change; no user-visible surface, no
TypeScript counterpart, and no changeset.
…agnostics (#13560)

The two final-graph tests that exercise peer-edge suffixes left
`node_dep_paths` empty, so `build_final_graph` skipped its `min_depth`
pass entirely and every node's depth came from the fallback
`record.depth`. Each test now registers a shallower `find_hit` revisit —
walked, so it has a `node_dep_paths` entry, but short-circuited before a
`NodeRecord` was created — and asserts the merged node takes that
shallower depth. Both new assertions fail when the `min_depth` lookup is
replaced by `record.depth`.

The bare `assert!` that no trimmed provider variant is fabricated now
prints the final graph keys, as does its sibling in the neighbouring
test, so a failure shows which variants were built.

Closes #13555
@pull pull Bot locked and limited conversation to collaborators Aug 1, 2026
@pull pull Bot added the ⤵️ pull label Aug 1, 2026
@pull
pull Bot merged commit a98ff3e into dwongdev:main Aug 1, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants