Repository navigation
mcp: one header shape for registry servers; --frozen skips servers install refused - #5814
Open
Daniel Meppiel (danielmeppiel) wants to merge 6 commits into
Open
Daniel Meppiel (danielmeppiel) wants to merge 6 commits into
Daniel Meppiel (danielmeppiel) wants to merge 6 commits into
Conversation
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Dec 2, 2026
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Active issues allow frozen mode to write an unclaimed server through false refusal exemptions and cause header overrides to retain stale values or incorrectly skip servers.
2 open issues
What changed in this PR
Extends #5773’s MCP dependency-value safeguards to mapping-form headers and registry overlays during frozen installs.
Changes:
- Normalizes remote headers and checks both supported shapes for refused values.
- Extends frozen-install refusal handling to registry dependency overlays.
- Adds regression coverage and updates existing header assertions.
| File | Description |
|---|---|
tests/unit/test_mcp_integrator_overlay.py |
Updates canonical header expectations. |
tests/unit/test_mcp_env_reference_headers.py |
Covers header shapes, rendering, and refusals. |
tests/unit/test_github_mcp_auth_policy.py |
Adapts value-type checks to normalized headers. |
tests/unit/test_github_mcp_auth_policy_logic.py |
Checks normalized overlay values and provenance. |
tests/integration/test_mcp_integrator_install_flow.py |
Updates merged-header expectations. |
tests/integration/test_mcp_dependency_overlay_refusal_lifecycle.py |
Adds install and frozen-replay regression cases. |
tests/fixtures/lifecycle_bug_ledger/bugs/5773.json |
Links the new regression cases. |
src/apm_cli/mcp_env_reference.py |
Handles mapping headers and registry-overlay refusals. |
src/apm_cli/integration/mcp_integrator.py |
Normalizes headers before overlay merging. |
src/apm_cli/integration/mcp_integrator_install.py |
Normalizes fetched header snapshots. |
changelog.d/5814.fixed.md |
Documents header and frozen-install changes. |
Review effort: Balanced
6 of 10 tasks
Registry remote headers are stored in the list form at the overlay step, so every writer and the env-reference owner read one shape; the owner also reads both forms directly. --frozen now counts a registry server whose dependency overlay the install refused, matching the install. apm-spec-waiver: MCP owner hardening covered by the #5773 scope record; no OpenAPM requirement changes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
…of the same name An overlay header now replaces a registry header with the same name (case-insensitive) instead of sitting beside it, so the refusal owner and every writer see the overriding value. An empty override keeps the published header, as before. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
A registry dependency's header overlay applies only to a remote, so its refusal is excused from --frozen claims when the declared transport is remote, never for stdio, and is deferred to the payload check when no transport is declared. An env overlay still decides alone. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
The overlay pairs that need the fetched payload are excused from the claim filter and the unclaimed ones seed the existing --frozen deferral; the owner applies each server's targets selection and native runtimes, as the claim filter does. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
force-pushed
the
mcp-exec-refusal-headers
branch
from
December 3, 2026 00:23
5685334 to
79be231
Compare
A registry server without a dependency overlay reaches the writers only through _overlaid_server_infos; this pins that its mapping-form headers are stored as list entries and render and judge like the list form. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Dec 3, 2026
This was referenced Dec 3, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Dec 3, 2026
Daniel Meppiel (danielmeppiel)
added a commit
that referenced
this pull request
Dec 3, 2026
This branch has not been deployed
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
Hardens the MCP env-reference owner introduced for #5773.
{name, value}entries at the overlay step (MCPIntegrator._canonicalize_remote_headers), so every writer and the owner read one shape. A payload that sends a mapping now renders on Codex, Gemini and Antigravity, which only read the list form._declared_valuesinmcp_env_referencewalks list-form and mapping-form headers.--frozenmatches install.refused_pairsalso covers registry servers. The dependency overlay goes through the same_apply_overlay, without the payload, and a server refused on every target is not reported as a missing lockfile claim. The every-target check is one helper,_dependency_exec_refusal, shared with_exec_refusal.Authored (root
apm.yml) values are unchanged.Note
Under
--frozen, an unrecorded registry server whose header overlay is confirmed against the fetched payload now reports "unrecorded" even if a matching native entry exists (stricter than before).Issue and approved scope
Issue: Refs #5773
Human scope-approval comment: the #5773 apm-scope record v3 (comment 7349125162) covers the dependency-value refusal in the shared owner.
Does this PR complete the issue, or what remains? #5773 was completed by #5777; this PR completes the owner's coverage of header shapes and the
--frozenview.Type of change
Testing
tests/unit/test_mcp_env_reference_headers.py: the dependency refusal in both header forms, one[!]line, and nothing rendered[mapping]failedrefused_pairscovers registry dependency overlays and leaves plain or root values alonefrozenset()tests/integration/test_mcp_dependency_overlay_refusal_lifecycle.py(real binary, local registry): mapping-form headers, install, then--frozen--frozen--frozenrc 1, "ownership is not recorded"_canonicalize_remote_headers(info)call in_overlaid_server_infosremoved,test_a_plain_registry_reference_is_judged_in_one_header_shapefails (assert {'X-Base': 'b', 'X-Key': '!registry'} == [{'name': ...}]; 1 failed, 12 passed). With the call restored, 13 passed. A registry reference with no dependency overlay has nodep_mapentry, so_apply_overlaynever sees it; this call is its only canonicalization.refuses_renderwarning fails both refusal rows.test_mcp_integrator_overlay.py,test_mcp_integrator_install_flow.py,test_github_mcp_auth_policy_logic.py), plus a type check intest_github_mcp_auth_policy.py. Each keeps its promise (the overlay is merged, the existing header is kept, and the authored value and type are retained) and now reads the canonical list form.test_mcp_env_reference_lifecycle.py, the goldens,test_mcp_remote_transport_harness_lifecycle.pyand the bug ledger.Changelog
changelog.d/<pr>.<section>.md, holdingone line: user-visible effect first, 25 words or fewer, ending with
(#PR); breaking changes only under upgrade notes; no Highlights; nonew lines under
## [Unreleased]. Seechangelog.d/README.mdand.github/instructions/changelog.instructions.md.Spec conformance (OpenAPM v0.1)
CONFORMANCE.{md,json}regeneratedAgent assessment
Co-authored-by: Copilot 223556219+Copilot@users.noreply.github.com