gabriel / musehub public
refactor main #47 / 70

refactor: domain bleed purge — remove generation/LLM/DAW code from MuseHub

MuseHub is a Git-like hosting platform for Muse VCS repos. This commit removes ~1,500 lines of dead code that bled in from the mono-repo era when MuseHub shared a codebase with music-generation and LLM backends.

Deleted files (11): - contracts/llm_types.py — OpenAI/Anthropic/OpenRouter wire types (367 lines) - contracts/generation_types.py — GenerationContext, CompositionContext (83 lines) - contracts/project_types.py — full DAW project state types (101 lines) - protocol/emitter.py — SSE emitter, never wired to any route - protocol/validation.py — stream ordering guard, only used by emitter - protocol/schemas/__init__.py + schemas/project.py — never imported outside

Modified files: - protocol/events.py: strip to MuseEvent + MCPMessageEvent + MCPPingEvent only - protocol/registry.py: EVENT_REGISTRY reduced from 22 entries to 2 - protocol/hash.py: remove enum hashing (_enum_definitions_canonical removed) - protocol/endpoints.py: remove enums field from /protocol/schema.json - protocol/responses.py: remove EnumDefinitionMap / enums field - protocol/__init__.py: remove re-exports of deleted emitter and MaestroEvent - contracts/json_types.py: prune 15 generation-only TypedDicts and EnumDefinitionMap - pyproject.toml: remove now-obsolete mypy overrides block

New files: - musehub/mcp/server.py: MuseMCPServer + ToolCallResult (enables test_mcp_musehub.py) - musehub/mcp/tools/__init__.py: add MCP_TOOLS + TOOL_CATEGORIES exports - musehub/py.typed: declare musehub as a typed package - tools/typing_audit.py: updated default dirs to musehub/ + tests/

Documentation: - docs/reference/type-contracts.md: full rewrite — removes deleted sections (Generation Context, LLM Wire Types, Project State, Core Domain Stubs, 20+ generation events), updates Entity Hierarchy and all 9 Mermaid diagrams

mypy: Success — 0 violations across 112 source files

G Gabriel Cardona <gabriel@tellurstori.com> · 6d ago Mar 17, 2026 · c4b6737d · parent 51c9a460
21
files changed
379
files in snapshot
Files Changed 379 in snapshot
+3 ~11 −7
+ musehub/py.typed .typed
musehub/contracts/generation_types.py .py
musehub/contracts/llm_types.py .py
musehub/contracts/project_types.py .py
musehub/protocol/emitter.py .py
musehub/protocol/schemas/__init__.py .py
musehub/protocol/schemas/project.py .py
musehub/protocol/validation.py .py

0 comments

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