Repository navigation
fix(licenses): resolve packages from hoisted layout - #1183
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Central YAML (base), Organization UI (inherited) Review profile: CHILL Plan: Pro Plus Run ID: 📒 Files selected for processing (4)
📝 WalkthroughWalkthroughThe install state now records modules-directory and hoisting-limit details. The licenses command uses recorded or inferred layouts to reconstruct hoisted package paths when reading license manifests, with coverage for current, changed, and legacy settings. ChangesHoisted license reporting
Estimated code review effort: 3 (Moderate) | ~25 minutes Sequence Diagram(s)sequenceDiagram
participant User
participant licenses
participant InstallState
participant HoistedPlacements
participant LicenseReport
User->>licenses: run licenses --long --json
licenses->>InstallState: read recorded or default layout
licenses->>HoistedPlacements: reconstruct placements when hoisted
licenses->>LicenseReport: collect_rows with placements
LicenseReport-->>User: package paths and license fields
Suggested reviewers: Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
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. Comment |
Instruction counts
No instruction-count regression above 1%. Only instruction counts gate. Wall clock is shown for context — on identical hardware it moves 4-20% run to run. Measured by tak — instruction-counted CLI benchmarks, stored in this repository's git notes.
|
Greptile SummaryThe PR makes license reporting resolve manifests using the materialized install layout.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (3): Last reviewed commit: "fix(licenses): support legacy hoisted st..." | Re-trigger Greptile |
There was a problem hiding this comment.
Cursor Bugbot has reviewed your changes and found 1 potential issue.
❌ Bugbot Autofix is OFF. To automatically fix reported issues with cloud agents, enable autofix in the Cursor dashboard.
Reviewed by Cursor Bugbot for commit 341cd29. Configure here.

Summary
--prod/--devfilteringRoot cause
aube licensesalways derived package paths from the isolated virtual store. A hoisted install does not createnode_modules/.aube, so every manifest read failed and each dependency fell back toUNKNOWN.This also respects installs made with the one-shot
--node-linker=hoistedflag by preferring the stored install layout over current configuration.Fixes the behavior reported in #1182.
Validation
cargo test -p aube commands::licensesmise run test:bats test/licenses.batscargo clippy -p aube --all-targets -- -D warningscargo fmt --checkAI-assisted — Tool: Codex; model: unavailable/unavailable; version: unavailable.
Note
Medium Risk
Changes path resolution for a user-facing command and extends persisted install layout metadata; behavior is backward-compatible via serde defaults and legacy inference, but wrong placement reconstruction could still mis-report licenses on edge-case hoisted trees.
Overview
aube licensesno longer assumes an isolated virtual store. It prefers the install layout snapshot in state (linker mode,modulesDir, hoisting limits), reconstructs hoisted placements from the full lockfile graph, then reads each package’spackage.jsonfrom the on-disk hoisted path instead ofnode_modules/.aube/...—fixing hoisted installs where every license showed asUNKNOWN.Install finalize now persists
modules_dir_nameandhoisting_limitsintoInstallLayoutState, and addsread_default_state_layoutso layout can still be found under defaultnode_modulesaftermodulesDirmoves. Older state without those fields is handled by inferring the modules directory from recorded direct entries and picking the hoisted plan that best matches existing directories on disk.Bats coverage was added for hoisted installs, post-install
.npmrcchanges, and legacy layout JSON missing the new fields.Reviewed by Cursor Bugbot for commit 6e2068a. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
aube licenses(including--long --json) to resolve packages using the recorded hoisted layout, keeping on-disk paths correct even if settings change later."UNKNOWN"results.