GitNexus/gitnexus-claude-plugin/hooks
Gergő Magyar f1ba6bb28d
refactor(hooks): use one package entrypoint for Claude hooks (#3879)
* refactor(hooks): share package runtime

Load one package hook from setup and the Claude plugin to prevent drift.

Refs #3869

* fix(hooks): resolve recovery review (#3879)

Cache the validated package runtime and supervise cold recovery in a
helper so concurrent events survive caller exits without repeat installs.
Handle installed shims, npm shell quoting, private state, and cooldowns.

Publish setup files atomically, clarify migration and ownership hints,
and cover recovery on the cross-platform matrix.

Note: pre-existing failure in analysis-publication-flow.test.ts (FTS
unavailable with an empty extension home) not addressed by this PR.

* fix(hooks): handle quoting and hint races

Preserve quoted and escaped Bash queries as one CLI argument. Serialize
rolling hint checks across processes and recover abandoned claims while
protecting successor ownership.

Refs #3879

Note: pre-existing failure in analysis-publication-flow.test.ts (FTS
unavailable with an empty extension home) not addressed by this PR.

* fix(hooks): preserve Windows npx shim paths

Keep discovered executable and batch launchers when npx-cli.js is absent.
Pass batch paths through the quoted environment transport used by hooks.
Complete the remaining finding from the same PR review batch.

Refs #3879

Note: pre-existing failure in analysis-publication-flow.test.ts (FTS
unavailable with an empty extension home) not addressed by this PR.

* test(hooks): model Windows package execution

Replace obsolete direct .cmd targets with Node executables and the
packaged CLI path. Include paths with spaces and literal arguments.

Refs #3879

Note: pre-existing failure in analysis-publication-flow.test.ts (FTS
unavailable with an empty extension home) not addressed by this PR.

* fix(hooks): consume long search option values

Handle --max-count and long context aliases before choosing the query.
Cover rg/grep values, quoted searches, incomplete options, and both
package and plugin entrypoints.

Refs #3879

Note: pre-existing failure in analysis-publication-flow.test.ts (FTS
unavailable with an empty extension home) not addressed by this PR.

* fix(hooks): resolve cross-platform CI failures

Treat Windows access errors during hint-claim contention as a lost
claim, include the launcher source in rebuild fixtures, and resolve
temporary fixture paths before comparing them with runtime paths.

Include the Windows Codex quoting fixes from #3892
(2a3c3ca981).

Co-authored-by: b84330808 <b84330808@gmail.com>

* test(hooks): handle Windows stdin EOF

---------

Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com>
Co-authored-by: b84330808 <b84330808@gmail.com>
2026-11-12 09:54:58 +00:00
..
gitnexus-hook.js refactor(hooks): use one package entrypoint for Claude hooks (#3879) 2026-11-12 09:54:58 +00:00
hooks.json refactor(hooks): use one package entrypoint for Claude hooks (#3879) 2026-11-12 09:54:58 +00:00