-
Notifications
You must be signed in to change notification settings - Fork 155
Bug: MCPIntegrator.update_lockfile uses Path.cwd() at --global scope, writing MCP audit entries to the wrong lockfile #794
Copy link
Copy link
Open
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).area/lockfileLockfile schema, per-file provenance, integrity hashes, drift detection.Lockfile schema, per-file provenance, integrity hashes, drift detection.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/governanceGoverned by policy. apm-policy, audit, enforcement, enterprise rollout.Governed by policy. apm-policy, audit, enforcement, enterprise rollout.type/bugSomething does not work as documented.Something does not work as documented.
Milestone
Metadata
Metadata
Assignees
Labels
area/cliCLI command surface, flags, help text (cross-cutting).CLI command surface, flags, help text (cross-cutting).area/lockfileLockfile schema, per-file provenance, integrity hashes, drift detection.Lockfile schema, per-file provenance, integrity hashes, drift detection.bugDeprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.Deprecated: use type/bug. Kept for issue history; will be removed in milestone 0.10.0.priority/highShips in current or next milestoneShips in current or next milestonestatus/acceptedDirection approved, safe to start work.Direction approved, safe to start work.status/triagedInitial agentic triage complete; pending maintainer ratification (silence = approval).Initial agentic triage complete; pending maintainer ratification (silence = approval).theme/governanceGoverned by policy. apm-policy, audit, enforcement, enterprise rollout.Governed by policy. apm-policy, audit, enforcement, enterprise rollout.type/bugSomething does not work as documented.Something does not work as documented.
Type
Projects
Status
Todo
Summary
MCPIntegrator.update_lockfile()defaultslock_pathtoget_lockfile_path(Path.cwd())when the caller does not pass an explicit path. At--globalscope (apm install -g), the lockfile should be written to~/.apm/apm.lock.yaml, but callers ininstall.pydo not pass the scope-resolved lockfile path toupdate_lockfile. This causes MCP server audit entries to be written to the project-local lockfile instead of the user-scope lockfile.Reproduction
cd /tmp/some-project && apm initapm install -g some-org/some-mcp-package./apm.lock.yaml(project) gets MCP entries instead of~/.apm/apm.lock.yaml.Expected Behavior
At
--globalscope,update_lockfileshould persist MCP server entries in the user-scope lockfile (~/.apm/apm.lock.yaml).Relevant Code
src/apm_cli/integration/mcp_integrator.py,update_lockfile()method (lines ~639-673)src/apm_cli/commands/install.pyorsrc/apm_cli/install/callersContext
Discovered during review of #638 (
apm install --globalMCP scope filtering). The scope-filtering fix in #638 correctly routes MCP installation to global-capable runtimes, but the lockfile path was out of scope for that PR.Labels
bug