fix(lockfile): preserve imported workspace links#535
Conversation
Greptile SummaryFixes a false-stale lockfile error where
Confidence Score: 5/5Safe to merge — the change is well-scoped, the exemption condition is tight, and removal of a workspace package from the manifests slice still triggers stale correctly. The workspace-link exemption requires three independent conditions to all be true (root importer, name in workspace-manifest set, resolved package is a link), making accidental over-exemption very unlikely. The non-workspace check_drift path is unaffected (passes an empty HashSet). The refactoring is minimal and the regression test directly covers the reported failure scenario. No files require special attention. Important Files Changed
Reviews (1): Last reviewed commit: "fix(lockfile): preserve imported workspa..." | Re-trigger Greptile |
Summary
link:entries that point at current workspace packages.Why
aube importpreserves npm workspace root links inaube-lock.yaml, including links for workspace packages that npm exposes at the root even when the rootpackage.jsondoes not list them as dependencies. A lateraube citreated those imported links as removed manifest dependencies and rejected the lockfile as stale, which prevented the linker from recreatingnode_modules/@scope/*workspace symlinks after switching frompackage-lock.jsontoaube-lock.yaml.Validation
cargo test -p aube-lockfilecargo fmt --checkcargo clippy --manifest-path crates/aube-lockfile/Cargo.toml --fix --allow-dirty --allow-staged --quietaube import && rm package-lock.json && aube ci --ignore-scripts, confirming root workspace symlinks are created.Note
Medium Risk
Adjusts workspace frozen-lockfile drift detection to treat certain root
link:entries as non-drift, which could potentially mask a real removed dependency if the heuristic misfires. Scope is limited to workspace-aware drift logic and is covered by a new regression test.Overview
Workspace-aware drift checking now preserves root-level
link:entries that point at current workspace packages, even when the rootpackage.jsondoesn’t declare them.This threads a workspace package-name set into the importer drift check and skips the “manifest removed” stale result when the locked entry is a root importer dep whose resolved
LockedPackageis aLocalSource::Link. A regression test was added to ensurecheck_drift_workspacestaysFreshfor npm-imported workspace root links.Reviewed by Cursor Bugbot for commit bf791e9. Bugbot is set up for automated code reviews on this repo. Configure here.