Skip to content

fix(hooks): turn off core.fsmonitor and hooks on the remaining hook git calls - #17082

Merged
kyle-sexton merged 10 commits into
mainfrom
fix/16959-hook-git-config-overrides
Nov 18, 2026
Merged

kyle-sexton merged 10 commits into
mainfrom
fix/16959-hook-git-config-overrides

Conversation

@kyle-sexton

@kyle-sexton kyle-sexton commented Nov 18, 2026 •

Copy link
Copy Markdown
Member

Refs: #16959

Summary

Hooks ran git in the edited file's repository without command-line overrides, so a core.fsmonitor command named in that repository's own .git/config ran whenever a hook read the index. #17104 (merged) added hook::git_untrusted in lib/hook-utils.sh, which passes --no-pager -c core.fsmonitor=false -c core.hooksPath=/dev/null (the overrides PR #16954 uses), and routed the three git ignore checks through it: hook::file_is_gitignored, guardrails spd_gitignored and hardcoded-path-check's ignore check. This pull request gives the same overrides to the other git calls in plugins/*/hooks/** and lib/hook-utils.sh, about 40 call sites: most call that helper, and about ten write the same four arguments out literally (listed under Fix). They include the seven that still started a planted fsmonitor on main: the convention resolver's two ls-files calls and its check-ignore, stale-path-verify's two ls-files calls, normalize-eol's check-attr, and worktree-remove-gate's status. No check answers differently.

Fix

  • lib/hook-utils.sh: hook::repo_root_uncached_to calls hook::git_untrusted and hook::in_git_working_tree passes its overrides; the function's comment now covers every hook git call and says why some callers write the overrides out. No second helper: the HOOK_GIT array this branch first added, and the array the merge from main left beside the function, are removed.
  • Each other hook call site in the table below calls hook::git_untrusted. harness-ops-paths.sh and worktree-remove-gate.sh did not load hook-utils.sh; they now source it (worktree-remove-gate.sh below its early exits, so check-killswitch-hoist holds). That load is a new dependency for worktree-remove-gate.sh: if its hook-utils.sh copy fails to load, the gate's first git call fails and it refuses the removal (fails closed).
  • Design choice: main's function shape cannot reach every site, so the same overrides are written out literally where a bash function either cannot run or costs a second process: lib/resolve-convention-pattern.sh and its guardrails copy (POSIX sh, one-line rcp_git), settings-write-ask.mjs (Node argv), abort-boundary.sh (command git skips functions, and it can run before hook-utils.sh is sourced), normalize-eol.sh (its tests source it without hook-utils.sh), block-root-delete-target.sh (rdt_bounded_to execs its argv), hook::in_git_working_tree and source-control git_unlocated (last command of a ( … ) subshell, where a function costs bash a second process: the spawn-budget suite counted 22/25/24 process creations instead of 20/24/23 until these were written out), and the two pipeline sites in stale-path-verify.sh and harness-ops-paths.sh. With mce::git_exec in block-main-checkout-edit.sh (PR feat(guardrails): deny edits in a main checkout on its default branch #16954, untouched) that is about nine places. The alternative a lanes bot's merge from main put on this branch (HOOK_GIT array plus hook::git_untrusted delegating to it) keeps one bash source for the overrides at the cost of a second helper; this branch keeps main's single function instead. Either can be switched later without changing behaviour.
  • Three sites used $(exec git … 2>…) to keep one process; a function cannot be exec'd, so the redirect moved: block-dangerous-git repo_oid_width runs exec 2>&1 first inside the substitution, and repo_is_temp_scratch and hardcoded-path-check's rev-parse put 2>/dev/null on a group around the assignment. Measured with strace -f -e trace=clone,clone3,execve on bash 5.3 for those shapes: one clone each, as before.
  • Copies regenerated with scripts/sync-shared-copies.sh (22 hook-utils.sh copies, the guardrails resolver copy, the harness-ops harness-ops-paths.sh copy). One patch fragment per carrier plugin (22), each naming only what this pull request adds beyond fix(hooks): turn off config-driven commands on the git ignore checks hooks run #17104's fragments.

Call sites this pull request adds

"Reads index" marks the subcommands that started the planted fsmonitor when probed against git 2.53.

