fix(policy): clarify 'not found' message for stub show command (#162) - #244
Open
nikhilpatidar wants to merge 2 commits into
Open
fix(policy): clarify 'not found' message for stub show command (#162)#244nikhilpatidar wants to merge 2 commits into
nikhilpatidar wants to merge 2 commits into
Conversation
…rdAI#162) nuguard policy show --policy-id <id> unconditionally reported 'not found' because there was no write path anywhere that persisted a compiled policy for later lookup. Fix per issue NuGuardAI#162's recommended option of updating the message rather than removing the subcommand outright: - Hide 'policy show' from --help output (it's a deprecated stub). - Expand the error message to explain that the policy registry is not implemented yet and point users at 'policy compile' instead. - Add a regression test verifying the command stays hidden from --help and still exits non-zero with a helpful message.
KanishkThamman
approved these changes
Aug 11, 2026
KanishkThamman
left a comment
Collaborator
There was a problem hiding this comment.
Small, self-contained, exit code untouched, well tested. LGTM.
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.
PR Type
Fixes #162.
The
nuguard policy showcommand is a stub that printsPolicy '<name>' not foundfor any input. The misleading part is that the message implies the policy exists but isn't currently loaded — when in realityshowis not implemented at all. This PR clarifies the message so users know that the command is a stub and points them atnuguard policy validateas the working alternative.Changes
nuguard/cli/commands/policy.py— improve the 'not found' stub message; markshowas hidden in--helpso it's not surfaced as a featureTests
tests/cli/test_policy_cli.py— extended regression tests for the new message and the hidden flagCloses #162