Skip to content

fix(policy): clarify 'not found' message for stub show command (#162) - #244

Open
nikhilpatidar wants to merge 2 commits into
NuGuardAI:mainfrom
nikhilpatidar:bug/policy-show-stub
Open

fix(policy): clarify 'not found' message for stub show command (#162)#244
nikhilpatidar wants to merge 2 commits into
NuGuardAI:mainfrom
nikhilpatidar:bug/policy-show-stub

Conversation

@nikhilpatidar

@nikhilpatidar nikhilpatidar commented Aug 10, 2026

Copy link
Copy Markdown

PR Type

  • Bug fix
  • Feature

Fixes #162.

The nuguard policy show command is a stub that prints Policy '<name>' not found for any input. The misleading part is that the message implies the policy exists but isn't currently loaded — when in reality show is not implemented at all. This PR clarifies the message so users know that the command is a stub and points them at nuguard policy validate as the working alternative.

Changes

  • nuguard/cli/commands/policy.py — improve the 'not found' stub message; mark show as hidden in --help so it's not surfaced as a feature

Tests

  • tests/cli/test_policy_cli.py — extended regression tests for the new message and the hidden flag

Closes #162

…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 KanishkThamman left a comment

Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

Small, self-contained, exit code untouched, well tested. LGTM.

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

nuguard policy show always reports 'not found'

2 participants