@stupidloud/codegraph 0.7.20 → 0.9.5
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/README.md +127 -106
- package/dist/bin/codegraph.d.ts +4 -0
- package/dist/bin/codegraph.d.ts.map +1 -1
- package/dist/bin/codegraph.js +327 -8
- package/dist/bin/codegraph.js.map +1 -1
- package/dist/bin/node-version-check.d.ts +17 -0
- package/dist/bin/node-version-check.d.ts.map +1 -1
- package/dist/bin/node-version-check.js +37 -0
- package/dist/bin/node-version-check.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -11
- package/dist/config.js.map +1 -1
- package/dist/db/index.d.ts +30 -1
- package/dist/db/index.d.ts.map +1 -1
- package/dist/db/index.js +75 -25
- package/dist/db/index.js.map +1 -1
- package/dist/db/queries.d.ts +16 -0
- package/dist/db/queries.d.ts.map +1 -1
- package/dist/db/queries.js +80 -27
- package/dist/db/queries.js.map +1 -1
- package/dist/db/sqlite-adapter.d.ts +17 -23
- package/dist/db/sqlite-adapter.d.ts.map +1 -1
- package/dist/db/sqlite-adapter.js +51 -174
- package/dist/db/sqlite-adapter.js.map +1 -1
- package/dist/extraction/grammars.d.ts +7 -1
- package/dist/extraction/grammars.d.ts.map +1 -1
- package/dist/extraction/grammars.js +42 -2
- package/dist/extraction/grammars.js.map +1 -1
- package/dist/extraction/index.d.ts +9 -14
- package/dist/extraction/index.d.ts.map +1 -1
- package/dist/extraction/index.js +131 -124
- package/dist/extraction/index.js.map +1 -1
- package/dist/extraction/languages/index.d.ts.map +1 -1
- package/dist/extraction/languages/index.js +4 -0
- package/dist/extraction/languages/index.js.map +1 -1
- package/dist/extraction/languages/lua.d.ts +3 -0
- package/dist/extraction/languages/lua.d.ts.map +1 -0
- package/dist/extraction/languages/lua.js +150 -0
- package/dist/extraction/languages/lua.js.map +1 -0
- package/dist/extraction/languages/luau.d.ts +3 -0
- package/dist/extraction/languages/luau.d.ts.map +1 -0
- package/dist/extraction/languages/luau.js +37 -0
- package/dist/extraction/languages/luau.js.map +1 -0
- package/dist/extraction/tree-sitter.d.ts.map +1 -1
- package/dist/extraction/tree-sitter.js +38 -0
- package/dist/extraction/tree-sitter.js.map +1 -1
- package/dist/extraction/wasm/tree-sitter-lua.wasm +0 -0
- package/dist/extraction/wasm/tree-sitter-luau.wasm +0 -0
- package/dist/extraction/wasm-runtime-flags.d.ts +38 -0
- package/dist/extraction/wasm-runtime-flags.d.ts.map +1 -0
- package/dist/extraction/wasm-runtime-flags.js +105 -0
- package/dist/extraction/wasm-runtime-flags.js.map +1 -0
- package/dist/graph/traversal.d.ts.map +1 -1
- package/dist/graph/traversal.js +71 -36
- package/dist/graph/traversal.js.map +1 -1
- package/dist/index.d.ts +11 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +28 -18
- package/dist/index.js.map +1 -1
- package/dist/installer/config-writer.d.ts.map +1 -1
- package/dist/installer/config-writer.js +3 -1
- package/dist/installer/config-writer.js.map +1 -1
- package/dist/installer/index.d.ts +66 -2
- package/dist/installer/index.d.ts.map +1 -1
- package/dist/installer/index.js +195 -5
- package/dist/installer/index.js.map +1 -1
- package/dist/installer/instructions-template.d.ts +2 -2
- package/dist/installer/instructions-template.d.ts.map +1 -1
- package/dist/installer/instructions-template.js +4 -2
- package/dist/installer/instructions-template.js.map +1 -1
- package/dist/installer/targets/claude.d.ts +26 -6
- package/dist/installer/targets/claude.d.ts.map +1 -1
- package/dist/installer/targets/claude.js +165 -10
- package/dist/installer/targets/claude.js.map +1 -1
- package/dist/installer/targets/cursor.d.ts.map +1 -1
- package/dist/installer/targets/cursor.js +57 -3
- package/dist/installer/targets/cursor.js.map +1 -1
- package/dist/installer/targets/hermes.d.ts +18 -0
- package/dist/installer/targets/hermes.d.ts.map +1 -0
- package/dist/installer/targets/hermes.js +305 -0
- package/dist/installer/targets/hermes.js.map +1 -0
- package/dist/installer/targets/registry.d.ts.map +1 -1
- package/dist/installer/targets/registry.js +2 -0
- package/dist/installer/targets/registry.js.map +1 -1
- package/dist/installer/targets/types.d.ts +1 -1
- package/dist/installer/targets/types.d.ts.map +1 -1
- package/dist/mcp/index.d.ts +12 -0
- package/dist/mcp/index.d.ts.map +1 -1
- package/dist/mcp/index.js +213 -18
- package/dist/mcp/index.js.map +1 -1
- package/dist/mcp/server-instructions.d.ts +1 -1
- package/dist/mcp/server-instructions.d.ts.map +1 -1
- package/dist/mcp/server-instructions.js +15 -0
- package/dist/mcp/server-instructions.js.map +1 -1
- package/dist/mcp/tools.d.ts +25 -1
- package/dist/mcp/tools.d.ts.map +1 -1
- package/dist/mcp/tools.js +221 -30
- package/dist/mcp/tools.js.map +1 -1
- package/dist/mcp/transport.d.ts +17 -0
- package/dist/mcp/transport.d.ts.map +1 -1
- package/dist/mcp/transport.js +63 -0
- package/dist/mcp/transport.js.map +1 -1
- package/dist/resolution/frameworks/drupal.d.ts +51 -0
- package/dist/resolution/frameworks/drupal.d.ts.map +1 -0
- package/dist/resolution/frameworks/drupal.js +335 -0
- package/dist/resolution/frameworks/drupal.js.map +1 -0
- package/dist/resolution/frameworks/index.d.ts +2 -0
- package/dist/resolution/frameworks/index.d.ts.map +1 -1
- package/dist/resolution/frameworks/index.js +9 -1
- package/dist/resolution/frameworks/index.js.map +1 -1
- package/dist/resolution/frameworks/nestjs.d.ts +26 -0
- package/dist/resolution/frameworks/nestjs.d.ts.map +1 -0
- package/dist/resolution/frameworks/nestjs.js +374 -0
- package/dist/resolution/frameworks/nestjs.js.map +1 -0
- package/dist/resolution/index.d.ts.map +1 -1
- package/dist/resolution/index.js +40 -7
- package/dist/resolution/index.js.map +1 -1
- package/dist/resolution/lru-cache.d.ts +24 -0
- package/dist/resolution/lru-cache.d.ts.map +1 -0
- package/dist/resolution/lru-cache.js +62 -0
- package/dist/resolution/lru-cache.js.map +1 -0
- package/dist/sync/git-hooks.d.ts +45 -0
- package/dist/sync/git-hooks.d.ts.map +1 -0
- package/dist/sync/git-hooks.js +223 -0
- package/dist/sync/git-hooks.js.map +1 -0
- package/dist/sync/index.d.ts +4 -0
- package/dist/sync/index.d.ts.map +1 -1
- package/dist/sync/index.js +12 -1
- package/dist/sync/index.js.map +1 -1
- package/dist/sync/watch-policy.d.ts +48 -0
- package/dist/sync/watch-policy.d.ts.map +1 -0
- package/dist/sync/watch-policy.js +124 -0
- package/dist/sync/watch-policy.js.map +1 -0
- package/dist/sync/watcher.d.ts +2 -4
- package/dist/sync/watcher.d.ts.map +1 -1
- package/dist/sync/watcher.js +14 -6
- package/dist/sync/watcher.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +11 -0
- package/dist/types.js.map +1 -1
- package/dist/utils.js +1 -1
- package/package.json +4 -4
- package/scripts/add-lang/bench.sh +60 -0
- package/scripts/add-lang/check-grammar.mjs +75 -0
- package/scripts/add-lang/dump-ast.mjs +103 -0
- package/scripts/add-lang/verify-extraction.mjs +70 -0
- package/scripts/agent-eval/audit.sh +68 -0
- package/scripts/agent-eval/itrun.sh +1 -1
- package/scripts/agent-eval/run-all.sh +67 -0
- package/scripts/build-bundle.sh +118 -0
- package/scripts/npm-shim.js +246 -0
- package/scripts/pack-npm.sh +95 -0
- package/scripts/patch-tree-sitter-dart.js +0 -112
- package/scripts/release.sh +0 -68
package/dist/sync/watcher.js
CHANGED
|
@@ -47,6 +47,7 @@ const fs = __importStar(require("fs"));
|
|
|
47
47
|
const extraction_1 = require("../extraction");
|
|
48
48
|
const errors_1 = require("../errors");
|
|
49
49
|
const utils_1 = require("../utils");
|
|
50
|
+
const watch_policy_1 = require("./watch-policy");
|
|
50
51
|
/**
|
|
51
52
|
* FileWatcher monitors a project directory for changes and triggers
|
|
52
53
|
* debounced sync operations via a provided callback.
|
|
@@ -54,7 +55,7 @@ const utils_1 = require("../utils");
|
|
|
54
55
|
* Design goals:
|
|
55
56
|
* - Minimal resource usage (native OS file events, no polling)
|
|
56
57
|
* - Debounced to avoid thrashing on rapid saves
|
|
57
|
-
* - Filters
|
|
58
|
+
* - Filters to supported source files by extension
|
|
58
59
|
* - Ignores .codegraph/ directory changes
|
|
59
60
|
*/
|
|
60
61
|
class FileWatcher {
|
|
@@ -64,14 +65,12 @@ class FileWatcher {
|
|
|
64
65
|
syncing = false;
|
|
65
66
|
stopped = false;
|
|
66
67
|
projectRoot;
|
|
67
|
-
config;
|
|
68
68
|
debounceMs;
|
|
69
69
|
syncFn;
|
|
70
70
|
onSyncComplete;
|
|
71
71
|
onSyncError;
|
|
72
|
-
constructor(projectRoot,
|
|
72
|
+
constructor(projectRoot, syncFn, options = {}) {
|
|
73
73
|
this.projectRoot = projectRoot;
|
|
74
|
-
this.config = config;
|
|
75
74
|
this.syncFn = syncFn;
|
|
76
75
|
this.debounceMs = options.debounceMs ?? 2000;
|
|
77
76
|
this.onSyncComplete = options.onSyncComplete;
|
|
@@ -85,6 +84,15 @@ class FileWatcher {
|
|
|
85
84
|
if (this.watcher)
|
|
86
85
|
return true; // Already watching
|
|
87
86
|
this.stopped = false;
|
|
87
|
+
// Some environments make recursive fs.watch unusable — most notably WSL2
|
|
88
|
+
// /mnt/ drives, where setup blocks long enough to break MCP startup
|
|
89
|
+
// handshakes (issue #199). Skip watching there; callers fall back to
|
|
90
|
+
// manual `codegraph sync` or the git sync hooks.
|
|
91
|
+
const disabledReason = (0, watch_policy_1.watchDisabledReason)(this.projectRoot);
|
|
92
|
+
if (disabledReason) {
|
|
93
|
+
(0, errors_1.logDebug)('File watcher disabled', { reason: disabledReason, projectRoot: this.projectRoot });
|
|
94
|
+
return false;
|
|
95
|
+
}
|
|
88
96
|
try {
|
|
89
97
|
this.watcher = fs.watch(this.projectRoot, { recursive: true }, (_eventType, filename) => {
|
|
90
98
|
if (!filename || this.stopped)
|
|
@@ -97,8 +105,8 @@ class FileWatcher {
|
|
|
97
105
|
normalized.startsWith('.codegraph\\')) {
|
|
98
106
|
return;
|
|
99
107
|
}
|
|
100
|
-
//
|
|
101
|
-
if (!(0, extraction_1.
|
|
108
|
+
// Only sync changes to files we can actually parse.
|
|
109
|
+
if (!(0, extraction_1.isSourceFile)(normalized)) {
|
|
102
110
|
return;
|
|
103
111
|
}
|
|
104
112
|
(0, errors_1.logDebug)('File change detected', { file: normalized });
|
package/dist/sync/watcher.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"watcher.js","sourceRoot":"","sources":["../../src/sync/watcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;
|
|
1
|
+
{"version":3,"file":"watcher.js","sourceRoot":"","sources":["../../src/sync/watcher.ts"],"names":[],"mappings":";AAAA;;;;;;;;GAQG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEH,uCAAyB;AACzB,8CAA6C;AAC7C,sCAA8C;AAC9C,oCAAyC;AACzC,iDAAqD;AAwBrD;;;;;;;;;GASG;AACH,MAAa,WAAW;IACd,OAAO,GAAwB,IAAI,CAAC;IACpC,aAAa,GAAyC,IAAI,CAAC;IAC3D,UAAU,GAAG,KAAK,CAAC;IACnB,OAAO,GAAG,KAAK,CAAC;IAChB,OAAO,GAAG,KAAK,CAAC;IAEP,WAAW,CAAS;IACpB,UAAU,CAAS;IACnB,MAAM,CAA8D;IACpE,cAAc,CAAkC;IAChD,WAAW,CAA+B;IAE3D,YACE,WAAmB,EACnB,MAAmE,EACnE,UAAwB,EAAE;QAE1B,IAAI,CAAC,WAAW,GAAG,WAAW,CAAC;QAC/B,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;QACrB,IAAI,CAAC,UAAU,GAAG,OAAO,CAAC,UAAU,IAAI,IAAI,CAAC;QAC7C,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC,cAAc,CAAC;QAC7C,IAAI,CAAC,WAAW,GAAG,OAAO,CAAC,WAAW,CAAC;IACzC,CAAC;IAED;;;OAGG;IACH,KAAK;QACH,IAAI,IAA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,CAAC;QACD,IAAI,CAAC,aAAa,GAAG,UAAU,CAAC,GAAG,EAAE;YACnC,IAAI,CAAC,aAAa,GAAG,IAAI,CAAC;YAC1B,IAAI,CAAC,KAAK,EAAE,CAAC;QACf,CAAC,EAAE,IAAI,CAAC,UAAU,CAAC,CAAC;IACtB,CAAC;IAED;;OAEG;IACK,KAAK,CAAC,KAAK;QACjB,0DAA0D;QAC1D,IAAI,IAAI,CAAC,OAAO,IAAI,IAAI,CAAC,OAAO;YAAE,OAAO;QAEzC,IAAI,CAAC,UAAU,GAAG,KAAK,CAAC;QACxB,IAAI,CAAC,OAAO,GAAG,IAAI,CAAC;QAEpB,IAAI,CAAC;YACH,MAAM,MAAM,GAAG,MAAM,IAAI,CAAC,MAAM,EAAE,CAAC;YACnC,IAAI,CAAC,cAAc,EAAE,CAAC,MAAM,CAAC,CAAC;QAChC,CAAC;QAAC,OAAO,GAAG,EAAE,CAAC;YACb,MAAM,KAAK,GAAG,GAAG,YAAY,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,IAAI,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;YAClE,IAAA,gBAAO,EAAC,mBAAmB,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACvD,IAAI,CAAC,WAAW,EAAE,CAAC,KAAK,CAAC,CAAC;QAC5B,CAAC;gBAAS,CAAC;YACT,IAAI,CAAC,OAAO,GAAG,KAAK,CAAC;YAErB,uDAAuD;YACvD,IAAI,IAAI,CAAC,UAAU,IAAI,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;gBACrC,IAAI,CAAC,YAAY,EAAE,CAAC;YACtB,CAAC;QACH,CAAC;IACH,CAAC;CACF;AA1JD,kCA0JC"}
|
package/dist/types.d.ts
CHANGED
|
@@ -20,7 +20,7 @@ export type EdgeKind = 'contains' | 'calls' | 'imports' | 'exports' | 'extends'
|
|
|
20
20
|
* Supported programming languages. See NODE_KINDS for why this is a
|
|
21
21
|
* runtime-iterable const array.
|
|
22
22
|
*/
|
|
23
|
-
export declare const LANGUAGES: readonly ["typescript", "javascript", "tsx", "jsx", "python", "go", "rust", "java", "c", "cpp", "csharp", "php", "ruby", "swift", "kotlin", "dart", "svelte", "vue", "liquid", "pascal", "scala", "unknown"];
|
|
23
|
+
export declare const LANGUAGES: readonly ["typescript", "javascript", "tsx", "jsx", "python", "go", "rust", "java", "c", "cpp", "csharp", "php", "ruby", "swift", "kotlin", "dart", "svelte", "vue", "liquid", "pascal", "scala", "lua", "luau", "yaml", "twig", "unknown"];
|
|
24
24
|
export type Language = (typeof LANGUAGES)[number];
|
|
25
25
|
/**
|
|
26
26
|
* A node in the knowledge graph representing a code symbol
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,8PAuBb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,OAAO,GACP,SAAS,GACT,SAAS,GACT,SAAS,GACT,YAAY,GACZ,YAAY,GACZ,SAAS,GACT,SAAS,GACT,cAAc,GACd,WAAW,GACX,WAAW,CAAC;AAEhB;;;GAGG;AACH,eAAO,MAAM,SAAS,
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAMH;;;;;;GAMG;AACH,eAAO,MAAM,UAAU,8PAuBb,CAAC;AAEX,MAAM,MAAM,QAAQ,GAAG,CAAC,OAAO,UAAU,CAAC,CAAC,MAAM,CAAC,CAAC;AAEnD;;GAEG;AACH,MAAM,MAAM,QAAQ,GAChB,UAAU,GACV,OAAO,G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IAEvB,mCAAmC;IACnC,OAAO,EAAE,MAAM,CAAC;IAEhB,mCAAmC;IACnC,KAAK,EAAE;QACL,+BAA+B;QAC/B,SAAS,EAAE,MAAM,CAAC;QAClB,+BAA+B;QAC/B,SAAS,EAAE,MAAM,CAAC;QAClB,8BAA8B;QAC9B,SAAS,EAAE,MAAM,CAAC;QAClB,qCAAqC;QACrC,cAAc,EAAE,MAAM,CAAC;QACvB,sCAAsC;QACtC,aAAa,EAAE,MAAM,CAAC;KACvB,CAAC;CACH;AAED;;GAEG;AACH,MAAM,WAAW,0BAA0B;IACzC,qDAAqD;IACrD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,yCAAyC;IACzC,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,4CAA4C;IAC5C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,uDAAuD;IACvD,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,wCAAwC;IACxC,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;IAEvB,4BAA4B;IAC5B,SAAS,CAAC,EAAE,QAAQ,EAAE,CAAC;CACxB"}
|
package/dist/types.js
CHANGED
|
@@ -66,6 +66,10 @@ exports.LANGUAGES = [
|
|
|
66
66
|
'liquid',
|
|
67
67
|
'pascal',
|
|
68
68
|
'scala',
|
|
69
|
+
'lua',
|
|
70
|
+
'luau',
|
|
71
|
+
'yaml',
|
|
72
|
+
'twig',
|
|
69
73
|
'unknown',
|
|
70
74
|
];
|
|
71
75
|
/**
|
|
@@ -124,6 +128,13 @@ exports.DEFAULT_CONFIG = {
|
|
|
124
128
|
// Scala
|
|
125
129
|
'**/*.scala',
|
|
126
130
|
'**/*.sc',
|
|
131
|
+
// Lua / Luau
|
|
132
|
+
'**/*.lua',
|
|
133
|
+
'**/*.luau',
|
|
134
|
+
// Drupal config/templates
|
|
135
|
+
'**/*.yml',
|
|
136
|
+
'**/*.yaml',
|
|
137
|
+
'**/*.twig',
|
|
127
138
|
],
|
|
128
139
|
exclude: [
|
|
129
140
|
// Version control
|
package/dist/types.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF;;;;;;GAMG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,WAAW;IACX,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,OAAO;IACP,UAAU;IACV,UAAU;IACV,MAAM;IACN,aAAa;IACb,YAAY;IACZ,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,WAAW;CACH,CAAC;AAqBX;;;GAGG;AACU,QAAA,SAAS,GAAG;IACvB,YAAY;IACZ,YAAY;IACZ,KAAK;IACL,KAAK;IACL,QAAQ;IACR,IAAI;IACJ,MAAM;IACN,MAAM;IACN,GAAG;IACH,KAAK;IACL,QAAQ;IACR,KAAK;IACL,MAAM;IACN,OAAO;IACP,QAAQ;IACR,MAAM;IACN,QAAQ;IACR,KAAK;IACL,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,SAAS;CACD,CAAC;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":";AAAA;;;;GAIG;;;AAEH,gFAAgF;AAChF,cAAc;AACd,gFAAgF;AAEhF;;;;;;GAMG;AACU,QAAA,UAAU,GAAG;IACxB,MAAM;IACN,QAAQ;IACR,OAAO;IACP,QAAQ;IACR,WAAW;IACX,OAAO;IACP,UAAU;IACV,UAAU;IACV,QAAQ;IACR,UAAU;IACV,OAAO;IACP,UAAU;IACV,UAAU;IACV,MAAM;IACN,aAAa;IACb,YAAY;IACZ,WAAW;IACX,WAAW;IACX,QAAQ;IACR,QAAQ;IACR,OAAO;IACP,WAAW;CACH,CAAC;AAqBX;;;GAG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QAChB,eAAe;QACf,mBAAmB;QACnB,oBAAoB;QACpB,iBAAiB;QAEjB,aAAa;QACb,aAAa;QAEb,gBAAgB;QAChB,YAAY;QACZ,WAAW;QACX,YAAY;QAEZ,6BAA6B;QAC7B,cAAc;QACd,mBAAmB;QACnB,YAAY;KACb;IACD,SAAS,EAAE,EAAE;IACb,UAAU,EAAE,EAAE;IACd,WAAW,EAAE,IAAI,GAAG,IAAI,EAAE,MAAM;IAChC,iBAAiB,EAAE,IAAI;IACvB,cAAc,EAAE,IAAI;IACpB,cAAc,EAAE;QACd,OAAO,EAAE,KAAK;QACd,QAAQ,EAAE,QAAQ;QAClB,KAAK,EAAE,oBAAoB;QAC3B,SAAS,EAAE,EAAE;KACd;CACF,CAAC"}
|
package/dist/utils.js
CHANGED
|
@@ -88,7 +88,7 @@ const path = __importStar(require("path"));
|
|
|
88
88
|
const SENSITIVE_PATHS = new Set([
|
|
89
89
|
'/', '/etc', '/usr', '/bin', '/sbin', '/var', '/tmp', '/dev', '/proc', '/sys',
|
|
90
90
|
'/root', '/boot', '/lib', '/lib64', '/opt',
|
|
91
|
-
'
|
|
91
|
+
'c:\\', 'c:\\windows', 'c:\\windows\\system32',
|
|
92
92
|
]);
|
|
93
93
|
/**
|
|
94
94
|
* Validate that a resolved file path stays within the project root.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@stupidloud/codegraph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.9.5",
|
|
4
4
|
"description": "Supercharge Claude Code with semantic code intelligence. 94% fewer tool calls • 77% faster exploration • 100% local.",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -39,8 +39,8 @@
|
|
|
39
39
|
"fast-string-width": "^3.0.2",
|
|
40
40
|
"fast-wrap-ansi": "^0.2.0",
|
|
41
41
|
"gpt-tokenizer": "^3.4.0",
|
|
42
|
+
"ignore": "^7.0.5",
|
|
42
43
|
"jsonc-parser": "^3.3.1",
|
|
43
|
-
"node-sqlite3-wasm": "^0.8.30",
|
|
44
44
|
"picomatch": "^4.0.3",
|
|
45
45
|
"sisteransi": "^1.0.5",
|
|
46
46
|
"tree-sitter-wasms": "^0.1.11",
|
|
@@ -54,10 +54,10 @@
|
|
|
54
54
|
"vitest": "^2.1.9"
|
|
55
55
|
},
|
|
56
56
|
"optionalDependencies": {
|
|
57
|
-
"better-sqlite3": "^
|
|
57
|
+
"better-sqlite3": "^12.4.1",
|
|
58
58
|
"sqlite-vss": "^0.1.2"
|
|
59
59
|
},
|
|
60
60
|
"engines": {
|
|
61
|
-
"node": ">=
|
|
61
|
+
"node": ">=20.0.0 <25.0.0"
|
|
62
62
|
}
|
|
63
63
|
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# Add-lang benchmark for ONE repo:
|
|
3
|
+
# clone -> wipe+index (with the codegraph on PATH) -> verify extraction ->
|
|
4
|
+
# with/without retrieval A/B (reuses scripts/agent-eval/run-all.sh).
|
|
5
|
+
#
|
|
6
|
+
# Assumes the codegraph dev build is already built + linked on PATH — the skill
|
|
7
|
+
# runs `npm run build && ./scripts/local-install.sh` ONCE before looping repos.
|
|
8
|
+
# The A/B is skipped if extraction fails its critical checks (don't burn $ on a
|
|
9
|
+
# broken extractor); set FORCE_AB=1 to run it anyway.
|
|
10
|
+
#
|
|
11
|
+
# Usage: bench.sh <lang> <repo-name> <repo-url> "<question>" [headless|tmux|all]
|
|
12
|
+
# Env: CORPUS corpus dir (default /tmp/codegraph-corpus, shared with agent-eval)
|
|
13
|
+
set -uo pipefail
|
|
14
|
+
|
|
15
|
+
LANG_TOKEN="${1:?usage: bench.sh <lang> <repo-name> <repo-url> \"<question>\" [mode]}"
|
|
16
|
+
NAME="${2:?repo-name required}"
|
|
17
|
+
URL="${3:?repo-url required}"
|
|
18
|
+
Q="${4:?question required}"
|
|
19
|
+
MODE="${5:-headless}"
|
|
20
|
+
|
|
21
|
+
HARNESS="$(cd "$(dirname "$0")" && pwd)"
|
|
22
|
+
AGENT_EVAL="$(cd "$HARNESS/../agent-eval" && pwd)"
|
|
23
|
+
CORPUS="${CORPUS:-/tmp/codegraph-corpus}"
|
|
24
|
+
REPO="$CORPUS/$NAME"
|
|
25
|
+
|
|
26
|
+
command -v codegraph >/dev/null || { echo "no codegraph on PATH (build + ./scripts/local-install.sh first)"; exit 1; }
|
|
27
|
+
|
|
28
|
+
echo "==================== add-lang bench: $NAME ($LANG_TOKEN) ===================="
|
|
29
|
+
echo "codegraph: $(command -v codegraph) -> $(codegraph --version 2>/dev/null || echo '?')"
|
|
30
|
+
|
|
31
|
+
# 1. Ensure the repo (shallow clone, reuse if present).
|
|
32
|
+
mkdir -p "$CORPUS"
|
|
33
|
+
if [ -d "$REPO/.git" ]; then
|
|
34
|
+
echo "→ reusing checkout: $REPO"
|
|
35
|
+
else
|
|
36
|
+
echo "→ cloning $URL"
|
|
37
|
+
git clone --depth 1 "$URL" "$REPO" || { echo "git clone failed"; exit 1; }
|
|
38
|
+
fi
|
|
39
|
+
|
|
40
|
+
# 2. Wipe + index with the binary under test.
|
|
41
|
+
echo "→ wiping .codegraph and indexing"
|
|
42
|
+
rm -rf "$REPO/.codegraph"
|
|
43
|
+
( cd "$REPO" && codegraph init -i ) || { echo "indexing failed"; exit 1; }
|
|
44
|
+
|
|
45
|
+
# 3. Verify extraction (cheap guard before the paid A/B).
|
|
46
|
+
echo "→ verifying extraction"
|
|
47
|
+
node "$HARNESS/verify-extraction.mjs" "$REPO" "$LANG_TOKEN"
|
|
48
|
+
VERIFY=$?
|
|
49
|
+
|
|
50
|
+
# 4. Retrieval A/B (skipped if extraction is broken, unless FORCE_AB=1).
|
|
51
|
+
if [ "$VERIFY" -ne 0 ] && [ "${FORCE_AB:-0}" != "1" ]; then
|
|
52
|
+
echo "→ SKIPPING A/B — extraction failed critical checks (set FORCE_AB=1 to override)"
|
|
53
|
+
else
|
|
54
|
+
echo "→ retrieval A/B (mode=$MODE)"
|
|
55
|
+
bash "$AGENT_EVAL/run-all.sh" "$REPO" "$Q" "$MODE"
|
|
56
|
+
fi
|
|
57
|
+
|
|
58
|
+
echo "==================== bench complete: $NAME (verify exit=$VERIFY) ===================="
|
|
59
|
+
# Exit reflects extraction: 0 = pass/warn, 1 = critical fail, 2 = couldn't read status.
|
|
60
|
+
exit "$VERIFY"
|
|
@@ -0,0 +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);
|
|
@@ -0,0 +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
|
+
// codegraph 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();
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
// Sanity-check that codegraph 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 `codegraph status <repo> --json` using whatever codegraph 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('codegraph', ['status', repo, '--json'], { encoding: 'utf8' });
|
|
23
|
+
status = JSON.parse(out);
|
|
24
|
+
} catch (e) {
|
|
25
|
+
console.error(`[verify] could not read codegraph 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 codegraph 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);
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
#!/usr/bin/env bash
|
|
2
|
+
# One-shot CodeGraph quality audit:
|
|
3
|
+
# set version -> ensure corpus repo -> wipe+reindex with that version ->
|
|
4
|
+
# run with/without A/B -> restore the local dev link.
|
|
5
|
+
#
|
|
6
|
+
# Usage: audit.sh <version> <repo-name> <repo-url> "<question>" [headless|all]
|
|
7
|
+
# <version> "local" (build + npm link this repo) | "latest" | a version (e.g. 0.7.10)
|
|
8
|
+
# <repo-name> dir name under the corpus dir
|
|
9
|
+
# <repo-url> git URL (cloned --depth 1 when the repo dir is missing)
|
|
10
|
+
# [mode] headless (default) | all (also the interactive tmux arms)
|
|
11
|
+
# Env: CORPUS corpus dir (default: /tmp/codegraph-corpus)
|
|
12
|
+
set -uo pipefail
|
|
13
|
+
|
|
14
|
+
VERSION="${1:?usage: audit.sh <version> <repo-name> <repo-url> \"<question>\" [mode]}"
|
|
15
|
+
NAME="${2:?repo-name required}"
|
|
16
|
+
URL="${3:?repo-url required}"
|
|
17
|
+
Q="${4:?question required}"
|
|
18
|
+
MODE="${5:-headless}"
|
|
19
|
+
|
|
20
|
+
HARNESS="$(cd "$(dirname "$0")" && pwd)"
|
|
21
|
+
REPO_ROOT="$(cd "$HARNESS/../.." && pwd)" # codegraph repo root
|
|
22
|
+
CORPUS="${CORPUS:-/tmp/codegraph-corpus}"
|
|
23
|
+
REPO="$CORPUS/$NAME"
|
|
24
|
+
PKG="@colbymchenry/codegraph"
|
|
25
|
+
|
|
26
|
+
echo "==================== CodeGraph audit ===================="
|
|
27
|
+
echo "version=$VERSION repo=$NAME mode=$MODE corpus=$CORPUS"
|
|
28
|
+
echo
|
|
29
|
+
|
|
30
|
+
# 1. Set the codegraph version under test (mutates the global install).
|
|
31
|
+
if [ "$VERSION" = local ]; then
|
|
32
|
+
echo "→ [1/4] building + linking local dev build (local-install.sh)"
|
|
33
|
+
( cd "$REPO_ROOT" && ./scripts/local-install.sh ) || { echo "local-install.sh failed"; exit 1; }
|
|
34
|
+
else
|
|
35
|
+
echo "→ [1/4] installing $PKG@$VERSION globally"
|
|
36
|
+
npm install -g "$PKG@$VERSION" || { echo "npm install -g $PKG@$VERSION failed"; exit 1; }
|
|
37
|
+
fi
|
|
38
|
+
ACTUAL="$(codegraph --version 2>/dev/null || echo '?')"
|
|
39
|
+
echo " codegraph on PATH: $(command -v codegraph) -> $ACTUAL"
|
|
40
|
+
|
|
41
|
+
# 2. Ensure the corpus repo exists (clone shallow if missing, reuse if present).
|
|
42
|
+
mkdir -p "$CORPUS"
|
|
43
|
+
if [ -d "$REPO/.git" ]; then
|
|
44
|
+
echo "→ [2/4] reusing existing checkout: $REPO"
|
|
45
|
+
else
|
|
46
|
+
echo "→ [2/4] cloning $URL"
|
|
47
|
+
git clone --depth 1 "$URL" "$REPO" || { echo "git clone failed"; exit 1; }
|
|
48
|
+
fi
|
|
49
|
+
|
|
50
|
+
# 3. Wipe + re-index with THIS version (the index must be built by the same
|
|
51
|
+
# binary that serves it — different versions extract differently).
|
|
52
|
+
echo "→ [3/4] wiping .codegraph and re-indexing with $ACTUAL"
|
|
53
|
+
rm -rf "$REPO/.codegraph"
|
|
54
|
+
( cd "$REPO" && codegraph init -i ) || { echo "indexing failed"; exit 1; }
|
|
55
|
+
|
|
56
|
+
# 4. Run the with/without A/B.
|
|
57
|
+
echo "→ [4/4] running A/B harness (mode=$MODE)"
|
|
58
|
+
bash "$HARNESS/run-all.sh" "$REPO" "$Q" "$MODE"
|
|
59
|
+
|
|
60
|
+
# Restore the dev link (the normal working state in this repo).
|
|
61
|
+
echo
|
|
62
|
+
echo "→ restoring local dev link (local-install.sh)"
|
|
63
|
+
if ( cd "$REPO_ROOT" && ./scripts/local-install.sh >/dev/null 2>&1 ); then
|
|
64
|
+
echo " global codegraph restored to dev build"
|
|
65
|
+
else
|
|
66
|
+
echo " WARN: restore failed — run ./scripts/local-install.sh manually"
|
|
67
|
+
fi
|
|
68
|
+
echo "==================== audit complete ===================="
|
|
@@ -24,7 +24,7 @@ tmux kill-session -t "$SESSION" 2>/dev/null
|
|
|
24
24
|
|
|
25
25
|
# Wide pane so the TUI doesn't hard-wrap tool lines.
|
|
26
26
|
tmux new-session -d -s "$SESSION" -x 230 -y 60
|
|
27
|
-
tmux send-keys -t "$SESSION" "cd $REPO && claude --dangerously-skip-permissions" Enter
|
|
27
|
+
tmux send-keys -t "$SESSION" "cd $REPO && claude --dangerously-skip-permissions ${CLAUDE_EXTRA_ARGS:-}" Enter
|
|
28
28
|
|
|
29
29
|
# Wait for the ❯ prompt (claude drew its UI), up to 60s. NOTE: ❯ appears on the
|
|
30
30
|
# welcome screen seconds before the input actually accepts keystrokes, so this is
|