feat(cli): aube rebuild <pkg> targets a specific package#477
Conversation
`aube rebuild` now takes zero or more positional package names. With no args the existing whole-policy rebuild runs unchanged. With one or more names, only those deps' lifecycle scripts run, the build policy is bypassed for the named deps, and the root preinstall / install / postinstall / prepare hooks are skipped — the user named the dep, so the dep is the work. Triage decision in PR #471 (lifecycleScripts.ts:282). Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Greptile SummaryThis PR extends Confidence Score: 5/5Safe to merge — implementation is correct, all edge cases are guarded, and tests cover the new paths. No P0 or P1 findings. The previously identified silent no-op (missing lockfile + selective mode) has been addressed with an early error. The jail policy is still applied in selective mode, and the alias-vs-registry-name distinction is handled correctly and consistently between the unmatched-name check and the lifecycle filter. No files require special attention. Important Files Changed
Reviews (3): Last reviewed commit: "fix(cli): aube rebuild <pkg> errors when..." | Re-trigger Greptile |
Without the guard, `aube rebuild my-package` on a fresh checkout (or before the first install) silently exits Ok: the lockfile-keyed graph is None, so the entire `if let Some(graph)` block — including the unmatched-name check — is skipped, and root hooks are also skipped (selected.is_some()). Invisible no-op in CI. Hard-error before the graph branch instead, with a hint to run `aube install` first. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
|
Addressed Greptile's P1: Added a guard before the graph branch that hard-errors with a hint to run Verified: cargo build/clippy/fmt clean, Written with Claude. |
Benchmark changesPublic ratios: warm installs vs Bun 4x -> 7x; warm installs vs pnpm 9x -> 11x.
7a72e31 vs 7d7ded0 | aube/bun/pnpm | 3 scenarios | 3 runs | 500mbit/50ms | generated by Codex. |
Summary
aube rebuildnow takes zero or more positional package names. With no args, the existing whole-policy rebuild runs unchanged (back-compat). With names, only the named deps' lifecycle scripts run, the build policy is bypassed for those deps, and the root preinstall / install / postinstall / prepare hooks are skipped.name(the in-tree alias when one is configured), soaube rebuild my-aliasworks for a manifest entry like"my-alias": "npm:real-pkg@1.0", matching pnpm. Unknown names hard-error and list every unmatched entry.aube --filter <something> rebuild <pkg>composes: each filtered importer runs only the named deps' scripts.Triage decision in PR #471 (lifecycleScripts.ts:282).
Test plan
cargo buildcargo testcargo clippy --all-targets -- -D warningscargo fmt --checkmise run test:bats test/rebuild.bats— 15/15 pass, including 4 new selective-mode tests (single dep, two deps, policy-bypass, unmatched-name error)mise run test:bats test/lifecycle_scripts.bats— 33/33 pass🤖 Generated with Claude Code
Note
Medium Risk
Extends lifecycle-script execution paths and adds an explicit policy-bypass mode, which could change when/which dependency scripts run if used in automation. Scope is contained to
rebuildand guarded by explicit package arguments plus new error checks for missing lockfile/unmatched names.Overview
aube rebuildnow accepts optional positional package names; when provided, it runs lifecycle scripts only for the named installed dependencies, skips all root hooks, and bypasses theallowBuilds/onlyBuiltDependenciespolicy as an explicit opt-in.The dependency lifecycle runner (
run_dep_lifecycle_scripts) was extended with a selective mode filter (matching by lockfile graphname/alias), andrebuildnow hard-errors on missing lockfile or unknown package names. CLI usage/docs were updated and new Bats tests cover selective rebuild behavior, policy bypass, and error cases.Reviewed by Cursor Bugbot for commit 7a72e31. Bugbot is set up for automated code reviews on this repo. Configure here.