pm: lock brand boundary on the not-a-command front door#39
Merged
Conversation
pnpm 10.15 delegates its not-implemented command set (access, edit, issues, profile, team, …) to the npm CLI, so those commands print "npm error code …". nub does not inherit that: a command nub does not implement is refused with a nub-branded message on every output stream. Add a regression test asserting no `npm error` (or `aube`) leak for that command set plus a wholly unsupported word, and that the refusal is nub-branded. The test deliberately does not pin an exit code — exit-code alignment with pnpm is a separate behavior question. Also correct a stale module comment in store_config_family that referred to a removed `run_npm_fallback` helper and called the native `pkg` / `set-script` editors "npm-fallback verbs". Claude-Session: https://claude.ai/code/session_01YRvztkcr4fzfg9rD5edUwa
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
Locks the package-manager “unknown / not-implemented command” front door to stay brand-clean (never delegating to npm or leaking engine branding), and fixes stale module documentation in the PM config/store family.
Changes:
- Add a regression test ensuring pnpm’s npm-delegated “not implemented” command set (plus a totally unknown command) is refused with nub-branded, brand-clean output.
- Update
store_config_familymodule docs to reflect thatpkg/set-scriptare native engine verbs (and remove a reference to a deleted helper).
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| crates/nub-cli/tests/pm_verbs.rs | Adds the unimplemented_pm_commands_never_leak_npm regression test for brand-clean refusals on non-commands. |
| crates/nub-cli/src/pm_engine/store_config_family.rs | Updates module-level docs to remove stale references and clarify native verb behavior. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+781
to
+786
| assert!( | ||
| out.combined().contains("nub"), | ||
| "the refusal must be nub-branded:\nstdout: {}\nstderr: {}", | ||
| out.stdout, | ||
| out.stderr | ||
| ); |
Contributor
Author
|
Shipped in v0.1.10: https://github.com/nubjs/nub/releases/tag/v0.1.10 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Investigated three pnpm-compat front-door divergences (B1 not-implemented→npm leak, B2 unsupported-command exit code, B3 self-update nag) against current nub and real pnpm 10.15.1. Most premises did not reproduce on current nub; this PR lands the one unambiguous, brand-correct guard plus a stale-comment fix.
What landed
unimplemented_pm_commands_never_leak_npm): asserts that pnpm's npm-delegated not-implemented set (access/edit/issues/profile/team/xmas/prefix) and a wholly unsupported word are refused brand-clean — nonpm error(oraube) line on any stream, nub-branded message. Locks the brand contract regardless of future wording/exit-code changes. Deliberately does not pin an exit code (that is an open behavior question, below).store_config_family.rs: removed a reference to a deletedrun_npm_fallbackhelper and corrected thepkg/set-scriptdescription (native engine verbs, not npm shell-outs).Findings (grounded against pnpm 10.15.1 + current nub on origin/main)
npm errorfor them, so matching pnpm would introduce a leak.token/set-scriptare clean native supersets.ERR_PNPM_RECURSIVE_EXEC_FIRST_FAIL); nub exits 1. The thread had this inverted (claimed pnpm=1/nub=254). Aligning would mean adopting an exec-shorthand nub deliberately rejects — a behavior call.self_update_enabled: false; aube's notifier early-returns, only fires from the dead-under-nubaube --version/doctorpath, and writes to stderr. A first-run install probe showed no nag on stdout.Verification
cargo test -p nub-cli --test pm_verbs unimplemented_pm_commands_never_leak_npm→ 1 passedcargo clippy -p nub-cli --all-targets --all-features -- -D warnings→ cleancargo fmt --check→ cleannubvs pnpm 10.15.1 across the full command setRefs the pnpm-compat-harness-bugs thread.