homegraph 1.5.0 → 1.5.1
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/LICENSE +21 -21
- package/README.md +305 -305
- package/dist/bin/command-supervision.d.ts.map +1 -1
- package/dist/bin/command-supervision.js +7 -4
- package/dist/bin/command-supervision.js.map +1 -1
- package/dist/bin/homegraph.js +9 -9
- package/dist/db/index.js +36 -36
- package/dist/db/migrations.js +37 -37
- package/dist/db/queries.js +156 -156
- package/dist/db/schema.sql +203 -203
- package/dist/directory.js +5 -5
- package/dist/extraction/languages/arkts-viewtree.d.ts +2 -4
- package/dist/extraction/languages/arkts-viewtree.d.ts.map +1 -1
- package/dist/extraction/languages/arkts-viewtree.js +6 -21
- package/dist/extraction/languages/arkts-viewtree.js.map +1 -1
- package/dist/extraction/languages/arkts.d.ts +16 -6
- package/dist/extraction/languages/arkts.d.ts.map +1 -1
- package/dist/extraction/languages/arkts.js +174 -21
- package/dist/extraction/languages/arkts.js.map +1 -1
- package/dist/extraction/wasm/tree-sitter-c_sharp.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfml.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfquery.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cfscript.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-cobol.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-erlang.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-nix.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-pascal.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-vbnet.wasm +0 -0
- package/dist/installer/instructions-template.js +9 -9
- package/dist/mcp/liveness-watchdog.d.ts +18 -0
- package/dist/mcp/liveness-watchdog.d.ts.map +1 -1
- package/dist/mcp/liveness-watchdog.js +185 -73
- package/dist/mcp/liveness-watchdog.js.map +1 -1
- package/dist/mcp/server-instructions.js +47 -47
- package/dist/reasoning/reasoner.js +32 -32
- package/dist/spec/db/commit-node.js +4 -4
- package/dist/spec/db/fragment-node.js +10 -10
- package/dist/spec/db/fts.js +8 -8
- package/dist/spec/db/relations.js +88 -88
- package/dist/spec/db/schema.js +6 -6
- package/dist/spec/db/schema.sql +121 -121
- package/dist/spec/db/spec-node.js +4 -4
- package/dist/spec/llm/prompts.js +53 -53
- package/dist/spec/utils.d.ts +16 -4
- package/dist/spec/utils.d.ts.map +1 -1
- package/dist/spec/utils.js +58 -6
- package/dist/spec/utils.js.map +1 -1
- package/package.json +62 -62
- package/scripts/_tmp-cfwk-resolve.log +0 -0
- package/scripts/_tmp-cfwk-sig.log +0 -0
- package/scripts/_tmp-cfwk-vt.log +0 -0
- package/scripts/add-lang/bench.sh +60 -60
- package/scripts/add-lang/check-grammar.mjs +75 -75
- package/scripts/add-lang/dump-ast.mjs +103 -103
- package/scripts/add-lang/verify-extraction.mjs +70 -70
- package/scripts/agent-eval/ab-adoption.sh +91 -91
- package/scripts/agent-eval/ab-hook.sh +86 -86
- package/scripts/agent-eval/ab-impl.sh +78 -78
- package/scripts/agent-eval/ab-new-vs-baseline.sh +102 -102
- package/scripts/agent-eval/ab-sufficiency.sh +78 -78
- package/scripts/agent-eval/arms-F.sh +21 -21
- package/scripts/agent-eval/arms-matrix.sh +37 -37
- package/scripts/agent-eval/audit.sh +68 -68
- package/scripts/agent-eval/bench-readme.sh +28 -28
- package/scripts/agent-eval/bench-why-repo.sh +22 -22
- package/scripts/agent-eval/block-read-hook.sh +19 -19
- package/scripts/agent-eval/hook-settings.json +15 -15
- package/scripts/agent-eval/itrun.sh +120 -120
- package/scripts/agent-eval/offload-eval-3arm.sh +72 -72
- package/scripts/agent-eval/offload-eval-cost.mjs +133 -133
- package/scripts/agent-eval/offload-eval-effort.mjs +108 -108
- package/scripts/agent-eval/offload-eval-frontload-matrix.sh +25 -25
- package/scripts/agent-eval/offload-eval-frontload.sh +47 -47
- package/scripts/agent-eval/offload-eval-ground-truth.json +18 -18
- package/scripts/agent-eval/offload-eval-hook.mjs +84 -84
- package/scripts/agent-eval/offload-eval-judge.mjs +103 -103
- package/scripts/agent-eval/offload-eval-matrix.sh +20 -20
- package/scripts/agent-eval/offload-eval-metrics.mjs +94 -94
- package/scripts/agent-eval/offload-eval-refs1.sh +50 -50
- package/scripts/agent-eval/offload-eval-setup.sh +24 -24
- package/scripts/agent-eval/offload-eval-styles.sh +71 -71
- package/scripts/agent-eval/offload-eval-summarize.mjs +68 -68
- package/scripts/agent-eval/offload-eval.md +76 -76
- package/scripts/agent-eval/parse-arms.mjs +116 -116
- package/scripts/agent-eval/parse-bench-readme.mjs +84 -84
- package/scripts/agent-eval/parse-run.mjs +45 -45
- package/scripts/agent-eval/parse-session.mjs +93 -93
- package/scripts/agent-eval/probe-context.mjs +21 -21
- package/scripts/agent-eval/probe-explore.mjs +40 -40
- package/scripts/agent-eval/probe-node.mjs +20 -20
- package/scripts/agent-eval/probe-sweep.mjs +119 -119
- package/scripts/agent-eval/probe-trace.mjs +20 -20
- package/scripts/agent-eval/redirect-read-hook.sh +38 -38
- package/scripts/agent-eval/repro-concurrent-explore.mjs +119 -119
- package/scripts/agent-eval/repro-daemon-clients.mjs +125 -125
- package/scripts/agent-eval/run-agent.sh +34 -34
- package/scripts/agent-eval/run-all.sh +75 -75
- package/scripts/agent-eval/run-arms.sh +56 -56
- package/scripts/agent-eval/seq-matrix.mjs +137 -137
- package/scripts/bench-arkts-init-rss.log +0 -0
- package/scripts/build-bundle.sh +123 -123
- package/scripts/exp_boundary_eval/README.md +247 -247
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/_utils.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/analyze.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/deveco_arm.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_all.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_one.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/run_session.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-310.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/setup.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/__pycache__/win_mcp_launcher.cpython-38.pyc +0 -0
- package/scripts/exp_boundary_eval/_test_mcp_chain.py +78 -78
- package/scripts/exp_boundary_eval/_test_stdin.py +8 -8
- package/scripts/exp_boundary_eval/_utils.py +1116 -1116
- package/scripts/exp_boundary_eval/analyze.py +1313 -1313
- package/scripts/exp_boundary_eval/deveco_arm.py +519 -519
- package/scripts/exp_boundary_eval/run_all.py +378 -378
- package/scripts/exp_boundary_eval/run_one.py +165 -165
- package/scripts/exp_boundary_eval/run_session.py +158 -158
- package/scripts/exp_boundary_eval/setup.py +120 -120
- package/scripts/exp_boundary_eval/win_mcp_launcher.py +73 -73
- package/scripts/exp_boundary_eval/win_mcp_stdio_wrap.js +36 -36
- package/scripts/exp_boundary_eval/win_node_launcher.py +24 -24
- package/scripts/extract-release-notes.mjs +130 -130
- package/scripts/local-install.sh +41 -41
- package/scripts/npm-sdk.js +75 -75
- package/scripts/npm-shim.js +275 -275
- package/scripts/ohos-sdk-publish.mjs +133 -133
- package/scripts/pack-npm.sh +119 -119
- package/scripts/prepare-release.mjs +270 -270
- package/scripts/probe-arkts-mem-why-run.log +0 -0
- package/scripts/probe-banner-livecard-ir.log +0 -0
- package/scripts/probe-cfwk-ast.stderr.log +0 -0
- package/scripts/probe-cfwk-ast.stdout.log +0 -0
- package/scripts/probe-cfwk-attr-shape.log +0 -0
- package/scripts/probe-cfwk-cfgdump.stderr.log +0 -0
- package/scripts/probe-cfwk-cfgdump.stdout.log +0 -0
- package/scripts/probe-cfwk-cvc.stderr.log +0 -0
- package/scripts/probe-cfwk-cvc.stdout.log +0 -0
- package/scripts/probe-cfwk-diag2.log +0 -0
- package/scripts/probe-cfwk-diag3.log +0 -0
- package/scripts/probe-cfwk-fedbg.stderr.log +0 -0
- package/scripts/probe-cfwk-fedbg.stdout.log +0 -0
- package/scripts/probe-cfwk-fileresult.log +0 -0
- package/scripts/probe-cfwk-fix.stderr.log +0 -0
- package/scripts/probe-cfwk-fix.stdout.log +0 -0
- package/scripts/probe-cfwk-fix2.stderr.log +0 -0
- package/scripts/probe-cfwk-fix2.stdout.log +0 -0
- package/scripts/probe-cfwk-fix3.stderr.log +0 -0
- package/scripts/probe-cfwk-fix3.stdout.log +0 -0
- package/scripts/probe-cfwk-foreach.log +0 -0
- package/scripts/probe-cfwk-getmethod-throw.log +0 -0
- package/scripts/probe-cfwk-hg-extract.log +0 -0
- package/scripts/probe-cfwk-pr1003-noprior.stderr.log +0 -0
- package/scripts/probe-cfwk-pr1003-noprior.stdout.log +0 -0
- package/scripts/probe-cfwk-pr1003.stderr.log +0 -0
- package/scripts/probe-cfwk-pr1003.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-noprior.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-noprior.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-prior.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-prior.stdout.log +0 -0
- package/scripts/probe-cfwk-preroot-skipstate.stderr.log +0 -0
- package/scripts/probe-cfwk-preroot-skipstate.stdout.log +0 -0
- package/scripts/probe-cfwk-resolve-sim.log +0 -0
- package/scripts/probe-cfwk-tree-shape.log +0 -0
- package/scripts/probe-cfwk-walk-abort.log +0 -0
- package/scripts/probe-cfwk.log +0 -0
- package/scripts/probe-force-index.log +0 -0
- package/scripts/probe-no-force-index.log +0 -0
- package/scripts/probe-samefile-ir.stderr.log +0 -0
- package/scripts/probe-samefile-ir.stdout.log +224 -0
- package/scripts/probe-sdk-vs-project.log +0 -0
- package/scripts/probe-viewtree-downgrade.log +0 -0
- package/dist/arkts/ohos-api-index.d.ts +0 -15
- package/dist/arkts/ohos-api-index.d.ts.map +0 -1
- package/dist/arkts/ohos-api-index.js +0 -190
- package/dist/arkts/ohos-api-index.js.map +0 -1
- package/dist/arkts/ohos-sdk-input.d.ts +0 -36
- package/dist/arkts/ohos-sdk-input.d.ts.map +0 -1
- package/dist/arkts/ohos-sdk-input.js +0 -214
- package/dist/arkts/ohos-sdk-input.js.map +0 -1
- package/dist/extraction/languages/arkts-state-decorators.d.ts +0 -13
- package/dist/extraction/languages/arkts-state-decorators.d.ts.map +0 -1
- package/dist/extraction/languages/arkts-state-decorators.js +0 -26
- package/dist/extraction/languages/arkts-state-decorators.js.map +0 -1
- package/dist/extraction/languages/ohos-api-consumer.d.ts +0 -34
- package/dist/extraction/languages/ohos-api-consumer.d.ts.map +0 -1
- package/dist/extraction/languages/ohos-api-consumer.js +0 -283
- package/dist/extraction/languages/ohos-api-consumer.js.map +0 -1
- package/dist/spec/build/git-scanner.d.ts +0 -93
- package/dist/spec/build/git-scanner.d.ts.map +0 -1
- package/dist/spec/build/git-scanner.js +0 -254
- package/dist/spec/build/git-scanner.js.map +0 -1
- package/dist/spec/git-utils.d.ts +0 -8
- package/dist/spec/git-utils.d.ts.map +0 -1
- package/dist/spec/git-utils.js +0 -14
- package/dist/spec/git-utils.js.map +0 -1
- package/dist/spec/mine/clusterer.d.ts +0 -63
- package/dist/spec/mine/clusterer.d.ts.map +0 -1
- package/dist/spec/mine/clusterer.js +0 -904
- package/dist/spec/mine/clusterer.js.map +0 -1
- package/dist/spec/mine/progress-handler.d.ts +0 -22
- package/dist/spec/mine/progress-handler.d.ts.map +0 -1
- package/dist/spec/mine/progress-handler.js +0 -108
- package/dist/spec/mine/progress-handler.js.map +0 -1
- package/dist/spec/mine/progress.d.ts +0 -23
- package/dist/spec/mine/progress.d.ts.map +0 -1
- package/dist/spec/mine/progress.js +0 -12
- package/dist/spec/mine/progress.js.map +0 -1
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Verify a tree-sitter grammar wasm is HEALTHY under the project's web-tree-sitter
|
|
3
|
-
// runtime BEFORE writing an extractor. Prints the ABI version and parses a valid
|
|
4
|
-
// sample many times in a multi-grammar context, to catch heap-corruption bugs
|
|
5
|
-
// that silently drop nodes on every parse after the first.
|
|
6
|
-
//
|
|
7
|
-
// Why this exists: the tree-sitter-wasms Lua grammar is ABI 13 and corrupts the
|
|
8
|
-
// shared WASM heap under web-tree-sitter 0.25 — Lua extraction degraded on every
|
|
9
|
-
// file after the first (nested calls/imports vanished). The fix was to vendor the
|
|
10
|
-
// upstream ABI-15 wasm. Run this on any new grammar first; if it FAILs, vendor a
|
|
11
|
-
// newer build instead of using the tree-sitter-wasms one.
|
|
12
|
-
//
|
|
13
|
-
// Usage: node scripts/add-lang/check-grammar.mjs <lang|wasm-path> <valid-sample> [iterations]
|
|
14
|
-
// Exit: 0 healthy, 1 corruption / parse errors, 2 could not run.
|
|
15
|
-
// NOTE: the sample must be SYNTACTICALLY VALID — a broken sample fails for the
|
|
16
|
-
// wrong reason.
|
|
17
|
-
|
|
18
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
19
|
-
import { createRequire } from 'node:module';
|
|
20
|
-
import { Parser, Language } from 'web-tree-sitter';
|
|
21
|
-
|
|
22
|
-
const require = createRequire(import.meta.url);
|
|
23
|
-
const fail = (code, msg) => { console.error(`[check-grammar] ${msg}`); process.exit(code); };
|
|
24
|
-
|
|
25
|
-
const [token, sample, iterArg] = process.argv.slice(2);
|
|
26
|
-
if (!token || !sample) fail(2, 'usage: check-grammar.mjs <lang|wasm-path> <valid-sample> [iterations]');
|
|
27
|
-
if (!existsSync(sample)) fail(2, `sample not found: ${sample}`);
|
|
28
|
-
const iters = iterArg ? parseInt(iterArg, 10) : 20;
|
|
29
|
-
|
|
30
|
-
const SPECIAL = { csharp: 'c_sharp', 'c#': 'c_sharp' };
|
|
31
|
-
function resolveWasm(t) {
|
|
32
|
-
if (t.endsWith('.wasm')) return existsSync(t) ? t : fail(2, `wasm not found: ${t}`);
|
|
33
|
-
const base = SPECIAL[t.toLowerCase()] ?? t.toLowerCase();
|
|
34
|
-
try { return require.resolve(`tree-sitter-wasms/out/tree-sitter-${base}.wasm`); } catch { /* try vendored */ }
|
|
35
|
-
const vendored = `src/extraction/wasm/tree-sitter-${base}.wasm`;
|
|
36
|
-
if (existsSync(vendored)) return vendored;
|
|
37
|
-
return fail(2, `no grammar for "${t}" — not in tree-sitter-wasms and not vendored`);
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
const wasmPath = resolveWasm(token);
|
|
41
|
-
const source = readFileSync(sample, 'utf8');
|
|
42
|
-
|
|
43
|
-
try { await Parser.init(); }
|
|
44
|
-
catch { await Parser.init({ locateFile: () => require.resolve('web-tree-sitter/tree-sitter.wasm') }); }
|
|
45
|
-
|
|
46
|
-
// Load a second, known-good grammar — the corruption surfaces under the
|
|
47
|
-
// multi-grammar runtime that real indexing uses, not a single grammar in isolation.
|
|
48
|
-
try { await Language.load(require.resolve('tree-sitter-wasms/out/tree-sitter-python.wasm')); } catch { /* ok */ }
|
|
49
|
-
|
|
50
|
-
let language;
|
|
51
|
-
try { language = await Language.load(wasmPath); }
|
|
52
|
-
catch (e) { fail(2, `failed to load ${wasmPath}: ${e.message}`); }
|
|
53
|
-
|
|
54
|
-
const parser = new Parser();
|
|
55
|
-
parser.setLanguage(language);
|
|
56
|
-
|
|
57
|
-
let ok = 0, err = 0;
|
|
58
|
-
for (let i = 0; i < iters; i++) {
|
|
59
|
-
const tree = parser.parse(source);
|
|
60
|
-
if (tree.rootNode.hasError) err++; else ok++;
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
console.log(`grammar: ${wasmPath.split('/').pop()}`);
|
|
64
|
-
console.log(` ABI version: ${language.abiVersion}`);
|
|
65
|
-
console.log(` parses: ${ok} clean / ${err} with errors (of ${iters})`);
|
|
66
|
-
if (err > 0) {
|
|
67
|
-
console.log(
|
|
68
|
-
`RESULT: FAIL — ${err}/${iters} parses produced ERROR trees on a valid sample. ` +
|
|
69
|
-
`This grammar corrupts under web-tree-sitter; vendor a newer (ABI 14/15) wasm ` +
|
|
70
|
-
`(see SKILL.md "Find a grammar"). Confirm your sample is syntactically valid first.`
|
|
71
|
-
);
|
|
72
|
-
process.exit(1);
|
|
73
|
-
}
|
|
74
|
-
console.log('RESULT: PASS — grammar parses cleanly and reuses safely.');
|
|
75
|
-
process.exit(0);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Verify a tree-sitter grammar wasm is HEALTHY under the project's web-tree-sitter
|
|
3
|
+
// runtime BEFORE writing an extractor. Prints the ABI version and parses a valid
|
|
4
|
+
// sample many times in a multi-grammar context, to catch heap-corruption bugs
|
|
5
|
+
// that silently drop nodes on every parse after the first.
|
|
6
|
+
//
|
|
7
|
+
// Why this exists: the tree-sitter-wasms Lua grammar is ABI 13 and corrupts the
|
|
8
|
+
// shared WASM heap under web-tree-sitter 0.25 — Lua extraction degraded on every
|
|
9
|
+
// file after the first (nested calls/imports vanished). The fix was to vendor the
|
|
10
|
+
// upstream ABI-15 wasm. Run this on any new grammar first; if it FAILs, vendor a
|
|
11
|
+
// newer build instead of using the tree-sitter-wasms one.
|
|
12
|
+
//
|
|
13
|
+
// Usage: node scripts/add-lang/check-grammar.mjs <lang|wasm-path> <valid-sample> [iterations]
|
|
14
|
+
// Exit: 0 healthy, 1 corruption / parse errors, 2 could not run.
|
|
15
|
+
// NOTE: the sample must be SYNTACTICALLY VALID — a broken sample fails for the
|
|
16
|
+
// wrong reason.
|
|
17
|
+
|
|
18
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
19
|
+
import { createRequire } from 'node:module';
|
|
20
|
+
import { Parser, Language } from 'web-tree-sitter';
|
|
21
|
+
|
|
22
|
+
const require = createRequire(import.meta.url);
|
|
23
|
+
const fail = (code, msg) => { console.error(`[check-grammar] ${msg}`); process.exit(code); };
|
|
24
|
+
|
|
25
|
+
const [token, sample, iterArg] = process.argv.slice(2);
|
|
26
|
+
if (!token || !sample) fail(2, 'usage: check-grammar.mjs <lang|wasm-path> <valid-sample> [iterations]');
|
|
27
|
+
if (!existsSync(sample)) fail(2, `sample not found: ${sample}`);
|
|
28
|
+
const iters = iterArg ? parseInt(iterArg, 10) : 20;
|
|
29
|
+
|
|
30
|
+
const SPECIAL = { csharp: 'c_sharp', 'c#': 'c_sharp' };
|
|
31
|
+
function resolveWasm(t) {
|
|
32
|
+
if (t.endsWith('.wasm')) return existsSync(t) ? t : fail(2, `wasm not found: ${t}`);
|
|
33
|
+
const base = SPECIAL[t.toLowerCase()] ?? t.toLowerCase();
|
|
34
|
+
try { return require.resolve(`tree-sitter-wasms/out/tree-sitter-${base}.wasm`); } catch { /* try vendored */ }
|
|
35
|
+
const vendored = `src/extraction/wasm/tree-sitter-${base}.wasm`;
|
|
36
|
+
if (existsSync(vendored)) return vendored;
|
|
37
|
+
return fail(2, `no grammar for "${t}" — not in tree-sitter-wasms and not vendored`);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
const wasmPath = resolveWasm(token);
|
|
41
|
+
const source = readFileSync(sample, 'utf8');
|
|
42
|
+
|
|
43
|
+
try { await Parser.init(); }
|
|
44
|
+
catch { await Parser.init({ locateFile: () => require.resolve('web-tree-sitter/tree-sitter.wasm') }); }
|
|
45
|
+
|
|
46
|
+
// Load a second, known-good grammar — the corruption surfaces under the
|
|
47
|
+
// multi-grammar runtime that real indexing uses, not a single grammar in isolation.
|
|
48
|
+
try { await Language.load(require.resolve('tree-sitter-wasms/out/tree-sitter-python.wasm')); } catch { /* ok */ }
|
|
49
|
+
|
|
50
|
+
let language;
|
|
51
|
+
try { language = await Language.load(wasmPath); }
|
|
52
|
+
catch (e) { fail(2, `failed to load ${wasmPath}: ${e.message}`); }
|
|
53
|
+
|
|
54
|
+
const parser = new Parser();
|
|
55
|
+
parser.setLanguage(language);
|
|
56
|
+
|
|
57
|
+
let ok = 0, err = 0;
|
|
58
|
+
for (let i = 0; i < iters; i++) {
|
|
59
|
+
const tree = parser.parse(source);
|
|
60
|
+
if (tree.rootNode.hasError) err++; else ok++;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
console.log(`grammar: ${wasmPath.split('/').pop()}`);
|
|
64
|
+
console.log(` ABI version: ${language.abiVersion}`);
|
|
65
|
+
console.log(` parses: ${ok} clean / ${err} with errors (of ${iters})`);
|
|
66
|
+
if (err > 0) {
|
|
67
|
+
console.log(
|
|
68
|
+
`RESULT: FAIL — ${err}/${iters} parses produced ERROR trees on a valid sample. ` +
|
|
69
|
+
`This grammar corrupts under web-tree-sitter; vendor a newer (ABI 14/15) wasm ` +
|
|
70
|
+
`(see SKILL.md "Find a grammar"). Confirm your sample is syntactically valid first.`
|
|
71
|
+
);
|
|
72
|
+
process.exit(1);
|
|
73
|
+
}
|
|
74
|
+
console.log('RESULT: PASS — grammar parses cleanly and reuses safely.');
|
|
75
|
+
process.exit(0);
|
|
@@ -1,103 +1,103 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Dump the tree-sitter AST for a sample file so you can write a LanguageExtractor
|
|
3
|
-
// mapping. Loads a grammar .wasm directly via web-tree-sitter (the same runtime
|
|
4
|
-
// homegraph uses) — you do NOT need to register the language first.
|
|
5
|
-
//
|
|
6
|
-
// Usage:
|
|
7
|
-
// node scripts/add-lang/dump-ast.mjs <lang|wasm-path> <sample-file> [--depth=N] [--full]
|
|
8
|
-
// Examples:
|
|
9
|
-
// node scripts/add-lang/dump-ast.mjs lua sample.lua
|
|
10
|
-
// node scripts/add-lang/dump-ast.mjs src/extraction/wasm/tree-sitter-zig.wasm a.zig --depth=4
|
|
11
|
-
//
|
|
12
|
-
// Output: an indented AST (named nodes, with field names) followed by a
|
|
13
|
-
// node-type FREQUENCY table. The frequency table is the payoff — it tells you
|
|
14
|
-
// which node types to map to functionTypes / classTypes / importTypes / etc.
|
|
15
|
-
|
|
16
|
-
import { readFileSync, existsSync } from 'node:fs';
|
|
17
|
-
import { createRequire } from 'node:module';
|
|
18
|
-
import { Parser, Language } from 'web-tree-sitter';
|
|
19
|
-
|
|
20
|
-
const require = createRequire(import.meta.url);
|
|
21
|
-
const fail = (msg) => { console.error(`[dump-ast] ${msg}`); process.exit(1); };
|
|
22
|
-
|
|
23
|
-
const argv = process.argv.slice(2);
|
|
24
|
-
const positional = argv.filter((a) => !a.startsWith('--'));
|
|
25
|
-
const [langOrWasm, sampleFile] = positional;
|
|
26
|
-
const depthFlag = argv.find((a) => a.startsWith('--depth='));
|
|
27
|
-
const showAll = argv.includes('--full'); // also print anonymous (token) nodes
|
|
28
|
-
const maxDepth = depthFlag ? parseInt(depthFlag.split('=')[1], 10) : (showAll ? Infinity : 8);
|
|
29
|
-
|
|
30
|
-
if (!langOrWasm || !sampleFile) {
|
|
31
|
-
fail('usage: dump-ast.mjs <lang|wasm-path> <sample-file> [--depth=N] [--full]');
|
|
32
|
-
}
|
|
33
|
-
if (!existsSync(sampleFile)) fail(`sample file not found: ${sampleFile}`);
|
|
34
|
-
|
|
35
|
-
// Language tokens whose tree-sitter-wasms filename differs from the token.
|
|
36
|
-
const WASM_SPECIAL = { csharp: 'c_sharp', 'c#': 'c_sharp' };
|
|
37
|
-
|
|
38
|
-
function resolveWasm(token) {
|
|
39
|
-
if (token.endsWith('.wasm')) {
|
|
40
|
-
if (!existsSync(token)) fail(`wasm not found: ${token}`);
|
|
41
|
-
return token;
|
|
42
|
-
}
|
|
43
|
-
const base = WASM_SPECIAL[token.toLowerCase()] ?? token.toLowerCase();
|
|
44
|
-
try {
|
|
45
|
-
return require.resolve(`tree-sitter-wasms/out/tree-sitter-${base}.wasm`);
|
|
46
|
-
} catch {
|
|
47
|
-
/* not in tree-sitter-wasms — try a vendored copy */
|
|
48
|
-
}
|
|
49
|
-
const vendored = `src/extraction/wasm/tree-sitter-${base}.wasm`;
|
|
50
|
-
if (existsSync(vendored)) return vendored;
|
|
51
|
-
fail(
|
|
52
|
-
`no grammar for "${token}" — not in tree-sitter-wasms and not vendored at ` +
|
|
53
|
-
`${vendored}. Pass an explicit .wasm path, or vendor one (see SKILL.md "Find a grammar").`
|
|
54
|
-
);
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
const wasmPath = resolveWasm(langOrWasm);
|
|
58
|
-
const source = readFileSync(sampleFile, 'utf8');
|
|
59
|
-
|
|
60
|
-
try {
|
|
61
|
-
await Parser.init();
|
|
62
|
-
} catch {
|
|
63
|
-
await Parser.init({ locateFile: () => require.resolve('web-tree-sitter/tree-sitter.wasm') });
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
let language;
|
|
67
|
-
try {
|
|
68
|
-
language = await Language.load(wasmPath);
|
|
69
|
-
} catch (e) {
|
|
70
|
-
fail(`failed to load grammar ${wasmPath}: ${e.message}`);
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
const parser = new Parser();
|
|
74
|
-
parser.setLanguage(language);
|
|
75
|
-
const tree = parser.parse(source);
|
|
76
|
-
|
|
77
|
-
const freq = new Map();
|
|
78
|
-
const snippet = (node) => {
|
|
79
|
-
const t = node.text.replace(/\s+/g, ' ').trim();
|
|
80
|
-
return t.length > 48 ? `${t.slice(0, 48)}…` : t;
|
|
81
|
-
};
|
|
82
|
-
|
|
83
|
-
function walk(node, depth, fieldName) {
|
|
84
|
-
if (node.isNamed) freq.set(node.type, (freq.get(node.type) || 0) + 1);
|
|
85
|
-
if ((node.isNamed || showAll) && depth <= maxDepth) {
|
|
86
|
-
const field = fieldName ? `${fieldName}: ` : '';
|
|
87
|
-
const leaf = node.childCount === 0 ? ` "${snippet(node)}"` : '';
|
|
88
|
-
console.log(`${' '.repeat(depth)}${field}${node.type} @${node.startPosition.row + 1}:${node.startPosition.column}${leaf}`);
|
|
89
|
-
}
|
|
90
|
-
for (let i = 0; i < node.childCount; i++) {
|
|
91
|
-
const child = node.child(i);
|
|
92
|
-
if (child) walk(child, depth + 1, node.fieldNameForChild(i));
|
|
93
|
-
}
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
console.log(`\n# AST for ${sampleFile} (grammar: ${wasmPath.split('/').pop()})\n`);
|
|
97
|
-
walk(tree.rootNode, 0, null);
|
|
98
|
-
|
|
99
|
-
console.log('\n# Node-type frequency (named nodes) — map the relevant ones in your extractor:\n');
|
|
100
|
-
[...freq.entries()]
|
|
101
|
-
.sort((a, b) => b[1] - a[1])
|
|
102
|
-
.forEach(([type, n]) => console.log(` ${String(n).padStart(5)} ${type}`));
|
|
103
|
-
console.log();
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Dump the tree-sitter AST for a sample file so you can write a LanguageExtractor
|
|
3
|
+
// mapping. Loads a grammar .wasm directly via web-tree-sitter (the same runtime
|
|
4
|
+
// homegraph uses) — you do NOT need to register the language first.
|
|
5
|
+
//
|
|
6
|
+
// Usage:
|
|
7
|
+
// node scripts/add-lang/dump-ast.mjs <lang|wasm-path> <sample-file> [--depth=N] [--full]
|
|
8
|
+
// Examples:
|
|
9
|
+
// node scripts/add-lang/dump-ast.mjs lua sample.lua
|
|
10
|
+
// node scripts/add-lang/dump-ast.mjs src/extraction/wasm/tree-sitter-zig.wasm a.zig --depth=4
|
|
11
|
+
//
|
|
12
|
+
// Output: an indented AST (named nodes, with field names) followed by a
|
|
13
|
+
// node-type FREQUENCY table. The frequency table is the payoff — it tells you
|
|
14
|
+
// which node types to map to functionTypes / classTypes / importTypes / etc.
|
|
15
|
+
|
|
16
|
+
import { readFileSync, existsSync } from 'node:fs';
|
|
17
|
+
import { createRequire } from 'node:module';
|
|
18
|
+
import { Parser, Language } from 'web-tree-sitter';
|
|
19
|
+
|
|
20
|
+
const require = createRequire(import.meta.url);
|
|
21
|
+
const fail = (msg) => { console.error(`[dump-ast] ${msg}`); process.exit(1); };
|
|
22
|
+
|
|
23
|
+
const argv = process.argv.slice(2);
|
|
24
|
+
const positional = argv.filter((a) => !a.startsWith('--'));
|
|
25
|
+
const [langOrWasm, sampleFile] = positional;
|
|
26
|
+
const depthFlag = argv.find((a) => a.startsWith('--depth='));
|
|
27
|
+
const showAll = argv.includes('--full'); // also print anonymous (token) nodes
|
|
28
|
+
const maxDepth = depthFlag ? parseInt(depthFlag.split('=')[1], 10) : (showAll ? Infinity : 8);
|
|
29
|
+
|
|
30
|
+
if (!langOrWasm || !sampleFile) {
|
|
31
|
+
fail('usage: dump-ast.mjs <lang|wasm-path> <sample-file> [--depth=N] [--full]');
|
|
32
|
+
}
|
|
33
|
+
if (!existsSync(sampleFile)) fail(`sample file not found: ${sampleFile}`);
|
|
34
|
+
|
|
35
|
+
// Language tokens whose tree-sitter-wasms filename differs from the token.
|
|
36
|
+
const WASM_SPECIAL = { csharp: 'c_sharp', 'c#': 'c_sharp' };
|
|
37
|
+
|
|
38
|
+
function resolveWasm(token) {
|
|
39
|
+
if (token.endsWith('.wasm')) {
|
|
40
|
+
if (!existsSync(token)) fail(`wasm not found: ${token}`);
|
|
41
|
+
return token;
|
|
42
|
+
}
|
|
43
|
+
const base = WASM_SPECIAL[token.toLowerCase()] ?? token.toLowerCase();
|
|
44
|
+
try {
|
|
45
|
+
return require.resolve(`tree-sitter-wasms/out/tree-sitter-${base}.wasm`);
|
|
46
|
+
} catch {
|
|
47
|
+
/* not in tree-sitter-wasms — try a vendored copy */
|
|
48
|
+
}
|
|
49
|
+
const vendored = `src/extraction/wasm/tree-sitter-${base}.wasm`;
|
|
50
|
+
if (existsSync(vendored)) return vendored;
|
|
51
|
+
fail(
|
|
52
|
+
`no grammar for "${token}" — not in tree-sitter-wasms and not vendored at ` +
|
|
53
|
+
`${vendored}. Pass an explicit .wasm path, or vendor one (see SKILL.md "Find a grammar").`
|
|
54
|
+
);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
const wasmPath = resolveWasm(langOrWasm);
|
|
58
|
+
const source = readFileSync(sampleFile, 'utf8');
|
|
59
|
+
|
|
60
|
+
try {
|
|
61
|
+
await Parser.init();
|
|
62
|
+
} catch {
|
|
63
|
+
await Parser.init({ locateFile: () => require.resolve('web-tree-sitter/tree-sitter.wasm') });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
let language;
|
|
67
|
+
try {
|
|
68
|
+
language = await Language.load(wasmPath);
|
|
69
|
+
} catch (e) {
|
|
70
|
+
fail(`failed to load grammar ${wasmPath}: ${e.message}`);
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
const parser = new Parser();
|
|
74
|
+
parser.setLanguage(language);
|
|
75
|
+
const tree = parser.parse(source);
|
|
76
|
+
|
|
77
|
+
const freq = new Map();
|
|
78
|
+
const snippet = (node) => {
|
|
79
|
+
const t = node.text.replace(/\s+/g, ' ').trim();
|
|
80
|
+
return t.length > 48 ? `${t.slice(0, 48)}…` : t;
|
|
81
|
+
};
|
|
82
|
+
|
|
83
|
+
function walk(node, depth, fieldName) {
|
|
84
|
+
if (node.isNamed) freq.set(node.type, (freq.get(node.type) || 0) + 1);
|
|
85
|
+
if ((node.isNamed || showAll) && depth <= maxDepth) {
|
|
86
|
+
const field = fieldName ? `${fieldName}: ` : '';
|
|
87
|
+
const leaf = node.childCount === 0 ? ` "${snippet(node)}"` : '';
|
|
88
|
+
console.log(`${' '.repeat(depth)}${field}${node.type} @${node.startPosition.row + 1}:${node.startPosition.column}${leaf}`);
|
|
89
|
+
}
|
|
90
|
+
for (let i = 0; i < node.childCount; i++) {
|
|
91
|
+
const child = node.child(i);
|
|
92
|
+
if (child) walk(child, depth + 1, node.fieldNameForChild(i));
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
console.log(`\n# AST for ${sampleFile} (grammar: ${wasmPath.split('/').pop()})\n`);
|
|
97
|
+
walk(tree.rootNode, 0, null);
|
|
98
|
+
|
|
99
|
+
console.log('\n# Node-type frequency (named nodes) — map the relevant ones in your extractor:\n');
|
|
100
|
+
[...freq.entries()]
|
|
101
|
+
.sort((a, b) => b[1] - a[1])
|
|
102
|
+
.forEach(([type, n]) => console.log(` ${String(n).padStart(5)} ${type}`));
|
|
103
|
+
console.log();
|
|
@@ -1,70 +1,70 @@
|
|
|
1
|
-
#!/usr/bin/env node
|
|
2
|
-
// Sanity-check that homegraph extracted REAL symbols (not just file/import nodes)
|
|
3
|
-
// from a repo for a given language. Exits non-zero on a critical failure so it
|
|
4
|
-
// can drive a write-extractor -> build -> re-check loop.
|
|
5
|
-
//
|
|
6
|
-
// Usage: node scripts/add-lang/verify-extraction.mjs <repo-path> <lang>
|
|
7
|
-
// Reads `homegraph status <repo> --json` using whatever homegraph is on PATH,
|
|
8
|
-
// so it reflects the binary that built the index.
|
|
9
|
-
//
|
|
10
|
-
// Exit codes: 0 = pass or soft-warn, 1 = critical fail, 2 = could not run.
|
|
11
|
-
|
|
12
|
-
import { execFileSync } from 'node:child_process';
|
|
13
|
-
|
|
14
|
-
const [repo, lang] = process.argv.slice(2);
|
|
15
|
-
if (!repo || !lang) {
|
|
16
|
-
console.error('usage: verify-extraction.mjs <repo-path> <lang>');
|
|
17
|
-
process.exit(2);
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
let status;
|
|
21
|
-
try {
|
|
22
|
-
const out = execFileSync('homegraph', ['status', repo, '--json'], { encoding: 'utf8' });
|
|
23
|
-
status = JSON.parse(out);
|
|
24
|
-
} catch (e) {
|
|
25
|
-
console.error(`[verify] could not read homegraph status for ${repo}: ${e.message}`);
|
|
26
|
-
process.exit(2);
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
// Kinds that prove the extractor mapped AST node types (everything except
|
|
30
|
-
// 'file' and 'import', which homegraph creates structurally for any language).
|
|
31
|
-
const SYMBOL_KINDS = new Set([
|
|
32
|
-
'module', 'class', 'struct', 'interface', 'trait', 'protocol', 'function',
|
|
33
|
-
'method', 'property', 'field', 'variable', 'constant', 'enum', 'enum_member',
|
|
34
|
-
'type_alias', 'namespace', 'route', 'component',
|
|
35
|
-
]);
|
|
36
|
-
|
|
37
|
-
const byKind = status.nodesByKind || {};
|
|
38
|
-
const langs = status.languages || [];
|
|
39
|
-
const files = status.fileCount || 0;
|
|
40
|
-
const edges = status.edgeCount || 0;
|
|
41
|
-
const symbolKinds = Object.keys(byKind).filter((k) => SYMBOL_KINDS.has(k));
|
|
42
|
-
const symbolCount = symbolKinds.reduce((s, k) => s + byKind[k], 0);
|
|
43
|
-
|
|
44
|
-
const checks = [];
|
|
45
|
-
const add = (severity, ok, label, detail) => checks.push({ severity, ok, label, detail });
|
|
46
|
-
|
|
47
|
-
add('critical', status.initialized === true, 'index initialized', `initialized=${status.initialized}`);
|
|
48
|
-
add('critical', langs.includes(lang), `language "${lang}" detected`, `languages=[${langs.join(', ')}]`);
|
|
49
|
-
add('critical', symbolCount > 0, 'structural symbols extracted', `${symbolCount} symbols (${symbolKinds.join(', ') || 'NONE — only file/import nodes!'})`);
|
|
50
|
-
add('soft', symbolCount >= files, 'symbol density >= 1/file', `${symbolCount} symbols across ${files} files`);
|
|
51
|
-
add('soft', edges > files, 'edges resolved', `${edges} edges across ${files} files`);
|
|
52
|
-
|
|
53
|
-
console.log(`\n# Extraction check — ${repo} (lang=${lang}, backend=${status.backend})`);
|
|
54
|
-
console.log(` files=${files} nodes=${status.nodeCount} edges=${edges}`);
|
|
55
|
-
console.log(` nodesByKind: ${JSON.stringify(byKind)}\n`);
|
|
56
|
-
for (const c of checks) console.log(` ${c.ok ? '✓' : '✗'} ${c.label} — ${c.detail}`);
|
|
57
|
-
|
|
58
|
-
const critical = checks.filter((c) => !c.ok && c.severity === 'critical');
|
|
59
|
-
const soft = checks.filter((c) => !c.ok && c.severity === 'soft');
|
|
60
|
-
console.log();
|
|
61
|
-
if (critical.length) {
|
|
62
|
-
console.log(`RESULT: FAIL (${critical.length} critical) — extractor or grammar wiring is broken. Re-run dump-ast.mjs and fix the node-type mappings.`);
|
|
63
|
-
process.exit(1);
|
|
64
|
-
}
|
|
65
|
-
if (soft.length) {
|
|
66
|
-
console.log(`RESULT: WARN (${soft.length} soft) — extraction works but looks thin; inspect the counts above.`);
|
|
67
|
-
process.exit(0);
|
|
68
|
-
}
|
|
69
|
-
console.log('RESULT: PASS — extraction looks healthy.');
|
|
70
|
-
process.exit(0);
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Sanity-check that homegraph extracted REAL symbols (not just file/import nodes)
|
|
3
|
+
// from a repo for a given language. Exits non-zero on a critical failure so it
|
|
4
|
+
// can drive a write-extractor -> build -> re-check loop.
|
|
5
|
+
//
|
|
6
|
+
// Usage: node scripts/add-lang/verify-extraction.mjs <repo-path> <lang>
|
|
7
|
+
// Reads `homegraph status <repo> --json` using whatever homegraph is on PATH,
|
|
8
|
+
// so it reflects the binary that built the index.
|
|
9
|
+
//
|
|
10
|
+
// Exit codes: 0 = pass or soft-warn, 1 = critical fail, 2 = could not run.
|
|
11
|
+
|
|
12
|
+
import { execFileSync } from 'node:child_process';
|
|
13
|
+
|
|
14
|
+
const [repo, lang] = process.argv.slice(2);
|
|
15
|
+
if (!repo || !lang) {
|
|
16
|
+
console.error('usage: verify-extraction.mjs <repo-path> <lang>');
|
|
17
|
+
process.exit(2);
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
let status;
|
|
21
|
+
try {
|
|
22
|
+
const out = execFileSync('homegraph', ['status', repo, '--json'], { encoding: 'utf8' });
|
|
23
|
+
status = JSON.parse(out);
|
|
24
|
+
} catch (e) {
|
|
25
|
+
console.error(`[verify] could not read homegraph status for ${repo}: ${e.message}`);
|
|
26
|
+
process.exit(2);
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
// Kinds that prove the extractor mapped AST node types (everything except
|
|
30
|
+
// 'file' and 'import', which homegraph creates structurally for any language).
|
|
31
|
+
const SYMBOL_KINDS = new Set([
|
|
32
|
+
'module', 'class', 'struct', 'interface', 'trait', 'protocol', 'function',
|
|
33
|
+
'method', 'property', 'field', 'variable', 'constant', 'enum', 'enum_member',
|
|
34
|
+
'type_alias', 'namespace', 'route', 'component',
|
|
35
|
+
]);
|
|
36
|
+
|
|
37
|
+
const byKind = status.nodesByKind || {};
|
|
38
|
+
const langs = status.languages || [];
|
|
39
|
+
const files = status.fileCount || 0;
|
|
40
|
+
const edges = status.edgeCount || 0;
|
|
41
|
+
const symbolKinds = Object.keys(byKind).filter((k) => SYMBOL_KINDS.has(k));
|
|
42
|
+
const symbolCount = symbolKinds.reduce((s, k) => s + byKind[k], 0);
|
|
43
|
+
|
|
44
|
+
const checks = [];
|
|
45
|
+
const add = (severity, ok, label, detail) => checks.push({ severity, ok, label, detail });
|
|
46
|
+
|
|
47
|
+
add('critical', status.initialized === true, 'index initialized', `initialized=${status.initialized}`);
|
|
48
|
+
add('critical', langs.includes(lang), `language "${lang}" detected`, `languages=[${langs.join(', ')}]`);
|
|
49
|
+
add('critical', symbolCount > 0, 'structural symbols extracted', `${symbolCount} symbols (${symbolKinds.join(', ') || 'NONE — only file/import nodes!'})`);
|
|
50
|
+
add('soft', symbolCount >= files, 'symbol density >= 1/file', `${symbolCount} symbols across ${files} files`);
|
|
51
|
+
add('soft', edges > files, 'edges resolved', `${edges} edges across ${files} files`);
|
|
52
|
+
|
|
53
|
+
console.log(`\n# Extraction check — ${repo} (lang=${lang}, backend=${status.backend})`);
|
|
54
|
+
console.log(` files=${files} nodes=${status.nodeCount} edges=${edges}`);
|
|
55
|
+
console.log(` nodesByKind: ${JSON.stringify(byKind)}\n`);
|
|
56
|
+
for (const c of checks) console.log(` ${c.ok ? '✓' : '✗'} ${c.label} — ${c.detail}`);
|
|
57
|
+
|
|
58
|
+
const critical = checks.filter((c) => !c.ok && c.severity === 'critical');
|
|
59
|
+
const soft = checks.filter((c) => !c.ok && c.severity === 'soft');
|
|
60
|
+
console.log();
|
|
61
|
+
if (critical.length) {
|
|
62
|
+
console.log(`RESULT: FAIL (${critical.length} critical) — extractor or grammar wiring is broken. Re-run dump-ast.mjs and fix the node-type mappings.`);
|
|
63
|
+
process.exit(1);
|
|
64
|
+
}
|
|
65
|
+
if (soft.length) {
|
|
66
|
+
console.log(`RESULT: WARN (${soft.length} soft) — extraction works but looks thin; inspect the counts above.`);
|
|
67
|
+
process.exit(0);
|
|
68
|
+
}
|
|
69
|
+
console.log('RESULT: PASS — extraction looks healthy.');
|
|
70
|
+
process.exit(0);
|