Repository navigation
fix(cli): update and approve print policy-block refusals as [x] errors - #4427
Merged
Daniel Meppiel (danielmeppiel) merged 7 commits intoNov 21, 2026
Merged
Conversation
…4259) #4259 routes approve and the deployed MCP consent check through the shared policy owner: approve now fails closed under fetch_failure_default=block, and audit --ci reports the routed reason (outcome=<class>) through its hook-approval and drift checks. Update the approve and mcp-admission rows to that behavior. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
apm update and apm approve printed an org-policy block ("Install blocked:
...", "Blocked by org policy: ...") as a bare red line without the [x]
error symbol every other refusal carries. Both now use the error symbol.
Five policy-outcome rows whose strict marks absorbed this unannounced
failure pass and lose their marks.
Fixes #4403
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 17:05
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
No active review issues remain for the change standardizing organization-policy refusal markers.
No open issues 🎉
What changed in this PR
This PR fixes #4403 by making org-policy refusals from apm update and apm approve use the standard [x] error marker, preserving existing wording and exit behavior.
Changes:
- Adds the error marker to both policy-block reporting paths, retaining stderr output for
update. - Updates lifecycle expectations for shared policy routing and removes five expected-failure marks.
- Documents the user-visible fix in the changelog.
| File | Description |
|---|---|
tests/lifecycle/security/test_policy_outcomes.py |
Updates policy-block assertions and removes resolved expected-failure marks. |
src/apm_cli/commands/update.py |
Adds [x] to policy violations without changing other handled errors. |
src/apm_cli/commands/approve.py |
Adds [x] through the shared policy-block reporting helper. |
CHANGELOG.md |
Records the refusal-output fix under Unreleased. |
Review effort: Balanced
The routed block reason named only the outcome class, so update, approve, install and the audit --ci replay lost why no org policy resolved (No org policy found, Invalid policy, HTTP 503, ...). The cause wording moves from commands/audit.py to the routing owner, policy/outcome_routing.py, and the block reason appends it. audit keeps its cause line through the same owner. The mcp-admission rows assert each cause alongside the routed line. Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: copilot-swe-agent[bot] <[email protected]>
5 of 10 tasks
Daniel Meppiel (danielmeppiel)
deleted the
danielmeppiel-policy-outcome-wording
branch
November 21, 2026 05:24
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.
Description
apm updateandapm approveprinted an org-policy block as a bare red line, without the[x]error symbol every other refusal carries:Both now print through the error helper with
symbol="error", so the line starts with[x](seeSTATUS_SYMBOLSinutils/console.py).src/apm_cli/commands/update.pyPolicyViolationErroris printed with the[x]symbol on stderr.DirectDependencyErrorandRequiredIntegrationErroroutput is unchanged.src/apm_cli/commands/approve.py_report_policy_block(shared withapm policy explain) prints the block with[x].src/apm_cli/policy/outcome_routing.py,src/apm_cli/commands/audit.pyoutcome_cause). Everyfetch_failure_default=blockreason appends it, so install, update, approve and theaudit --cireplay say why no policy resolved, not just the outcome class.audit._audit_outcome_causedelegates to the owner.tests/lifecycle/security/test_policy_outcomes.pyFailing before, passing after, on main with this branch's tests:
P|update-regate-shortcircuit|{absent,no_git_remote,empty,cache_miss_fetch_fail,garbage_response}/block,incomplete_chain,cached_stale/org-block, andP|approve|cache=stale<7d.No owner id touched.
tests/lifecycle/oracles.pyis unchanged.Issue and approved scope
Fixes #4403
Human scope-approval comment: posted on #4403 by the PM.
Does this PR complete the issue? Yes.
Type of change
Testing
Verification (own venv, after merging main):
pytest tests/lifecycle/security/test_policy_outcomes.py(APM_E2E_TESTS=1): 190 passed, 36 xfailed. On main: 17 failed.python -m tests.lifecycle.generator --check: up to date.tests/lifecycle/securityrun shows only failures that also fail on main without this change: stale strict cells whose issues (apm approve cannot find a native Claude or Codex plugin parked by the executables gate at user scope #4154, apm deny with a marketplace install spec does not match the installed package #4189) are already fixed, and the 3 rows fix(install): policy-blocked install names a runnable next step #4418 fixes.Changelog
## [Unreleased]inCHANGELOG.mdSpec conformance (OpenAPM v0.1)
Co-authored-by: Copilot [email protected]