Site Subcommand
lib/hook-utils.sh hook::in_git_working_tree, hook::repo_root_uncached_to (all 22 carriers) rev-parse
lib/resolve-convention-pattern.sh (+ guardrails copy) ls-files x2, check-ignore (reads index)
guardrails stale-path-verify.sh ls-files x2 (reads index); rev-parse x2, log
eol-normalizer normalize-eol.sh check-attr (reads index)
source-control worktree-remove-gate.sh status (reads index); rev-parse, symbolic-ref, rev-list, worktree unlock/remove/lock
guardrails hardcoded-path-check.sh rev-parse
guardrails abort-boundary.sh, block-dangerous-git.sh, block-fix-request-post.sh show
guardrails block-dangerous-git.sh x2, block-no-verify.sh, block-root-delete-target.sh, block-convention-violation.sh rev-parse
guardrails block-convention-violation.sh, block-noncanonical-commit.sh (repo_git_probe) config, rev-parse
guardrails block-unresolved-pr-merge.sh, autonomy lane-stop-gate.sh, desktop-notification.sh branch
guardrails settings-write-ask.mjs rev-parse
session-telemetry harness-ops-paths.sh (+ harness-ops copy) rev-parse x2
source-control pr-linkage-mcp-gate.sh remote
source-control worktree-add-containment-gate.sh (git_unlocated) rev-parse

Not changed: plugins/testing/hooks/judge-lib.sh (no hook loads it), lib/hook-test-sink.sh and its copies (test helper), block-root-delete-target-fixtures.sh (test fixture).

Verification

  • bash lib/hook-git.test.sh: a repository whose .git/config names a core.fsmonitor command that leaves a marker file, run through the convention resolver, normalize-eol.sh and worktree-remove-gate.sh, each also asserting the hook's answer is unchanged. Its hook::file_is_gitignored, secret-pattern-detection and hardcoded-path-check cases were dropped: fix(hooks): turn off config-driven commands on the git ignore checks hooks run #17104's own tests cover those sites. Not covered: stale-path-verify.sh's two ls-files calls have no planted-fsmonitor case, and the resolver has one case (its tracked-file check), so the test covers three of the hooks that read the index, not each of the seven sites.
  • Suites run by path on this branch (WSL2 Ubuntu, bash 5.3): lib/hook-git.test.sh 5/0, lib/resolve-convention-pattern.test.sh 125/0, guardrails secret-pattern-detection 315/0, hardcoded-path-check 173/0, abort-boundary 391/0, block-convention-violation 185/0, block-fix-request-post 316/0, block-no-verify 470/0, block-unresolved-pr-merge 726/0, stale-path-verify 151/0, settings-write-ask 24/0, block-root-delete-target and -b to -f and -resolve all 0 failures; eol-normalizer eol-git-add 12/0; source-control worktree-remove-gate 63/0, worktree-add-containment-gate 48/0, pr-linkage-mcp-gate 57/0; desktop-notification 49/0; session-telemetry harness-ops-paths 37/0. worktree-gates-spawn-budget: process creations exactly 20, 24, 23 and 23 as budgeted.
  • Host-only failures, the same ones this branch reported before the rebuild and that fail on main on this host: lib/hook-utils.test.sh 713/1 (a locally installed biome), eol-normalizer 63/1 (mise node shim), block-dangerous-git 1089/5 and block-noncanonical-commit 292/2 (strace execve counts 2 higher through mise shims), lane-stop-gate 126/2, and the spawn-budget execve counts (shims). No process-creation count changed.
  • One test edit: secret-pattern-detection.test.sh's git shim recorded -C only as the first argument; it now finds -C anywhere, since the overrides come first.
  • shellcheck --rcfile .shellcheckrc -x on every changed shell file: clean. scripts/check-affected.sh: 18 passed, 1 skipped over 68 changed files.

Remaining

Issue #16959 stays open for these; this pull request links it with Refs: because they are not done here.

  • Git calls in files hooks load from outside hooks/: bash-format.sh, markdown-format.sh, javascript-format.sh and python-format.sh source their plugins' git-hooks/adapters.sh (and markdown-format's markdown-gates.sh), which run plain git ls-files; worktree-create-gate.sh runs source-control's scripts/worktree-create.sh, which uses scripts/lib/worktree-facts.sh and scripts/worktree-root-resolve.sh; also scripts/reap-project-plugin-records.sh.
  • Content filters: git status in worktree-remove-gate.sh (and inside its git worktree remove) rehashes a touched tracked file through its .gitattributes filter=<driver>, which runs filter.<driver>.clean or .process from the repository's config. Command-line -c cannot switch off a driver whose name is unknown; a status check that skips rehashing needs its own study.
  • Owner decision: worktree-create.sh runs git worktree add, which runs the repository's post-checkout hook, so passing core.hooksPath=/dev/null there would change what it does.

