Skip to content

refactor(lefthook): tighten the guardrails remote shim header comments - #14362

Merged
melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14324-42568815292-1
Nov 9, 2026
Merged

melodic-automation-lanes[bot] merged 1 commit into
mainfrom
work-resolve-issue/issue-14324-42568815292-1

Conversation

@melodic-automation-lanes

@melodic-automation-lanes melodic-automation-lanes Bot commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Closes #14324

Summary

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

Ran /simplify's four checks over the five listed files. The code was already minimal and has to stay as it is: plugins/guardrails/git-hooks/lefthook-remote.test.sh:52 matches each shim's exec sh "${src%/*}/..." "$" line word for word, and merging the four identical shims into one is deduping across files, which the issue rules out. So the change only rewrites the header comment of the four .lefthook/ shims, which was hard to follow, to say plainly that lefthook looks up a remote's scripts under .lefthook/, that the shim runs the plugin's script in place so it finds its libs beside it, that only the fetched copy runs and the work-tree copy exits 0, what \134 is, and why it runs with sh. The redundant 'POSIX sh' (the shebang and shellcheck directive already say it) and 'backslashes become slashes first' (the tr shows it) are gone. No executable line changed.

Not verified

  • lefthook.yml: not edited. Its code (the check-affected job) was already minimal and I planned only to tighten its header and job comments, but the session refused the edit as a sensitive file with no approval surface. It is not a patch-protected path, so the run went on. Behavior is unchanged…
  • tidy: skipped. Every row is under .lefthook/**, which code-tidying's GLOBAL HARD exclusions list as the local git-hook chain (hard_exclusions enforced), so tidy-diff dropped all rows and had nothing to tidy.
  • plugins/guardrails/git-hooks/lefthook-remote.test.sh and lib/git-hooks/sh-entries.test.sh were not run here (this lane's Bash runs only the named wrappers); left to the PR's CI. The change touches only comment lines, which neither test reads.
  • shellcheck over the four shims not run here (no wrapper for it); left to the PR's CI. Only comment lines changed.
  • ci-status green: a PR check, left to the PR's CI.

Fix

  • .lefthook/commit-msg/guardrails-commit-msg-convention.sh: rewrote the header comment (lines 3-7); code unchanged
  • .lefthook/pre-commit/guardrails-pre-commit-content.sh: rewrote the header comment (lines 3-7); code unchanged
  • .lefthook/pre-push/guardrails-pre-push-content.sh: rewrote the header comment (lines 3-7); code unchanged
  • .lefthook/pre-push/guardrails-reference-verify.sh: rewrote the header comment (lines 3-7); code unchanged

Verification

The runner ran each check from the base copy against 010608c:

  • scripts/check-changelog-fragments.sh --check: passed
  • scripts/check-changed-skills.sh --merge-base: passed

The run reports:

  • check-changelog-fragments: all 4 changelog fragments under .changes/ valid (no fragment needed: no plugin file changed)
  • check-changed-skills: no changed skills, nothing to gate
  • check-affected: 10 passed, 6 skipped over 4 changed files (run before and after the review fixes)
  • git-read diff --unified=0 HEAD: every changed line in the four shims is a # comment; shebang, shellcheck directive and lines from src= through exec are byte-identical
  • fresh-context review subagent: behavior unchanged, no test or tool reads the comment text (lefthook-remote.test.sh:52 matches only the exec line; lib/git-hooks/sh-entries.test.sh checks the shebang and skips comments). It confirmed two comment problems in the first draft (a 'which' pointing at the…
  • The lane run: https://github.com/melodic-software/claude-code-plugins/actions/runs/42568815292

Left out: the items under Not verified.

Related

#14324

Merge-Risk: max=LOW demote=false head=010608c2b213cf21ed46e986490f73db9d4446a7 rubric=8.1.2 rater=claude-opus-5-5 checker=claude-opus-5-5

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

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 010608c2b213cf21ed46e986490f73db9d4446a7: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Security review: no security issues found

I read every hunk of all 4 changed files:

  • .lefthook/commit-msg/guardrails-commit-msg-convention.sh
  • .lefthook/pre-commit/guardrails-pre-commit-content.sh
  • .lefthook/pre-push/guardrails-pre-push-content.sh
  • .lefthook/pre-push/guardrails-reference-verify.sh

What changed: In each shim, the only edits are to the header comment, lines 3–7. Each hunk is @@ -1,10 +1,10 @@. The shebang, the # shellcheck shell=sh directive, src=$(printf '%s\n' "$0" | tr '\134' '/') and case "$src" in are all unchanged context lines. No executable line was added, removed or changed. That includes the logic that skips the work-tree copy.

Instruction-surface lens: The removed text ("POSIX sh", "Backslashes become slashes first") only described the code. It was never a rule a model or a tool enforces, and the code it described (tr '\134' '/' and the case guard) is untouched. Nothing is deleted, narrowed or softened. No protected class applies, so I did not look up the instruction exception register.

Trust controls / trusted paths: None of the changed files matches a TRUSTED PATHS: glob. No trusted-actor list, token scope, kill switch, merge hold or plugin manifest is touched.

PR context: The description has no embedded directives aimed at this lane.

The prior-findings file shows no earlier review by this lane (earlier heads reviewed: 0, blocking only: no), so this is a full review.

critical-findings: 0

@github-actions

github-actions Bot commented Nov 9, 2026

Copy link
Copy Markdown
Contributor

claude-review reviewed 010608c2b213cf21ed46e986490f73db9d4446a7: read 4 of 4 changed file(s); 0 finding(s), 0 as inline comments.

Code review: no findings

This PR changes only comments. In each of the four .lefthook/ shims it rewrites lines 3–7 of the header comment. The shebang, the # shellcheck shell=sh directive and every line from src= through exec are the same as on base, so behavior does not change.

Do the new comments match the code? Yes. Checked against .lefthook/pre-push/guardrails-reference-verify.sh:

  • Copy that runs: "Only the fetched copy of main in lefthook-remotes/ runs it; the work-tree copy exits 0" matches the case at L10–13.
  • \134: the comment describes the tr '\134' '/' at L9 correctly.
  • Finding its libs: "runs the plugin's script in place, so it finds its libs beside it" matches the exec sh "${src%/*}/../../plugins/..." at L14.

Dropping "POSIX sh" loses nothing, since the shebang and the shellcheck directive still say it. All four files received the same text.

Does anything read the old comment text? No. I searched the repository for the removed phrases. The only matches were in the diff and PR context files, plus one unrelated comment in plugins/guardrails/hooks/block-root-delete-target.sh. No test asserts on these comments.

Closing issue #14324, acceptance criteria:

  • Behavior unchanged: met. Only comment lines change and no file is renamed, moved or deleted.
  • Diff touches only the listed files: met. All four changed files are on the issue's list. lefthook.yml was left unedited, which the PR explains under "Not verified".
  • Within 400 lines and 15 files: met (4 files, about 20 changed lines).
  • ci-status green: not something I can check from this lane. The author also leaves it to the PR's CI, so it is unconfirmed.

What I did and didn't check:

  • Not run: I didn't run shellcheck or the tests (lefthook-remote.test.sh, sh-entries.test.sh); this lane can't run them. The PR's claims that they pass are the author's and unconfirmed.
  • Rules and manifests: no .claude/rules/ file has a glob that matches these paths. No plugin manifest changed.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The unattended merge path armed native auto-merge at head 010608c2b213cf21ed46e986490f73db9d4446a7, the head its arming checks judged.

@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

Verification evidence for 010608c

The verifier passed this head. The capture artifact holds the capture summary, which says whether the capture ran, and any screenshot or video that passed the mask check; this comment uploads no file.

Capture artifact: pr-capture-14362-010608c2b213cf21ed46e986490f73db9d4446a7, expires on 2026-12-09.

One comment per pull request, updated in place for each new head.

@melodic-automation-lanes
melodic-automation-lanes Bot added this pull request to the merge queue Nov 9, 2026
Merged via the queue into main with commit f39c1cf Nov 9, 2026
74 of 77 checks passed
@melodic-automation-lanes
melodic-automation-lanes Bot deleted the work-resolve-issue/issue-14324-42568815292-1 branch November 9, 2026 06:56
@melodic-automation-lanes

Copy link
Copy Markdown
Contributor Author

The post-merge check verified merge commit f39c1cf002dbf9ef500aca9b5e411583d677a248; later checks count it verified from this comment.

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.

Simplify the commit-msg, pre-commit, pre-push and 1 more root files

0 participants