Skip to content

fix(cli): suggest current namespace in pack remediation messages - #1669

Open
SequeI wants to merge 3 commits into
mainfrom
fixNS
Open

fix(cli): suggest current namespace in pack remediation messages#1669
SequeI wants to merge 3 commits into
mainfrom
fixNS

Conversation

@SequeI

@SequeI SequeI commented Aug 18, 2026

Copy link
Copy Markdown
Member

Linked Issue

Closes #1634

Summary

A profile can still reference an official pack by a namespace it was published under before a registry rename (e.g. always-further/claude, now nolabs-ai/claude). Every nono pull .../nono remove ... remediation message in verify_profile_packs echoed the stale namespace straight back instead of the one that still resolves, across six separate error paths (not-installed, missing lockfile entry, missing artifact, tampered artifact, missing trust bundle, signer mismatch).

separate error paths (not-installed, missing lockfile entry, missing artifact, tampered artifact, missing trust bundle, signer mismatch).

Add package_status::canonicalize_legacy_pack_ref(), reusing the existing legacy_namespaces table, and route every remediation message through it. Also add a proactive warning when a legacy-namespace pack is loaded at all, even when its otherwise healthy, so users learn to migrate before something breaks rather than only after.

No automatic migration is performed and the users own profile is never modified — this only fixes what nono tells them to run.

Test Plan

Checklist

  • An issue exists and is linked above
  • All commits are signed-off, using DCO
  • All new code follows the project's coding standards (CLAUDE.md) and is covered by tests
  • Public-facing changes are paired with documentation updates

@github-actions github-actions Bot added bug Something isn't working nono-cli size/medium labels Aug 18, 2026
@github-actions

github-actions Bot commented Aug 18, 2026

Copy link
Copy Markdown
Contributor

PR Review Summary

Size

Metric Value
Lines added +160
Lines removed -18
Total changed 178
Classification Medium (50–300 lines)

Affected crates

  • crates/nono-cli — CLI changes. Verify argument parsing, flag documentation, and UX behaviour across supported platforms.

Blast radius — Contained

This PR touches: source code


Updated automatically on each push to this PR.

@nogent-nolabs-ai nogent-nolabs-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nogent code review

1 design concern regarding incomplete profile migration remediation guidance.

Findings (not tied to a changed line):

  • 🔒 [HIGH · security] crates/nono-cli/src/package_status.rs:105 — The yanked-pack and security advisory enforcement in enforce_official_pack_status looks up the locked package exclusively using its current canonical key (nolabs-ai/claude). If a legacy pack is registered in the lockfile under a retired namespace (such as always-further/claude), lockfile.packages.get(&key) returns None. This silently bypasses the official pack status check, allowing potentially yanked or vulnerable legacy versions of the pack to be loaded and run without any security enforcement. Fix this by checking all possible namespaces/keys for the target using target.keys().find_map(|k| lockfile.packages.get(&k)).
  • 🐛 [LOW · bug] crates/nono-cli/src/profile/mod.rs:3020 — The remediation hint Use 'nono pull {}' to install it instead. uses the raw, uncanonicalized pack reference. If a legacy/retired namespace is used, this will guide the user to pull from the stale/unresolvable namespace. Wrap the reference in canonicalize_legacy_pack_ref to ensure the correct canonical namespace is suggested.
  • 🐛 [LOW · bug] crates/nono-cli/src/output.rs:1309 — The command recommendation nono pull {pack_ref} uses the raw pack_ref which may be a retired legacy namespace. For parity with the other CLI remediation messages, pass the reference through canonicalize_legacy_pack_ref before formatting the output.

Automated code + security review. CI already covers clippy, rustfmt, tests, cargo-audit and commit-lint.

Comment thread crates/nono-cli/src/profile_runtime.rs
SequeI added 2 commits August 18, 2026 16:00
A profile can still reference an official pack by a namespace it was
published under before a registry rename (e.g. `always-further/claude`,
now `nolabs-ai/claude`). Every `nono pull ...`/`nono remove ...`
remediation message in verify_profile_packs echoed the stale namespace
straight back instead of the one that still resolves, across six
separate error paths (not-installed, missing lockfile entry, missing
artifact, tampered artifact, missing trust bundle, signer mismatch).

separate error paths (not-installed, missing lockfile entry, missing
artifact, tampered artifact, missing trust bundle, signer mismatch).

Add package_status::canonicalize_legacy_pack_ref(), reusing the
existing legacy_namespaces table, and route every remediation message
through it. Also add a proactive warning when a legacy-namespace pack
is loaded at all, even when its otherwise healthy, so users learn to
migrate before something breaks rather than only after.

No automatic migration is performed and the users own profile is
never modified — this only fixes what nono tells them to run.

Signed-off-by: Aleksy Siek <aleksy@nolabs.ai>
- enforce_official_pack_status only looked up the lockfile entry under
  the canonical key, so a pack still locked under a retired namespace
  (e.g. always-further/claude) silently skipped the yanked/advisory
  check entirely. Look up all known keys (current + legacy) instead.
- load_registry_profile's "no profile artifact" hint and
  print_profile_hint's install suggestion both echoed the raw,
  possibly-retired pack ref instead of canonicalizing it, unlike the
  other remediation paths this PR fixes.
- the legacy-namespace warning in verify_profile_packs only told users
  to reinstall, not to also update the retired ref in their profile's
  extends/packs entries, so the warning would recur indefinitely.

Signed-off-by: Aleksy Siek <aleksy@nolabs.ai>

@connrg connrg left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working nono-cli size/medium

Projects

None yet

Development

Successfully merging this pull request may close these issues.

NONO error message suggests using old namespace for profile update

2 participants