gabriel / muse public
refactor BREAKING dev
AI Agent gabriel · 157 days ago · Apr 19, 2026 · Diff

refactor: decompose hub.py (5983 lines) into hub/ package

Split the monolithic hub.py into 10 focused domain modules: - hub/_core.py — shared TypedDicts, constants, helper functions - hub/__init__.py — thin register() that delegates to domain registrars - hub/connection.py — connect, disconnect, status, ping - hub/repos.py — repo create/delete/update/list/read/transfer - hub/proposals.py — proposal list/read/create/merge/review/comment - hub/issues.py — issue create/update/read/list/close/comment/assign/label - hub/labels.py — label create/list/update/delete - hub/collaborators.py — collaborator list/invite/update/remove - hub/webhooks.py — webhook create/list/delete + deliveries - hub/releases.py — release list/create/read/delete + assets - hub/users.py — user read/update + topics + forks

Largest file is now issues.py at 1086 lines vs 5983 before. Public interface unchanged: app.py imports hub and calls hub.register().

sha256:3ed24c284c43a8d52c533177946166d0c800198c53f2d09c7fac9e3fb6ed0e5e sha
+109 −61 symbols
sha256:3dce5cfa104ae5112c98bf39c0317910327e173b7e682848859c57194661c6a8 snapshot
+109
symbols added
−61
symbols removed
0
dead code introduced
Semantic Changes 170 symbols
~ muse/cli/commands/hub/__init__.py .py 12 symbols added
+ annotations import import annotations L22–22
+ argparse import import argparse L24–24
+ collaborators import import collaborators L26–26
+ connection import import connection L26–26
+ issues import import issues L26–26
+ labels import import labels L26–26
+ proposals import import proposals L26–26
+ releases import import releases L26–26
+ repos import import repos L26–26
+ users import import users L26–26
+ webhooks import import webhooks L26–26
+ register function function register L39–58
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L137–262
+ run_collaborator_invite function function run_collaborator_invite L38–73 ← moved from muse/cli/commands/hub/_core.py
+ run_collaborator_list function function run_collaborator_list L5–36 ← moved from muse/cli/commands/hub/_core.py
+ run_collaborator_remove function function run_collaborator_remove L108–134 ← moved from muse/cli/commands/hub/_core.py
+ run_collaborator_update_permission function function run_collaborator_update_permission L75–106 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/connection.py .py 8 symbols added
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L369–466
+ run_connect function function run_connect L5–109 ← moved from muse/cli/commands/hub/_core.py
+ run_disconnect function function run_disconnect L208–284 ← moved from muse/cli/commands/hub/_core.py
+ run_ping function function run_ping L286–366 ← moved from muse/cli/commands/hub/_core.py
+ run_status function function run_status L111–206 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/issues.py .py 15 symbols added
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L635–1085
+ run_issue_assign function function run_issue_assign L538–581 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_close function function run_issue_close L317–350 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_comment function function run_issue_comment L387–437 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_comment_delete function function run_issue_comment_delete L439–477 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_comment_list function function run_issue_comment_list L479–536 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_create function function run_issue_create L5–95 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_label function function run_issue_label L583–632 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_list function function run_issue_list L243–315 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_read function function run_issue_read L205–241 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_reopen function function run_issue_reopen L352–385 ← moved from muse/cli/commands/hub/_core.py
+ run_issue_update function function run_issue_update L97–203 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/labels.py .py 10 symbols added
+ _lookup_label_by_name function function _lookup_label_by_name L19–38 ← moved from muse/cli/commands/hub/_core.py
+ _validate_hex_color function function _validate_hex_color L5–17 ← moved from muse/cli/commands/hub/_core.py
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L293–452
+ run_label_create function function run_label_create L40–102 ← moved from muse/cli/commands/hub/_core.py
+ run_label_delete function function run_label_delete L245–290 ← moved from muse/cli/commands/hub/_core.py
+ run_label_list function function run_label_list L104–147 ← moved from muse/cli/commands/hub/_core.py
+ run_label_update function function run_label_update L149–243 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/proposals.py .py 14 symbols added
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L577–874
+ run_proposal_comment_create function function run_proposal_comment_create L510–543 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_comment_list function function run_proposal_comment_list L345–388 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_create function function run_proposal_create L144–264 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_list function function run_proposal_list L5–67 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_merge function function run_proposal_merge L266–343 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_read function function run_proposal_read L69–142 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_review_list function function run_proposal_review_list L467–508 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_review_submit function function run_proposal_review_submit L545–574 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_reviewer_remove function function run_proposal_reviewer_remove L429–465 ← moved from muse/cli/commands/hub/_core.py
+ run_proposal_reviewer_request function function run_proposal_reviewer_request L390–427 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/releases.py .py 11 symbols added
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L261–413
+ run_release_asset_attach function function run_release_asset_attach L187–228 ← moved from muse/cli/commands/hub/_core.py
+ run_release_asset_delete function function run_release_asset_delete L230–258 ← moved from muse/cli/commands/hub/_core.py
+ run_release_asset_list function function run_release_asset_list L149–185 ← moved from muse/cli/commands/hub/_core.py
+ run_release_create function function run_release_create L52–91 ← moved from muse/cli/commands/hub/_core.py
+ run_release_delete function function run_release_delete L124–147 ← moved from muse/cli/commands/hub/_core.py
+ run_release_list function function run_release_list L5–50 ← moved from muse/cli/commands/hub/_core.py
+ run_release_read function function run_release_read L93–122 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/repos.py .py 11 symbols added
+ _resolve_hub_override function function _resolve_hub_override L519–541 ← moved from muse/cli/commands/hub/_core.py
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L544–773
+ run_repo_create function function run_repo_create L5–172 ← moved from muse/cli/commands/hub/_core.py
+ run_repo_delete function function run_repo_delete L174–226 ← moved from muse/cli/commands/hub/_core.py
+ run_repo_list function function run_repo_list L277–381 ← moved from muse/cli/commands/hub/_core.py
+ run_repo_read function function run_repo_read L383–483 ← moved from muse/cli/commands/hub/_core.py
+ run_repo_transfer_ownership function function run_repo_transfer_ownership L485–517 ← moved from muse/cli/commands/hub/_core.py
+ run_repo_update function function run_repo_update L228–275 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/users.py .py 10 symbols added
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L201–355
+ run_fork_create function function run_fork_create L137–165 ← moved from muse/cli/commands/hub/_core.py
+ run_fork_list function function run_fork_list L167–198 ← moved from muse/cli/commands/hub/_core.py
+ run_topic_list function function run_topic_list L71–103 ← moved from muse/cli/commands/hub/_core.py
+ run_topic_set function function run_topic_set L105–135 ← moved from muse/cli/commands/hub/_core.py
+ run_user_read function function run_user_read L5–32 ← moved from muse/cli/commands/hub/_core.py
+ run_user_update function function run_user_update L34–69 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/webhooks.py .py 9 symbols added
+ *:_core import import *:_core L3–3
+ annotations import import annotations L1–1
+ argparse import import argparse L2–2
+ register function function register L183–329
+ run_webhook_create function function run_webhook_create L5–47 ← moved from muse/cli/commands/hub/_core.py
+ run_webhook_delete function function run_webhook_delete L83–109 ← moved from muse/cli/commands/hub/_core.py
+ run_webhook_delivery_list function function run_webhook_delivery_list L111–152 ← moved from muse/cli/commands/hub/_core.py
+ run_webhook_list function function run_webhook_list L49–81 ← moved from muse/cli/commands/hub/_core.py
+ run_webhook_redeliver function function run_webhook_redeliver L154–180 ← moved from muse/cli/commands/hub/_core.py
~ muse/cli/commands/hub/_core.py .py moved from muse/cli/commands/hub.py; 1 added, 61 removed
_lookup_label_by_name function function _lookup_label_by_name L4466–4485 → moved to muse/cli/commands/hub/labels.py
_resolve_hub_override function function _resolve_hub_override L3783–3805 → moved to muse/cli/commands/hub/repos.py
_validate_hex_color function function _validate_hex_color L4451–4463 → moved to muse/cli/commands/hub/labels.py
register function function register L909–2732
run_collaborator_invite function function run_collaborator_invite L4781–4816 → moved to muse/cli/commands/hub/collaborators.py
run_collaborator_list function function run_collaborator_list L4747–4778 → moved to muse/cli/commands/hub/collaborators.py
run_collaborator_remove function function run_collaborator_remove L4853–4879 → moved to muse/cli/commands/hub/collaborators.py
run_collaborator_update_permission function function run_collaborator_update_permission L4819–4850 → moved to muse/cli/commands/hub/collaborators.py
run_connect function function run_connect L5619–5723 → moved to muse/cli/commands/hub/connection.py
run_disconnect function function run_disconnect L5824–5900 → moved to muse/cli/commands/hub/connection.py
run_fork_create function function run_fork_create L5404–5432 → moved to muse/cli/commands/hub/users.py
run_fork_list function function run_fork_list L5435–5466 → moved to muse/cli/commands/hub/users.py
run_issue_assign function function run_issue_assign L4350–4393 → moved to muse/cli/commands/hub/issues.py
run_issue_close function function run_issue_close L4124–4157 → moved to muse/cli/commands/hub/issues.py
run_issue_comment function function run_issue_comment L4196–4246 → moved to muse/cli/commands/hub/issues.py
run_issue_comment_delete function function run_issue_comment_delete L4249–4287 → moved to muse/cli/commands/hub/issues.py
run_issue_comment_list function function run_issue_comment_list L4290–4347 → moved to muse/cli/commands/hub/issues.py
run_issue_create function function run_issue_create L3808–3898 → moved to muse/cli/commands/hub/issues.py
run_issue_label function function run_issue_label L4396–4445 → moved to muse/cli/commands/hub/issues.py
run_issue_list function function run_issue_list L4049–4121 → moved to muse/cli/commands/hub/issues.py
run_issue_read function function run_issue_read L4010–4046 → moved to muse/cli/commands/hub/issues.py
run_issue_reopen function function run_issue_reopen L4160–4193 → moved to muse/cli/commands/hub/issues.py
run_issue_update function function run_issue_update L3901–4007 → moved to muse/cli/commands/hub/issues.py
run_label_create function function run_label_create L4488–4550 → moved to muse/cli/commands/hub/labels.py
run_label_delete function function run_label_delete L4696–4741 → moved to muse/cli/commands/hub/labels.py
run_label_list function function run_label_list L4553–4596 → moved to muse/cli/commands/hub/labels.py
run_label_update function function run_label_update L4599–4693 → moved to muse/cli/commands/hub/labels.py
run_ping function function run_ping L5903–5983 → moved to muse/cli/commands/hub/connection.py
run_proposal_comment_create function function run_proposal_comment_create L5548–5581 → moved to muse/cli/commands/hub/proposals.py
run_proposal_comment_list function function run_proposal_comment_list L3085–3128 → moved to muse/cli/commands/hub/proposals.py
run_proposal_create function function run_proposal_create L2879–2999 → moved to muse/cli/commands/hub/proposals.py
run_proposal_list function function run_proposal_list L2738–2800 → moved to muse/cli/commands/hub/proposals.py
run_proposal_merge function function run_proposal_merge L3002–3079 → moved to muse/cli/commands/hub/proposals.py
run_proposal_read function function run_proposal_read L2803–2876 → moved to muse/cli/commands/hub/proposals.py
run_proposal_review_list function function run_proposal_review_list L3210–3251 → moved to muse/cli/commands/hub/proposals.py
run_proposal_review_submit function function run_proposal_review_submit L5584–5613 → moved to muse/cli/commands/hub/proposals.py
run_proposal_reviewer_remove function function run_proposal_reviewer_remove L3171–3207 → moved to muse/cli/commands/hub/proposals.py
run_proposal_reviewer_request function function run_proposal_reviewer_request L3131–3168 → moved to muse/cli/commands/hub/proposals.py
run_release_asset_attach function function run_release_asset_attach L5184–5225 → moved to muse/cli/commands/hub/releases.py
run_release_asset_delete function function run_release_asset_delete L5228–5256 → moved to muse/cli/commands/hub/releases.py
run_release_asset_list function function run_release_asset_list L5145–5181 → moved to muse/cli/commands/hub/releases.py
run_release_create function function run_release_create L5045–5084 → moved to muse/cli/commands/hub/releases.py
run_release_delete function function run_release_delete L5119–5142 → moved to muse/cli/commands/hub/releases.py
run_release_list function function run_release_list L4997–5042 → moved to muse/cli/commands/hub/releases.py
run_release_read function function run_release_read L5087–5116 → moved to muse/cli/commands/hub/releases.py
run_repo_create function function run_repo_create L3257–3424 → moved to muse/cli/commands/hub/repos.py
run_repo_delete function function run_repo_delete L3430–3482 → moved to muse/cli/commands/hub/repos.py
run_repo_list function function run_repo_list L3535–3639 → moved to muse/cli/commands/hub/repos.py
run_repo_read function function run_repo_read L3642–3742 → moved to muse/cli/commands/hub/repos.py
run_repo_transfer_ownership function function run_repo_transfer_ownership L3745–3777 → moved to muse/cli/commands/hub/repos.py
run_repo_update function function run_repo_update L3485–3532 → moved to muse/cli/commands/hub/repos.py
run_status function function run_status L5726–5821 → moved to muse/cli/commands/hub/connection.py
run_topic_list function function run_topic_list L5333–5365 → moved to muse/cli/commands/hub/users.py
run_topic_set function function run_topic_set L5368–5398 → moved to muse/cli/commands/hub/users.py
run_user_read function function run_user_read L5262–5289 → moved to muse/cli/commands/hub/users.py
run_user_update function function run_user_update L5292–5327 → moved to muse/cli/commands/hub/users.py
run_webhook_create function function run_webhook_create L4885–4927 → moved to muse/cli/commands/hub/webhooks.py
run_webhook_delete function function run_webhook_delete L4965–4991 → moved to muse/cli/commands/hub/webhooks.py
run_webhook_delivery_list function function run_webhook_delivery_list L5472–5513 → moved to muse/cli/commands/hub/webhooks.py
run_webhook_list function function run_webhook_list L4930–4962 → moved to muse/cli/commands/hub/webhooks.py
run_webhook_redeliver function function run_webhook_redeliver L5516–5542 → moved to muse/cli/commands/hub/webhooks.py
+ __all__ variable variable __all__ L909–909
← 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:3ed24c284c43a8d52c533177946166d0c800198c53f2d09c7fac9e3fb6ed0e5e --body "your comment"