feat: implement .muse/bridge-hooks.toml pre/post hook system for git-export
- Add BridgeHook and BridgeHooks dataclasses - Add load_bridge_hooks(muse_root) — reads/validates bridge-hooks.toml - Add run_hook / run_hooks — execute hooks with cwd and MUSE_BRIDGE_* env vars - Wire pre_bridge hooks (cwd=muse_root) before sync_to_git in run_git_export - Wire post_bridge hooks (cwd=git_dir) after git_commit in run_git_export - Hoist find_repo_root to module-level import so tests can patch it - Fix test_post_bridge_hooks_run_after_commit tuple unpacking in TDD suite
Closes #55 (musehub)
sha256:2a9ffde71a16c3a44ffa98f5cad6f0fda85f82782c0d77f3a6d1653e952bebd1
sha
+43
~1
symbols
sha256:dc90726cc2ca193ecfc13b1c911a6a832ee55b3b8ee7692f5934d54965714e8f
snapshot
+43
symbols added
~1
symbol modified
0
dead code introduced
Semantic Changes
44 symbols
+
test_blocking_pre_hook_failure_aborts_export
method
method test_blocking_pre_hook_failure_aborts_export L567–601
+
test_no_hooks_file_export_runs_normally
method
method test_no_hooks_file_export_runs_normally L651–677
+
test_post_bridge_hooks_run_after_commit
method
method test_post_bridge_hooks_run_after_commit L417–475
+
test_post_bridge_hooks_run_in_git_dir
method
method test_post_bridge_hooks_run_in_git_dir L477–520
+
test_pre_bridge_hooks_run_before_sync
method
method test_pre_bridge_hooks_run_before_sync L361–415
+
test_pre_bridge_hooks_run_in_muse_root
method
method test_pre_bridge_hooks_run_in_muse_root L522–565
+
test_invalid_on_fail_value_raises_user_error
method
method test_invalid_on_fail_value_raises_user_error L127–139
+
test_missing_run_field_raises_user_error
method
method test_missing_run_field_raises_user_error L141–153
+
test_returns_empty_hooks_when_file_missing
method
method test_returns_empty_hooks_when_file_missing L50–57
+
test_returns_empty_sections_when_section_missing
method
method test_returns_empty_sections_when_section_missing L100–114
+
test_block_hook_raises_on_nonzero_exit
method
method test_block_hook_raises_on_nonzero_exit L204–215
+
test_warn_hook_does_not_raise_on_nonzero_exit
method
method test_warn_hook_does_not_raise_on_nonzero_exit L217–234
+
test_block_failure_stops_subsequent_hooks
method
method test_block_failure_stops_subsequent_hooks L274–297
+
test_warn_failure_continues_to_next_hook
method
method test_warn_failure_continues_to_next_hook L299–318
0 comments
To add a comment, use the Muse CLI:
muse hub commit comment sha256:2a9ffde71a16c3a44ffa98f5cad6f0fda85f82782c0d77f3a6d1653e952bebd1 --body "your comment"
No comments yet. Be the first to start the discussion.