Skip to content

fix(D-1): robust git-hook registration + lefthook support (2.3.0)#57

Merged
jurby merged 3 commits into
mainfrom
defect/D-1-hook-registration
Jun 3, 2026
Merged

fix(D-1): robust git-hook registration + lefthook support (2.3.0)#57
jurby merged 3 commits into
mainfrom
defect/D-1-hook-registration

Conversation

@jurby
Copy link
Copy Markdown
Contributor

@jurby jurby commented Jun 3, 2026

Fixes D-1 — git hooks could silently stop firing after a plugin update or under lefthook, so the post-commit local_evidence.py emitter never ran and contribution evidence stopped landing on items.

Supersedes #56 (same work; branch renamed to defect/D-1-… so it satisfies the EDPA branch-naming convention this very PR strengthens — dogfooding).

Root causes

  1. install_hooks used a blunt not dst.exists() guard → if a slot was already held (typically by lefthook, which owns .git/hooks/), EDPA silently skipped its hook.
  2. update_engine.sh re-vendored the engine on update but never re-registered hooks.

Fix

  • Robust install_hooksEDPA-MANAGED-HOOK sentinel; per slot: install if missing, refresh if EDPA-owned, never clobber a foreign hook (warns + prints the chain-in line).
  • lefthook support — detects lefthook.yml, prints a paste-ready snippet (use_stdin: true on pre-push, or lefthook hangs) instead of touching .git/hooks/.
  • Self-healupdate_engine.sh re-registers EDPA hooks after a version bump when the project already uses them.
  • New --check-hooks (read-only doctor) + --refresh-hooks (register-only); install.sh → thin delegator (drops core.hooksPath); removed dead generic pre-commit; TTY-aware ANSI.

Docs / web

RUNBOOK §1+§6, quick-start, skills/setup/SKILL.md, playbook.md, README ×2, E2E-TEST-PLAN; website setup/guide/playbook/methodology (CZ + EN).

Tests

New tests/test_project_setup_hooks.py + self-heal cases in tests/test_update_engine_hook.py. Full suite: 618 passed.

Release

Version 2.3.0 (plugin.json + web/package.json + CHANGELOG). Web deploy + gh release after merge.

🤖 Generated with Claude Code

jurby and others added 2 commits June 3, 2026 18:18
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>
Both workflows called `python3 .claude/edpa/scripts/sync.py` — a stale path to a script removed with the V1 GitHub-Projects flow in 2.0.0. They have failed on every release since (v2.1.8–2.2.1) and only added red noise; my D-1 backlog item re-triggered them via the .edpa/backlog/** path filter.

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
@jurby jurby merged commit 96d3402 into main Jun 3, 2026
1 check passed
@jurby jurby deleted the defect/D-1-hook-registration branch June 3, 2026 17:49
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.

1 participant