gabriel / musehub public
refactor BREAKING dev
AI Agent gabriel · 158 days ago · Apr 21, 2026 · Diff

refactor: strip MIDI domain bleed from MuseHub

Removes all MIDI/audio-specific code from what should be a domain-agnostic system. MIDI is the first Muse domain but is not yet implemented in MuseHub, so all music-specific assumptions were creating false surface area.

Templates: - blob.html: remove MIDI inline player branch - blame.html: remove 80-line piano roll section with hardcoded track names - release_detail.html: replace MIDI/stems/MP3/MusicXML packages with generic source/metadata - commits.html: remove tempo/key/emotion/stage/instrument CSS chips; neutral tag placeholder

Models (musehub.py): - RepoResponse: remove key_signature, tempo_bpm fields - Remove TimelineEmotionEvent, TimelineSectionEvent, TimelineTrackEvent - Simplify TimelineResponse to commits + total_commits only - Remove EmotionDiffResponse; remove emotion_diff from CompareResponse - ProposalDiffDimensionScore/ProposalDiffResponse: remove affected_sections, update dimension names

Services: - musehub_divergence.py: replace melodic/harmonic/rhythmic/structural/dynamic keyword buckets with interface/data/logic/tests/infrastructure Remove _SECTION_RE, extract_affected_sections - musehub_repository.py: remove _derive_emotion, strip emotion from get_timeline_events - musehub_discover.py: remove genre and instrumentation filter params

API routes: - discover.py: remove genre/instrumentation query params - repos.py: remove _derive_emotion_vector, _compute_emotion_diff, emotion_diff - _nav_ctx.py: remove repo_key/repo_bpm from docstring - Delete ui_mcp_elicitation.py (streaming platform OAuth — entirely MIDI domain)

MCP: - elicitation.py: gut music-specific schemas (compose_preferences, repo_creation, platform_connect_confirm); rewrite proposal_review_focus with code dimensions - tools/musehub.py: remove MIDI example from domain_meta description

Tests: - Delete test_mcp_elicitation.py (tested deleted MIDI platform elicitation routes)

