aube add re-resolves unrelated versions in a fresh npm package-lock.json #1286
This is not the missing-entry repair in #690 npm-lock-missing-entry, the stale-lock-treated-fresh case in #964 lock-drift-fresh, or the optional-native recording in #938 npm-lock-optionals. After #1155 filter-add-optionals, the expected Reproductiongit clone https://github.com/mwolson/tmp-aube-issues.git
cd tmp-aube-issues/npm-lock-add-reresolve
# Point NPM_BIN at a real npm if PATH npm is aubeshim.
./repro.shThe script exits 1 while the issue is present. Manual form of the same check: cd npm-lock-add-reresolve
# Fresh: aube install leaves the lock's hoisted camelcase at 5.3.1.
aube install --ignore-scripts --reporter append-only
# Control: real npm only promotes the already-transitive is-number.
npm install is-number@7.0.0 --ignore-scripts --package-lock-only --no-audit --no-fund
# packages["node_modules/camelcase"].version is still 5.3.1
# Subject: aube add re-hoists camelcase.
aube add is-number@7.0.0 --ignore-scripts --reporter append-only
# packages["node_modules/camelcase"].version becomes 6.3.0
The same
Smaller public trees did not reproduce the unrelated hoist: Expected
Actual
Docshttps://aube.jdx.dev/package-manager/install.html (prefer-frozen reuses a fresh lock; |
Replies: 2 comments
|
Confirmed and fixed in #1287. The resolver retained both camelcase versions; the churn happened when the npm writer rebuilt the physical hoist/nest layout from the flat graph. Its BFS encountered The fix seeds the writer with still-reachable top-level placements from the existing npm lockfile, while pruning a preference after its last dependency edge disappears. I verified both the supplied Thanks for the precise reproduction. AI-assisted — Tool: Codex; model: openai/gpt-5; version: unavailable. |
|
Confirmed fixed with aube |
Confirmed and fixed in #1287.
The resolver retained both camelcase versions; the churn happened when the npm writer rebuilt the physical hoist/nest layout from the flat graph. Its BFS encountered
jest-validate -> camelcase@6.3.0first and replaced npm’s existing top-levelcamelcase@5.3.1choice.The fix seeds the writer with still-reachable top-level placements from the existing npm lockfile, while pruning a preference after its last dependency edge disappears. I verified both the supplied
npm-lock-add-reresolve/repro.shandaube install --fix-lockfileagainst the rebuilt CLI.Thanks for the precise reproduction.
AI-assisted — Tool: Codex; model: openai/gpt-5; version: unavailable.