fix(#1772): read full multi-line command in graphify-update hook Gate 2 (#1815)

* fix(#1772): read full multi-line command in graphify-update hook Gate 2

The PostToolUse hook joined tool_name + newline + tool_input.command and
extracted the command with sed -n '2p' — line 2 only. Agent runtimes
(Claude Code's Bash tool among them) routinely emit HEAD-advancing commits
as multi-line scripts ('cd /path', then 'git add', then 'git commit …'), so
line 2 is the 'cd', Gate 2's *"git commit"* match failed, and the rebuild
silently no-op'd on real commits despite graphify.auto_update: true.

Capture line 2 through EOF (sed -n '2,$p') so the case glob sees the full
multi-line command string. Single-line behavior is unchanged (the match
only widens); non-HEAD-advancing multi-line commands still no-op cleanly.

Regression tests cover multi-line commit/merge/pull dispatch plus a
multi-line no-op no-regression guard.

* docs(#1772): add changeset fragment for graphify-update multi-line fix

* test(#1772): regenerate golden-install-parity fixtures for hook change

gsd-graphify-update.sh ships to 9 graphify-aware runtimes; widening the
sed range (2p -> 2,$p) shifts its shipped hash. Recapture the 9 affected
fixtures via UPDATE_GOLDEN=1 — each changes exactly one line (the hook hash).
This commit is contained in:
Tom Boucher
2026-06-28 22:42:23 -04:00
committed by GitHub
parent 4f6fda852e
commit 2d314c3a28
12 changed files with 77 additions and 10 deletions

View File

@@ -306,7 +306,7 @@
"hooks/gsd-cursor-post-tool.js": "d61ee04f6ee7858c",
"hooks/gsd-cursor-session-start.js": "148b8ec4e2c97f00",
"hooks/gsd-ensure-canonical-path.js": "83e02e841e123037",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "b602f88f046a7551",

View File

@@ -375,7 +375,7 @@
"hooks/gsd-cursor-post-tool.js": "d61ee04f6ee7858c",
"hooks/gsd-cursor-session-start.js": "148b8ec4e2c97f00",
"hooks/gsd-ensure-canonical-path.js": "3499b6e6b453dc59",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "b602f88f046a7551",

View File

@@ -305,7 +305,7 @@
"hooks/gsd-cursor-post-tool.js": "dd1b12f795de8d72",
"hooks/gsd-cursor-session-start.js": "a93095ac609a3ea6",
"hooks/gsd-ensure-canonical-path.js": "34f4522a23cc5f41",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "b602f88f046a7551",

View File

@@ -375,7 +375,7 @@
"hooks/gsd-cursor-post-tool.js": "d61ee04f6ee7858c",
"hooks/gsd-cursor-session-start.js": "148b8ec4e2c97f00",
"hooks/gsd-ensure-canonical-path.js": "6900c226c1c28a44",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "b602f88f046a7551",

View File

@@ -375,7 +375,7 @@
"hooks/gsd-cursor-post-tool.js": "d61ee04f6ee7858c",
"hooks/gsd-cursor-session-start.js": "148b8ec4e2c97f00",
"hooks/gsd-ensure-canonical-path.js": "a19947cac42002d4",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "b602f88f046a7551",

View File

@@ -306,7 +306,7 @@
"hooks/gsd-cursor-post-tool.js": "dd1b12f795de8d72",
"hooks/gsd-cursor-session-start.js": "a93095ac609a3ea6",
"hooks/gsd-ensure-canonical-path.js": "c49fb011c3b97f4a",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "474bc1800d34456f",

View File

@@ -375,7 +375,7 @@
"hooks/gsd-cursor-post-tool.js": "d61ee04f6ee7858c",
"hooks/gsd-cursor-session-start.js": "148b8ec4e2c97f00",
"hooks/gsd-ensure-canonical-path.js": "a5c67a1a7abc90c0",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "b602f88f046a7551",

View File

@@ -375,7 +375,7 @@
"hooks/gsd-cursor-post-tool.js": "d61ee04f6ee7858c",
"hooks/gsd-cursor-session-start.js": "148b8ec4e2c97f00",
"hooks/gsd-ensure-canonical-path.js": "5f8be5b0a01a88ea",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "b602f88f046a7551",

View File

@@ -306,7 +306,7 @@
"hooks/gsd-cursor-post-tool.js": "dd1b12f795de8d72",
"hooks/gsd-cursor-session-start.js": "a93095ac609a3ea6",
"hooks/gsd-ensure-canonical-path.js": "4c1626ed20ab7a75",
"hooks/gsd-graphify-update.sh": "396ebda3c6705dc9",
"hooks/gsd-graphify-update.sh": "845aeecb0d82dd6e",
"hooks/gsd-phase-boundary.sh": "6aa3ba9af3d465d9",
"hooks/gsd-prompt-guard.js": "4b08c2dce0233e2d",
"hooks/gsd-read-guard.js": "9d1b227b6fcb6dba",