sha256:98945fd05d7a137f0a0da079ce97f719228702d9177e28edc4c44af62075d9ff sha
~111 −139 symbols
sha256:60679549a89f563badc7af79228a6d903b0d379ee12ebc8c8705c98be80ea56e snapshot
~111
symbols modified
−139
symbols removed
0
dead code introduced
Semantic Changes 250 symbols
− _DAW_BY_SLUG variable variable _DAW_BY_SLUG L48–50
− _DAW_OAUTH_URLS variable variable _DAW_OAUTH_URLS L64–70
− _PLATFORM_BY_SLUG variable variable _PLATFORM_BY_SLUG L44–46
− _PLATFORM_OAUTH_URLS variable variable _PLATFORM_OAUTH_URLS L53–62
− _error_page function function _error_page L281–292
− _get_musehub_user_id function function _get_musehub_user_id L76–82
− _signal_elicitation_complete function function _signal_elicitation_complete L236–275
− daw_connect_start function async_function daw_connect_start L151–191
− elicitation_callback function async_function elicitation_callback L203–230
− APIRouter import import APIRouter L31–31
− AVAILABLE_DAW_CLOUDS import import AVAILABLE_DAW_CLOUDS L36–36
− AVAILABLE_PLATFORMS import import AVAILABLE_PLATFORMS L36–36
− HTMLResponse import import HTMLResponse L32–32
− Query import import Query L31–31
− RedirectResponse import import RedirectResponse L32–32
− Request import import Request L31–31
− Response import import Response L33–33
− logging import import logging L29–29
− templates import import templates L35–35
− logger variable variable logger L38–38
− platform_connect_start function async_function platform_connect_start L94–139
− router variable variable router L40–40
~ tests/test_mcp_elicitation.py .py 84 symbols removed
− TestDataIntegrityElicitation class class TestDataIntegrityElicitation L415–443
− test_accepted_content_preserved_in_result method async_method test_accepted_content_preserved_in_result L416–424
− test_build_form_requested_schema_is_schemas_entry method method test_build_form_requested_schema_is_schemas_entry L436–439
− test_build_url_elicitation_id_in_params method method test_build_url_elicitation_id_in_params L441–443
− test_declined_action_in_result method async_method test_declined_action_in_result L426–434
− TestE2EDawConnectRoute class class TestE2EDawConnectRoute L349–374
− test_invalid_daw_slug_returns_404 method async_method test_invalid_daw_slug_returns_404 L350–356
− test_unauthenticated_valid_daw_redirects method async_method test_unauthenticated_valid_daw_redirects L358–374
− TestE2EElicitationCallbackRoute class class TestE2EElicitationCallbackRoute L301–316
− test_callback_accepted_returns_200 method async_method test_callback_accepted_returns_200 L302–308
− test_callback_declined_returns_200 method async_method test_callback_declined_returns_200 L310–316
− TestE2EPlatformConnectRoute class class TestE2EPlatformConnectRoute L319–346
− test_invalid_platform_slug_returns_404 method async_method test_invalid_platform_slug_returns_404 L320–326
− test_unauthenticated_valid_platform_redirects method async_method test_unauthenticated_valid_platform_redirects L328–346
− TestIntegrationPendingElicitation class class TestIntegrationPendingElicitation L205–245
− test_create_pending_stores_future method async_method test_create_pending_stores_future L206–214
− test_resolve_already_done_future_returns_false method async_method test_resolve_already_done_future_returns_false L236–245
− test_resolve_matching_id_returns_true method async_method test_resolve_matching_id_returns_true L216–225
− test_resolve_non_matching_id_returns_false method async_method test_resolve_non_matching_id_returns_false L227–234
− TestIntegrationSignalElicitation class class TestIntegrationSignalElicitation L248–295
− test_delete_session_cancels_pending_futures method async_method test_delete_session_cancels_pending_futures L286–295
− test_signal_no_matching_session_returns_zero method async_method test_signal_no_matching_session_returns_zero L279–284
− test_signal_pushes_sse_notification_to_queue method async_method test_signal_pushes_sse_notification_to_queue L262–277
− test_signal_resolves_matching_future method async_method test_signal_resolves_matching_future L249–260
− TestPerformanceElicitation class class TestPerformanceElicitation L481–508
− test_1000_build_form_under_50ms method method test_1000_build_form_under_50ms L482–488
− test_1000_build_url_under_50ms method method test_1000_build_url_under_50ms L490–495
− test_100_pending_create_and_resolve_under_100ms method async_method test_100_pending_create_and_resolve_under_100ms L497–508
− TestSecurityElicitation class class TestSecurityElicitation L449–476
− test_callback_unknown_id_does_not_crash method async_method test_callback_unknown_id_does_not_crash L450–457
− test_double_resolve_returns_false method async_method test_double_resolve_returns_false L466–476
− test_platform_unknown_slug_returns_404_not_500 method async_method test_platform_unknown_slug_returns_404_not_500 L459–464
− TestStressElicitation class class TestStressElicitation L380–409
− test_50_pending_elicitations_no_collision method async_method test_50_pending_elicitations_no_collision L381–392
− test_signal_resolves_across_5_sessions method async_method test_signal_resolves_across_5_sessions L394–409
− TestUnitAvailableLists class class TestUnitAvailableLists L169–180
− test_available_daw_clouds_non_empty method method test_available_daw_clouds_non_empty L173–174
− test_available_platforms_non_empty method method test_available_platforms_non_empty L170–171
− test_daw_clouds_are_strings method method test_daw_clouds_are_strings L179–180
− test_platforms_are_strings method method test_platforms_are_strings L176–177
− TestUnitComposePreferencesSchema class class TestUnitComposePreferencesSchema L183–199
− test_schema_has_key_property method method test_schema_has_key_property L188–190
− test_schema_has_tempo_bpm_property method method test_schema_has_tempo_bpm_property L192–194
− test_schema_is_object_type method method test_schema_is_object_type L184–186
− test_tempo_bpm_has_min_max_constraints method method test_tempo_bpm_has_min_max_constraints L196–199
− TestUnitElicitationTypesDicts class class TestUnitElicitationTypesDicts L141–166
− test_elicitation_action_has_action_field method method test_elicitation_action_has_action_field L142–144
− test_elicitation_action_with_content method method test_elicitation_action_with_content L146–148
− test_elicitation_request_form_shape method method test_elicitation_request_form_shape L150–157
− test_elicitation_request_url_shape method method test_elicitation_request_url_shape L159–166
− TestUnitSchemaBuilders class class TestUnitSchemaBuilders L108–138
− test_build_form_all_schema_keys method method test_build_form_all_schema_keys L109–115
− test_build_form_schema_matches_schemas_dict method method test_build_form_schema_matches_schemas_dict L117–121
− test_build_url_auto_generates_id_when_omitted method method test_build_url_auto_generates_id_when_omitted L128–132
− test_build_url_caller_supplied_id_preserved method method test_build_url_caller_supplied_id_preserved L123–126
− test_build_url_mode_and_url_set method method test_build_url_mode_and_url_set L134–138
− anyio_backend function function anyio_backend L92–93
− http_client function async_function http_client L97–102
− ASGITransport import import ASGITransport L63–63
− AVAILABLE_DAW_CLOUDS import import AVAILABLE_DAW_CLOUDS L69–69
− AVAILABLE_PLATFORMS import import AVAILABLE_PLATFORMS L69–69
− AsyncClient import import AsyncClient L63–63
− AsyncSession import import AsyncSession L65–65
− ElicitationAction import import ElicitationAction L67–67
− ElicitationRequest import import ElicitationRequest L67–67
− MCPSession import import MCPSession L78–78
− SCHEMAS import import SCHEMAS L69–69
− annotations import import annotations L55–55
− app import import app L68–68
− asyncio import import asyncio L57–57
− build_form_elicitation import import build_form_elicitation L69–69
− build_url_elicitation import import build_url_elicitation L69–69
− create_pending_elicitation import import create_pending_elicitation L78–78
− create_session import import create_session L78–78
− daw_cloud_connect_url import import daw_cloud_connect_url L69–69
− delete_session import import delete_session L78–78
− get_type_hints import import get_type_hints L59–59
− oauth_connect_url import import oauth_connect_url L69–69
− patch import import patch L64–64
− push_to_session import import push_to_session L78–78
− pytest import import pytest L61–61
− pytest_asyncio import import pytest_asyncio L62–62
− resolve_elicitation import import resolve_elicitation L78–78
− time import import time L58–58
~ musehub/db/musehub_models.py .py 1 symbol modified
~ musehub/mcp/elicitation.py .py 16 symbols removed, 3 symbols modified
− AVAILABLE_DAWS variable variable AVAILABLE_DAWS L301–301
− AVAILABLE_DAW_CLOUDS variable variable AVAILABLE_DAW_CLOUDS L303–303
− AVAILABLE_GENRES variable variable AVAILABLE_GENRES L300–300
− AVAILABLE_KEYS variable variable AVAILABLE_KEYS L298–298
− AVAILABLE_MOODS variable variable AVAILABLE_MOODS L299–299
− AVAILABLE_PLATFORMS variable variable AVAILABLE_PLATFORMS L302–302
− _DAWS variable variable _DAWS L48–51
− _DAW_CLOUDS variable variable _DAW_CLOUDS L58–60
− _GENRES variable variable _GENRES L43–46
− _KEYS variable variable _KEYS L31–36
− _MOODS variable variable _MOODS L38–41
− _PLATFORMS variable variable _PLATFORMS L53–56
− _TIME_SIGNATURES variable variable _TIME_SIGNATURES L68–70
− build_url_elicitation function function build_url_elicitation L338–364
− daw_cloud_connect_url function function daw_cloud_connect_url L384–388
− oauth_connect_url function function oauth_connect_url L367–381
~ musehub/models/musehub.py .py 4 symbols removed, 5 symbols modified
− EmotionDiffResponse class class EmotionDiffResponse L2437–2468
− TimelineEmotionEvent class class TimelineEmotionEvent L1485–1499
− TimelineSectionEvent class class TimelineSectionEvent L1502–1514
− TimelineTrackEvent class class TimelineTrackEvent L1517–1529
~ musehub/services/musehub_divergence.py .py 4 symbols removed, 4 symbols modified
− _SECTION_KEYWORDS variable variable _SECTION_KEYWORDS L59–59
− _SECTION_RE variable variable _SECTION_RE L62–65
− extract_affected_sections function function extract_affected_sections L439–461
− re import import re L33–33
~ musehub/templates/musehub/pages/blame.html .html 2 symbols removed
− div#blame2-tooltip section div#blame2-tooltip L361–361
− form@289 section form@289 L289–319
~ musehub/templates/musehub/pages/blob.html .html 1 symbol removed, 2 symbols modified
− div#midi-player section div#midi-player L118–126
← Older Oldest on dev
All commits
Newer → Latest on dev

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:98945fd05d7a137f0a0da079ce97f719228702d9177e28edc4c44af62075d9ff --body "your comment"