fix(npm): explain aube trust downgrade failures#11292
Conversation
📝 WalkthroughWalkthroughExpanded npm trust-downgrade error messaging, updated its test assertions, and added documentation covering investigation steps, version-scoped exclusions, bypass behavior, and related aube resources. Changesnpm trust downgrade guidance
Estimated code review effort: 2 (Simple) | ~10 minutes Possibly related PRs
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 |
Greptile SummaryImproves guidance for npm trust-downgrade failures.
Confidence Score: 5/5The PR appears safe to merge. No blocking failure remains. Important Files Changed
Reviews (2): Last reviewed commit: "fix(npm): refine trust downgrade guidanc..." | Re-trigger Greptile |
There was a problem hiding this comment.
Actionable comments posted: 3
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Inline comments:
In `@src/backend/npm.rs`:
- Around line 1182-1186: Update the user-facing trust-failure wording in
src/backend/npm.rs lines 1182-1186 and docs/dev-tools/backends/npm.md lines
301-303 to describe the selected release as having weaker trust evidence, rather
than implying trust evidence is completely absent. Keep both paths consistent
with Aube’s tiered trust policy and preserve the surrounding explanation.
- Around line 1184-1190: Revise the warning text in src/backend/npm.rs lines
1184-1190 and the corresponding documentation in docs/dev-tools/backends/npm.md
lines 309-312 so it does not assert that the package maintainer’s release
process failed; instruct users to report inconsistent trust evidence to the
relevant upstream owner or registry operator, since either may need to correct
stripped or missing metadata.
- Around line 1196-1197: Fix the broken trust-policy investigation link by
either publishing the missing route or replacing it with a live canonical URL.
Update both occurrences: src/backend/npm.rs lines 1196-1197 in the user-facing
guidance and docs/dev-tools/backends/npm.md lines 319-320, keeping both
references consistent.
🪄 Autofix (Beta)
Fix all unresolved CodeRabbit comments on this PR:
- Push a commit to this branch (recommended)
- Create a new PR with the fixes
ℹ️ Review info
⚙️ Run configuration
Configuration used: Central YAML (base), Organization UI (inherited)
Review profile: CHILL
Plan: Pro Plus
Run ID: ddcbc8dd-27fe-4c8b-806c-1e43dea4f583
📒 Files selected for processing (2)
docs/dev-tools/backends/npm.mdsrc/backend/npm.rs
Hyperfine Performance
|
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.13 x -- echo |
17.7 ± 0.8 | 16.3 | 27.1 | 1.00 |
mise x -- echo |
19.3 ± 1.3 | 17.6 | 33.2 | 1.09 ± 0.09 |
mise env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.13 env |
16.7 ± 0.7 | 15.5 | 19.8 | 1.00 |
mise env |
18.1 ± 0.7 | 16.8 | 21.6 | 1.08 ± 0.06 |
mise hook-env
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.13 hook-env |
17.6 ± 0.7 | 16.1 | 21.3 | 1.00 |
mise hook-env |
19.0 ± 0.9 | 17.6 | 23.9 | 1.08 ± 0.07 |
mise ls
| Command | Mean [ms] | Min [ms] | Max [ms] | Relative |
|---|---|---|---|---|
mise-2026.7.13 ls |
14.9 ± 0.6 | 13.7 | 17.6 | 1.00 |
mise ls |
16.2 ± 0.8 | 14.7 | 21.3 | 1.09 ± 0.07 |
xtasks/test/perf
| Command | mise-2026.7.13 | mise | Variance |
|---|---|---|---|
| install (cached) | 149ms | 164ms | -9% |
| ls (cached) | 56ms | 58ms | -3% |
| bin-paths (cached) | 58ms | 61ms | -4% |
| task-ls (cached) | 121ms | 125ms | -3% |
Summary
trust_policy_excludesentries and describe the broader risk of package-wide exclusions ornpm.shell_out=trueContext
mise replaces aube's
.npmrc-oriented remediation because mise owns the synthetic install project and exposestrust_policy_excludesas a tool option. That replacement needs to retain the richer security context being added in jdx/aube#1110.Validation
cargo fmt --checkcargo test test_build_aube_install_error_message_trust_downgrademise run docs:buildmise run lint-fixThe pre-existing untracked
.claude/worktrees/andxtasks/fig/directories were not included.Note
Low Risk
User-facing error text and documentation only; no install or trust-policy behavior changes.
Overview
Expands embedded aube trust-downgrade remediation so
ERR_AUBE_TRUST_DOWNGRADEis framed as a supply-chain signal (weaker trust evidence vs an earlier release), not a normal version-resolution error.The npm backend’s
build_aube_install_error_messagenow walks users through investigation before bypass: review release metadata, source, publisher, and tarball; compare with npmjs.org; report drift to maintainers vs registry operators. It recommends version-scopedtrust_policy_excludes(<package>@<version>), warns that bare package names exempt all versions, and treatsnpm.shell_out=trueas a last resort that skips the check, with a link to aube’s trust-policy docs.Docs add a matching Investigating trust downgrades section under
trust_policy_excludesin the npm backend guide. Unit tests assert the new message content.Reviewed by Cursor Bugbot for commit b9a5bab. Bugbot is set up for automated code reviews on this repo. Configure here.
Summary by CodeRabbit
Bug Fixes
<package>@<version>exceptions for affected releases.Documentation
npm.shell_out=truebypasses the trust-policy check.