feat(hooks): robust git-hook registration + lefthook support (2.3.0)#56
Closed
jurby wants to merge 1 commit into
Closed
feat(hooks): robust git-hook registration + lefthook support (2.3.0)#56jurby wants to merge 1 commit into
jurby wants to merge 1 commit into
Conversation
Git hooks could silently stop firing after a plugin update or under lefthook — most visibly the post-commit local_evidence.py emitter, so contribution evidence stopped landing on items. install_hooks now marks hooks with an EDPA-MANAGED-HOOK sentinel and decides per slot (install / refresh / never-clobber-foreign), detects lefthook and prints a paste-ready snippet (use_stdin:true on pre-push), and update_engine.sh self-heals registration after a version bump. Adds --check-hooks and --refresh-hooks, reconciles the stale core.hooksPath installer into a thin delegator, removes the dead generic pre-commit, and makes ANSI TTY-aware. Docs + web (CZ/EN) updated; new test_project_setup_hooks.py + self-heal tests (618 passed). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
Contributor
Author
|
Superseded by #57 — same work, branch renamed to |
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.
Problem
Git hooks could silently stop firing — most visibly the
post-commitlocal_evidence.pyemitter, so contribution evidence stopped landing on items (the reported bug). Two root causes:install_hooksused a bluntnot dst.exists()guard — if a slot was already occupied (typically by lefthook, which owns.git/hooks/), EDPA silently skipped its hook.update_engine.shre-vendored the engine but never re-registered hooks; the copies in.git/hooks/went stale / missing.Fix
install_hooks— hooks carry anEDPA-MANAGED-HOOKsentinel; per slot: install when missing, refresh when EDPA-owned, never clobber a foreign hook (warns + prints the exact chain-in line).lefthook.ymland prints a paste-ready snippet (withuse_stdin: trueonpre-push, or lefthook hangs) instead of touching.git/hooks/. EDPA never edits the user's lefthook config.update_engine.shre-registers EDPA hooks after a version bump when the project already uses them (opt-out repos untouched).--check-hooks(read-only doctor) and--refresh-hooks(register-only) flags.scripts/hooks/install.sh→ thin delegator (drops the conflictingcore.hooksPath); removed dead genericpre-commit; ANSI now TTY-aware.Docs / web
RUNBOOK §1+§6, quick-start,
skills/setup/SKILL.md, playbook.md, README ×2, E2E-TEST-PLAN, plus website setup/guide/playbook/methodology (CZ + EN). Documents the lefthook snippet, foreign-hook behavior, and--check-hooksverification.Tests
New
tests/test_project_setup_hooks.py(fresh install, refresh, foreign-skip, lefthook snippet validity) + self-heal cases intests/test_update_engine_hook.py. Full suite: 618 passed.Release
Version bumped to 2.3.0 (plugin.json + web/package.json + CHANGELOG). Web deploy +
gh releaseto follow after merge.🤖 Generated with Claude Code