Skip to content

feat(v3): rig-aware plugin assist + canonical import binding (#91, #89)#93

Merged
mbreiser merged 1 commit into
mainfrom
feat/rig-aware-plugins-91
Jun 2, 2026
Merged

feat(v3): rig-aware plugin assist + canonical import binding (#91, #89)#93
mbreiser merged 1 commit into
mainfrom
feat/rig-aware-plugins-91

Conversation

@mbreiser
Copy link
Copy Markdown
Contributor

@mbreiser mbreiser commented Jun 2, 2026

Summary

Makes the v3 Experiment Designer's plugin support rig-aware (#91) and fixes the linked D4 import bug where canonical plugin names were prefixed (#89). Builds on v0.20's add-plugin dropdown.

  • Rig parsing: Settings → Rig → Browse… now parses the picked rig YAML's plugins: block (it previously discarded the contents).
  • Rig-aware dropdown: "+ Add plugin…" shows a Supported by rig group (the rig's enabled plugins, bound to their canonical name + derived matlab.class) plus a Registry group. Adding a rig plugin uses the canonical rig name.
  • Mismatch warnings: non-blocking, inline in Settings → Plugins (protocol-uses-unsupported / rig-enables-unused).
  • Tolerant mapping: matches the well-known rig key first, falls back to a normalized type ("LED Controller", "Bias"/"BIAS"), degrades gracefully when unmapped. Malformed/partial rig YAML never throws a module error.
  • Plugins imported from another yaml have incorrect name when exported #89 fix: D4 import never prefixes a canonical rig name (camera/backlight/temperature, plus any the loaded rig declares) — it merges into an existing target plugin or adds under the canonical name. The well-known names are an always-on baseline, so Plugins imported from another yaml have incorrect name when exported #89 is fixed even with no rig loaded.

Files

  • js/plugin-registry.jsmapRigPluginToBuiltin, deriveRigPlugins, diffRigVsProtocol, WELL_KNOWN_RIG_PLUGIN_NAMES, createPluginEntry name override
  • js/protocol-yaml-v3.jsparseRigYAMLText
  • js/v3-import.js — canonical-name branch in _computePluginAction, rigPluginNames staging option, non-renamable canonical binds
  • experiment_designer_v3.html (v0.21) — async Browse parse, loadedRig state, rig-aware dropdown, mismatch warnings, import inspector + wiring
  • tests/test-protocol-roundtrip-v3.js — suites N12 (rig parse + tolerant map vs tests/fixtures/rigs/*) and N13 (Plugins imported from another yaml have incorrect name when exported #89 binding); N9 updated

Acceptance criteria (#91)

  • Browse… parses the rig plugins: block (tolerant across tests/fixtures/rigs/*)
  • Dropdown reflects the rig's enabled plugins with derived matlab.class; adding uses the canonical rig name
  • Mismatch warnings appear (non-blocking)
  • Malformed/partial rig YAML degrades gracefully (clear message, no module error)
  • Node tests cover rig-plugins parse + map
  • No regression: npm test green; v0.20 add/remove + rig-path Browse still work

#89

  • Importing a camera condition into a camera-less protocol exports plugin_name: "camera" (not <prefix>__camera)

Test plan

  • npm test — arena 10/10, v2 137/137, v3 645/645 (incl. N12/N13, updated N9)
  • Browser e2e (no console errors): rig dropdown groups, canonical add (camera → BiasPlugin, no config), both warning types, malformed-YAML graceful revert, and Plugins imported from another yaml have incorrect name when exported #89 import showing camera → binds to rig plugin "camera" with the committed protocol declaring camera (zero prefixed occurrences)

Closes #91
Closes #89

🤖 Generated with Claude Code

Parse the rig YAML picked via Settings → Rig → Browse… and use its
plugins: block to drive the add-plugin dropdown and surface rig-vs-protocol
mismatch warnings. D4 cross-library import now binds canonical rig plugin
names (camera/backlight/temperature, plus any the loaded rig declares)
instead of prefixing them — closing #89.

- js/plugin-registry.js: tolerant mapRigPluginToBuiltin / deriveRigPlugins /
  diffRigVsProtocol; createPluginEntry name override; WELL_KNOWN_RIG_PLUGIN_NAMES
- js/protocol-yaml-v3.js: parseRigYAMLText (clean RIG_PARSE_ERROR)
- js/v3-import.js: canonical-name branch in _computePluginAction, always-on
  well-known baseline, rigPluginNames staging option, non-renamable canonical binds
- experiment_designer_v3.html (v0.21): async Browse parse, loadedRig state,
  rig-aware dropdown (optgroups), inline mismatch warnings, import inspector + wiring
- tests: N12 (rig parse + tolerant map vs fixtures/rigs/*), N13 (#89 binding);
  N9 updated to assert camera is added unprefixed

Verified: npm test green (arena 10/10, v2 137/137, v3 645/645) + browser e2e
(rig dropdown, canonical add, warnings, malformed-YAML graceful, #89 import).

Closes #91
Closes #89

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@mbreiser mbreiser merged commit ac0eb57 into main Jun 2, 2026
3 checks passed
@mbreiser mbreiser deleted the feat/rig-aware-plugins-91 branch June 2, 2026 16:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Feature: derive supported plugins from the rig YAML (rig-aware plugin assist) Plugins imported from another yaml have incorrect name when exported

1 participant