Related

🤖 Generated with Claude Code

kyle-sexton and others added 5 commits November 18, 2026 00:16
A repository whose .git/config names a core.fsmonitor command runs it
from hook::file_is_gitignored, spd_gitignored, hardcoded-path-check,
resolve-convention-pattern, normalize-eol and worktree-remove-gate,
because each reads the index without the command-line overrides.

Refs #16959

Co-Authored-By: Claude Opus 5.5 <[email protected]>
HOOK_GIT in lib/hook-utils.sh holds the one git command a hook runs in
a repository it did not create: git --no-pager -c core.fsmonitor=false
-c core.hooksPath=/dev/null. Command-line configuration outranks the
repository's own, so a core.fsmonitor named in a planted .git/config no
longer runs when a hook reads the index. Each hook git call now starts
with it; normalize-eol.sh, harness-ops-paths.sh and worktree-remove-gate
source hook-utils.sh for it. The POSIX-sh resolver and the Node
settings-write-ask hook pass the same arguments, since neither can
read a bash array. Shared copies regenerated by sync-shared-copies.sh.

Closes #16959

Co-Authored-By: Claude Opus 5.5 <[email protected]>
…t shim

The hook's git calls now lead with the HOOK_GIT overrides, so -C is no
longer the first argument the shim sees.

Refs #16959

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@kyle-sexton
kyle-sexton marked this pull request as ready for review November 18, 2026 08:49
@chatgpt-codex-connector

chatgpt-codex-connector Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Codex Review Summary: ✅ Completed

This comment shows the latest Codex review activity on this pull request.

Review Status Commit Review trigger
📝 Code Review ✅ Completed 2026-11-18T08:51:00.786831Z ad7ce94 Draft marked ready
ℹ️ 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" or "@codex security review".

Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-security-review: 1 inline finding(s) on ad7ce94c0aef2bb09759b4afa69a85eed0ac6dd6; the summary is in this lane's pull request comment.

claude-lane: claude-security-review

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

claude-security-review reviewed 50351e07d559d99510c42f118cb1369ac5a63cc3: read 66 of 66 changed file(s); 0 finding(s), 0 as inline comments.

Security review: PR #17082, incremental 6945a00f..50351e07

No security issues found. This push drops the HOOK_GIT array from lib/hook-utils.sh and its 22 copies. Every hook git call goes through the existing hook::git_untrusted function instead. Callers that a function can't serve write out the same four arguments: --no-pager -c core.fsmonitor=false -c core.hooksPath=/dev/null. Those callers are a subshell's last command, a pipeline element, and argv handed to another program. The overrides each call passes are the same as at the last reviewed head. No call goes back to plain git.

What I checked

  • No reference to the removed array is left. A search for HOOK_GIT under plugins/ and lib/ at head finds nothing. secret-pattern-detection.sh:841 is unchanged in this push and already calls hook::git_untrusted.
  • Two fallbacks got stricter. abort-boundary.sh:316 and normalize-eol.sh:129 used "${HOOK_GIT[@]-git}", which fell back to plain git when the library wasn't loaded. They now always pass the overrides.
  • Literal call sites carry the full override set. Checked: block-root-delete-target.sh (argv to rdt_bounded_to), stale-path-verify.sh:701 and both harness-ops-paths.sh ensure_git_exclude calls (pipelines), worktree-add-containment-gate.sh git_unlocated, and hook::in_git_working_tree in each hook-utils.sh copy.
  • Gates still fail closed and keep their decisions.
    • worktree-remove-gate.sh loads hook-utils.sh at line 127, before its hook::git_untrusted calls. If the function were missing, rev-parse and status would fail and end in gate::refuse, as before.
    • The guardrails hooks load the library with || exit 70.
    • In block-dangerous-git.sh, repo_oid_width still captures git's stderr through exec 2>&1 inside the substitution, and repo_is_temp_scratch moved its stderr redirect to a group. Neither changes a branch.
    • The swaps in block-convention-violation, block-fix-request-post, block-no-verify, block-noncanonical-commit, block-unresolved-pr-merge, hardcoded-path-check, lane-stop-gate, desktop-notification and pr-linkage-mcp-gate keep their arguments and failure paths.
  • Test and changelog edits.
    • lib/hook-git.test.sh drops its checks for hook::file_is_gitignored, secret-pattern-detection and hardcoded-path-check. This is test coverage, with no security effect.
    • The changelog fragments now describe less. None claims protection the code doesn't give, and the source-control fragment still says the .gitattributes content-filter gap isn't covered.

