mirror of
https://github.com/abhigyanpatwari/GitNexus.git
synced 2026-10-11 03:38:07 +00:00
* fix(deps): upgrade native tree-sitter to 0.25.1 * fix(tree-sitter): preserve sync loading and update verified capture baselines Route C# scope queries through the synchronous native grammar loader so the compiled analyze module remains require-compatible on Node 22.18. Refresh only the audited empty-Python-module and renamed-PHP-fixture captures, and pin the runtime assertion to 0.25.1. Validated 479 targeted tests, all 16 scope-capture benchmark cases, Python capture/import guards, compiled C# worker parsing, build, typecheck and formatting. Performance budgets are unchanged. * fix(tree-sitter): refresh upstream vendors and preserve parser semantics * fix(ci): refresh prebuilds and support Windows ARM Refresh macOS, Linux ARM, and Windows x64 grammar binaries from the successful native CI builds. Pin node-gyp 12.4.0 so the Windows ARM jobs recognize Visual Studio 2026. Use local Git filtering for E2E to avoid PR-files API timeouts on generated parser diffs. Validation: 143 focused tests, Actionlint, and all 16 scope-capture benchmark checks passed. Full npm test run started; native database suites still running. * fix(ci): refresh Windows ARM grammar prebuilds Import all seven Windows ARM grammar artifacts from successful native build run 37965761760. Artifact filenames and SHA-256 hashes verified; all 42 native build jobs passed. Validation: 31 prebuild coverage tests passed. * fix(bench): stabilize scope capture timing guard Warm each input size seven times and use 21 median samples while retaining isolated timing blocks. Yield between languages so native finalizers release allocations outside the measured sections. Keep all fixture sizes, fingerprints, scaling formulas, and budgets unchanged. Validation: all 16 language guards passed with a 2 GB heap limit (1.38 deep-chain ratio; 1518 MB peak RSS). Linear and quadratic controls passed their expected guard outcomes. Formatting and graph change analysis passed. Full npm test is running without failures so far. * fix(parser): reduce TypeScript capture traversal cost * fix(test): await parser worker readiness before teardown * fix(parser): load C# synchronously in workers * fix(grpc): resolve native proto detections against their own file With the native proto grammar active, sibling .proto files that declare the same short service name under different packages tied in the directory-based resolveProtoConflict heuristic and both providers were dropped. A proto-origin detection already knows its defining file, so use that file's entry before falling back to the heuristic. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci(packaging): assert native grammars load from the installed tarball The packaged-install smoke only ran `gitnexus --version`, so a grammar that failed to load from the published package (bundled runtime, patched peer manifests, vendored prebuilds, C# sync loader, Protobuf wrapper) would ship silently; the dev-tree ABI smoke also accepts vendored grammars that report unavailable. Parse a sample for every registered grammar plus the native Protobuf plugin from the installed package, on the main thread and in a worker thread. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * ci(tree-sitter): track compatibility workarounds instead of 0.25 readiness The daily readiness report still targeted tree-sitter@0.25.0, so after the upgrade it would keep reporting "Blocked" and never close its tracking issue. Repurpose it to track what we carry for the bundled runtime: derive the target from the package.json pin, list each pack-time peer patch from prepare-tree-sitter-bundle.cjs with its drop condition (bump, wait for an upstream release, transitive, or intentionally pinned), and reword the buckets. The workflow adopts the issue opened under the old title. Also update the grammar-update-monitor header and auto-PR text, which still described the 0.21.1 runtime and a tree-sitter-c hold. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> * test(dart): assert both nested labels target the loop; fix Zig call-shape doc The nested-label CFG test only jumped to `outer` and checked reachability, which still passes when a jump is retargeted to the inner loop (its exit reaches the outer header). Jump to both labels and assert the exact `continue` edges; dropping the inner label now fails the test. Update the Zig callable-flow comment: call_expression now wraps actuals in a required `arguments:` field. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> --------- Co-authored-by: Codex <codex@openai.com> Co-authored-by: Gergo Magyar <gergomagyar0@gmail.com> Co-authored-by: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
97 lines
4 KiB
JavaScript
97 lines
4 KiB
JavaScript
#!/usr/bin/env node
|
|
// Packaged-install smoke for the bundled tree-sitter runtime and grammars.
|
|
// Every registered grammar — including the vendored "optional" ones, which
|
|
// ship prebuilds for every supported platform — must load and parse a sample
|
|
// cleanly from the INSTALLED package, on the main thread and in a worker
|
|
// thread (the parse pipeline's real host). Usage:
|
|
// node scripts/assert-native-parsers.mjs <installed gitnexus dir>
|
|
import { createRequire } from 'node:module';
|
|
import path from 'node:path';
|
|
import { pathToFileURL } from 'node:url';
|
|
import { Worker, isMainThread, workerData, parentPort } from 'node:worker_threads';
|
|
|
|
// One sample per grammar key. A key without a sample fails the check, so a new
|
|
// grammar cannot ship without packaged coverage.
|
|
const SAMPLES = {
|
|
javascript: 'function f(a) { return a + 1; }\n',
|
|
typescript: 'class A { m(x: number): void {} }\n',
|
|
'typescript:tsx': 'const C = () => <div className="x">{1}</div>;\n',
|
|
python: 'def f(x):\n return x\n',
|
|
java: 'class A { void m() {} }\n',
|
|
csharp: 'class A { void M() {} }\n',
|
|
cpp: 'struct A { void m(); };\nint main() { return 0; }\n',
|
|
'objective-c': '@interface A : NSObject\n- (void)m;\n@end\n',
|
|
go: 'package main\nfunc main() {}\n',
|
|
rust: 'fn main() { let x = 1; }\n',
|
|
php: '<?php function f($a) { return $a; }\n',
|
|
ruby: 'def f(a)\n a\nend\n',
|
|
vue: 'export default { data() { return {}; } };\n',
|
|
c: 'int add(int a, int b) { return a + b; }\n',
|
|
swift: 'class A { func m() {} }\n',
|
|
dart: 'void main() { print(1); }\n',
|
|
kotlin: 'class A {\n fun m() {}\n}\n',
|
|
zig: 'pub fn main() void {}\n',
|
|
};
|
|
|
|
async function check(installedDir) {
|
|
const load = (rel) => import(pathToFileURL(path.join(installedDir, rel)).href);
|
|
const Parser = createRequire(path.join(installedDir, 'package.json'))('tree-sitter');
|
|
const { listGrammarSources, getLanguageGrammar } = await load(
|
|
'dist/core/tree-sitter/parser-loader.js',
|
|
);
|
|
const failures = [];
|
|
const keys = listGrammarSources().map((s) => s.key);
|
|
for (const key of keys) {
|
|
const sample = SAMPLES[key];
|
|
if (sample === undefined) {
|
|
failures.push(`${key}: no sample in assert-native-parsers.mjs`);
|
|
continue;
|
|
}
|
|
try {
|
|
const [language, variant] = key.split(':');
|
|
const parser = new Parser();
|
|
parser.setLanguage(getLanguageGrammar(language, variant ? `x.${variant}` : undefined));
|
|
const root = parser.parse(sample).rootNode;
|
|
if (root.hasError || root.namedChildCount === 0) {
|
|
failures.push(`${key}: parsed with errors: ${root.toString().slice(0, 200)}`);
|
|
}
|
|
} catch (err) {
|
|
failures.push(`${key}: ${err instanceof Error ? err.message : String(err)}`);
|
|
}
|
|
}
|
|
const { PROTO_GRPC_PLUGIN } = await load('dist/core/group/extractors/grpc-patterns/proto.js');
|
|
if (PROTO_GRPC_PLUGIN === null) {
|
|
failures.push('proto: native Protobuf grammar failed to initialize');
|
|
} else {
|
|
const parser = new Parser();
|
|
parser.setLanguage(PROTO_GRPC_PLUGIN.language);
|
|
const found = PROTO_GRPC_PLUGIN.scan(
|
|
parser.parse('syntax = "proto3";\nservice S { rpc M (R) returns (R); }\n'),
|
|
).map((d) => d.symbolName);
|
|
if (found.join() !== 'S.M') failures.push(`proto: expected [S.M], got [${found}]`);
|
|
}
|
|
return { checked: keys.length + 1, failures };
|
|
}
|
|
|
|
if (!isMainThread) {
|
|
parentPort.postMessage(await check(workerData));
|
|
} else {
|
|
const installedDir = path.resolve(process.argv[2] ?? '.');
|
|
const main = await check(installedDir);
|
|
const worker = await new Promise((resolve, reject) => {
|
|
const w = new Worker(new URL(import.meta.url), { workerData: installedDir });
|
|
w.once('message', resolve);
|
|
w.once('error', reject);
|
|
});
|
|
const failures = [
|
|
...main.failures.map((f) => `[main] ${f}`),
|
|
...worker.failures.map((f) => `[worker] ${f}`),
|
|
];
|
|
if (failures.length > 0) {
|
|
console.error(`[native-parsers] ${failures.length} failure(s):\n${failures.join('\n')}`);
|
|
process.exit(1);
|
|
}
|
|
console.log(
|
|
`[native-parsers] ${main.checked} grammar(s) parsed cleanly on the main thread and in a worker`,
|
|
);
|
|
}
|