feat(v3): rig-aware plugin assist + canonical import binding (#91, #89)#93
Merged
Conversation
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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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.
plugins:block (it previously discarded the contents).matlab.class) plus a Registry group. Adding a rig plugin uses the canonical rig name.type("LED Controller","Bias"/"BIAS"), degrades gracefully when unmapped. Malformed/partial rig YAML never throws a module error.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.js—mapRigPluginToBuiltin,deriveRigPlugins,diffRigVsProtocol,WELL_KNOWN_RIG_PLUGIN_NAMES,createPluginEntryname overridejs/protocol-yaml-v3.js—parseRigYAMLTextjs/v3-import.js— canonical-name branch in_computePluginAction,rigPluginNamesstaging option, non-renamable canonical bindsexperiment_designer_v3.html(v0.21) — async Browse parse,loadedRigstate, rig-aware dropdown, mismatch warnings, import inspector + wiringtests/test-protocol-roundtrip-v3.js— suites N12 (rig parse + tolerant map vstests/fixtures/rigs/*) and N13 (Plugins imported from another yaml have incorrect name when exported #89 binding); N9 updatedAcceptance criteria (#91)
plugins:block (tolerant acrosstests/fixtures/rigs/*)matlab.class; adding uses the canonical rig namenpm testgreen; v0.20 add/remove + rig-path Browse still work#89
cameracondition into a camera-less protocol exportsplugin_name: "camera"(not<prefix>__camera)Test plan
npm test— arena 10/10, v2 137/137, v3 645/645 (incl. N12/N13, updated N9)camera → binds to rig plugin "camera"with the committed protocol declaringcamera(zero prefixed occurrences)Closes #91
Closes #89
🤖 Generated with Claude Code