Skip to content

feat(guardrails): install the commit-msg entry as a git config hook under an includeIf, from git 2.54 - #11082

Closed
melodic-automation-lanes[bot] wants to merge 3 commits into
mainfrom
work-resolve-issue/issue-9775-40964361097-1
Closed

melodic-automation-lanes[bot] wants to merge 3 commits into
mainfrom
work-resolve-issue/issue-9775-40964361097-1

Conversation

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor

Closes #9775

Summary

Opened by the work-resolve-issue lane. The run's own summary:

The shared git-hook installer gains a config-hook --include-if <condition> action. It writes a stable copy of each commit-msg entry and an include file holding one \[hook "<plugin>-<entry>"\] block under $XDG_CONFIG_HOME/git/checks/<plugin>/ (default ~/.config/git/checks/<plugin>/), and returns the global includeIf.<condition>.path line as a decision. /guardrails:setup apply install-git-hooks scope=user routes to a new context doc covering the 2.54 floor, the location, the friendly name guardrails-commit-msg-convention, and checks.skipmissing as the only skip, following the recorded owner decision (no env-var or hook.<name>.enabled=false bypass). verify now reports a config-hook install by its stable copy, and reports missing when the repository disables the hook or overrides its command.

Not verified

  • lib/git-hooks/install.test.mjs was not run: this lane cannot run node or the test suites; the PR's CI runs them (install.test.sh), including the git >= 2.54 and lefthook-gated cases
  • scripts/check-changelog-fragments.sh --check-required origin/main was not run with that argument (the lane wrapper takes none); the wrapper's validation passed, and CI runs the --check-required gate
  • The issue's 'PR body carries Hold: a human merges this' is a PR-body item the lane writes when it opens the PR; this run cannot set it
  • Tidy skipped: the change touches 24 files, over the 10-file cutoff, and includes the shared path lib/
  • Review was a local fresh-context subagent: there was no review-venue.txt in the scratchpad
  • Build/test/lint of the touched JS was not run locally (no node in this lane); check-affected's static checks passed

Fix

  • lib/git-hooks/install.mjs: new config-hook action (stable copy, include file, include-if / include-if-unmatched / git-too-old / modified decisions, --include-if parsing and validation); verify reads an entry's config hook (command, enabled, events) before its copies
  • plugins/{actionlint,bash-format,biome-format,go-format,guardrails,instruction-placement,markdown-format,powershell-format,ruff-format,typos-format}/lib/git-hooks/install.mjs: regenerated copies of lib/git-hooks/install.mjs
  • lib/git-hooks/install.test.mjs: config-hook tests: two runs leave one hook block and one includeIf line, and git hook list shows it; verify ok, then missing once the repo overrides the command; a commit runs the hook and checks.skipmissing skips it only while its tool is absent; beside lefthook a co
  • plugins/guardrails/skills/setup/context/install-commit-msg.md: new: the scope=user config-hook install (2.54 floor with pointer, stable copy location, friendly name, steps, decisions, checks.skipmissing as the only skip, removal)
  • plugins/guardrails/skills/setup/SKILL.md: install-git-hooks gains scope=user, offered but never auto-chosen, routing to the context doc; description and the writes list updated
  • .changes/guardrails/feat-9775-config-hook-install-a3c9e517.md: minor fragment for the new install scope
  • .changes/{actionlint,bash-format,biome-format,go-format,instruction-placement,markdown-format,powershell-format,ruff-format,typos-format}/feat-9775-config-hook-install-a3c9e517.md: bump none, since these plugins carry the installer copy but have no commit-msg entry

Verification

The runner ran each check from the base copy against 233360a:

  • scripts/check-changelog-fragments.sh --check: passed

