Skip to content

fix(kaizen): git hooks require Kaizen core behind an explicit pointer; parity test with the resolver (4.1.2) - #41

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 20, 2026

Copy link
Copy Markdown
Owner

Summary

Finding #4 of the core/ops split review: the Kaizen core lookup is written twice — in the git hook templates and in the kaizen-ops resolver.

  • Kept self-contained in each: the hooks run from .githooks/ and must find core before they can import anything.
  • Hooks aligned on the resolver's stricter rule: git config kaizen.cli / $KAIZEN_CLI must point to Kaizen core (its plugin.json names kaizen); a wrong pointer is refused with its path, never replaced by the cache. Before, any existing file was run.
  • Parity test plugins/kaizen-ops/tests/parity.test.mjs: runs the hooks' node -e lookup and findCore on the same fake worlds (numeric semver order, foreign cache entries, decoy marketplace, explicit pointers right/wrong/missing, git config over env) and requires the same answer. Both templates must carry the same lookup. The resolver's sibling checkout is the one deliberate difference.
  • Kaizen 4.1.2: CHANGELOG, troubleshooting (re-install hooks to get the stricter lookup — install never overwrites), CLAUDE.md, plan DoD.

Test plan

  • node --test plugins/kaizen/tests/*.test.mjs plugins/kaizen-ops/tests/*.test.mjs → 206 pass, 0 fail
  • Parity test against the old templates: fails on the KAIZEN_CLI → non-Kaizen case (the divergence), passes with the fix
  • Parity test with TMPDIR through a symlink (macOS /var → /private/var)
  • CI: 6 jobs (Ubuntu/macOS/Windows × Node 18/22)

Generated by Claude Code

…; parity test with the resolver

The hooks accepted any file named by git config kaizen.cli or $KAIZEN_CLI; they now
check its plugin.json like the kaizen-ops resolver and refuse a wrong pointer with
its path. The lookup stays self-contained in each (hooks run before anything can be
imported); a kaizen-ops test runs both on the same fake worlds and requires the same
answer. Kaizen 4.1.2.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
Claude-Session: https://claude.ai/code/session_012iZk6aQ3fhJy4jrZhfWtaf
@Lingelo
Lingelo merged commit c95cea3 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