Prior findings

  • The earlier SUGGESTION about content filters in worktree-remove-gate.sh (discussion_r4611286686) was settled at the last head and isn't raised again. This push's change to those lines only swaps the array for the function.

Scope

  • Read: all 32 files in to-read.txt, every hunk.
  • Manifests: no plugin.json or marketplace.json changes, so there is no manifest block.
  • Instructions: none were deleted or softened.
  • Trust controls and merge holds: none were touched.
  • Embedded directives: none in the PR context.

This was a blocking-only review: the lane already reviewed an earlier head.

critical-findings: 0

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on ad7ce94c0aef2bb09759b4afa69a85eed0ac6dd6; the summary is in this lane's pull request comment.

claude-lane: claude-review

@github-actions

github-actions Bot commented Nov 18, 2026 •

Copy link
Copy Markdown
Contributor

claude-review reviewed 50351e07d559d99510c42f118cb1369ac5a63cc3: read 66 of 66 changed file(s); 1 finding(s), 1 as inline comments.

Code review (blocking only): routing hook git calls through hook::git_untrusted

I read the whole change for all 32 files on the to-read list. The hook-utils.sh copies and the identical changelog fragments match their first paths, and none of their paths changes what the content does.

One blocking finding (inline, on block-dangerous-git.sh:455-458). This push replaces HOOK_GIT with the function hook::git_untrusted. A function call can't be exec'd, so a git call that used to be one process is now two at:

  • the sites that used exec;
  • the sites that kept the redirect outside the substitution.

The strace pins in block-dangerous-git.test.sh cover one of these sites, and this push doesn't update them. Read against the test code, they should now fail on any host with a working strace:

The inline comment lists every site in this class.

What I checked and found sound

  • Every new hook::git_untrusted caller loads hook-utils.sh first. The two callers that may run before it is loaded now spell the four overrides themselves: abort-boundary.sh:316 and normalize-eol.sh:129. So do the remaining pipeline, subshell and argv-handoff sites: hook::in_git_working_tree, git_unlocated, rdt_bounded_to, stale-path-verify.sh:701 and harness_ops::ensure_git_exclude. None of them is left referencing the removed HOOK_GIT array.
  • Sites whose redirect sits inside the substitution (for example worktree-remove-gate.sh, stale-path-verify.sh:316,819 and hook::repo_root_uncached_to) already cost two processes under the repo's own rule, so they don't regress.
  • lib/hook-git.test.sh dropped its hook::file_is_gitignored, secret-pattern-detection and hardcoded-path-check cases. Main already covers these: file_is_gitignored already ran through hook::git_untrusted, and secret-pattern-detection.test.sh and hardcoded-path-check.test.sh each have fsmonitor cases. Coverage isn't lost.
  • The rewritten ### Security fragments now name only the calls each plugin changes. The source-control fragment keeps the "Not yet covered" clause for worktree-create.sh and content filters. The settled threads on fragment wording are not reopened.

Prior and settled points. The two prior inline findings are resolved threads on fragment wording. This head narrows that wording further, so I'm not posting either one again.

Not verified by me. I had no shell and ran nothing. The process counts are inferred from bash's exec rules as the repository's own comments and tests describe them. I didn't measure them. The PR body's test results and its claim that "the array adds no fork" are the author's and unverified. That claim also no longer describes this head, which has no array.

Scope. No plugin manifest changed. The PR has Refs: #16959 and no closing issue, so there are no acceptance criteria to check. I resolved no paved-path row. The change brings no real charge and no prepaid or subscription spend.

This review was blocking only: this lane already reviewed an earlier head.

Loosened-check verdict: fail (default; the wrapper wrote no loosened_check_verdict: line); patterns: 0

Verifier dropped 0 of 0 candidates (no verifier subagent was dispatched; the one finding was checked directly against block-dangerous-git.test.sh).

The fragments said every git command a hook runs passes the overrides
and that no command named in a repository's config runs. Neither holds:
bash-format, markdown-format and source-control hooks load scripts
outside hooks/ that still call git plainly, and a .gitattributes content
filter can still run through git status. The fragments now name the
hooks/ scripts, fsmonitor and git hooks only, and the three plugins
name what remains under issue 16959.

