Skip to content

Fix minimal MCP verification and isolate inspection metadata - #85

Draft
DebarghaG wants to merge 1 commit into
devfrom
fix/dev-validation
Draft

DebarghaG wants to merge 1 commit into
devfrom
fix/dev-validation

Conversation

@DebarghaG

Copy link
Copy Markdown
Owner

Findings

The documented .[test,mcp] install cannot collect the HTTP MCP tests because they import httpx. The pinned MCP SDK supplies httpx2, which runs the same ASGI assertions.

inspect_policy copies the inspection tree but shares the manifest's pack property list. Editing an inspection result can therefore change the property names that another consumer reads from the same engine. This change copies that list and extends the manifest-isolation regression.

Validation

  • The full local verification gate passed with 581 tests, the Lean axiom audit, and 21 conformance cases.
  • The minimal install passed 28 targeted checks including a loopback call through the MCP CLI, rejected credentials and origins, concurrent use of one approval, and replay after an uncertain backend outcome.
  • The downstream verified pack still reports its named property after an inspection consumer edits its copy.

@amazon-q-developer

Copy link
Copy Markdown

Warning

Amazon Q Developer for GitHub: end of support

On January 30, 2027, AWS will discontinue support for the Amazon Q Developer for GitHub App. New app installations will no longer be available starting November 18, 2026.

For capabilities similar to the Amazon Q Developer for GitHub App, explore Kiro and the Kiro GitHub App. For more information about the end of support, see Amazon Q Developer end-of-support announcement on the AWS DevOps Blog.

@amazon-q-developer amazon-q-developer Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Review Summary

This PR addresses two distinct issues: (1) a shared-reference mutation bug in inspect_policy where the "pack" property list was not deep-copied, and (2) switching the MCP HTTP test transport from httpx to httpx2 to match the pinned SDK dependency.

The core fixes are correct. The deepcopy in inspection.py properly isolates the returned "pack" list from the engine manifest, and the new test assertion in test_inspection.py correctly validates that isolation.

One blocking issue found:

test_http_requires_auth_and_dispatches_only_through_host in tests/test_mcp_http.py is declared async def but is missing a @pytest.mark.asyncio decorator (or equivalent, e.g., via asyncio_mode = "auto" in pytest config). Without it, pytest silently skips the entire coroutine body — every assertion passes vacuously, meaning the new auth/dispatch tests are not actually exercised. Please verify that either the decorator is present or the project's pytest configuration applies automatic asyncio mode globally, and add @pytest.mark.asyncio if neither applies.


You can now have the agent implement changes and create commits directly on your pull request's source branch. Simply comment with /q followed by your request in natural language to ask the agent to make changes.

Comment thread tests/test_mcp_http.py
transport=httpx2.ASGITransport(app), base_url="http://localhost:8000"
) as client,
):
assert (await client.post("/mcp", json=payload, headers=headers)).status_code == 401

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🛑 Logic Error: test_http_requires_auth_and_dispatches_only_through_host is an async def function but has no @pytest.mark.asyncio decorator (or equivalent async runner marker). Without it, pytest collects the coroutine object but never awaits it — the entire test body is silently skipped and all assertions pass vacuously. This means the auth and dispatch checks added in this PR are never actually executed. Add @pytest.mark.asyncio above the function definition.

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