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
When the locked install fast path (install/fast_entry.py, then install/diff_apply.try_apply) evaluates a plain apm install on a project with a dependency-declared MCP server, a legacy $APM_HOME/approvals.yml gets migrated into config.json and deleted. This happens even under APM_INSTALL_FAST_PATH=decide, the test seam that should only report the decision and write nothing.
The fast path's decision is speculative. It runs before its apply journal, and a later decline cannot roll this write back. The migration of personal consent should belong to the full install. Readers that are only previewing pass migrate_user_legacy=False to McpAdmission.for_project.
#5423 already applies this rule to the frozen preflight (InstallRequest.frozen_preflight(speculative=True)). The plain fast path still migrates through another McpAdmission route; it is not yet identified, but candidates are the policy and MCP admission checks the fast path runs before its render.
To Reproduce
- In a project with a dependency-declared MCP server (e.g. the
tree-10perf fixture), runapm install. - Write a legacy
$APM_HOME/approvals.yml(e.g.perf-org/pkg-000: {hooks: true}) and remove$APM_HOME/config.json. - Run
APM_INSTALL_FAST_PATH=decide apm install. approvals.ymlis gone, andconfig.jsonnow holds the grants.
Expected behavior
A speculative fast-path decision reads legacy consent and never migrates it. Under decide nothing is written. The full install keeps migrating as today.
Environment (please complete the following information):
- OS: macOS (local); likely all
- Python Version: 3.12
- APM Version: perf(install): a converged install attests its state, so the next unchanged install skips the proof #5383 head ddd81de (main 1e4a208 plus the attested record)
- VSCode Version (if relevant): n/a
Logs
Found while folding a Copilot review thread on #5423, then confirmed with a local script that runs the steps above for both install and install --frozen under decide. In both cases approvals.yml was removed before #5423's fix; after it, only the frozen preflight route is fixed.
Additional context
W3d (security) rates this low: it is the same user's consent, and the migration is idempotent. Their ruling is to apply the same speculative rule here. The fix is to thread migrate_user_legacy=False (a preview request) through every McpAdmission the fast path builds before it commits, and to add a cell that runs decide with a legacy file and asserts approvals.yml and config.json are byte-identical.
Metadata
Metadata
Assignees
Labels
Type
Projects
- StatusShow more project fieldsDone
Activity
danielmeppiel commentedon Nov 25, 2026
Decision: approve
Area: project
Scope: Make every McpAdmission that the locked install fast path builds before it commits (src/apm_cli/install/fast_entry.py and src/apm_cli/install/diff_apply.py try_apply) a preview request, passing migrate_user_legacy=False, so a speculative fast-path decision reads a legacy $APM_HOME/approvals.yml without migrating or deleting it. This matches the rule already applied to the frozen preflight. The full install keeps migrating legacy consent as it does today.
Done when: A red-first cell runs
APM_INSTALL_FAST_PATH=decide apm install(and the --frozen variant) on a project with a dependency-declared MCP server, a legacy approvals.yml and no config.json, and asserts both files are byte-identical afterwards; a fullapm installstill migrates the legacy file; the existing install and approvals cells stay green.Out of scope: Changing the migration itself, the approvals.yml or config.json formats, consent semantics, the full-install write path, and the fast-path decision rules.
Review contact: Daniel Meppiel (@danielmeppiel)
Merge pull request #5429 from microsoft/danielmeppiel-fast-path-consent
test(install): the fast path never migrates a legacy approvals.yml (m…
fix(install): the fast path reads legacy consent and never migrates it (