Skip to content

test(policy): pin the -g explain hint for user-scope bin, hook and canvas denies - #4498

Merged
Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-h-4296-scope-hint-assert
Nov 21, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 2 commits into
mainfrom
danielmeppiel-h-4296-scope-hint-assert

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

Pins the single contract for user-scope deny hints. For a -g deny of a native bin plugin, a hook, or a canvas extension, the output names apm policy explain -g <package> and never the project-only apm policy explain <package>. The hook and canvas cells reuse #4297's fixtures, with the assertions inverted to match this contract. Run from the user scope, the project-only form fails, so this negative assert pins the behaviour #4275 delivered.

Issue and approved scope

Issue: Refs #4296

Human scope-approval comment: the maintainer-run 0.37 PM decided this disposition (option b: pin it with a negative assert, close #4296 as fixed by #4275, and close #4297 as superseded).

Does this PR complete the issue, or what remains? The behaviour shipped in #4275. This PR adds only the regression pin, and #4296 is closed by hand.

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Evidence: tests/integration/test_bin_canvas_deny_diagnostics_lifecycle.py -k "global_explain or user_scope_names" passed (3 passed: native bin plugin, canvas, hooks) against the main source tree. ruff check and ruff format --check (0.15.12) are clean.

Changelog

  • One line in one section under ## [Unreleased] in CHANGELOG.md.
  • N/A -- internal-only change (CI, tests, refactor).

Spec conformance (OpenAPM v0.1)

  • N/A -- this PR does not change OpenAPM-observable behaviour.

Copilot AI 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.

🟢 Approval recommended

No active review issues are reported for the user-scope deny diagnostic regression check.

No open issues 🎉

What changed in this PR

Adds a regression check for the user-scope deny diagnostics delivered in #4275, supporting the resolution of #4296 without changing CLI behavior.

Changes:

  • Assert that user-scope deny output omits the project-only apm policy explain <package> hint, complementing the existing assertion that the -g form is present.
File Description
tests/​integration/​test_bin_canvas_deny_diagnostics_lifecycle.py Adds the negative hint assertion and a comment explaining why it is required.

Review effort: Balanced

@danielmeppiel Daniel Meppiel (danielmeppiel) changed the title test(policy): pin that a user-scope deny never shows the project-only explain hint test(policy): pin the -g explain hint for user-scope bin, hook and canvas denies Nov 20, 2026
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 9f45bfe into main Nov 21, 2026
43 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the danielmeppiel-h-4296-scope-hint-assert branch November 21, 2026 05:24
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.

policy explain: user-scope mode and scope-aware deny hints

2 participants