Co-Authored-By: Claude Fable 5.2 <[email protected]>

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 1020f5d0c8f4bf889591ad098497b3e8d0a9a21e; the summary is in this lane's pull request comment.

claude-lane: claude-review

kyle-sexton and others added 2 commits November 18, 2026 04:29
…gments

javascript-format.sh and python-format.sh source their plugins'
git-hooks/adapters.sh, which still run plain git ls-files, so their
Security fragments now say those calls are not yet covered, as the
bash-format fragment does.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
Lint Shell failed on the PR head. worktree-remove-gate.sh sourced
hook-utils.sh above its first early exit, which check-killswitch-hoist
refuses; the source now sits just before the first git call. The source
added to normalize-eol.sh made shellcheck follow hook-utils.sh from
eol-normalizer.test.sh and report SC2031; normalize-eol.sh no longer
sources it and runs "${HOOK_GIT[@]-git}", since eol-normalizer.sh
sources hook-utils.sh first, as abort-boundary.sh does.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@kyle-sexton
kyle-sexton added this pull request to the merge queue Nov 18, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 18, 2026
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/resolve-conflicts
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed none (read lane)
Run 44293411605

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

Lane-Activity: pr-unblock/resolve-conflicts
@github-actions

Copy link
Copy Markdown
Contributor

Lane run report

Field Value
Activity pr-unblock/apply-conflict-patch
Model rung 0
Leg base
Run job success
Activity step success
Commits pushed 6945a00
Run 44293411605

Failed GitHub API calls

