Skip to content

feat(kaizen): doctor and audit report outdated git hooks; audit fix refreshes their CLI lookup (4.2.0) - #43

Merged
Lingelo merged 1 commit into
mainfrom
ccr-8ab01603-apdrcp
Oct 21, 2026
Merged

Lingelo merged 1 commit into
mainfrom
ccr-8ab01603-apdrcp

Conversation

@Lingelo

@Lingelo Lingelo commented Oct 21, 2026

Copy link
Copy Markdown
Owner

Summary

Follow-up to #41: audit fix git_hooks never overwrites a hook, so hooks installed before 4.1.2 kept a CLI lookup that runs any file named by git config kaizen.cli or $KAIZEN_CLI — and nothing reported it.

  • Detection (doctor.mjs): gitHooksState returns outdated — Kaizen hooks (they run githook <name>) whose cli=$(node -e '…') || exit 1 line differs from this version's template. kaizen doctor warns (git_hooks) even when the hooks are wired, with the fix; audit scores it warn.
  • Refresh (githooks.mjs): audit fix git_hooks replaces 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/.
  • Kaizen 4.2.0: CHANGELOG, troubleshooting (no more "delete .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 fail
  • New test with the real 4.1.1 hooks (fixtures from e89534d): doctor and audit warn → audit fix refreshes 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 alone
  • Same test against the previous scripts: fails (no warning, no refresh)
  • Test passes with CRLF fixtures (Windows checkout)
  • CI: 6 jobs (Ubuntu/macOS/Windows × Node 18/22)

Generated by Claude Code

…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
@Lingelo
Lingelo merged commit 5d6e9e5 into main Oct 21, 2026
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants