Implement gitnexus-refresh hook, add skill for initialization gitnexus#76
Conversation
Rosetta Triage ReviewSummary: This PR implements the Findings:
Suggestions:
Automated triage by Rosetta agent |
…oncatenation, inherit stdio for log output
…identity check so only the last-spawned deferred process runs.
mkuznietsov
left a comment
There was a problem hiding this comment.
Looks good to me. Please merge latest v3
…s-hook-integration-v3
| ` const current = fs.readFileSync('${stampFile}', 'utf-8').trim();`, | ||
| ` if (current !== '${token}') process.exit(0);`, | ||
| ` require('child_process').execSync(`, | ||
| ` 'npx gitnexus analyze --force${extraFlags}',`, |
There was a problem hiding this comment.
Please double check --force
There was a problem hiding this comment.
@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.
…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.
…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
No description provided.