Bilateral drift guard across three registries + two executable paths: Registries: - ELEMENT_SHIMS (client shim, apps/web) - SUPPORTED_EMBEDDED_ELEMENT_TOOLS (canonical exported list) - ELEMENT_TOOL_NAMES (pen-mcp source of truth for all 42 tools) Executable paths: - A: client shim → pen-core buildX - B: server /api/mcp/exec-tool → pen-core buildX Since both paths delegate to the SAME pen-core buildX, the structural parity is transitive: if shim output matches direct buildX output, server output matches too. Tests: - CASES (42 fixtures) covers every ELEMENT_SHIMS key — refactor adding a new shim without a test row fails here. - CASES covers SUPPORTED_EMBEDDED_ELEMENT_TOOLS — same guarantee at the exported constant. - SUPPORTED_EMBEDDED_ELEMENT_TOOLS ⊆ ELEMENT_TOOL_NAMES — shim must only expose tools that pen-mcp actually defines. - No duplicate keys in ELEMENT_SHIMS. - For each tool: stripIds(shim(args).node) === stripIds(buildX(args)). The shim is a pure delegation layer plus id stamping. - Meta-param extraction: parent_id / pageId / filePath are split out BEFORE the builder sees them (no spurious field leak into the node). If any of these diverge in future refactors, the failure points directly at the broken registry or transformation. |
||
|---|---|---|
| .. | ||
| cli | ||
| desktop | ||
| web | ||