Repair stale pnpm GVS package projections#638
Merged
schickling merged 4 commits intomainfrom Apr 29, 2026
Merged
Conversation
b2e06e0 to
5ce025d
Compare
5ce025d to
fbac966
Compare
fbac966 to
be67553
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Rationale
The existing health check caught broken symlinks and missing transitive dependency projections, but not incomplete package contents under pnpm 11 GVS links. A package could keep a valid package.json while an exported runtime file was absent, causing downstream Vitest/build runs to fail later with less actionable module-load errors.
Concrete public repro from side experiments:
@testing-library/svelte@5.3.1in a PNPM 11 workspace withenable-global-virtual-store=true.src/vitest.jsfrom the resolved package projection understore/v11/links/@testing-library/svelte/.../node_modules/@testing-library/svelte.Missing package content: @testing-library/svelte -> ./src/vitest.js.pnpm install --forcedoes not restore the missing file while the existingv11/linksprojection remains.store/v11/linksand reinstalling restores the missing runtime export target.The repair path already detected GVS hash/config drift and forced a relink, but it only purged workspace
node_modules. It now also removes the activev11/linksdirectory before the forced install so pnpm cannot reuse incomplete package projections.The content check intentionally validates runtime export targets only. During side experiments,
vitest@4.0.15exposed declaration-onlytypestargets that were absent from the GVS projection while the runtime targets were present and loadable. Treating those as package-content failures would make the health check too broad.Verification
@testing-library/svelte@5.3.1:src/vitest.jsis detectedpnpm install --forcealone does not restore itstore/v11/linksplus reinstall restores itPATH=/run/current-system/sw/bin:$PATH bash nix/devenv-modules/tasks/shared/tests/pnpm.test.shPATH=/run/current-system/sw/bin:$PATH oxfmt --check nix/devenv-modules/tasks/shared/check-node-modules-projection-health.cjsPATH=/run/current-system/sw/bin:$PATH nixfmt --check nix/devenv-modules/tasks/shared/pnpm.nixgit diff --checkenv -u OTEL_STATE_DIR -u OTEL_EXPORTER_OTLP_ENDPOINT -u OTEL_MODE CI=1 devenv tasks run --refresh-task-cache --no-eval-cache genie:check lint:nix:format lint:check:format lint:check:oxlint ts:build --mode before --no-tuiDownstream LiveStore validation with the earlier candidate pinned:
env -u OTEL_STATE_DIR -u OTEL_EXPORTER_OTLP_ENDPOINT -u OTEL_MODE -u PNPM_HOME -u PNPM_STORE_DIR -u npm_config_store_dir CI=1 devenv tasks run --refresh-task-cache --no-eval-cache test:unit --mode before --no-tuienv -u OTEL_STATE_DIR -u OTEL_EXPORTER_OTLP_ENDPOINT -u OTEL_MODE -u PNPM_HOME -u PNPM_STORE_DIR -u npm_config_store_dir CI=1 devenv tasks run --refresh-task-cache --no-eval-cache ts:build lint:check:format lint:check:oxlint test:unit --mode before --no-tuiPosted on behalf of @schickling
agent_nameagent_session_idagent_toolagent_tool_versionagent_runtimeagent_modelworktreemachinetooling_profile