Skip to content

fix(install): delete the emptied .github/mcp.json APM created on the 0.36 move (#4524) - #4527

Merged
Daniel Meppiel (danielmeppiel) merged 4 commits into
train/0.37-final-2from
fix/4524-empty-legacy-mcp
Nov 20, 2026
Merged

Daniel Meppiel (danielmeppiel) merged 4 commits into
train/0.37-final-2from
fix/4524-empty-legacy-mcp

Conversation

@danielmeppiel

@danielmeppiel Daniel Meppiel (danielmeppiel) commented Nov 20, 2026 •

Copy link
Copy Markdown
Collaborator

Description

After upgrading from 0.36.1, the Copilot MCP move to the root .mcp.json left .github/mcp.json behind as an empty {"mcpServers": {}}, even when APM had created it.

The fix is in the retired-destination owner (install/mcp/retired_destinations.py, heal_retired_project_mcp_destinations):

  • The file is deleted, and the move summary says Removed empty .github/mcp.json (APM created it and no longer writes it), when APM provably created it. That means every server it held was APM's and this heal removed it, or it holds none while the pre-0.37 lock claims names there.
  • The file is kept, with only APM's entries removed, when it holds any other entry (user content is never deleted).
  • It is also kept when copilot would lose its only detection signal (.github/mcp.json is in SIGNAL_WHITELIST). In that case apm.yml does not declare copilot and no other copilot signal remains.
  • It is kept under --frozen. A frozen install cannot restamp the lock, so the file is the only proof of the move (split_mcp_claims). The next install deletes it.

Two lifecycle assertions that pinned the old "never delete" decision (#3866) now expect deletion for projects that declare copilot.

Issue and approved scope

Issue: Fixes #4524

Human scope-approval comment: #4524 (comment)

Does this PR complete the issue, or what remains? It completes the issue. Rebased onto train-2 b51f2bb, which already holds #4522; the branch carries only the #4524 delta (4 commits: C6 extension, fix, C7 by the C lead, --frozen pins).

Type of change

  • Bug fix
  • New feature
  • Documentation
  • Maintenance / refactor

Testing

  • Tested locally
  • All existing tests pass
  • Added tests for new functionality (if applicable)

Validation evidence (targeted runs only, via the host guard):

  • pytest -p no:xdist tests/integration/test_legacy_lock_upgrade_lifecycle.py::test_c6_036_copilot_kiro_mcp_project_converges_to_the_037_layout
    • Before the fix: failed with Extra items in the left set: '.github/mcp.json'.
    • After the fix: passed. C6 uses the real released 0.36.1 fixture.
  • pytest -p no:xdist tests/integration/test_legacy_lock_upgrade_lifecycle.py::test_c7_036_user_created_copilot_mcp_file_keeps_user_server_on_upgrade: passed. It is a guard that a user file is kept, so it passes with or without the fix.
  • pytest -p no:xdist tests/integration/test_copilot_root_mcp_json_lifecycle.py tests/unit/install/test_copilot_project_mcp_destination.py plus C6: 65 passed. An earlier version of the fix deleted under --frozen, and the four frozen-upgrade cells caught it; they pass now.
  • pytest -p no:xdist tests/quality/test_lifecycle_bug_ledger.py: 2 passed.
  • uvx [email protected] check and format --check on the touched files: clean.

Spec conformance (OpenAPM v0.1)

  • Spec edit: docs/src/content/docs/specs/openapm-v0.1.md updated
    (new/changed <a id="req-XXX"></a> anchor + prose + Appendix C
    row).
  • Manifest edit: docs/src/content/docs/specs/manifests/openapm-v0.1.requirements.yml
    updated.
  • Test edit: a @pytest.mark.req("req-XXX") test under
    tests/spec_conformance/ added or extended.
  • CONFORMANCE.{md,json} regenerated via
    uv run --extra dev python -m tests.spec_conformance.gen_statement
    and committed.
  • N/A -- this PR does not change OpenAPM-observable behaviour.

Follow-up pins (steward): test_frozen_upgrade_keeps_the_root_entry_apm_wrote[copilot] now checks:

  • after install --frozen, .github/mcp.json is exactly {"mcpServers": {}} and audit --ci exits 0;
  • the next plain install deletes it and prints the summary line, and audit --ci and install --frozen stay clean;
  • a repeat install prints no Removed line.
    The frozen test, C6, C7, the two updated lifecycle cells and the ledger quality test all pass on the rebased head (2 + 2 + 6 passed).

…0.36 move

When the Copilot MCP move empties .github/mcp.json and every server it held
was APM's (or a frozen heal already emptied a file the pre-0.37 lock claims),
the heal deletes it and names it in the move summary. It stays when it holds
any other entry, when copilot would lose its only detection signal (apm.yml
does not declare copilot and no other copilot signal remains), and under
--frozen, whose unrestamped lock still needs the file as proof of the move;
the next install deletes it. Updates the two lifecycle cells that pinned the
old keep, adds the ledger row and a CHANGELOG line.

Fixes #4524

apm-spec-waiver: retired Copilot MCP destination cleanup only; no OpenAPM contract change

Co-authored-by: Copilot App <[email protected]>
…on the 0.36.1 upgrade (#4524)

C7 seeds the released 0.36.1 Copilot + Kiro fixture's .github/mcp.json in the
user's own style with a user server 'mine' beside APM's 'notes'. After the
0.37 install the file is kept and its parsed content is the user's file minus
APM's entry; 'mine' is unchanged and does not move to .mcp.json; the lock
matches disk; audit --ci and install --frozen are clean; a repeat install
changes no bytes.

Co-authored-by: Copilot App <[email protected]>
…b/mcp.json move (#4524)

After --frozen the emptied file stays as {"mcpServers": {}} and audit --ci
passes; the next plain install deletes it with the summary line, audit and
--frozen stay clean, and a repeat install prints no Removed line.

Co-authored-by: Copilot App <[email protected]>
@danielmeppiel
Daniel Meppiel (danielmeppiel) merged commit 5e2f234 into train/0.37-final-2 Nov 20, 2026
4 checks passed
@danielmeppiel
Daniel Meppiel (danielmeppiel) deleted the fix/4524-empty-legacy-mcp branch November 20, 2026 22:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant