feat(mcp): pin MCP-plugin delivery contract (core#3080) — includes prerequisite build fix #3084
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?
Summary
Pin the MCP-plugin delivery contract (core#3080) so molecule-core and molecule-ai-workspace-template-claude-code cannot silently diverge on the
/configs/.claude/settings.jsonmcpServersdelivery surface.Paired with molecule-ai-workspace-template-claude-code#150, which adds the byte-identical contract file and the Python consumer-side test.
Changes
contracts/mcp-plugin-delivery.contract.jsonas the cross-repo SSOT.LoadMCPPluginDeliveryContract+ producer-side guard tests inworkspace-server/internal/handlers/mcp_plugin_delivery_contract_test.go.TestMCPPluginDeliveryContract_MatchesSSOTpins settings_path, key, entry_shape, producer, and consumer.TestMCPPluginDeliveryContract_MCPServerAdaptorWritesMcpServersis the always-on hermetic guard.TestMCPPluginDeliveryContract_RealMCPServerAdaptorWritesMcpServersinvokes the actual runtimeMCPServerAdaptorwhenmolecule-ai-workspace-runtimeis available (sibling checkout orMOLECULE_WORKSPACE_RUNTIME), and skips cleanly when it is not..gitea/workflows/mcp-plugin-delivery-contract-drift.ymlto byte-compare core's contract against the template canonical. It is bootstrap-aware: a 404 from the canonical repo main soft-skips with a warning during the paired rollout, then fails closed once both mains contain the file.fix/main-red-concierge-mcp-name(#3077) because main is currently red for anyworkspace-server/**change (undefined: conciergePlatformMCPPlugin).SOP checklist
comprehensive-testing): Contract tests exercise loading, SSOT field matching, and both hermetic + real producer write behavior; template-side consumer test pins_load_settings_mcpto the contract path/key; cherry-picked build fix unblocks Platform (Go) / Handlers Postgres integration.local-postgres-e2e): N/A — no DB surface touched by the contract/test changes.staging-smoke): Pending CI green; post-merge drift gate runs on schedule.root-cause): N/A — new contract/test feature, not a bug fix. The included platform-agent fix addresses a pre-existing main-red regression (undefined: conciergePlatformMCPPlugin).five-axis-review): Reviewed (correctness/readability/architecture/security/performance).no-backwards-compat): No shim. The producer helpers are in the test file; the live pipeline still uses the runtime PythonMCPServerAdaptor. The platform-agent change is a straight symbol fix.memory-consulted): N/A — no directly applicable memory; follows the provision-request contract test pattern (core#3058).🤖 Generated with Claude Code
REQUEST_CHANGES: two blockers in the contract proof.
Cross-repo byte-identity is not currently true.
contracts/mcp-plugin-delivery.contract.jsonexists in this core PR, but the workflow's canonical targetmolecule-ai-workspace-template-claude-code/raw/contracts/mcp-plugin-delivery.contract.json?ref=mainreturns 404. I also checked template PR #149 after merge; its file list only changedclaude_sdk_executor.pyandtests/test_extra_mcp_servers.py, so it did not add the matching contract file. As written, the drift workflow will fail once it actually runs in a trusted context, and the claimed SSOT/byte-identical contract is not established.TestMCPPluginDeliveryContract_MCPServerAdaptorWritesMcpServersdoes not exercise the real producer. It uses test-localmergeMCPPluginSettingsthat explicitly “models” the runtime adaptor, so it proves the helper writes the contract path/key, not thatMCPServerAdaptorstill writes there. For the P1 contract test, please either invoke the actual adaptor/write path or otherwise bind the production writer to the loaded contract so producer drift is caught.5-axis notes: the intended contract shape and the strict-mcp-config consumer path are sensible, and security posture of the contract file itself is fine. But correctness/test coverage do not yet prove the cross-repo contract. Current gates are also not merge-ready: Platform Go/Handlers/API smoke plus qa-review and reserved-path-review are red/skipped. I do not see a
security-review / approvedcontext on this PR, so I cannot say this is blocked on security-team(21); the visible review gates are qa-review and reserved-path-review.REQUEST_CHANGES. The contract intent is right, but the current PR does not yet prove the cross-repo contract it is meant to pin.
Correctness blockers:
Robustness/CI: current head
cecfaeb6is not green: Platform Go, handlers integration, required-context lint, security-review, reserved-path-review, SOP, and other gates are red/skipped. Since this PR adds a .gitea workflow and contract/CI path, the red security-review likely does require security-team(21) clearance.Security/performance/readability: no secret material and the JSON contract/workflow are small, but the workflow cannot be relied on until the canonical template file exists and CI/security gates are green.
--strict-mcp-config is untouched, which is good. Please add/sync the template contract file, add the consumer-side Python contract test, make the producer test cover the real adaptor or clearly wire the real writer contract, and clear CI/security gates.
feat(mcp): pin MCP-plugin delivery contract (core#3080)to feat(mcp): pin MCP-plugin delivery contract (core#3080) — includes prerequisite build fixREQUEST_CHANGES: both prior blockers are still unresolved at new head
fdd718bc.The cross-repo canonical contract still does not resolve. I fetched core's
contracts/mcp-plugin-delivery.contract.jsonatfdd718bcsuccessfully, butmolecule-ai-workspace-template-claude-code/raw/contracts/mcp-plugin-delivery.contract.json?ref=mainstill returns 404. That means the drift gate's canonical fetch still fails and the contract is not byte-identical across core + template main.The Go producer test still does not bind the real MCPServerAdaptor/write path. The diff still defines test-local
mergeMCPPluginSettings, whose comment says it “models the runtime MCPServerAdaptor's write side,” thenTestMCPPluginDeliveryContract_MCPServerAdaptorWritesMcpServerscalls that helper. This proves the model helper writes the contract path/key, not that the production adaptor writes there.Until the template canonical exists and the producer-side test exercises or is directly bound to the real production writer, this contract test can still pass while the repos/runtime drift. Visible gates also remain non-green: qa-review, security-review, reserved-path-review failing; Platform Go currently running at my check.
REQUEST_CHANGES. Re-review at
fdd718bc: the two prior blockers are still not resolved.Cross-repo canonical fetch is still not proven usable: the PR branch has contracts/mcp-plugin-delivery.contract.json, but raw fetches for contracts/mcp-plugin-delivery.contract.json on both molecule-core:main and molecule-ai-workspace-template-claude-code:main returned 404 during review. That leaves the drift gate unable to compare against the canonical file it fetches.
The Go producer test still does not exercise the real MCPServerAdaptor. workspace-server/internal/handlers/mcp_plugin_delivery_contract_test.go still defines a test-local mergeMCPPluginSettings helper, and TestMCPPluginDeliveryContract_MCPServerAdaptorWritesMcpServers calls that helper. The comment explicitly says it models the runtime MCPServerAdaptor write side, so this remains model coverage rather than real producer coverage.
Current head also is not merge-ready: Platform Go/E2E contexts are pending and qa/security/reserved-path/SOP-related gates are red. --strict-mcp-config remains untouched.
9435307857to649bbbde91Thanks for the review. This push addresses the blockers:
Remaining red contexts (, human review gates, reserved-path-review) are pre-existing or require peer acks.
Thanks for the review. This push addresses the blockers:
Remaining red contexts (lint-continue-on-error-tracking, human review gates, reserved-path-review) are pre-existing or require peer acks.
APPROVED: re-review at
b149feda. The two prior blockers are resolved for code-review purposes. The paired contract file is byte-identical to template#150's current head (same 195 bytes / sha256 1af99242...), and core now includes a real-producer guard:TestMCPPluginDeliveryContract_RealMCPServerAdaptorWritesMcpServersimports and runs the actual PythonMCPServerAdaptor; the oldermergeMCPPluginSettingshelper remains only as a hermetic always-on model test. Correctness: producer/consumer contract path/configs/.claude/settings.jsonand keymcpServersare pinned, and the prerequisite concierge plugin source/name fix is preserved. Tests: Go contract tests plus paired template consumer/drift tests cover the contract; CI was still in progress for Platform Go at my final check, so this is not a merge-readiness statement. Security: no secret material; drift workflows use read token for raw fetch only and strict-mcp-config remains preserved. Scope/backcompat: additive contract/drift coverage. Ops: paired bootstrap is handled by landing core#3084 with template#150; after both mains have the file, drift gates compare bytes.APPROVED. Re-reviewed
b149feda. The paired contract bytes match template#150 exactly (sha256 1af99242ea7235d15407cab18a79ee03a17e4a5dcaa3a705a7c50c8085da4cbb), the core drift gate now handles bootstrap 404 for template main, and the Go coverage now includes TestMCPPluginDeliveryContract_RealMCPServerAdaptorWritesMcpServers, which imports molecule_runtime.plugins_registry.builtins.MCPServerAdaptor and runs adaptor.install() against the contract settings_path/key. The local merge helper is retained only as the hermetic guard. --strict-mcp-config remains untouched.New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
APPROVED: re-review at current head
2c52536e. The paired contract files are byte-identical to template#150 current head 46ecc67 (same 195 bytes / sha256 1af99242...). The core drift workflow now checks the paired branch ref first, then main, with bootstrap skip only when neither canonical exists, which removes the cross-repo deadlock during first landing. The producer-side coverage now includes a real-adaptor path: CI installsmolecule-ai-workspace-runtime, andTestMCPPluginDeliveryContract_RealMCPServerAdaptorWritesMcpServersimports/runs the actual PythonMCPServerAdaptor; the local helper remains as an always-on hermetic guard. Correctness/security/scope are sound for the contract and prerequisite concierge plugin source/name fix. Note: this is code approval, not merge-readiness; visible process/status gates still include SOP 0/7 and security/reserved/template-delivery statuses at my check.APPROVED. Re-reviewed current head
2c52536e. The contract remains byte-identical to template#150 (sha256 1af99242ea7235d15407cab18a79ee03a17e4a5dcaa3a705a7c50c8085da4cbb), the core drift gate now fetches the paired branch ref first then falls back to main with bootstrap 404 skip, and the Go coverage includes the real-producer path importing molecule_runtime.plugins_registry.builtins.MCPServerAdaptor and running adaptor.install() against the contract settings_path/key. The hermetic local helper remains only as backup coverage. CI note: current combined status still has unrelated/policy/E2E reds, but no regression in the reviewed contract implementation./sop-ack comprehensive-testing
/sop-ack local-postgres-e2e
/sop-ack staging-smoke
/sop-ack root-cause
/sop-ack five-axis-review
/sop-ack no-backwards-compat
/sop-ack memory-consulted
SOP body is filled with all 7 RFC#351 section markers. The sop-checklist gate now only needs the reviewers to post the matching /sop-ack comments (author self-ack is forbidden).
Required acks:
Once these land, #3084 should be fully green and ready for the paired merge with molecule-ai-workspace-template-claude-code#150.