Repository navigation
chore: guard generated trees against drift with a wrapper and a commit hook - #254
Merged
Merged
Conversation
…t hook skills-catalog/ drifted on #252 and was only caught by CI. The repo's .githooks/pre-commit never runs here because a global core.hooksPath overrides it, so a git hook alone would not have helped. - add utils/regen-generated.sh: sync -> port -> catalog in dependency order, with --check that reports every stage - add --check to port-session-skills.py - add a Claude PreToolUse hook that blocks `git commit` while a generated tree is stale - point .githooks/pre-commit at the wrapper - add tests/ci/test-generated-drift.sh and document it in CLAUDE.md Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_018KC1pVf43ZKMjSfWwkMMnx
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
skills-catalog/drifted on fix(session): run inbox triage as its own step before the ship prompt in session-end #252 and was only caught by CI..githooks/pre-commitnever runs on a clone with a globalcore.hooksPath, so a git hook alone would not have helped.utils/regen-generated.sh: runssync.sh->port-session-skills.py->skills-catalog.pyin dependency order.--checkreports drift in all three without writing.--checktoport-session-skills.py..claude/hooks/check-generated-drift.sh(PreToolUseon Bash), which blocksgit commitwhile a generated tree is stale. It needs no per-clone setup..githooks/pre-commitat the wrapper and document it inCLAUDE.md(new Generated trees section).Test plan
tests/ci/test-generated-drift.sh: 25 cases, using stub generators in a sandbox repotests/opencode/test-session-port.sh: 74/74 (the porter's--checkparsing runs only when executed as a script)utils/regen-generated.sh --check: cleanbash test.sh: all pass except 2 unrelated permission-hook cases that also failed on masterKnown limits: the hook is a text match, so a quoted
git commitis a false positive while drift exists; port--checkdoes not flag orphaned files.🤖 Generated with Claude Code
https://claude.ai/code/session_018KC1pVf43ZKMjSfWwkMMnx