Repository navigation
feat(git-hooks): inspect what runs at each hook stage, and detect Husky.Net - #16627
Conversation
…ky.Net The shared git-hook installer gains a read-only `inspect` action. For each git hook stage it lists every item that runs under the repository's hook manager (plain dispatcher markers and chained hooks, .husky/<event> lines, lefthook jobs from `lefthook dump`, git config hooks, any other hook file), names stamped entry copies by plugin and entry, and times only the calling plugin's own installed entries that rewrite nothing and whose tools are present. Every other item is reported not run, with the reason. Each carrier's setup exposes it as `check inspect`. `detect` recognizes Husky.Net's .husky/task-runner.json as husky with variant "husky.net": Husky.Net runs .husky/<event> as husky does, so the husky adapter drives it unchanged, and inspect lists the tasks a `husky run --group` or `--name` line selects. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MWmASPFjTu4anSp6BowqVC
…source Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MWmASPFjTu4anSp6BowqVC
Husky.Net points core.hooksPath at .husky, so git runs .husky/<event> directly and skips it unless it is executable. The husky-config decision now says so, and the adopting guide links Husky.Net's install steps for contributors. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MWmASPFjTu4anSp6BowqVC
… action The argument-hint contract requires setup skills to lead with "[check|apply]"; `check inspect` stays documented in each body's own section. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MWmASPFjTu4anSp6BowqVC
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 395e9f27e4
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
The plain dispatcher runs an installed copy whose first line is not #!/bin/sh by its own shebang, so timing it under sh measured a shell failure, not the check. inspect now reports such a copy as not measured, naming the refresh that makes it timeable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MWmASPFjTu4anSp6BowqVC
|
Held for the owner's review of the decisions behind this change. The hold comes off when the owner confirms them. |
Lane run report
Failed GitHub API calls
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01MWmASPFjTu4anSp6BowqVC
|
Hold lifted: the owner reviewed and confirmed the decisions behind this change (2026-11-16), and the no-per-stack-examples rule is applied (29f7c52). |
|
claude-security-review reviewed Security review: PR #16627, incremental (e55300c → 210a14f)This was an incremental, blocking-only review: this lane already reviewed an earlier head, so it reports CRITICAL and IMPORTANT findings only. I read all 16 files in scope. The other 10 changelog fragments are identical to I found no security issues in this push. Prior finding (IMPORTANT, forged stamp run by
|
|
claude-review reviewed Code review (incremental, e55300c → 210a14f, blocking only)This lane already reviewed an earlier head, so this pass posts only blocking findings. I read all 16 files on the to-read list in What changed
What I checked
Earlier findings. All three are resolved, with no lines changed since resolution:
The owner states that each fix is in 210a14f, and the diff above matches those fixes. I did not raise any of them again. The owner's change to the argument-hint shape, Closing issue. There is none: the PR states that no issue covers it. Manifests. This push changes no Verification. The test results are the author's claim. I did not run them, because this lane has no shell. Spend. None. Verifier dropped 0 of 0 candidates. No verifier subagent ran; I reviewed the diff in this session. |
|
Held: the security-review thread on install.mjs:1507 is valid (inspect runs a stamped file without checking its content against the shipped entry's hash). A fix for it and the two claude-review threads is in progress; the hold lifts once they are pushed and both lanes review that head. |
…spect inspect timed any file whose second line parsed as this plugin's stamp, so a repository's .husky or lefthook line naming a forged script ran it. It now times a copy only when its script, lib and assets hash to what the plugin ships now (copyState is ok) and the entry's own event matches the stage; an edited or forged copy is reported not run, an older one gets a refresh hint. A script path from a husky or lefthook command, a dispatcher marker or a lefthook script is followed only inside the work tree or the hooks directory, which holds a linked worktree's local copies. Config hooks honor an empty hook.<name>.event value's reset and report hook.<name>.enabled=false as disabled. Each setup skill that carries the inspect section routes `check inspect` to it: the routing sentence, the description's action list and an argument-hint of `[check|apply] [inspect|...]`, the setup shape the argument-hint contract and validator accept. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
No related issue: extends the shared git-hook installer with a read-only stage inspect and Husky.Net detection; no tracked issue covers it.
Summary
Nothing showed what a repository's git hooks run at each stage across hook managers, or how long this marketplace's entries take there, which is the number the check-placement duration budgets need. The shared installer (
lib/git-hooks/install.mjs, synced into the 11 carrier plugins) gains a read-onlyinspectaction, exposed assetup check inspect, anddetectnow recognizes Husky.Net.Fix
inspectlists, per git hook stage, every item that runs under the detected manager: plain dispatcher markers and a chained<event>.pre-checks, each line of.husky/<event>, the Husky.Net tasks ahusky run --group/--nameline selects, lefthook jobs fromlefthook dump, git config hooks, and any other hook file. It runs only the calling plugin's own installed entries that rewrite nothing and whose tools are present (staged set, a message file outside the repo, or the branch against its upstream) and reports median, range, input and exit codes; every other item isnotMeasuredwith the reason.lefthook dumpis read-only: lefthook v2.2.2loader.goloadRemotesreads only already-fetched remote folders.detectreturnshuskywithvariant: "husky.net"when.husky/task-runner.jsonexists, so Husky.Net installs through the husky adapter as before (no newconflict). Thehusky-configdecision now says a new.husky/<event>under Husky.Net must be#!/bin/sh, executable and staged 100755, sincecore.hooksPath=.huskymakes git run it directly (Husky.Net InstallCommand).inspect), adopting guide (Husky.Net install, "See what runs at each stage"), each carrier's setup body (check inspectsection and allowed-tools), oneminorchangelog fragment per carrier (11).Notes: setup never exposed
list, soinspectis a newcheck inspectsub-action in each body; the argument-hint keeps[check|apply]first, as the argument-hint contract requires. In this repository the lefthook remote jobs list as plain lefthook jobs, not entries, because.lefthook/<event>/holds same-named local scripts.Verification
node --test --test-concurrency=4 lib/git-hooks/install.test.mjs: 238 tests, 234 pass, 0 fail, 4 skipped (config-hook cases need git 2.54; host has 2.53.0). The 12 new cases cover plain (own entry timed, another plugin's entry, chained hook not run, nothing staged, rewrites, missing tool, commit-msg, pre-push with and without upstream), husky 9, Husky.Net (detect, plan,--grouptasks, barerun), lefthook (canned dump, binary absent), a foreign manager, config hooks,--runsbounds, and thatinspectleaves the repository tree byte-identical. Removing the own-plugin gate made the "runs nothing else" case fail.lib/git-hooks/install.test.shpasses;sh-entries.test.sh: 181 passed.scripts/sync-shared-copies.sh --check: all registered copies match.scripts/check-changelog-fragments.sh --check-required origin/main: 11 of 11.scripts/validate-plugins.shon the 11 carriers,typosandcheck-as-of-recheck.sh: clean. The pre-pushcheck-affectedrun passed.inspecton this repository under lefthook 2.2.2: four stages listed from the merged config, remotes included.Related
🤖 Generated with Claude Code
https://claude.ai/code/session_01MWmASPFjTu4anSp6BowqVC