Repository navigation
Description
Reporting and investigating a bug need no permission. Before implementing a
substantive fix for inclusion in APM, obtain human scope approval and a review
contact on this issue. Trivial documentation corrections have standing
preapproval. See Contributing.
For vulnerabilities, use SECURITY.md
instead of a public issue. Remove credentials and other sensitive data from logs.
Describe the bug
Suppose a project deployed a local plugin bundle that ships an MCP server, and apm.lock.yaml is then lost (for example, a fresh checkout without it). Reinstalling the same bundle exits 0, but it leaves lock state that both gates reject. apm audit --ci fails config-consistency with p-exec-mcp: in lockfile but not in manifest (declared by bundle:p-exec). apm install --frozen exits 1 with MCP server 'p-exec-mcp' is no longer declared in apm.yml. A successful install should leave a state that --frozen and audit --ci accept. The same bundle flow with the lock in place stays clean.
To Reproduce
apm install ./bundles/p-exec-1.0.0.zip. The bundle ships a hook and a stdio MCP server,p-exec-mcp.- Pin the bundle as the output says (
executables: allow: "p-exec#1.0.0@sha256:<digest>": {hooks: true, mcp: true, bin: true}), thenapm install ./bundles/p-exec-1.0.0.zipagain. This deploys.github/hooks/p-exec-hooks.jsonand thep-exec-mcpentry in.mcp.json. rm apm.lock.yaml.apm install ./bundles/p-exec-1.0.0.zipexits 0. It printsSkipping .github/hooks/p-exec-hooks.json -- local file exists (not managed by APM)andAll servers up to date.apm audit --ciexits 1 (config-consistency).apm install --frozenexits 1.apm install(the printed remediation) makesaudit --ciclean. Running step 4 again breaks it again.
Expected behavior
After step 4, the lock records the bundle's MCP server the same way a first bundle install does, so audit --ci and install --frozen both pass. Otherwise the install should fail, or tell the user what to run.
Environment (please complete the following information):
- OS: macOS (lifecycle test world, engine driver)
- Python Version: 3.12
- APM Version: main (0.38 development)
Logs
=== apm audit --ci -> 1
| [x] | config-consistency | 1 MCP config inconsistenc(ies) -- repeat 'apm install' with the intended selection ('--only apm' for skills-only) to reconcile |
config-consistency details:
- p-exec-mcp: in lockfile but not in manifest (declared by bundle:p-exec)
=== apm install --frozen -> 1
- MCP server 'p-exec-mcp' is no longer declared in apm.yml
[x] --frozen: apm.lock.yaml is out of sync with apm.yml.
Additional context
Strict known cell to flip when this is fixed: tests/lifecycle/scenarios/test_ownership_siblings.py::test_a_local_bundle_never_replaces_the_users_hook[present-provenance-unknown] (law R on the audit --ci / install --frozen pair after the reinstall, tracking this issue). Then regenerate with python -m tests.lifecycle.generator so its pair moves from known-failing to required.
Found by the T-6b ownership scenario suite: cell pair|SRC=local-bundle|DEPLOYED=present-provenance-unknown, law P-INV-I3 / P-LAW-outcome.status_matches_state (a successful install leaves a state the gates accept). Epic #4565.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
danielmeppiel commentedon Nov 21, 2026
Decision: approve
Area: project
Scope: Bug fix, no new surface and no new lockfile fields. Reinstalling a local plugin bundle (
apm install <bundle>) whenapm.lock.yamlis absent records the bundle's MCP servers exactly as a first bundle install does, withbundle:<name>provenance (BUNDLE_MCP_OWNER_PREFIXin src/apm_cli/integration/mcp_config_view.py), soapm audit --ci(config-consistency) andapm install --frozenaccept the result. The fix lives in the local-bundle install path (src/apm_cli/install/local_bundle_handler.py together with the MCP recording in src/apm_cli/install/mcp/integration.py) and reuses the existing first-install recording; no second provenance rule.Done when: The lifecycle case behind tests/lifecycle/scenarios/test_ownership_siblings.py::test_a_local_bundle_never_replaces_the_users_hook[present-provenance-unknown] passes its audit and frozen checks on the real binary: after the lock is removed and the same bundle is reinstalled,
apm audit --ciandapm install --frozenboth exit 0, and a repeat reinstall stays clean. Controls: the same flow with the lock in place stays clean; a first bundle install records the same lock rows as before (byte-identical); the hook file APM no longer has provenance for is still skipped, not taken over. A bug-ledger row and one Fixed line in CHANGELOG.md.Out of scope: Re-adopting or overwriting files whose provenance is unknown (hooks or others; see #4626); bundle format or pack changes; new flags.
Review contact: Daniel Meppiel (@danielmeppiel)
danielmeppiel commentedon Nov 21, 2026
Moved from 0.38.0 to 0.38.1 in the 0.38 release cut (2026-11-21). Scope and acceptance are unchanged.
danielmeppiel commentedon Nov 21, 2026
Moved to 0.38.0: maintainer direction is that found bugs and in-flight accepted work ship in 0.38.
docs(changelog): add the #4634 fix fragment
test(install): owned MCP recording test reads the written lockfile
fix(install): name only a bundle MCP server whose unmanaged entry exists
fix(install): record a local bundle's MCP server only where the insta…
test(lifecycle): retire the #4634 known cells now that #4657 fixed them
train: #4711 refresh (3527e75: #4709 and #4634 cells retired)
test(lifecycle): T-6b ownership scenario suite -- user bytes survive …