Skip to content

Implement gitnexus-refresh hook, add skill for initialization gitnexus#76

Merged
YevheniiaLementova merged 7 commits into
v3from
CTORNDGAIN-1327-gitnexus-hook-integration-v3
Apr 30, 2026
Merged

Implement gitnexus-refresh hook, add skill for initialization gitnexus#76
YevheniiaLementova merged 7 commits into
v3from
CTORNDGAIN-1327-gitnexus-hook-integration-v3

Conversation

@YevheniiaLementova
Copy link
Copy Markdown
Contributor

No description provided.

@github-actions
Copy link
Copy Markdown
Contributor

Rosetta Triage Review

Summary: This PR implements the gitnexus-refresh PostToolUse hook that silently re-indexes GitNexus after file edits, and adds a new opt-in gitnexus installation skill — distributed across all four plugin targets (Claude, Codex, Copilot, Cursor) with an updated build pipeline and a 296-line test suite.

Findings:

  • Empty PR description: The body is blank, leaving no explanation of what changed or why. Please add a summary, motivation, and testing notes.
  • Committed dist artifact: hooks/dist/src/gitnexus-refresh.js is a compiled CJS output in dist/src/ that references ./adapter without bundling it — this looks like a development artifact rather than a deployable hook. Per the architecture, only dist/bundles/ files are used by plugins; verify whether this file is intentional or should be excluded via .gitignore.
  • Phase renumbering (potential state breakage): The verification phase in init-workspace-flow.md was renumbered from 8 → 9 to insert the new GitNexus phase. Users with existing state files that recorded phase 8 as completed may need to migrate or re-run verification.
  • Target branch: PR targets v3 (not main), which appears intentional for pre-release, but should be confirmed.
  • Code quality: Hook implementation is clean — debounce via stamp files, no stdout output, silent failure on all error paths, detached subprocess correctly unreffed.
  • Test coverage: Comprehensive vitest suite covering event filter, tool filter, debounce, spawn args, and error paths.

Suggestions:

  • Add a PR description covering: the GitNexus integration rationale, which editors are supported, and how to test end-to-end.
  • Either add hooks/dist/src/ to .gitignore or document why dist/src/gitnexus-refresh.js is intentionally committed.
  • Consider adding a migration note or version bump for the phase renumbering to inform users of existing state files.

Automated triage by Rosetta agent

…identity check so only the last-spawned deferred process runs.
sharkich added a commit that referenced this pull request Apr 29, 2026
Copy link
Copy Markdown
Contributor

@mkuznietsov mkuznietsov left a comment

Choose a reason for hiding this comment

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

Looks good to me. Please merge latest v3

` const current = fs.readFileSync('${stampFile}', 'utf-8').trim();`,
` if (current !== '${token}') process.exit(0);`,
` require('child_process').execSync(`,
` 'npx gitnexus analyze --force${extraFlags}',`,
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.

Please double check --force

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@isolomatov-gd
Sure, I checked how npx gitnexus analyze works under the hood. Without --force, if the git commit hasn't changed it exits immediately - nothing runs at all (https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/src/core/run-analyze.ts#L166). Overall in any cases with --force or without it, the graph DB is always deleted and rebuilt from scratch regardless but it isn't the most time consuming operation. The real cost is embedding generation, and even with --force, only nodes whose content actually changed get new embeddings, unchanged symbols reuse the cached vectors (https://github.com/abhigyanpatwari/GitNexus/blob/main/gitnexus/src/core/embedding-mode.ts#L11).

So, --force must be used according to the logic of this hook.

@YevheniiaLementova YevheniiaLementova merged commit b9b4214 into v3 Apr 30, 2026
2 checks passed
sharkich added a commit that referenced this pull request May 4, 2026
…heck

Replaces timestamp-age comparison (Date.now() - stamp < DEBOUNCE_MS) with
token-identity check (current !== token). Each spawn writes a unique token;
deferred process exits early if a newer spawn replaced the token, eliminating
the race window in the timestamp approach.

Syncs debounce strategy with the fix landed in v3 via PR #76.
sharkich added a commit that referenced this pull request May 4, 2026
…n-only

Brings in gitnexus-refresh hook (PR #76), token-identity debounce
improvement, and matcher fixes from origin/v3.

Conflict resolution:
- hooks/scripts/build-bundles.mjs: kept ours (auto-discover from src/hooks/)
- hooks/src/hooks/gitnexus-refresh.ts: kept ours (defineHook/runHook
  architecture + token-identity debounce already applied)
- hooks/tests/gitnexus-refresh.test.ts: kept ours (runHook-based tests)
- plugins/*/hooks/gitnexus-refresh.js: kept ours (bundle artefacts,
  rebuilt from source)
- hooks.json/tmpl per-plugin: auto-merged — loose-files retains
  creation-only matcher; gitnexus-refresh uses v3 broader matcher
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants