Contract test: pin MCP-plugin delivery path (adaptor write == executor read) across core + claude-code template #3080

Closed
opened 2026-06-19 21:06:39 +00:00 by core-devops · 0 comments
Member

Prevention for the core#3079 class (a plugin-delivered MCP server written to a file the consumer ignores).

The MCP-plugin delivery path was unpinned across two repos: core's MCPServerAdaptor writes mcpServers to /configs/.claude/settings.json; the claude-code template executor reads config.yaml + mcp_servers.yaml and (via --strict-mcp-config) ignored settings.json. Nothing failed when they diverged.

Ask: a producer↔consumer contract test (same pattern as the provision-request contract test, core#3058 / cp#871):

  • A committed mcp-plugin-delivery.contract.json (byte-identical in molecule-core and molecule-ai-workspace-template-claude-code) declaring the canonical delivery: settings_path=/configs/.claude/settings.json, key=mcpServers, shape name->{command,args,env}.
  • Core test: assert MCPServerAdaptor writes to the contract path/key.
  • Template test: assert the executor's read set INCLUDES the contract path (extend test_extra_mcp_servers.py).
  • A drift gate (reuse ci-required-drift machinery) that fails if the two contract files diverge.
    Catches the divergence at PR time instead of in prod.
**Prevention for the core#3079 class** (a plugin-delivered MCP server written to a file the consumer ignores). The MCP-plugin delivery path was unpinned across two repos: core's `MCPServerAdaptor` *writes* mcpServers to `/configs/.claude/settings.json`; the claude-code template executor *reads* config.yaml + `mcp_servers.yaml` and (via `--strict-mcp-config`) ignored settings.json. Nothing failed when they diverged. **Ask:** a producer↔consumer contract test (same pattern as the provision-request contract test, core#3058 / cp#871): - A committed `mcp-plugin-delivery.contract.json` (byte-identical in molecule-core **and** molecule-ai-workspace-template-claude-code) declaring the canonical delivery: `settings_path=/configs/.claude/settings.json`, `key=mcpServers`, shape `name->{command,args,env}`. - Core test: assert `MCPServerAdaptor` writes to the contract path/key. - Template test: assert the executor's read set INCLUDES the contract path (extend test_extra_mcp_servers.py). - A drift gate (reuse ci-required-drift machinery) that fails if the two contract files diverge. Catches the divergence at PR time instead of in prod.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: molecule-ai/molecule-core#3080