Repository navigation
feat(kaizen): doctor and audit report outdated git hooks; audit fix refreshes their CLI lookup (4.2.0) - #43
Merged
Merged
Conversation
…efreshes their CLI lookup (4.2.0) Install never overwrites a hook, so hooks installed before 4.1.2 kept a lookup that runs any file named by kaizen.cli or $KAIZEN_CLI, silently. doctor and audit now warn on a Kaizen hook whose lookup line differs from the template, and audit fix git_hooks replaces that line only, keeping team additions and line endings; hooks that are not Kaizen's are never touched. Co-Authored-By: Claude Opus 5.5 <[email protected]> Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Follow-up to #41:
audit fix git_hooksnever overwrites a hook, so hooks installed before 4.1.2 kept a CLI lookup that runs any file named bygit config kaizen.clior$KAIZEN_CLI— and nothing reported it.doctor.mjs):gitHooksStatereturnsoutdated— Kaizen hooks (they rungithook <name>) whosecli=$(node -e '…') || exit 1line differs from this version's template.kaizen doctorwarns (git_hooks) even when the hooks are wired, with the fix;auditscores itwarn.githooks.mjs):audit fix git_hooksreplaces that one line in place. Everything else in the hook is kept (lines the team added, CRLF endings); a hook that is not Kaizen's is never touched; idempotent. The result says to commit.githooks/..githooks/and reinstall"), audit reference, CLAUDE.md.Test plan
node --test plugins/kaizen/tests/*.test.mjs plugins/kaizen-ops/tests/*.test.mjs→ 213 pass, 0 faile89534d): doctor and audit warn →audit fixrefreshes both lookups, keeps a team line and CRLF → doctor/audit ok → second run writes nothing → a non-Kaizen hook carrying the old line is left aloneGenerated by Claude Code