Method Path Status
GET /repos/{repo}/git/ref/tags/* 404

#17104 added hook::git_untrusted for the three ignore checks. Drop this
branch's HOOK_GIT array, and the array the merge from main left beside the
function, and call the function at the remaining hook git call sites. Sites
a bash function cannot reach without an extra process or at all (a `( … )`
subshell or pipeline tail, an exec'd argv, `command git`, POSIX sh, Node, a
library sourced without hook-utils.sh) write the same overrides out.

block-dangerous-git's width probe and the hardcoded-path-check and
temp-scratch probes used `$(exec git … 2>…)` for one process; a function
cannot be exec'd, so the width probe runs `exec 2>&1` first inside the
substitution and the other two put the redirect on a group around the
assignment: one clone each under strace, as before. The comments that
explained the old `exec` are removed.

Trim lib/hook-git.test.sh to the sites #17104's tests do not cover, and
reword the 22 fragments to what this branch adds.

Co-Authored-By: Claude Fable 5.2 <[email protected]>
@kyle-sexton kyle-sexton added the do-not-merge Hard merge gate: do not merge while applied. label Nov 18, 2026

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

claude-review: 1 inline finding(s) on 50351e07d559d99510c42f118cb1369ac5a63cc3; the summary is in this lane's pull request comment.

claude-lane: claude-review

@kyle-sexton

Copy link
Copy Markdown
Member Author

Held by the session that owns this PR. After #17104 landed the same kind of hardening on main, this branch was rebuilt on main's hook::git_untrusted helper and pushed as 50351e0. The worker that did the rebuild was stopped before it updated this body, so the Summary, Fix, Verification and Remaining sections above still describe the earlier design. The rebuilt diff has not had an independent read against #17104 yet. do-not-merge stays until that read is done and the body matches the code.

@github-actions

Copy link
Copy Markdown
Contributor

The pr-verify verifier failed head 50351e07d559d99510c42f118cb1369ac5a63cc3. What it wrote, as data:

What it wrote (42 lines)
Summary: Refs #16959 (part delivery). The code change itself looks correct. It adds the git
  overrides `--no-pager -c core.fsmonitor=false -c core.hooksPath=/dev/null` to the repository-root
  lookups in hook-utils.sh, to the convention resolver (both copies), to normalize-eol,
  stale-path-verify, worktree-remove-gate and worktree-add-containment-gate, to the remaining
  guardrails hooks, to harness-ops-paths (both copies) and to settings-write-ask.mjs. It keeps all
  22 hook-utils.sh copies in sync and adds 22 changelog fragments. Every Test Bash and Test Node job
  passed on the judged head (run 44299062962). CI Status failed, but that job only sums holds and is
  no test evidence. The pull request still fails, for three reasons. First, its body describes an
  earlier design that is not in the diff. The owner's own comment says the branch was rebuilt on
  main's `hook::git_untrusted` and the body was never updated. Second, the body says every call goes
  through one shared command. In the diff, about ten call sites write the overrides out literally
  instead of using the helper, and the body's Remaining section does not list that gap. Third, the
  new planted-fsmonitor test covers only three of the hooks this diff changes that read the index.
  No binary files are in the diff, and I found no text trying to steer the reviewer.
- PR body: rewrite the Summary, Fix, Verification and Call sites sections to match the code. They
  describe a `HOOK_GIT` array in lib/hook-utils.sh, `"${HOOK_GIT[@]-git}"` in normalize-eol.sh and
  abort-boundary.sh, and a `lib/hook-git.test.sh` result of 12 passed / 0 failed covering
  hook::file_is_gitignored, secret-pattern-detection and hardcoded-path-check. None of this is in
  the diff. The diff uses `hook::git_untrusted`, writes the overrides out literally at several
  sites, and its test has 5 assertions: the fixture, the resolver, normalize-eol and two for
  worktree-remove-gate. The owner's hold comment on the pull request also says the body is stale.
- PR body: under Remaining, list the done-when part 'from one shared helper' as not delivered at the
  sites that write the overrides out literally. These are hook::in_git_working_tree,
  normalize-eol.sh check-attr, abort-boundary.sh show, block-root-delete-target.sh rev-parse,
  stale-path-verify.sh --is-shallow-repository, harness-ops-paths.sh ensure_git_exclude (both
  copies), worktree-add-containment-gate.sh git_unlocated, settings-write-ask.mjs and rcp_git in
  resolve-convention-pattern.sh. Alternatively, route them through one shared definition.
- lib/hook-git.test.sh: add a planted core.fsmonitor case for
  plugins/guardrails/hooks/stale-path-verify.sh. Its `git ls-files` calls (ensure_tracked_files and
  the `ls-files -v` skip-worktree probe) read the index and are changed in this diff, but no test
  shows the planted command stays off there. Also add
  `plugins/guardrails/hooks/stale-path-verify.sh` to the file's `# test-scope:` lines.
- plugins/guardrails/hooks/hardcoded-path-check.sh:333: the old `$(exec git …)` used one process.
  The new `$(hook::git_untrusted …)` runs a shell function inside a command substitution, which
  costs bash a second process on every tool call. The new comment in lib/hook-utils.sh says a caller
  like this should pass the overrides itself. Use `$(exec git --no-pager -c core.fsmonitor=false -c
  core.hooksPath=/dev/null -C "$CLAUDE_PROJECT_DIR" rev-parse … 2>/dev/null)`.
- plugins/guardrails/hooks/block-dangerous-git.sh:455: the same problem affects repo_oid_width. The
  `exec 2>&1; hook::git_untrusted …` body no longer replaces the subshell with git. Keep `exec git
  --no-pager -c core.fsmonitor=false -c core.hooksPath=/dev/null "$@" rev-parse --show-object-format
  2>&1` and keep the deleted comment that explains why. Do the same for repo_is_temp_scratch at line
  525.

This pull request leaves the merge queue, and ci-status holds it out while it carries pr-verify-failed. A pr-verify pass removes the label, at a new commit or at this same head: once a trusted person edits the body, and only trusted people have edited it since the fail, this head is judged again, so a fail on the body or the issues it links needs only the body fixed, no new commit.

@github-actions github-actions Bot added the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 18, 2026
@kyle-sexton kyle-sexton changed the title fix(hooks): run every hook git call with core.fsmonitor and hooks off fix(hooks): turn off core.fsmonitor and hooks on the remaining hook git calls Nov 18, 2026
@kyle-sexton

Copy link
Copy Markdown
Member Author

Owner decision, 2026-11-18, typed in the owning session: "go w/ recommendations" on Q74, option A: an independent reviewer read the rebuilt diff against #17104, the body is rewritten to match, and the pull request merges with its Refs: link to issue 16959. The hold is lifted.

The review found one helper (hook::git_untrusted), no hook deciding differently on any input it traced, and nothing unrelated in the diff. The title and body now describe the rebuilt branch, including the call sites that write the overrides out literally and the test's coverage.

@kyle-sexton kyle-sexton removed the do-not-merge Hard merge gate: do not merge while applied. label Nov 18, 2026
@github-actions github-actions Bot removed the pr-verify-failed pr-verify failed this head; a pass at a new commit, or after a trusted body edit, removes it. label Nov 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

merge-path: owner-agent Post-merge accounting record (README.md, Merge paths)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant