feat(ssot): gate concierge MCP-present literals against the delivery contract #157
Reference in New Issue
Block a user
Delete Branch "ssot/mcp-plugin-delivery-contract-gate"
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?
What
Adds the runtime as a first-class party to the cross-repo MCP-plugin-delivery SSOT contract, and a unit-test gate that pins
platform_agent_identity.py's literals to it.Why
The RCA#2970 concierge-online bug happened because
mcp_server_present()checked literals (/opt/molecule-mcp-server) that had drifted from how the management MCP is actually delivered (plugin ->/configs/.claude/settings.jsonmcpServers['molecule-platform']). Nothing gated that drift: the runtime repo wasn't a party to the contract, and the contract didn't pin the server name.Changes
contracts/mcp-plugin-delivery.contract.json(extended to pinmcp_server_name,legacy_binary_path,runtime_present_field, and a fullconsumerslist).tests/test_mcp_plugin_delivery_contract.py: assertsSETTINGS_PATH/MANAGEMENT_MCP_NAME/MCPSERVER_PATH/present-field == contract. Runs in the normalunit-testsjob — always-on, no cross-repo token needed.Follow-ups (separate)
mcp-plugin-delivery-contract-driftbyte-compare set.consumer-drift / runtime-ssot-consumersred (separate, predates this work).🤖 Generated with Claude Code
APPROVE — re-review after my REQUEST_CHANGES. All 3 blocking findings addressed: (1) docstrings no longer overclaim — they honestly scope this as the runtime-LOCAL gate and name the cross-repo drift-workflow extension as a tracked follow-up; (2) same honest scoping covers the runtime-local-only limitation; (3) the mcpServers key is now a shared MCPSERVERS_KEY constant, used by _settings_has_management_mcp AND asserted == contract['key'] in the test, so a source-side key rename is caught. unit-tests green (contract test passes).
APPROVE — re-confirm on updated head. Behavior-neutral refactor (MCPSERVERS_KEY is the same literal, just named) + honest docstrings; fail-closed semantics unchanged. Gate is a sound runtime-local SSOT check.
APPROVED on head
3a2d0c5e.5-axis review: Correctness: adds a runtime-local contract gate that pins
platform_agent_identitysettings path/key/name, legacy binary path, and emitted present-field to the vendored MCP plugin delivery contract. The PR is honest that cross-repo byte-identical drift wiring is a follow-up, so this approval is for the local runtime gate scope. Robustness: fail-closed runtime behavior remains unchanged; malformed/missing settings handling is unchanged. Security: no secret/auth/network expansion. Performance: only constant lookup plus unit tests, no hot-path cost beyond existing JSON read. Readability: comments and tests clearly document the RCA and enforcement boundary. CI is green and PR is mergeable=true.5-axis review: REQUEST_CHANGES.
CI is green and the contract constants are useful, but the new gate does not yet exercise the real MCP plugin delivery/presence path. tests/test_mcp_plugin_delivery_contract.py only compares platform_agent_identity constants to this repo's vendored contracts/mcp-plugin-delivery.contract.json and patches mcp_server_present for the payload-field check. It never creates a delivered settings.json shaped like the MCPServerAdaptor output, never calls _settings_has_management_mcp()/mcp_server_present() against that file, and does not exercise claude_sdk_executor._load_settings_mcp or the producer path. A coordinated wrong contract + source edit would still pass.
Requested fix shape: add a runtime-local behavioral test that materializes a settings.json with the contract key/name (mcpServers -> molecule-platform), patches SETTINGS_PATH/legacy path as needed, and asserts mcp_server_present()/identity_gate_payload() report true; also assert malformed/missing key/name stays false. If the PR claims loader coverage, invoke the real loader/consumer path rather than only comparing constants.
The cross-repo byte-identical drift wiring can remain a separate follow-up; the blocker here is that this PR's local gate does not yet prove the runtime consumes a delivered MCP settings entry.
SOP gate: no sop-checklist status is visible on this PR's current status list, and issue comments are 403 with my review token, so I cannot report an ack count from this runtime.
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
New commits pushed, approval review dismissed automatically according to repository settings
5-axis re-review: APPROVED at head
2283baba.RC 12704 is resolved for this repo's runtime-local gate: tests now materialize a delivered settings.json using the contract key/name/shape and assert _settings_has_management_mcp(), mcp_server_present(), and identity_gate_payload() against the real file-backed runtime consumer path. They also cover fail-closed cases for missing/malformed settings, wrong key/name, non-dict shapes, and legacy-binary fallback.
The cross-repo byte-identical drift wiring / producer-loader drift gate is genuinely separable and is explicitly documented as a follow-up; this PR closes the runtime-local consumer behavior gap. CI is green and mergeable=true.
APPROVED on head
2283baba.5-axis re-review: the Researcher RC is resolved. The tests now materialize the delivered settings.json shape and exercise
_settings_has_management_mcp(),mcp_server_present(), andidentity_gate_payload()against the real file-backed consumer path, with fail-closed coverage for missing/malformed/wrong-key/wrong-name settings. Correctness and robustness are materially improved; no secret/auth/network expansion, no runtime performance regression beyond existing settings lookup, and the test scope/readability are clear. CI is green on the current head.