Repository navigation
fix(install): route the local-bundle approval hint through the remediation catalog - #4506
Merged
Merged
Conversation
…ation catalog
The parked local-bundle executable hint keeps the exact key snippet and
renders its next step from the catalog entry local-bundle-executables-unapproved:
add the key under executables.allow, then run 'apm install <bundle-path>'
('-g' at user scope). An installed-CLI test runs the printed remedy.
Co-authored-by: Copilot App <[email protected]>
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 20, 2026 20:39
Co-authored-by: Copilot App <[email protected]>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The change alters user-visible wording outside the approved refactor scope, and the lifecycle test corrupts valid bundle paths when constructing the install command.
2 open issues
What changed in this PR
This PR centralizes the approval next step for parked local-bundle executables in APM's remediation catalog, addressing #4436 while retaining the exact approval-key snippet.
Changes:
- Adds a catalog entry and uses it for project- and user-scope approval hints.
- Adds a lifecycle proof that applies the printed approval and reinstalls the bundle.
- Records the regression coverage and user-visible change.
| File | Description |
|---|---|
tests/unit/core/test_remediation_w4_drift_trust_catalog.py |
Delegates the new entry's execution proof to the lifecycle test. |
tests/integration/test_remediation_advice_lifecycle.py |
Tests the catalog hint, approval, reinstall, and audit. |
tests/fixtures/lifecycle_bug_ledger.json |
Links #4436 to its regression test. |
src/apm_cli/security/executables.py |
Renders approval advice through the catalog with scope-specific commands. |
src/apm_cli/core/remediation.py |
Defines the local-bundle approval remediation entry. |
CHANGELOG.md |
Documents the updated approval advice. |
Review effort: Balanced
| f' "{approval_key}":\n' | ||
| f" {exec_type}: true\n" | ||
| "Then rerun the install." | ||
| f" {exec_type}: true\n" + remedy.bind(exec_type=exec_type, manifest=target).sentence() |
| manifest = load_yaml(consumer / "apm.yml") | ||
| manifest["executables"] = {"allow": {key: {"hooks": True}}} | ||
| dump_yaml(manifest, consumer / "apm.yml") | ||
| command = shlex.split(remedy.command.replace("<bundle-path>", str(bundle))) |
…apm approve command
One remedy, one message: a parked local-bundle executable prints the
catalog entry local-bundle-executables-unapproved, 'apm approve <key>'
('-g' at user scope), then the reinstall, with the executables.allow entry
as the same grant. The executed-remedy test runs the printed approve
command and reinstalls; it needs apm approve for content-bound keys (#4490).
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
Co-authored-by: Copilot App <[email protected]>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 20, 2026
…tests follow #4506's catalog hint (L1) Co-authored-by: Copilot App <[email protected]>
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
One remedy, one message (steward condition). A parked local-bundle executable (hooks, MCP, LSP) now prints the remediation catalog's
apm approvecommand, the same commandapm approve --pendingprints (#4490). The manifest entry follows as the equivalent grant:core/remediation.py: new entrylocal-bundle-executables-unapproved(W4 drift-trust block): commandapm approve {key}, promise "approve this exact local bundle's {exec_type}", then "rerun '{install}'". At user scope the command isapm approve -g '<key>'(security.trust.approve_command) and the reinstall isapm install -g <bundle-path>.security/executables.pylocal_bundle_approval_hintrenders from that entry.test_local_bundle_approval_hint_is_the_catalog_remedy_and_runs: parks a bundle hook, asserts the exact catalog text, RUNS the printedapm approve '<key>', reinstalls, then asserts the hook is registered, the lock matches disk (I1) andaudit --cipasses.Fold order: #4490 -> #4506.
apm approve <key>for content-bound bundle keys exists only once #4490 (#4437) is in. Standalone CI of this PR on main is therefore expected to be red on that test node; train CI is the gate.Fold patch (integrator: apply when folding this PR, after #4490, on top of #4283)
#4283's
test_bundle_hooks_park_then_register_like_a_source_install(#4216) still asserts the old wording. This patch pins the NEW exact catalog wording and runs the printedapm approvecommand (no alternation).git apply --checkis clean on #4490 @ e20abf8 and on train/0.37-final-2 @ b7bd508:Issue and approved scope
Issue: Fixes #4436 (scope record: #4436 (comment))
Human scope-approval comment: #4436 (comment)
Does this PR complete the issue, or what remains? It completes #4436.
Type of change
Testing
Run through the host test guard:
pytest tests/unit/core/test_remediation_block_proofs.py tests/unit/core/test_remediation_w4_drift_trust_catalog.py tests/unit/core/test_remediation_catalog_commands.py tests/integration/test_remediation_advice_lifecycle.py::test_local_bundle_approval_hint_is_the_catalog_remedy_and_runs-> 470 passed.pytest tests/quality/test_lifecycle_bug_ledger.py-> 2 passed.Changelog
## [Unreleased]inCHANGELOG.md:user-visible effect first, 25 words or fewer, ending with
(#PR);breaking changes only under upgrade notes; no Highlights; see
.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)