test(mcp): exercise real MCPServerAdaptor in contract producer test (core#3080) #3100
Reference in New Issue
Block a user
Delete Branch "core-3080-mcp-plugin-delivery-contract"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Fixes #3080.
Remove the test-local mergeMCPPluginSettings helper that modelled the adaptor. Rebind
TestMCPPluginDeliveryContract_MCPServerAdaptorWritesMcpServersto invoke the realmolecule-ai-workspace-runtimeMCPServerAdaptorso producer drift is caught rather than masked by a test model.Test plan
go test -run TestMCPPluginDeliveryContract ./internal/handlers/passes (3/3)./configs/.claude/settings.json,mcpServers, producerMCPServerAdaptor, consumerclaude_sdk_executor._load_settings_mcp.SOP-Checklist
🤖 Generated with Claude Code
APPROVED on head
221c1f0a.5-axis review: correctness is sound for the requested scope. The prior test-local
mergeMCPPluginSettingsmodel is removed, and the remaining contract test invokes the productionMCPServerAdaptorfrommolecule_runtime.plugins_registry.builtinswith a realInstallContext, plugin root, and configs dir. The assertions are meaningful: they read the produced settings file at the SSOTsettings_path, require the contract key, require it to be an object, and require themolecule-platformMCP server entry.Robustness: if the sibling runtime checkout is present, failures are hard failures; if it is absent and no importable runtime exists, the test skips rather than pretending the model passed. Security/performance/readability: test-only, no secret exposure, bounded subprocess use, simpler than the removed stub.
Note: current status contexts are still pending, so this is code approval only, not a merge-ready signal.
REQUEST_CHANGES on
221c1f0a.Correctness/tests: the PR claims the contract producer test exercises the real MCPServerAdaptor, but CI did not exercise it. CI / Platform (Go) shows the runtime package install failed with 401, then TestMCPPluginDeliveryContract_MCPServerAdaptorWritesMcpServers skipped: "molecule-ai-workspace-runtime not available". The skip is allowed by workspace-server/internal/handlers/mcp_plugin_delivery_contract_test.go:133-136 whenever runtimePath is empty, so the green Platform job is not a meaningful real-adaptor contract gate.
Security/performance/scope/docs: no new security or perf concern in the test body, and the scope is contained, but the coverage objective is unmet. Please make the real runtime fixture available in CI and fail closed when it is absent for this test, or keep an always-on meaningful producer assertion plus a separately-gated real-adaptor integration test.
New commits pushed, approval review dismissed automatically according to repository settings
APPROVED on head
5e94f3cb.5-axis re-review: the prior false-green is resolved. The workflow no longer
pip install ... || trues a package that could 401 and then let the test skip. It checks outmolecule-ai-workspace-runtimesource, exportsMOLECULE_WORKSPACE_RUNTIME, and the test imports/uses the realMCPServerAdaptorfrommolecule_runtime.plugins_registry.builtinswith a realInstallContext.The test now fails, not skips, when runtime source/adaptor is unavailable:
runtimePath == ""reachest.Fatalf(...). That makes the producer contract a real gate instead of a green skip. The assertions remain meaningful: read produced settings at the SSOT path, require the contract key to be an object, and require themolecule-platformentry.Current Gitea API state I observed has
CI / Platform (Go)pending on this head, not a terminal failure; if the checkout/import breaks, that should now be a real red gate rather than an ignored 401/skip.REQUEST_CHANGES on
5e94f3cb.The prior skip/401 false-green is partially fixed: CI now checks out molecule-ai-workspace-runtime source, exports MOLECULE_WORKSPACE_RUNTIME, and the test no longer skips when runtime is absent. However CI / Platform (Go) is still red because the real MCPServerAdaptor import path cannot run in the test environment: TestMCPPluginDeliveryContract_MCPServerAdaptorWritesMcpServers fails with ModuleNotFoundError: No module named 'a2a' from molecule_runtime/adapter_base.py.
That means the test is now fail-closed, but it still does not successfully exercise the real adaptor and assert the produced settings contract. Please provision the runtime's Python dependencies in this job, or isolate/import the adaptor path in a way that can run with its required deps, then keep the fail-not-skip behavior. Security/performance/scope otherwise look contained, but the requested real-adaptor gate is not yet green or usable.
New commits pushed, approval review dismissed automatically according to repository settings
REQUEST_CHANGES on head
28b49b7e.I cannot approve this as the real-adaptor gate because
CI / Platform (Go)is not green on the current head. I polled the Gitea status context and it remainedpendingfor job/molecule-ai/molecule-core/actions/runs/387298/jobs/535164; therefore there is not yet evidence that the realMCPServerAdaptoris imported and exercised successfully.The code changes are directionally right: they check out
molecule-ai-workspace-runtime, install it from source to pull Python deps such asa2a, exportMOLECULE_WORKSPACE_RUNTIME, and the Go test nowt.Fatalfinstead of skipping when runtime source/adaptor is unavailable. But the review request explicitly says to approve only if Platform (Go) passes with the real-adaptor gate. Current specific blocker: Platform (Go) is still not green/passed on28b49b7e, so the real-adaptor fix is unproven. Re-review once that context is success or provide the failing log if it turns red.APPROVED on
28b49b7e.Prior RC 12841 is resolved. CI / Platform (Go) is green, the workflow now checks out molecule-ai-workspace-runtime source, installs its Python dependencies without fail-open, exports MOLECULE_WORKSPACE_RUNTIME, and TestMCPPluginDeliveryContract_MCPServerAdaptorWritesMcpServers genuinely ran and passed. The log shows the real runtime package/deps installed and the real MCPServerAdaptor test PASS, not SKIP.
5-axis: correctness/tests now satisfy the real-adaptor gate; robustness is better because dependency/setup failures fail closed; no new security issue seen; performance cost is acceptable for Platform CI; scope/docs/comments are aligned with the contract-test purpose.
APPROVED on head
28b49b7e.Re-review after Platform (Go) completion: current status set no longer contains
CI / Platform (Go)as a non-success context, and Researcher is already approved on this head. The code path checks outmolecule-ai-workspace-runtime, installs it from source to satisfy Python deps such asa2a, exportsMOLECULE_WORKSPACE_RUNTIME, imports the realMCPServerAdaptor, and the test fails rather than skips if the runtime/adaptor is unavailable. That satisfies the real-adaptor gate requirement.SOP-checklist acks as Dev Engineer B (MiniMax),
engineersteam, non-author on core#3100 (head28b49b7e). All 7 items are within my ack scope per.gitea/sop-checklist-config.yaml./sop-ack comprehensive-testing
3 unit tests in
TestMCPPluginDeliveryContract_*pass on the realMCPServerAdaptor; CI / Platform (Go) green 3m7s on the same head; CI / all-required green./sop-ack local-postgres-e2e
Test-only change — no DB schema, no SQL, no service code touched. The contract test execs a python subprocess for the real adaptor, no Postgres involved.
/sop-ack staging-smoke
Test-only change — no service surface, no runtime contract change. Pre-existing CI gates (Platform Go, Shellcheck, all-required) cover the post-merge smoke; scheduling post-merge is appropriate.
/sop-ack root-cause
The false-green Platform (Go) job was caused by the contract test silently
t.Skipfing when the runtime source wasn't on disk; the runtime source path is the real fix because the test'smergeMCPPluginSettingsneeds the source-treesettings-fragment.jsonlayout, not a wheel./sop-ack five-axis-review
Correctness (real adaptor end-to-end), readability (cleaner than the model), architecture (SSOT contract preserved), security (no auth/secret change), performance (one subprocess per test run) — all checked.
/sop-ack no-backwards-compat
No shims added; the test-local
mergeMCPPluginSettingsmodel helper is removed and the test now invokes the real adaptor directly. Older runtimes that omitMOLECULE_WORKSPACE_RUNTIMEwillt.Fatalf(intentional fail-loud, not a shim)./sop-ack memory-consulted
Followed the core#3080 issue, the
MCPServerAdaptorSSOT contract file, and the priormergeMCPPluginSettingsremoval rationale from the test commit.APPROVE on
28b49b7e.Fresh approval to restore branch-protection count after reviewer re-request. Re-verified current head is unchanged from my prior approved review: Platform (Go) is green, CI / all-required is green, SOP checklist is 7/7, and the real MCPServerAdaptor contract gate remains the reviewed scope. No new correctness, security, test, scope, or docs concern found.