gabriel / muse public
feat patch feat/midi-domain-opt-in-gate #1 / 1
AI Agent gabriel · 1 day ago · Sep 12, 2026 · Diff

feat: gate the suspended midi domain behind MUSE_ENABLE_MIDI

The midi domain plugin is fully maintained but not registered by default, pending its own security and performance audit -- unrelated to code quality, purely a focus decision while the code domain ships to the general public first. Previously the only way to re-enable it was uncommenting its import and registry entry directly, which flips the default for every user of that checkout with nothing to remind you to revert it.

Replaced that with an explicit opt-in: setting MUSE_ENABLE_MIDI=1 adds MidiPlugin to the registry at import time; unset (the default), the registry is byte-for-byte the same six domains as before. Needed to unblock a local midi demo without touching the public default.

Tests: tests/test_plugin_registry.py::TestMidiOptInGate -- three new tests, each spawning a fresh interpreter (registry state is built once at import time) to prove: midi absent with no env var, midi present with MUSE_ENABLE_MIDI=1, and resolve_plugin() actually returns a working MidiPlugin for a midi-domain repo when opted in (the exact 'Unknown domain' failure this fixes). Full regression sweep across test_domain_schema/test_plugin_registry/test_domain_command_registry(_wiring)/ test_cli_plugin_dispatch/test_cmd_domains_hardening: 314 passed.

Version bump to 0.2.1rc4 -- a real, tested CLI change worth publishing through the normal release channel rather than living only as a local site-packages reinstall.

Co-Authored-By: Claude Sonnet 5 <[email protected]>

sha256:7fbbeb1aea57e54e882cb3f5cf6c5071fa82142953df8675d44ab1082d4eb783 sha
+9 ~3 −1 symbols
3 changed · 1185 in snapshot files
sha256:373fc25aa9fb8606d7864a1fafe8c6c614a5bc103c4deca60be4915c30b63e30 snapshot
+9
symbols added
~3
symbols modified
−1
symbol removed
3
files changed
1185
files in snapshot
0
dead code introduced
Semantic Changes 13 symbols
~ muse/plugins/registry.py .py 1 symbol added
+ os import import os L16–16
~ pyproject.toml .toml 2 symbols modified
~ tests/test_plugin_registry.py .py 8 symbols added, 1 symbol removed, 1 symbol modified
test_midi_suspended method method test_midi_suspended L78–80
+ TestMidiOptInGate class class TestMidiOptInGate L94–139
+ _registered_domains_with_env method method _registered_domains_with_env L102–111
+ test_midi_absent_without_env_var method method test_midi_absent_without_env_var L113–115
+ test_midi_present_when_env_var_set method method test_midi_present_when_env_var_set L117–119
+ test_resolve_plugin_works_for_midi_when_opted_in method method test_resolve_plugin_works_for_midi_when_opted_in L121–139
+ test_midi_suspended_by_default method method test_midi_suspended_by_default L80–83
+ subprocess import import subprocess L5–5
+ sys import import sys L6–6
Files Changed
~3
1185 in snapshot
← Older Oldest on feat/midi-domain-opt-in-gate
All commits
Newer → Latest on feat/midi-domain-opt-in-gate

0 comments

No comments yet. Be the first to start the discussion.

To add a comment, use the Muse CLI: muse hub commit comment sha256:7fbbeb1aea57e54e882cb3f5cf6c5071fa82142953df8675d44ab1082d4eb783 --body "your comment"