The run reports:

  • read https: //git-scm.com/docs/git-hook: hook.<friendly-name>.command/.event/.enabled, git hook list, configured hooks run in config-parse order and the hookdir hook runs last; a friendly name must not be a hook event name
  • read https: //git-scm.com/docs/git-hook/2.54.0: documents the hook.<friendly-name>.* keys and git hook list
  • read https: //git-scm.com/docs/git-hook/2.53.0 (redirects to 2.43.0) and https: //git-scm.com/docs/git-hook/2.43.0: no config keys and no list subcommand; the changelog lists 2.43.1 to 2.53.0 as no changes and 2.54.0 (2026-04-20) as the next change
  • read https: //git-scm.com/docs/git-config (Conditional includes): includeIf syntax, gitdir matches a linked worktree's final git directory, trailing / adds **
  • sync-shared-copies --check: all 535 registered copies match their canonical sources
  • check-changelog-fragments: all 18 fragments valid
  • check-affected: 11 passed, 7 skipped, 0 failed over 24 changed files (it first caught a ${CLAUDE_PLUGIN_ROOT} token in the new spoke and a 1027-character skill description; both fixed)
  • fresh-context review subagent: no HIGH findings; MEDIUM (verify said ok for a disabled or overridden config hook) fixed and a test added; LOW (removal doc used --unset on a possibly multi-valued key) fixed with --fixed-value; LOW (the config-hook verdict hides drift in a local or shared copy of the
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/40964361097

Left out: the items under Not verified.

Related

#9775

Lane-Activity: work-resolve-issue/resolve-issue
@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 63674424a2d31008c7e40afb60f330234b551912: 0 finding(s), 0 as inline comments.

No security findings in this incremental review (since 2ab4df8).

The only change is in plugins/guardrails/skills/setup/SKILL.md, lines 265-270. It re-wraps one bullet that lists the skill's only permitted writes. The listed writes are the same before and after:

  • the apply install-git-hooks entry copies
  • the apply install-read-deny rules in the settings file the scope names
  • the confirmed apply identity-domains map
  • the confirmed cleanup of the retired hooks

No rule is removed, narrowed or softened. This is a compression that leaves what the instruction forbids unchanged, so it is not an instruction-surface deletion. It touches no trust control, manifest or userConfig key.

I did not read the instruction exception register, because there is no removed rule to check against it.

Nothing in this change spends credits or can start a charge.

critical-findings: 0

@github-actions

github-actions Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 63674424a2d31008c7e40afb60f330234b551912: 0 finding(s), 0 as inline comments.

Incremental review of plugins/guardrails/skills/setup/SKILL.md since 2ab4df8. I read .claude-lane/incremental.diff only, and I didn't open the full diff or the PR context.

The change rewraps one bullet in the "never writes" list across more lines. The words are identical before and after: the same four permitted writes (apply install-git-hooks entry copies, apply install-read-deny rules, the confirmed apply identity-domains map, and apply's confirmed retired-hook cleanup). Nothing about behavior, scope or wording changed, and I found nothing to flag.

The wrapper lists no trusted-path glob that matches this file, so I applied no extra scrutiny. No cost or security hold applies.

I reviewed only this incremental change. Every other file was reviewed at 2ab4df8 and is unchanged.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

Unattended merge: native auto-merge leaves this pull request unarmed at head 63674424a2d31008c7e40afb60f330234b551912. The lanes clear this reason on their own; the next scheduled run judges it again.

pr-merge's gate refuses its verifier verdict (verify:fail)

Comment thread lib/git-hooks/install.mjs Resolved
Lane-Activity: pr-unblock/address-feedback
Lane-Thread: PRRT_kwDOTCGFQM6xy0gm
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 1 of max 4 on 6367442.

@melodic-automation-lanes

melodic-automation-lanes Bot commented Oct 29, 2026 •

Copy link
Copy Markdown
Contributor Author

The pr-unblock lane stopped address-feedback on this pull request: the pull request has an unresolved review thread the lane does not take (a reviewer it does not act on, a review of an older head, or a thread it already answered), so nothing will resolve it. The lane sets no label: the run ends in a failing pr-unblock/address-feedback status on the head the lane gated.

When a retry on this head can change the outcome, the lane runs one on its own, up to its per-head cap, and edits this comment if it stops again; a run that does not stop clears the status. When no retry can (a review thread the lane does not take or settle, or a failing check after the retries are spent), a person resolves the threads or gets the checks green, then dispatches the workflow below: that run finds the cause gone and clears the status. On a pull request the lanes App opened, the dispatchers start that run once per stop; on any other, a person does. A new commit to the branch starts clean.

To run it again on this head now, dispatch the pr-unblock workflow:

gh workflow run pr-unblock.yml -R melodic-software/claude-code-plugins -f pr-number=11082 -f activity=address-feedback

Comment thread lib/git-hooks/install.test.mjs Resolved
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

pr-unblock / address-feedback finished round 2 of max 4 on 6367442.

@kyle-sexton
kyle-sexton added this pull request to the merge queue Oct 30, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to failed status checks Oct 30, 2026
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Oct 30, 2026
@kyle-sexton

Copy link
Copy Markdown
Member

Superseded by #11166, which merged this change from the owner login.

@github-actions
github-actions Bot deleted the work-resolve-issue/issue-9775-40964361097-1 branch October 31, 2026 06:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

do-not-merge Hard merge gate: do not merge while applied.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

feat(git-hooks): install hook entries as git config-based hooks under an includeIf, from git 2.54

1 participant