chore(hooks): vendor control-plane hooks from the canonical skills repo#62
Conversation
|
🔍 OpenCodeReview found 26 issue(s) in this PR.
📊 Posting Statistics:
|
9450f80 to
f4726b0
Compare
The hooks under hooks/ were a hand-maintained copy that had drifted from the skills repo (github.com/vanducng/skills) — the actual source deployed by `vd install hooks`. They diverged bidirectionally (skills had LRU caches, isGlobalScratchPath, readOnly feature resolution + the python notifier/merge-guard; this copy had a separate nearestGitBoundary home-anchor variant), risking a stale deploy whenever vd resolved its root here. Make the skills repo the single source of truth: - Vendor hooks/ verbatim from skills@<pin>; record the commit in hooks/.vendored-from. - Add scripts/sync-hooks.sh to regenerate the copy (`--ref main` to bump). - Add a hooks-drift CI job that re-vendors the pinned commit and fails on any diff, so the copy can never silently re-diverge. - Replace the three duplicate Go behavior tests with one that runs the vendored canonical suite (hooks/lib/paths.test.cjs) — behavior is owned upstream now. Drops this repo's nearestGitBoundary home-anchor variant in favor of the deployed, tested skills version (isHomeDir guard).
f4726b0 to
f37576f
Compare
Review triage
All remaining findings are in Valid upstream nits (e.g. Resolving the vendored-file threads here as not-actionable-in-this-PR. |
Why
hooks/here was a hand-maintained copy that had drifted fromgithub.com/vanducng/skills— the repovd install hooksactually deploys from. The two diverged bidirectionally: the skills copy had LRU caches,isGlobalScratchPath,readOnlyfeature resolution, and the python notifier/merge-guard hooks; this copy had a separatenearestGitBoundaryhome-anchor variant. Whenevervdresolved its root to this repo, a stale/divergent hook set could deploy.Single source of truth
The skills repo is canonical (deployed + tested). This repo now vendors it:
hooks/is vendored verbatim fromskills@bdfda7c; the commit is recorded inhooks/.vendored-from.scripts/sync-hooks.shregenerates the copy —--ref mainbumps to the latest skills, bare re-materializes the recorded pin.hooks-driftCI job re-vendors the pinned commit and fails on any diff, sohooks/can never silently re-diverge. (Pinned by SHA, so an unrelated skills change doesn't turn this repo's PRs red — bumping is an explicitsync-hooks.sh --ref main+ commit.)paths_home_anchor,paths_no_git,paths_worktree) are replaced by one that runs the vendored canonical suitehooks/lib/paths.test.cjs— behavior is owned upstream now.Tradeoff
Drops this repo's
nearestGitBoundaryhome-anchor variant in favor of the deployed, tested skills version (isHomeDirguard). If that variant is genuinely wanted, port it into the skills repo (canonical) and re-vendor — don't reintroduce a fork here.Verified
go vetclean.skills/hooks(diff -r).Supersedes the no-git fix in #60 (that copy is now replaced by the vendored skills version, which carries the same fix via #261).