feat(#192): Phase 4 — discoverability nudges at clone/status time
Hooks that are declared but never installed are invisible unless someone thinks to run `muse hooks status`. This phase surfaces that gap at the two moments it's most likely to matter: right after cloning a repo that ships .musehooks.toml, and any time `muse status` runs afterward (covers clones that predate this feature, or where install was skipped).
Added: - muse/core/hooks.py::install_notice() — shared one-line nudge, "None" for every state except "defined_not_installed". Best-effort: swallows a malformed .musehooks.toml rather than erroring here (that's surfaced by `muse hooks status`/`list` directly, not by an incidental notice). - muse/cli/commands/clone.py: prints the notice to stderr right after working-tree restore. A fresh clone can never have hooks installed yet (install state is deliberately local-only, never cloned) -- so if the repo declares any, this is the earliest possible moment to say so. - muse/cli/commands/status.py: prints the same notice to stderr, unconditionally before the JSON/text output split, so it fires identically for both `muse status` and `muse status --json` (stdout stays clean for JSON consumers either way).
Tests (TDD, red confirmed before implementation): - tests/test_hooks_clone_status_notice.py (9 tests): install_notice() unit-tested directly against a real filesystem (not_defined/ defined_not_installed/installed); muse status prints/omits the notice correctly in both text and --json modes; muse clone prints the notice when the cloned manifest includes .musehooks.toml (via a patched _restore_working_tree that writes the file, following this repo's existing clone-test mocking pattern) and stays silent when it doesn't. - Manually smoke-tested against a real disposable repo via muse-dev: `muse status` shows the nudge before install, silent after.
Full regression run: tests/test_cmd_clone_hardening.py + 3 related clone test files (59 tests) and 7 status test files (174 tests) all still green. 99/99 across all hooks test files + tests/test_app.py.
Co-Authored-By: Claude Sonnet 5 <[email protected]>
Semantic Changes
34 symbols
Files Changed
+1
~3
1183 in snapshot
0 comments
muse hub commit comment sha256:b5a46a9923166b1435c3d7549801a23fbf281f8f78c766142e923b35c23bdc13 --body "your comment"
No comments yet. Be the first to start the discussion.