feat: add cross-platform Node Git hook - #24
Merged
Conversation
anusbutt
force-pushed
the
002-cross-platform-git-hook
branch
from
August 13, 2026 13:25
1e700a6 to
181f80b
Compare
anusbutt
force-pushed
the
002-cross-platform-git-hook
branch
from
August 13, 2026 13:30
181f80b to
d2ee30d
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Outcome
Replace the package-owned shell pre-commit wrapper with a minimal, rule-free Node launcher that invokes the same repository-local
scripts/validate.mjs --stagedvalidator used bygraphkeeper check.PR #23 was squash-merged while this PR was stacked. This branch has been rebased onto the resulting
main, so the review now contains one Phase 3 commit and 12 changed files only.This PR does not change query, update, prerequisites,
validate.sh, graph schema/data, or claim complete native Windows support.Evidence
The initial CI run exposed two independent issues:
The hook now uses dynamic built-in imports compatible with Node 18 in both CommonJS and ESM scopes. The Windows acceptance test resolves and removes the actual directories providing sh and jq while preserving Git and Node.
Verification after the fixes:
core.hooksPath.npm run validator:check,npm run typecheck, andnpm run package:smokepassed.node --check templates/pre-commit, LF-only verification, andgit diff --checkpassed.Checklist
npm run buildpasses.npm run typecheckpasses.npm run package:smokepasses and the tarball contains intended assets only.sh -n scripts/validate.shandnode --check templates/pre-commitpass.Compatibility and recovery
Only the exact package-owned legacy installed hook or exact package-owned legacy fallback is migrated. Modified marker-bearing hooks, third-party hooks, custom hook paths, and concurrent edits remain protected. The launcher forwards validator output and status and fails closed when the repository Node validator is missing.
Linux, macOS, Windows Git Bash, and native-Windows hook journeys are verified for this phase. Query still requires jq, and init/update still reject native PowerShell, so the overall native Windows support claim remains deferred to later phases.