Skip to content

fix(install): track actual hoisted direct entries - #1295

Merged
jdx merged 1 commit into
mainfrom
codex/fix-hoisted-auto-install-freshness
Aug 14, 2026
Merged

fix(install): track actual hoisted direct entries#1295
jdx merged 1 commit into
mainfrom
codex/fix-hoisted-auto-install-freshness

Conversation

@jdx

@jdx jdx commented Aug 14, 2026

Copy link
Copy Markdown
Owner

Summary

  • record the actual ancestor-visible placement for direct dependencies in hoisted workspaces
  • retain importer-local fallback paths for isolated and non-planner entries
  • cover repeated warm script checks after a dependency is shared at the workspace root

Root cause

The install state always recorded <importer>/node_modules/<name> for every direct dependency. Workspace-wide hoisting intentionally leaves that path absent when the dependency is shared from an ancestor node_modules, so every freshness check treated a valid layout as stale and reinstalled the same tree.

Validation

  • cargo test -p aube state::tests
  • cargo clippy --all-targets -- -D warnings
  • cargo fmt --check
  • mise run test:bats test/hoisted.bats --filter 'hoisted workspace root placements stay warm'
  • public reproduction from discussion 1292

AI-assisted — Tool: Codex; model: unavailable; version: unavailable.


Note

Medium Risk
Changes install freshness/layout verification on a hot path (aube run); behavior is scoped to hoisted linker with placements, with isolated fallback unchanged.

Overview
Fixes false install warm-path misses in hoisted workspaces where a member’s direct dependency is satisfied from the root node_modules and the member-local slot is intentionally empty.

When persisting direct_entries in InstallLayoutState::from_graph, the code no longer always records <importer>/node_modules/<name>. For hoisted installs it uses HoistedPlacements to store the first ancestor-visible path Node can resolve (e.g. node_modules/is-number for packages/app), walking importer ancestors until a recorded placement matches. Isolated mode and missing placement data still use the local importer path.

Adds a unit test for hoisted workspace importers and a bats case that repeated aube run does not trigger Auto-installing when deps live only at the workspace root.

Reviewed by Cursor Bugbot for commit 44f16e5. Bugbot is set up for automated code reviews on this repo. Configure here.

Summary by CodeRabbit

  • Bug Fixes
    • Fixed dependency visibility for workspace projects using hoisted installations.
    • Lifecycle scripts can now reliably access hoisted dependencies before installation.
    • Ensured dependency availability remains consistent across repeated runs without unnecessary automatic installation.
  • Tests
    • Added regression coverage for hoisted workspace dependency placement and repeated command execution.

@coderabbitai

coderabbitai Bot commented Aug 14, 2026

Copy link
Copy Markdown

Review Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Repository YAML (base), Central YAML (inherited), Organization UI (inherited)

Review profile: CHILL

Plan: Pro Plus

Run ID: 552c1ea4-10bb-402b-80ff-618af0bc6f93

📥 Commits

Reviewing files that changed from the base of the PR and between e6c9540 and 44f16e5.

📒 Files selected for processing (2)
  • crates/aube/src/state.rs
  • test/hoisted.bats

📝 Walkthrough

Walkthrough

The change records visible ancestor paths for hoisted dependencies in InstallLayoutState and retains local fallbacks for isolated or unresolved layouts. Regression tests cover workspace visibility, root placement, and repeated script execution.

Changes

Hoisted dependency visibility

Layer / File(s) Summary
Resolve visible dependency placements
crates/aube/src/state.rs
InstallLayoutState::from_graph records the first visible ancestor placement for hoisted dependencies. The Rust regression test checks the root node_modules path.
Validate repeated workspace execution
test/hoisted.bats
The workspace test verifies root placement, absence from local node_modules, and successful repeated script execution without auto-installation.

Estimated code review effort: 3 (Moderate) | ~20 minutes

Merge Risk: ⚪ Minimal · up to 44f16

The change records the actual locations of hoisted direct dependencies while preserving fallback paths, with targeted regression coverage; no actionable merge-blocking risk remains beyond normal checks and review.

Possibly related PRs

  • jdx/aube#1183: Both changes update InstallLayoutState::from_graph to persist hoisted dependency placements.
  • jdx/aube#1243: Both changes cover hoisted workspace dependency visibility in state.rs and test/hoisted.bats.

Poem

A rabbit finds a package at root,
While local shelves hold no loot.
Scripts run twice, with paths in sight,
No auto-install interrupts the night.
Hoisted hops now resolve just right.

🚥 Pre-merge checks | ✅ 5
✅ Passed checks (5 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely describes the main change: tracking actual direct dependency entries in hoisted installs.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.

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.

@greptile-apps

greptile-apps Bot commented Aug 14, 2026

Copy link
Copy Markdown
Contributor

Greptile Summary

The PR corrects install freshness state for hoisted workspaces by recording the nearest ancestor-visible placement of each direct dependency while retaining importer-local fallbacks. It adds unit and BATS coverage for repeated warm script checks when a workspace dependency is shared at the root.

Confidence Score: 5/5

The PR appears safe to merge with no actionable correctness, security, or repository-rule issues identified.

The placement lookup is scoped by the dependency’s resolved dep path, follows Node’s nearest-ancestor resolution order, and preserves existing local fallback behavior for isolated or unavailable planner state.

Important Files Changed

Filename Overview
crates/aube/src/state.rs Updates direct-entry state generation to follow actual hoisted placements visible through Node’s ancestor lookup and adds focused unit coverage.
test/hoisted.bats Adds an end-to-end regression test confirming repeated script runs do not trigger auto-install for a root-hoisted workspace dependency.

Reviews (1): Last reviewed commit: "fix(install): track actual hoisted direc..." | Re-trigger Greptile

@github-actions

Copy link
Copy Markdown

Instruction counts

benchmark trend instructions Δ wall (min) Δ
graph ▁▂██▁▇▁▂▂█▄▁▂▁▁█▂▁▂▁ 17,573,471 → 17,557,631 -0.09% 4.38 → 4.51ms +2.95%
install ▁▂▁▁▁▁▁▇█▇▇▇█▇▇▇▇▇▇█ 108,615,568 → 108,632,928 +0.02% 24.83 → 24.69ms -0.58%
startup ▃▃▄▄▄▂▂▆▆▆▄▄▇███▃██▁ 7,482,969 → 7,477,478 -0.07% 3.31 → 3.31ms +0.04%
tree ▇▇█▇███▇█▇█▇█▇██▇▁██ 17,747,501 → 17,753,189 +0.03% 4.57 → 4.44ms -2.84%

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.

44f16e56599a vs e21b4b4ee032 · measured on this runner, not pushed to the history.

@jdx
jdx merged commit a574890 into main Aug 14, 2026
21 checks passed
@jdx
jdx deleted the codex/fix-hoisted-auto-install-freshness branch August 14, 2026 22:51
@cursor cursor Bot mentioned this pull request Aug 14, 2026
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.

1 participant