fix(cc034): install/uninstall-hooks idempotency by basename after repo rename#53
Merged
Merged
Conversation
Full-path comparison in the jq `_present` checks caused duplicate hook
entries when the repo was renamed or moved. Switch all six checks to
basename comparison via `split("/") | last`, add a path-refresh pass
that updates stale command paths in-place, and apply the same fix to
the statusLine bash check. Add regression test
`test_install_hooks_updates_stale_paths_after_rename` (30/30 pass).
Closes CC-034.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
Add parent-dir == "scripts" guard to all six jq basename checks and the statusLine refresh so unrelated tools with the same hook filename are never overwritten. Add regression test test_install_hooks_preserves_unrelated_same_basename_hook (31/31 pass). Addresses qa-tester block from PR-gate round 1. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
…name Switch all four hook-group selectors in uninstall-hooks.sh from exact-path to basename + scripts/ parent-dir match, so uninstalling after a repo rename correctly removes stale entries. Retain exact-path removal for legacy old_stop hooks/ path. Add regression test (32/32 pass). Completes CC-034 requirement item #4. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2 tasks
screenleon
added a commit
that referenced
this pull request
May 16, 2026
…/028/034 (#60) Index row CC-029 was still 🔵 active even though PR #57 landed it 2026-05-15. Promote to ✅ closed and add Outcome + See pointers. Backfill missing **See**: pr:#NN stubs for previously-closed entries CC-027/CC-028/CC-034 that already pointed at PR #54/#55/#53 in their Refs column but lacked the body-side See stub required by pm/scripts/validate.sh E-CLOSURE-NO-SEE. Pure data drift fix; no validator or runtime change. Remaining baseline noise (CC-035 E-INDEX-MISMATCH, CC-038 E-AREA-ENUM + E-REFS-PREFIX) is tracked separately and intentionally out of scope here. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2 tasks
screenleon
added a commit
that referenced
this pull request
May 16, 2026
CC-030 strengthened closure-date rule (heading marker OR **Outcome**: line only) exposes drift: CC-027 and CC-028 Outcome lines lacked a date token (previously masked by Source-line dates), and CC-034 had no Outcome line at all. Add `2026-05-15 —` prefix to existing CC-027 / CC-028 Outcome lines. Add a new Outcome line for CC-034 (dated 2026-05-15, summarizing PR #53 landing). No semantic change to history; only date metadata needed by the strengthened validator. Verified against the strengthened validator (from feat/cc030 branch): emits only the pre-existing 3 token set (E-AREA-ENUM, E-REFS-PREFIX, E-INDEX-MISMATCH). No new errors introduced. Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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
install-hooks.shidempotency checks from full-path to basename +scripts/parent-dir comparison, preventing duplicate hook entries after a repo rename/move (e.g.,claude-config→pm-dispatch)install-hooks.shthat updates stale command paths in-place (same basename,scripts/parent) before the append-if-absent stepscripts/guard touninstall-hooks.shso stale managed paths are correctly removed after a renamePR-Gate
Standard tier (critic, qa-tester, architecture-reviewer): GO
Advisory (not blocking): the
basename + scripts/ parentmanaged-hook heuristic does not protect against an unrelated tool whose hook also lives under ascripts/subdirectory with the same filename. This collision path is uncommon (requires another tool to adopt our exact filenames and layout), and is accepted as a known tradeoff. Tracked in BACKLOG as CC-035 for future tightening if needed.Test plan
bash scripts/test-install.sh→ 32 passed, 0 failedbash scripts/test-install.sh --filter install-hooks-updates-stale-paths-after-rename→ PASSbash scripts/test-install.sh --filter install-hooks-preserves-unrelated-same-basename-hook→ PASSbash scripts/test-install.sh --filter install-hooks-uninstall-stale-paths-after-rename→ PASS🤖 Generated with Claude Code