Repository navigation
Plugin panels: MCP parity for panel surfaces (S08, api v29) - #3586
Conversation
- mcp_ops: plugin_panels (bounded reads: overview + tier detail + keyed paging) and plugin_panel_action (semantic activation) OpDefs. - mcp: READ_OPS/EXECUTE_OPS allow the two ops. - panel_surfaces: owner-agnostic facade accessors (surface_summaries, *_any_owner) for the host's own automation interface. - panel_events: on_element_clicked mirroring on_node_activated. - automation: plugin_panels_read/plugin_panels_detail/plugin_panel_action (registry owner lookup, element-in-surface validation, router dispatch, desktop-gated delivery). - mcp_intent: ocs_panels + ocs_panel_action descriptors; catalogue NAMES and count extended (16 -> 18).
- Tests: the MCP plugin_panel_action routes the SAME PanelSurfaceEvent as the GUI gesture (recorded-dispatch equivalence, sequence monotonicity); bounded overview/paged reads; refusal discipline (no surface events); 10k-row surface walked through 200-row keyed pages, every row exactly once, strictly increasing. In-process test sink satisfies the reaper's owner-visibility law without a plugin process. - record_test_dispatch gains the PanelSurfaceEvent arm (was 'Other'). - docs/automation/guides/plugin-panels.md: agent-side reads/actions AND plugin-side construction (button rows, keyed pages, typed tables + canonicalizing patches, scenes, menus via the v15 quad path); registered in GUIDES, INSTRUCTIONS and the ocs_read description. - TOOL_SCHEMA_DIGEST repinned deliberately: ocs_panels + ocs_panel_action joined the catalogue (NAMES 16 -> 18), ocs_read description mentions the new guide.
… fmt touch-up) The rebase brought upstream's entities_delete test lines, which carry two of the inherited baseline fmt hunks. Wrapping them leaves every file this stage touches fmt-clean (baseline 28 -> 26).
…S08 CI fixes) The windows test job caught six suite-wide pins the scoped gate filters never ran: - tool-count pins 20 -> 22 (advertises_the_shared_tools, negotiates_and_lists_tools, all_tools_keep_facades_first_and_append_..., renamed sixteen -> eighteen) and generated schemas 16 -> 18. - INSTRUCTIONS budget 1100 -> 1200 (the catalogue announcement sentence is trimmed to one line; 1189 bytes). - execute-request schema budget 45_000 -> 48_000 bytes (46,002 actual). - plugin_panels is a READ op and never belonged in OPS (the execute request schema's anyOf builder iterates OPS, so a read op was wrongly advertised inside ocs_execute); removed from the OPS list - the ocs_panels descriptor references the OpDef directly, and read ops conventionally stay out of OPS (query/state/... were never there). - TOOL_SCHEMA_DIGEST repinned deliberately (anyOf shrinks by the read-op variant). Verified with the FULL unfiltered lib suite: 7029 passed, 0 failed, 45 ignored.
|
The windows test job caught six suite-wide MCP pins my scoped gate runs never executed (tool counts 20->22 / 16->18, the INSTRUCTIONS length budget, the execute-schema size budget) plus one real schema bug the failure exposed: |
Staged train (this PR is stage 8 — the final content stage)
Stages 1–7 are merged (scenes #3460, patches #3510, events #3530, widget tier #3540, buttons #3545, tables: this train's predecessor). Nothing follows.
Problem and minimal scope
Stage 8 — the evidence leg — of the atomic panel-surface train (#3460 scenes, #3510 patches, #3530 events, #3540 widget tier, the button and typed-table stages): MCP parity for panel surfaces. Everything an agent can do to a drawing through MCP, it can now do to a plugin panel:
ocs_panelsreads the published surfaces with bounded, keyed pages;ocs_panel_actionperforms the user's activation gesture; and the equivalence is PROVEN, not claimed — the MCP path and the GUI path route through the onePanelEventRouterand the one owner-targeted delivery, and a recorded-dispatch test asserts the resultingPanelSurfaceEventis identical (modulo the sequence advancing, which is the identity contract working). No new wire, no second panel machinery: the facade rides the existingocs_read/ocs_executepipeline exactly as the GUI mutations do.Public API / wire changes and current API-major basis
Based on the train's merged v29 (
manifestAPI_VERSION unchanged — no new API major, no wire changes at all):mcp_ops.rs: two OpDefs —plugin_panels(read: per-panel owner + per-tier revision/count overview; per-surface detail withtier/rows/after— scene tier answers COUNTS only, widget/table rows return keyed pages capped at 200) andplugin_panel_action(execute:panel_id+element(StableId) +kind(node_activated|element_clicked, defaulted by which tier holds the element; an element must exist in the addressed surface or the op refuses and burns no sequence number).mcp_intent.rs: descriptorsocs_panels(Read) andocs_panel_action(Execute) join the catalogue (NAMES16 → 18; the catalogue-uniqueness test updated with them).mcp.rs:READ_OPS/EXECUTE_OPSallow the two ops;TOOL_SCHEMA_DIGESTrepinned deliberately (586df5bc…→6f35562b…) — the diff is exactly the two new tool definitions plus theocs_readdescription's guide list (reviewed per the pinned test's instruction; the inspector CI validates the live schema).panel_surfacesgains owner-agnostic facade accessors (surface_summaries,*_any_owner) — the operator's own automation interface; plugin-to-plugin isolation (scene/widget/tableowner checks) is untouched.panel_eventsgainson_element_clicked, mirroringon_node_activated(pos is pointer-derived payload, never identity).Documentation (agent and plugin author)
New guide
docs/automation/guides/plugin-panels.md, registered inGUIDES,INSTRUCTIONS, and theocs_readdescription: the agent side (discover → page → activate, with real JSON shapes) AND the plugin side — constructing a widget tree with a BUTTON row, answering anUnloadedexpansion with a keyedWidgetPage, publishing a typed table and canonicalizing committed edits with an atomicTablePatch, a scene surface, and menus via the existing v15 quad-panel API (no second menu path).Legacy compatibility
Zero impact on existing tools, ops, schemas (append-only catalogue), surfaces, or the wire. Panels without surfaces read back as an empty overview. A v28 runner still cannot receive tag 16; nothing in this stage sends anything new.
Verification (exact commands, exit 0, at head
abf5d067e, rebased on upstreama11cfab85)cargo test -p ocs_plugin_api --all-features→ 223 passed, 0 failed, 1 ignored (unchanged: no crate-side changes).cargo test --lib -p OpenCADStudio -- plugin_panels mcp_panel_action tool_schema→ 7 passed, 0 failed, including:plugin_panel_actionand the GUIPanelWidgetNodeActivatedmessage produce the SAMEPanelSurfaceEvent(recorded dispatch, sequences 1 → 2 on the per-surface identity);cargo test --lib -p OpenCADStudio -- panel_events panel_surfaces plugin_scene panel_widgets plugin_tables→ 25 passed, 0 failed (the train's surface suites, unchanged).cargo check --lib -p OpenCADStudio→ clean; wasm32 check → clean (delivery stays desktop-gated; the facade's activation arm is a no-op on web, same paired-stub convention).rustfmt --checkon the seven touched files → 0 diffs.(Recorded artifacts for every line above;
tool_schema_digest_is_pinnedgreen after the deliberate repin.)Live-test evidence
Not run — honestly. The parity proof is the recorded-dispatch test (same router, same delivery, same event); a live MCP client against a live plugin panel awaits the Windows host mirror (pending note unchanged across the train). The MCP-conformance inspector job validates the advertised schema live on CI.
Upstream-baseline failures (not regressions)
Unchanged across the train: windows D3D12/windows-rs trait errors (inherited, documented with clean-checkout evidence on #3460/#3530); fmt/clippy informational jobs fail on pristine main. This PR adds zero new diagnostics.