gitnexus 1.6.6-rc.50 → 1.6.6-rc.51
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.
- package/package.json +3 -1
- package/scripts/cross-platform-tests.ts +131 -0
- package/scripts/run-cross-platform.ts +44 -0
- package/scripts/run-parity.ts +128 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "gitnexus",
|
|
3
|
-
"version": "1.6.6-rc.
|
|
3
|
+
"version": "1.6.6-rc.51",
|
|
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",
|
|
@@ -48,6 +48,8 @@
|
|
|
48
48
|
"test:integration": "vitest run test/integration",
|
|
49
49
|
"test:watch": "vitest",
|
|
50
50
|
"test:coverage": "vitest run --coverage",
|
|
51
|
+
"test:parity": "tsx scripts/run-parity.ts",
|
|
52
|
+
"test:cross-platform": "tsx scripts/run-cross-platform.ts",
|
|
51
53
|
"postinstall": "node scripts/materialize-vendor-grammars.cjs && node scripts/build-tree-sitter-dart.cjs && node scripts/build-tree-sitter-proto.cjs && node scripts/build-tree-sitter-swift.cjs",
|
|
52
54
|
"prepare": "node scripts/build.js",
|
|
53
55
|
"prepack": "node scripts/build.js"
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-platform test subset runner.
|
|
3
|
+
*
|
|
4
|
+
* Runs only the tests that exercise platform-sensitive behavior on
|
|
5
|
+
* Windows and macOS. The full suite runs on Ubuntu; this narrows the
|
|
6
|
+
* cross-platform matrix to tests that actually vary across OSes.
|
|
7
|
+
*
|
|
8
|
+
* Categories included:
|
|
9
|
+
* - Platform-specific logic (path.sep, process.platform guards)
|
|
10
|
+
* - Native addon loading (LadybugDB, tree-sitter)
|
|
11
|
+
* - Process spawning and shell behavior
|
|
12
|
+
* - Filesystem locking and temp-dir behavior
|
|
13
|
+
* - Worker threads (real, not mocked)
|
|
14
|
+
* - CLI end-to-end tests
|
|
15
|
+
*
|
|
16
|
+
* When adding a new test that uses platform-varying APIs (native addons,
|
|
17
|
+
* child_process with real spawning, filesystem locking, path.sep), add
|
|
18
|
+
* it to the appropriate section below.
|
|
19
|
+
*
|
|
20
|
+
* Usage:
|
|
21
|
+
* npx vitest run $(npx tsx scripts/cross-platform-tests.ts)
|
|
22
|
+
* # or via the package script:
|
|
23
|
+
* npm run test:cross-platform
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
// Platform-specific logic tests — contain explicit process.platform guards
|
|
27
|
+
// or test behavior that differs across operating systems
|
|
28
|
+
const PLATFORM_LOGIC = [
|
|
29
|
+
'test/unit/setup.test.ts',
|
|
30
|
+
'test/unit/setup-jsonc.test.ts',
|
|
31
|
+
'test/unit/setup-codex.test.ts',
|
|
32
|
+
'test/unit/platform-capabilities.test.ts',
|
|
33
|
+
'test/unit/worker-pool-windows-quarantine.test.ts',
|
|
34
|
+
'test/unit/lbug-pool-win-fts-probe.test.ts',
|
|
35
|
+
'test/unit/repo-manager.test.ts',
|
|
36
|
+
'test/unit/repo-manager-finalize-invariant.test.ts',
|
|
37
|
+
'test/unit/hooks.test.ts',
|
|
38
|
+
'test/unit/cursor-hook.test.ts',
|
|
39
|
+
'test/unit/sidecar-recovery.test.ts',
|
|
40
|
+
'test/unit/pool-wal-recovery.test.ts',
|
|
41
|
+
'test/unit/detect-changes-worktree.test.ts',
|
|
42
|
+
'test/unit/eval-server-bind-restriction.test.ts',
|
|
43
|
+
'test/unit/ignore-service.test.ts',
|
|
44
|
+
'test/unit/group/bridge-db.test.ts',
|
|
45
|
+
'test/unit/group/bridge-db-edge.test.ts',
|
|
46
|
+
];
|
|
47
|
+
|
|
48
|
+
// Native LadybugDB integration tests — exercise the @ladybugdb/core
|
|
49
|
+
// N-API addon which has known platform-specific behavior (Windows
|
|
50
|
+
// file-lock lag after close, macOS N-API destructor segfaults)
|
|
51
|
+
const LBUG_NATIVE = [
|
|
52
|
+
'test/integration/lbug-core-adapter.test.ts',
|
|
53
|
+
'test/integration/lbug-vector-extension.test.ts',
|
|
54
|
+
'test/integration/lbug-pool.test.ts',
|
|
55
|
+
'test/integration/lbug-pool-stability.test.ts',
|
|
56
|
+
'test/integration/lbug-lock-retry.test.ts',
|
|
57
|
+
'test/integration/lbug-open-retry.test.ts',
|
|
58
|
+
'test/integration/lbug-close-handle-release.test.ts',
|
|
59
|
+
'test/integration/lbug-orphan-sidecar-recovery.test.ts',
|
|
60
|
+
'test/integration/lbug-readonly-init.test.ts',
|
|
61
|
+
'test/integration/local-backend.test.ts',
|
|
62
|
+
'test/integration/local-backend-calltool.test.ts',
|
|
63
|
+
'test/integration/search-core.test.ts',
|
|
64
|
+
'test/integration/search-pool.test.ts',
|
|
65
|
+
'test/integration/staleness-and-stability.test.ts',
|
|
66
|
+
'test/integration/analyze-wal-checkpoint-failure.test.ts',
|
|
67
|
+
];
|
|
68
|
+
|
|
69
|
+
// Process spawning and CLI tests — exercise child_process with real
|
|
70
|
+
// process spawning, which behaves differently across platforms (shell
|
|
71
|
+
// quoting, path resolution, signal handling)
|
|
72
|
+
const SPAWN_CLI = [
|
|
73
|
+
'test/integration/cli-e2e.test.ts',
|
|
74
|
+
'test/integration/hooks-e2e.test.ts',
|
|
75
|
+
'test/integration/skills-e2e.test.ts',
|
|
76
|
+
'test/integration/server-http-startup.test.ts',
|
|
77
|
+
'test/integration/mcp/server-startup.test.ts',
|
|
78
|
+
'test/integration/analyze-heap-oom-e2e.test.ts',
|
|
79
|
+
'test/integration/group/group-cli.test.ts',
|
|
80
|
+
'test/integration/cli/tool-no-index-stderr.test.ts',
|
|
81
|
+
'test/integration/setup-skills.test.ts',
|
|
82
|
+
];
|
|
83
|
+
|
|
84
|
+
// Worker threads tests — exercise real worker_threads which have
|
|
85
|
+
// platform-specific behavior (thread spawning, IPC, exit handling)
|
|
86
|
+
const WORKER_THREADS = [
|
|
87
|
+
'test/integration/worker-pool.test.ts',
|
|
88
|
+
'test/integration/parse-impl-quarantine-cache-skip.test.ts',
|
|
89
|
+
];
|
|
90
|
+
|
|
91
|
+
// Tree-sitter native addon smoke tests — verify that native grammars
|
|
92
|
+
// load correctly on each platform (binary compatibility, .node loading)
|
|
93
|
+
const NATIVE_ADDON_SMOKE = [
|
|
94
|
+
'test/integration/tree-sitter-languages.test.ts',
|
|
95
|
+
'test/integration/parsing.test.ts',
|
|
96
|
+
'test/integration/pipeline.test.ts',
|
|
97
|
+
'test/integration/pipeline-graph-golden.test.ts',
|
|
98
|
+
'test/unit/parser-loader.test.ts',
|
|
99
|
+
];
|
|
100
|
+
|
|
101
|
+
// Filesystem behavior tests — exercise operations that vary across
|
|
102
|
+
// platforms (CRLF, symlinks, permissions, temp dirs)
|
|
103
|
+
const FILESYSTEM = [
|
|
104
|
+
'test/integration/filesystem-walker.test.ts',
|
|
105
|
+
'test/integration/markdown-processor-crlf.test.ts',
|
|
106
|
+
'test/integration/ignore-and-skip-e2e.test.ts',
|
|
107
|
+
];
|
|
108
|
+
|
|
109
|
+
const ALL_CROSS_PLATFORM = [
|
|
110
|
+
...PLATFORM_LOGIC,
|
|
111
|
+
...LBUG_NATIVE,
|
|
112
|
+
...SPAWN_CLI,
|
|
113
|
+
...WORKER_THREADS,
|
|
114
|
+
...NATIVE_ADDON_SMOKE,
|
|
115
|
+
...FILESYSTEM,
|
|
116
|
+
];
|
|
117
|
+
|
|
118
|
+
// When invoked directly, print the file list for vitest consumption
|
|
119
|
+
if (process.argv[1]?.endsWith('cross-platform-tests.ts')) {
|
|
120
|
+
console.log(ALL_CROSS_PLATFORM.join('\n'));
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
export {
|
|
124
|
+
ALL_CROSS_PLATFORM,
|
|
125
|
+
PLATFORM_LOGIC,
|
|
126
|
+
LBUG_NATIVE,
|
|
127
|
+
SPAWN_CLI,
|
|
128
|
+
WORKER_THREADS,
|
|
129
|
+
NATIVE_ADDON_SMOKE,
|
|
130
|
+
FILESYSTEM,
|
|
131
|
+
};
|
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-platform test runner.
|
|
3
|
+
*
|
|
4
|
+
* Runs the platform-sensitive test subset defined in cross-platform-tests.ts
|
|
5
|
+
* via vitest. Used by `npm run test:cross-platform` and by the CI cross-
|
|
6
|
+
* platform matrix (ci-tests.yml).
|
|
7
|
+
*
|
|
8
|
+
* The main vitest.config.ts is used, so lbug-db project files get
|
|
9
|
+
* sequential execution and other safety constraints are preserved.
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
import { execFileSync } from 'child_process';
|
|
13
|
+
import fs from 'fs';
|
|
14
|
+
import path from 'path';
|
|
15
|
+
import { fileURLToPath } from 'url';
|
|
16
|
+
import { ALL_CROSS_PLATFORM } from './cross-platform-tests.js';
|
|
17
|
+
|
|
18
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
19
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
20
|
+
|
|
21
|
+
// Verify all files exist
|
|
22
|
+
const missing = ALL_CROSS_PLATFORM.filter((f) => !fs.existsSync(path.resolve(ROOT, f)));
|
|
23
|
+
if (missing.length > 0) {
|
|
24
|
+
console.error(`Cross-platform test files not found (${missing.length}):`);
|
|
25
|
+
for (const f of missing) console.error(` ${f}`);
|
|
26
|
+
console.error('\nUpdate scripts/cross-platform-tests.ts if files were moved or removed.');
|
|
27
|
+
process.exit(1);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
console.log(`Running ${ALL_CROSS_PLATFORM.length} platform-sensitive tests...\n`);
|
|
31
|
+
|
|
32
|
+
try {
|
|
33
|
+
execFileSync('npx', ['vitest', 'run', ...ALL_CROSS_PLATFORM], {
|
|
34
|
+
cwd: ROOT,
|
|
35
|
+
stdio: 'inherit',
|
|
36
|
+
timeout: 15 * 60 * 1000,
|
|
37
|
+
shell: true,
|
|
38
|
+
});
|
|
39
|
+
} catch (err: any) {
|
|
40
|
+
if (err.killed || err.signal) {
|
|
41
|
+
console.error('vitest timed out after 15 minutes');
|
|
42
|
+
}
|
|
43
|
+
process.exit(1);
|
|
44
|
+
}
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Consolidated scope-resolution parity runner.
|
|
3
|
+
*
|
|
4
|
+
* Replaces the per-language matrix in ci-scope-parity.yml with a single
|
|
5
|
+
* job that runs all migrated languages sequentially in one process. This
|
|
6
|
+
* eliminates 8× redundant checkout + npm ci + build cycles (the old
|
|
7
|
+
* workflow created a separate GitHub Actions job per language).
|
|
8
|
+
*
|
|
9
|
+
* For each language in MIGRATED_LANGUAGES:
|
|
10
|
+
* 1. Run its resolver test with REGISTRY_PRIMARY_<LANG>=0 (legacy DAG)
|
|
11
|
+
* 2. Run its resolver test with REGISTRY_PRIMARY_<LANG>=1 (registry-primary)
|
|
12
|
+
*
|
|
13
|
+
* Both modes must pass. Failures are collected and reported at the end
|
|
14
|
+
* so all regressions are visible in a single CI run (equivalent to the
|
|
15
|
+
* old workflow's fail-fast: false behavior).
|
|
16
|
+
*
|
|
17
|
+
* Vitest output streams to the console in real time (stdio: 'inherit')
|
|
18
|
+
* so CI logs show the actual test output directly. No per-invocation
|
|
19
|
+
* timeout — the CI job-level timeout (30 min) is the outer guard.
|
|
20
|
+
*
|
|
21
|
+
* Usage:
|
|
22
|
+
* npx tsx scripts/run-parity.ts
|
|
23
|
+
* npx tsx scripts/run-parity.ts --language python # single language
|
|
24
|
+
*/
|
|
25
|
+
|
|
26
|
+
import { execFileSync } from 'child_process';
|
|
27
|
+
import fs from 'fs';
|
|
28
|
+
import path from 'path';
|
|
29
|
+
import { fileURLToPath } from 'url';
|
|
30
|
+
import { MIGRATED_LANGUAGES } from '../src/core/ingestion/registry-primary-flag.js';
|
|
31
|
+
|
|
32
|
+
const __dirname = path.dirname(fileURLToPath(import.meta.url));
|
|
33
|
+
const ROOT = path.resolve(__dirname, '..');
|
|
34
|
+
|
|
35
|
+
interface ParityFailure {
|
|
36
|
+
lang: string;
|
|
37
|
+
mode: 'legacy' | 'registry-primary';
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
function envVarName(slug: string): string {
|
|
41
|
+
return `REGISTRY_PRIMARY_${slug.toUpperCase().replace(/-/g, '_')}`;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
function testFilePath(slug: string): string {
|
|
45
|
+
return `test/integration/resolvers/${slug}.test.ts`;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function runVitest(testFile: string, env: Record<string, string>): boolean {
|
|
49
|
+
try {
|
|
50
|
+
execFileSync('npx', ['vitest', 'run', testFile], {
|
|
51
|
+
cwd: ROOT,
|
|
52
|
+
env: { ...process.env, ...env },
|
|
53
|
+
stdio: 'inherit',
|
|
54
|
+
shell: true,
|
|
55
|
+
});
|
|
56
|
+
return true;
|
|
57
|
+
} catch {
|
|
58
|
+
return false;
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
// Parse CLI args
|
|
63
|
+
const args = process.argv.slice(2);
|
|
64
|
+
const langFlag = args.indexOf('--language');
|
|
65
|
+
const singleLang = langFlag >= 0 ? args[langFlag + 1] : undefined;
|
|
66
|
+
|
|
67
|
+
if (langFlag >= 0 && singleLang === undefined) {
|
|
68
|
+
console.error('--language requires a value');
|
|
69
|
+
process.exit(1);
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
const languages = singleLang ? [singleLang] : [...MIGRATED_LANGUAGES].map(String);
|
|
73
|
+
|
|
74
|
+
// Verify test files exist before running
|
|
75
|
+
const missingFiles: string[] = [];
|
|
76
|
+
for (const lang of languages) {
|
|
77
|
+
const file = path.resolve(ROOT, testFilePath(lang));
|
|
78
|
+
try {
|
|
79
|
+
fs.accessSync(file);
|
|
80
|
+
} catch {
|
|
81
|
+
missingFiles.push(`${testFilePath(lang)} (${lang})`);
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
if (missingFiles.length > 0) {
|
|
86
|
+
console.error('Missing resolver test files:');
|
|
87
|
+
for (const f of missingFiles) console.error(` ${f}`);
|
|
88
|
+
process.exit(1);
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
console.log(`Scope-resolution parity: ${languages.length} language(s)`);
|
|
92
|
+
console.log(`Languages: ${languages.join(', ')}\n`);
|
|
93
|
+
|
|
94
|
+
const failures: ParityFailure[] = [];
|
|
95
|
+
|
|
96
|
+
for (const lang of languages) {
|
|
97
|
+
const file = testFilePath(lang);
|
|
98
|
+
const envVar = envVarName(lang);
|
|
99
|
+
|
|
100
|
+
console.log(`\n── ${lang} — legacy DAG (${envVar}=0) ──`);
|
|
101
|
+
if (!runVitest(file, { [envVar]: '0' })) {
|
|
102
|
+
failures.push({ lang, mode: 'legacy' });
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
console.log(`\n── ${lang} — registry-primary (${envVar}=1) ──`);
|
|
106
|
+
if (!runVitest(file, { [envVar]: '1' })) {
|
|
107
|
+
failures.push({ lang, mode: 'registry-primary' });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// Summary
|
|
112
|
+
const total = languages.length * 2;
|
|
113
|
+
const passed = total - failures.length;
|
|
114
|
+
|
|
115
|
+
console.log('\n═══════════════════════════════════════');
|
|
116
|
+
console.log('PARITY SUMMARY');
|
|
117
|
+
console.log('═══════════════════════════════════════');
|
|
118
|
+
console.log(`Passed: ${passed}/${total}`);
|
|
119
|
+
|
|
120
|
+
if (failures.length > 0) {
|
|
121
|
+
console.log(`\nFAILURES (${failures.length}):`);
|
|
122
|
+
for (const f of failures) {
|
|
123
|
+
console.log(` ✗ ${f.lang} [${f.mode}]`);
|
|
124
|
+
}
|
|
125
|
+
process.exit(1);
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
console.log('\nAll parity checks passed.');
|