Repository navigation
fix(install): deploy an approved package that declares both hooks and LSP servers - #4680
Merged
Daniel Meppiel (danielmeppiel) merged 3 commits intoNov 21, 2026
Merged
Conversation
…eclaring package After `apm approve` pinned a package that declares both a hook and an LSP server, the next `apm install` failed with "'types.SimpleNamespace' object has no attribute 'install_path'". The trusted-LSP graph check (install/lsp/integration.py) asked check_executable_approval about the package with a stand-in carrying only its dependency_ref; pinned-hook admission (security/trust.py hooks_package_admissible) reads the package's hook files from install_path. The stand-in now carries the install path, so the approved hook and LSP server deploy. Approval decisions are unchanged. Regression: tests/lifecycle/security/test_gate_removal.py:: test_approved_package_with_hook_and_lsp_installs_both (fails before: exit 1 with the AttributeError; after: exit 0, hook and LSP deployed, lock row records the hook, repeat install is a byte no-op). Ledger row 4658. Fixes #4658 Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
requested a review
from Sergio Sisternes (sergio-sisternes-epam)
as a code owner
November 21, 2026 19:27
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
The new changelog bullet is rejected by check-unreleased because it requires a per-PR fragment and shortening to meet the 25-word limit.
1 open issue
What changed in this PR
Fixes #4658 by supplying the package install path to the existing approval check, preventing installation crashes for approved packages that declare both hooks and LSP servers.
Changes:
- Passes
install_pathalongside the dependency identity without changing approval decisions. - Adds lifecycle coverage for approval, deployment, lockfile tracking, and repeat-install stability.
- Records the regression in the bug ledger and documents the fix in the changelog.
| File | Description |
|---|---|
tests/lifecycle/security/test_gate_removal.py |
Adds a real-CLI regression test for combined hook and LSP deployment. |
tests/fixtures/lifecycle_bug_ledger/bugs/4658.json |
Links the reported failure to its regression test. |
src/apm_cli/install/lsp/integration.py |
Supplies the install path required by pinned-hook admission. |
CHANGELOG.md |
Adds a user-facing entry describing the installation fix. |
Review effort: Balanced
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
deleted the
ql-w1-4658-hooks-lsp-approve
branch
November 21, 2026 20:50
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Nov 21, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This was referenced Nov 21, 2026
Merged
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 installnow deploys an approved package that declares both hooks and LSP servers. Before this fix it failed before writing anything:Root cause:
_graph_declares_trusted_lspinsrc/apm_cli/install/lsp/integration.pyaskedcheck_executable_approvalabout each LSP-declaring package, passing a stand-in that carried onlydependency_ref. Once a hook pin exists (afterapm approve), pinned-hook admission (hooks_package_admissibleinsecurity/trust.py) reads the package's hook files frompackage_info.install_path. That attribute was missing, so the install crashed.The fix adds the package's install path (already computed for the manifest read) to the stand-in. The approval owner is unchanged and makes the same decisions.
Regression trap:
tests/lifecycle/security/test_gate_removal.py::test_approved_package_with_hook_and_lsp_installs_both, on the real CLI driver in the hermetic lifecycle world.lsp_dependenciesentry.apm install <path>: the unapproved hook and LSP server park.apm approve <path>, thenapm install. It must exit 0 with no traceback or AttributeError, deploy.github/hooks/<pkg>-session.jsonand the LSP server in.github/lsp.json, and record the hook in the package's lock row.apm installmust leave the hook,lsp.jsonand the lockfile byte-identical.Bug-ledger row:
tests/fixtures/lifecycle_bug_ledger/bugs/4658.json.Issue and approved scope
Issue: Fixes #4658
Human scope-approval comment: the
apm-scope:v1approve record on #4658 (review contact Daniel Meppiel (@danielmeppiel)).Does this PR complete the issue, or what remains? It completes it.
changelog.d/4680.fixed.mdis added.Type of change
Testing
All local runs go through the host guard, on a worktree with its own venv:
APM_E2E_TESTS=1):pytest tests/lifecycle/security/test_gate_removal.py::test_approved_package_with_hook_and_lsp_installs_bothgives 1 failed:apm installexit 1, "'types.SimpleNamespace' object has no attribute 'install_path'".pytest tests/unit/install/test_lsp_integration.py tests/unit/install/test_frozen_service_boundary.py tests/unit/install/phases/test_integrate_held_headers.py tests/unit/commands/test_uninstall_atomic_selection.py tests/unit/commands/test_update_command.py: 142 passed.pytest tests/quality/test_lifecycle_bug_ledger.py: 2 passed.uvx ruff@0.15.12 checkandformat --check, pylint R0801,lint-auth-signals.sh,check_complexity_ratchet.py --base-ref origin/main, the assertion-quality ratchet, andpython -m tests.quality.taxonomy --changed: all pass.python -m tests.lifecycle.generator --checkandpython -m tests.lifecycle.witnessesare up to date.Changelog
## [Unreleased]inCHANGELOG.md(as the fragmentchangelog.d/4680.fixed.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)
docs/src/content/docs/specs/openapm-v0.1.mdupdated(new/changed
<a id="req-XXX"></a>anchor + prose + Appendix Crow).
docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.ymlupdated.
@pytest.mark.req("req-XXX")test undertests/spec_conformance/added or extended.CONFORMANCE.{md,json}regenerated viauv run --extra dev python -m tests.spec_conformance.gen_statementand committed.