gitnexus 1.6.8-rc.53 → 1.6.8-rc.54

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -551,6 +551,8 @@ function isFollowedByPackExpansion(baseClause, childIndex) {
551
551
  return true;
552
552
  if (sibling.type === ',' || sibling.type === 'access_specifier')
553
553
  return false;
554
+ if (sibling.type === 'comment')
555
+ continue;
554
556
  if (sibling.isNamed)
555
557
  return false;
556
558
  }
@@ -99,6 +99,17 @@ function resolveHookBinary(tool) {
99
99
  return tool;
100
100
  }
101
101
 
102
+ function hasMissingHookBinaryOverride(tool) {
103
+ const envKey = tool === 'lsof' ? 'GITNEXUS_HOOK_LSOF_PATH' : 'GITNEXUS_HOOK_PS_PATH';
104
+ const fromEnv = process.env[envKey];
105
+ if (!fromEnv || !String(fromEnv).trim()) return false;
106
+ try {
107
+ return !fs.existsSync(String(fromEnv).trim());
108
+ } catch {
109
+ return true;
110
+ }
111
+ }
112
+
102
113
  // Sentinel:
103
114
  // undefined = not resolved yet (resolve lazily, on first lsof/ps fallback)
104
115
  // string = self-tested coreutils timeout/gtimeout path (use as wrapper)
@@ -597,6 +608,9 @@ function linuxProcScanFindGitNexusServer(dbPathAbs, myPid) {
597
608
 
598
609
  function unixLsofPsFindGitNexusServer(dbPathAbs, myPid) {
599
610
  const guard = resolveUnixGuardTimeout();
611
+ // An explicit missing override models ENOENT and must fail open instead of
612
+ // falling through to a host binary with different process-table visibility.
613
+ if (hasMissingHookBinaryOverride('lsof')) return false;
600
614
  const lsofPath = resolveHookBinary('lsof');
601
615
  // The spawnSync timeouts below (lsof 1000ms / ps 500ms) are deliberately
602
616
  // SHORTER than the wrapper budgets (2s / 1s): on the supervised path Node's
@@ -629,9 +643,12 @@ function unixLsofPsFindGitNexusServer(dbPathAbs, myPid) {
629
643
  if (guard && (lsof.status === 124 || lsof.status === 137)) return true;
630
644
 
631
645
  const pids = (lsof.stdout || '').split(/\s+/).filter(Boolean);
646
+ const psMissing = hasMissingHookBinaryOverride('ps');
632
647
  const psPath = resolveHookBinary('ps');
633
648
  for (const pid of pids) {
634
649
  if (Number(pid) === myPid) continue;
650
+ // Missing ps means we cannot verify that this pid is a GitNexus server.
651
+ if (psMissing) continue;
635
652
  const [psCmd, psArgs] = guard
636
653
  ? [guard, ['-k', '1', '1', psPath, '-p', pid, '-o', 'command=']]
637
654
  : [psPath, ['-p', pid, '-o', 'command=']];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "gitnexus",
3
- "version": "1.6.8-rc.53",
3
+ "version": "1.6.8-rc.54",
4
4
  "description": "Graph-powered code intelligence for AI agents. Index any codebase, query via MCP or CLI.",
5
5
  "author": "Abhigyan Patwari",
6
6
  "license": "PolyForm-Noncommercial-1.0.0",