package-info, graph: keep .tar.br integrity on store hits by ruy-bot[bot] · Pull Request #2011 · vltpkg/vltpkg · GitHub
Skip to content

package-info, graph: keep .tar.br integrity on store hits - #2011

Open
ruy-bot[bot] wants to merge 1 commit into
mainfrom
ruyadorno/br-integrity
Open

ruy-bot[bot] wants to merge 1 commit into
mainfrom
ruyadorno/br-integrity

Conversation

@ruy-bot

@ruy-bot ruy-bot Bot commented Oct 15, 2026

Copy link
Copy Markdown
Contributor

A .tar.br linked from the store with no pinned hash left lockfile integrity null, and rm -rf node_modules && vlt i never repaired it. A lockfile node with no hash also took the installed node's hash and url even when that was the other tarball kind, flipping [4,…] nodes to .tgz.

Fixes #1995

Changes

  • package-info: store hit for an unpinned .tar.br hashes its cached bytes (if they match what was linked) so the lockfile gets one
  • graph: reference node fills in integrity/resolved only when its tarball kind matches the lockfile flag bit (reverses the old "reference pair taken as a whole" rule)

Tests

  • package-info: store hit pins the hash (with and without a resolved url); missing or damaged cached body leaves it unset
  • graph: other-kind references ignored both ways, same-kind still used

Follow-ups

  • No-op install (node_modules intact) doesn't write a hidden-lockfile hash back to vlt-lock.json; rm -rf node_modules && vlt i does
  • Store hit with no readable cache body (evicted/invalid entry) still leaves integrity null, so that repair isn't guaranteed there
  • Same-kind hidden-lockfile hash still fills a lockfile node without one on graph change: machines may differ in integrity presence (never kind or value)
  • No vlt-lock.json + stale .tgz node_modules: actual graph seeds the ideal one, lockfile written as [0,…tgz]; kind still installer-dependent there
  • .tgz without dist.integrity linked from the store: integrity stays null

Co-authored-by: Ruy Adorno ruy@vlt.sh

A `.tar.br` linked from the store with no pinned hash left lockfile
integrity null, and `rm -rf node_modules && vlt i` never repaired it.
A lockfile node with no hash also took the installed node's hash and
url even when that was the other tarball kind, flipping `[4,…]` nodes
to `.tgz`.

Fixes #1995

## Changes
- package-info: on a store hit for an unpinned `.tar.br`, hash its
  cached bytes (if they match what was linked) so the lockfile gets one
- graph: a reference node fills in integrity/resolved only when its
  tarball kind matches the lockfile flag bit

## Tests
- package-info: store hit pins the hash (with and without a resolved
  url); missing or damaged cached body leaves it unset
- graph: other-kind references ignored both ways, same-kind still used

Co-authored-by: Ruy Adorno <ruy@vlt.sh>
@vercel

vercel Bot commented Oct 15, 2026 •

Copy link
Copy Markdown

@coderabbitai

coderabbitai Bot commented Oct 15, 2026

Copy link
Copy Markdown

Important

Review skipped

Bot user detected.

To trigger a single review, invoke the @coderabbitai review command.

⚙️ Run configuration
  • Configuration used: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 8844f2f8-f121-4e30-a997-ce158a650dff

You can disable this status message by setting the reviews.review_status to false in the CodeRabbit configuration file.

Use the checkbox below for a quick retry:

  • 🔍 Trigger review
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@github-actions

Copy link
Copy Markdown

🐰 Bencher Report

Projectvltpkg
Branchruyadorno/br-integrity
Testbedubuntu-latest
Click to view all benchmark results
BenchmarkLatencyBenchmark Result
milliseconds (ms)
(Result Δ%)
Upper Boundary
milliseconds (ms)
(Limit %)
vlt install: vue & cache-lockfile📈 view plot
🚷 view threshold
816.53 ms
(+15.82%)Baseline: 705.00 ms
881.25 ms
(92.66%)
vlt install: vue & cache-lockfile-node-modules📈 view plot
🚷 view threshold
401.38 ms
(+20.66%)Baseline: 332.66 ms
415.82 ms
(96.53%)
vlt install: vue & clean📈 view plot
🚷 view threshold
13,407.63 ms
(+1.20%)Baseline: 13,248.44 ms
16,560.55 ms
(80.96%)
vlt install: vue & lockfile📈 view plot
🚷 view threshold
4,585.85 ms
(-13.43%)Baseline: 5,297.14 ms
6,621.42 ms
(69.26%)
🐰 View full continuous benchmarking report in Bencher

This branch was successfully deployed

1 active deployment
Preview — 06d5fe89 Deployed Oct 15, 2026 by vercel[bot]
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.

Brotli tarball integrity is dropped when the artifact is served from the local cache, leaving lockfile nodes without integrity

1 participant