@sdsrs/code-graph 0.184.0 → 0.186.0
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/claude-plugin/.claude-plugin/plugin.json +1 -1
- package/claude-plugin/scripts/lifecycle.js +9 -9
- package/claude-plugin/scripts/post-grep-inject.js +51 -6
- package/claude-plugin/scripts/pre-grep-guide.js +2 -1
- package/claude-plugin/scripts/pre-read-guide.js +41 -21
- package/claude-plugin/scripts/tmp-dir.js +2 -2
- package/claude-plugin/scripts/user-prompt-context.js +9 -66
- package/claude-plugin/templates/code-graph-snapshot.yml +1 -1
- package/package.json +6 -6
|
@@ -1314,15 +1314,15 @@ function hookFirePayload(matcher, event = '') {
|
|
|
1314
1314
|
case 'Write|Edit':
|
|
1315
1315
|
return { tool_name: 'Edit', tool_input: { file_path: 'src/example.rs', old_string: 'a', new_string: 'b' } };
|
|
1316
1316
|
case '': // UserPromptSubmit
|
|
1317
|
-
// A
|
|
1318
|
-
//
|
|
1319
|
-
//
|
|
1320
|
-
//
|
|
1321
|
-
//
|
|
1322
|
-
//
|
|
1323
|
-
//
|
|
1324
|
-
// has always had it right, while the
|
|
1325
|
-
// (audit 2026-08-29 JS-01).
|
|
1317
|
+
// A prompt that resolves to no query, so the probe never runs the CLI.
|
|
1318
|
+
// Every query path of this hook that emits runs the CLI since P2-1
|
|
1319
|
+
// removed the binary-free `[code-graph:hint]` line this probe used to
|
|
1320
|
+
// engage (the restart notice of an install with no manifest still
|
|
1321
|
+
// emits, before the prompt is read), so like
|
|
1322
|
+
// the Stop and SubagentStart probes it proves load + exit 0; the field it
|
|
1323
|
+
// reads is pinned by user-prompt-context.test.js with a stub binary. Field
|
|
1324
|
+
// name is `prompt`: this constructor has always had it right, while the
|
|
1325
|
+
// hook itself read `message` (audit 2026-08-29 JS-01).
|
|
1326
1326
|
return { prompt: 'why does the parser crash on empty input' };
|
|
1327
1327
|
default:
|
|
1328
1328
|
return { tool_name: 'Unknown', tool_input: {} };
|
|
@@ -192,16 +192,45 @@ function grepFoundPattern(output, rawPattern) {
|
|
|
192
192
|
// ids are pure `[A-Za-z_]\w*` tokens (no regex metachars) → safe to embed in \b…\b.
|
|
193
193
|
const wordRes = ids.map((id) => new RegExp(`\\b${id}\\b`));
|
|
194
194
|
return output.split('\n').some((line) => {
|
|
195
|
-
|
|
196
|
-
// A `-l` bare path is short, so a line longer than the cap is never one.
|
|
197
|
-
const head = line.length > HIT_SHAPE_SCAN_MAX ? line.slice(0, HIT_SHAPE_SCAN_MAX) : line;
|
|
198
|
-
const hitShaped = GREP_HIT_LINE.test(head)
|
|
199
|
-
|| (line.length <= HIT_SHAPE_SCAN_MAX && BARE_PATH_LINE.test(line));
|
|
200
|
-
if (!hitShaped) return false;
|
|
195
|
+
if (!isGrepHitLine(line)) return false;
|
|
201
196
|
return wordRes.some((re) => re.test(line)); // \b…\b is linear — safe on the full line
|
|
202
197
|
});
|
|
203
198
|
}
|
|
204
199
|
|
|
200
|
+
/** Whether one stdout line has a grep hit's shape (see GREP_HIT_LINE). */
|
|
201
|
+
function isGrepHitLine(line) {
|
|
202
|
+
// Decide hit-shape from a bounded prefix (ReDoS guard — see HIT_SHAPE_SCAN_MAX).
|
|
203
|
+
// A `-l` bare path is short, so a line longer than the cap is never one.
|
|
204
|
+
const head = line.length > HIT_SHAPE_SCAN_MAX ? line.slice(0, HIT_SHAPE_SCAN_MAX) : line;
|
|
205
|
+
return GREP_HIT_LINE.test(head)
|
|
206
|
+
|| (line.length <= HIT_SHAPE_SCAN_MAX && BARE_PATH_LINE.test(line));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
/**
|
|
210
|
+
* Did the command's own output carry grep hits at all, whatever they matched?
|
|
211
|
+
* False for unreadable output (unknown) and for output with no hit-shaped line,
|
|
212
|
+
* such as a sibling `echo` after a grep that matched nothing.
|
|
213
|
+
*/
|
|
214
|
+
function grepShowedHits(output) {
|
|
215
|
+
return typeof output === 'string' && output.split('\n').some(isGrepHitLine);
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
// `code-graph-mcp grep` puts ` → <kind> <name> (lines a-b)` under each hit it
|
|
219
|
+
// can place; a hit line itself starts with its path, never with spaces.
|
|
220
|
+
const CONTAINER_LINE = /^ {2}→ (\S+) /gm;
|
|
221
|
+
|
|
222
|
+
/**
|
|
223
|
+
* Whether a grep answer places at least one hit inside a function, class or
|
|
224
|
+
* other node below the file. `→ module <file>` and a `-l` list (no annotation)
|
|
225
|
+
* say nothing the grep's own hits did not (P2-1).
|
|
226
|
+
*/
|
|
227
|
+
function hasAstContext(text) {
|
|
228
|
+
for (const m of String(text || '').matchAll(CONTAINER_LINE)) {
|
|
229
|
+
if (m[1] !== 'module') return true;
|
|
230
|
+
}
|
|
231
|
+
return false;
|
|
232
|
+
}
|
|
233
|
+
|
|
205
234
|
// Short header so the model recognizes this as cg's parallel structural view of
|
|
206
235
|
// the grep it just ran (the grep already executed; this is additive context).
|
|
207
236
|
const INJECT_HEADER = '[code-graph] AST-aware view of your grep (ran alongside):';
|
|
@@ -519,6 +548,20 @@ function runMain() {
|
|
|
519
548
|
binaryCacheOk: !grepListsBinaryMatches(segment),
|
|
520
549
|
})) return;
|
|
521
550
|
|
|
551
|
+
// P2-1 — in era E (0.178.0 to 2026-11-03, neutral projects) 15 of 21 grep-mode
|
|
552
|
+
// injects placed no hit below file level (10 `-l` lists, 5 all `→ module`),
|
|
553
|
+
// each after a grep whose own hits were on screen. When the model's output
|
|
554
|
+
// shows grep hits, such an answer is skipped and recorded like the
|
|
555
|
+
// redundancy skip; after a grep that printed none, the hits are the news.
|
|
556
|
+
if (answeredMode === 'grep' && !hasAstContext(answer.text)
|
|
557
|
+
&& grepShowedHits(extractGrepOutput(input))) {
|
|
558
|
+
recordRecommendation(root, {
|
|
559
|
+
hook: 'grep', action: 'observe', reason: 'no-ast-context',
|
|
560
|
+
...(pattern ? { pattern } : {}),
|
|
561
|
+
});
|
|
562
|
+
return;
|
|
563
|
+
}
|
|
564
|
+
|
|
522
565
|
// B11: `scope:'outside'` marks a pointer in place of the tree; `mode` stays
|
|
523
566
|
// `callgraph`, the one the funnel aggregator buckets.
|
|
524
567
|
const rootFile = answeredMode === 'callgraph' ? definitionFile(answer.text) : null;
|
|
@@ -545,6 +588,8 @@ module.exports = {
|
|
|
545
588
|
extractCallgraphSymbols,
|
|
546
589
|
extractGrepOutput,
|
|
547
590
|
grepFoundPattern,
|
|
591
|
+
grepShowedHits,
|
|
592
|
+
hasAstContext,
|
|
548
593
|
buildInjectText,
|
|
549
594
|
definitionFile,
|
|
550
595
|
searchCovers,
|
|
@@ -2294,7 +2294,8 @@ function runMain() {
|
|
|
2294
2294
|
if (!readGuide.isSourceFile(t)) continue;
|
|
2295
2295
|
const abs = path.isAbsolute(t) ? t : path.resolve(shellCwd, t);
|
|
2296
2296
|
// D#560 — a linked worktree's copy counts toward the indexed directory.
|
|
2297
|
-
const dir = readGuide.trackRead(
|
|
2297
|
+
const dir = readGuide.trackRead(
|
|
2298
|
+
root, indexKey(root, path.relative(root, abs)), Date.now(), readGuide.readerOf(input));
|
|
2298
2299
|
if (dir !== null) firedDirs.push(dir); // a dir fires once: markHint starts its cooldown
|
|
2299
2300
|
}
|
|
2300
2301
|
if (firedDirs.length > 0) {
|
|
@@ -23,10 +23,16 @@ if (require.main === module) require('./hook-fail-open').installHookFailOpen('Pr
|
|
|
23
23
|
// 6. The dir has not fired before while its state entry lives
|
|
24
24
|
// 7. The CLI delivers an overview for the dir (no advice-only line)
|
|
25
25
|
//
|
|
26
|
-
// State scoping: per
|
|
27
|
-
// the
|
|
28
|
-
//
|
|
29
|
-
//
|
|
26
|
+
// State scoping: per project AND per reader (D#713) — the session, and within
|
|
27
|
+
// it the subagent, as the hook input's session_id and agent_id name them
|
|
28
|
+
// (`readerOf`); per project alone when the input carries neither. Keyed on the
|
|
29
|
+
// project alone, every session, subagent and worktree of it added to one
|
|
30
|
+
// count, and the overview went to whichever read crossed it: replaying era E
|
|
31
|
+
// (tasks/d713-fanout-per-session/replay_fanout.py), 7 of 19 overviews landed in
|
|
32
|
+
// a context that had not read 5 files of the dir itself — a parent and its
|
|
33
|
+
// subagents adding up, since a subagent's hooks get the parent's session_id.
|
|
34
|
+
// Stale entries (no read in 30 min) get pruned on load; SessionStart's
|
|
35
|
+
// pruneCgTmp removes the files a day after their last write.
|
|
30
36
|
//
|
|
31
37
|
// Escape hatch: CODE_GRAPH_QUIET_HOOKS=1 — matches user-prompt-context.js /
|
|
32
38
|
// pre-grep-guide.js convention.
|
|
@@ -35,6 +41,7 @@ const fs = require('fs');
|
|
|
35
41
|
const path = require('path');
|
|
36
42
|
const crypto = require('crypto');
|
|
37
43
|
const { cgTmpDir } = require('./tmp-dir');
|
|
44
|
+
const { sessionKey } = require('./session-edits');
|
|
38
45
|
const { recordRecommendation } = require('./recommendation-log');
|
|
39
46
|
const { resolveProjectRoot, indexKey, indexBuildInProgress } = require('./project-root');
|
|
40
47
|
const { runOverviewAnswer } = require('./cg-answer');
|
|
@@ -73,14 +80,26 @@ function cwdHash(cwd) {
|
|
|
73
80
|
return crypto.createHash('sha1').update(String(cwd)).digest('hex').slice(0, 12);
|
|
74
81
|
}
|
|
75
82
|
|
|
76
|
-
|
|
77
|
-
|
|
83
|
+
/// Who is reading, for the fan-out count: the session, and the subagent the
|
|
84
|
+
/// hook fired in (Claude Code sets `agent_id` on a subagent's tool events and
|
|
85
|
+
/// gives it the parent's `session_id`). null when the input names neither.
|
|
86
|
+
function readerOf(input) {
|
|
87
|
+
const session = (input && input.session_id) || '';
|
|
88
|
+
const agent = (input && input.agent_id) || '';
|
|
89
|
+
if (!session && !agent) return null;
|
|
90
|
+
return agent ? `${session}/${agent}` : session;
|
|
78
91
|
}
|
|
79
92
|
|
|
80
|
-
function
|
|
93
|
+
function statePath(cwd, reader = null) {
|
|
94
|
+
const key = sessionKey(reader);
|
|
95
|
+
const suffix = key ? `-${key}` : '';
|
|
96
|
+
return path.join(cgTmpDir(), `.code-graph-readfan-${cwdHash(cwd)}${suffix}.json`);
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
function loadState(cwd, now = Date.now(), reader = null) {
|
|
81
100
|
let state;
|
|
82
101
|
try {
|
|
83
|
-
const raw = fs.readFileSync(statePath(cwd), 'utf8');
|
|
102
|
+
const raw = fs.readFileSync(statePath(cwd, reader), 'utf8');
|
|
84
103
|
state = JSON.parse(raw);
|
|
85
104
|
} catch { return { by_dir: {} }; }
|
|
86
105
|
if (!state || typeof state !== 'object' || !state.by_dir) return { by_dir: {} };
|
|
@@ -94,9 +113,9 @@ function loadState(cwd, now = Date.now()) {
|
|
|
94
113
|
return state;
|
|
95
114
|
}
|
|
96
115
|
|
|
97
|
-
function saveState(cwd, state) {
|
|
116
|
+
function saveState(cwd, state, reader = null) {
|
|
98
117
|
try {
|
|
99
|
-
fs.writeFileSync(statePath(cwd), JSON.stringify(state));
|
|
118
|
+
fs.writeFileSync(statePath(cwd, reader), JSON.stringify(state));
|
|
100
119
|
} catch { /* ok */ }
|
|
101
120
|
}
|
|
102
121
|
|
|
@@ -163,16 +182,17 @@ function isAnswerDisabled(env = process.env) {
|
|
|
163
182
|
|
|
164
183
|
// --- Shared tracking core (also driven by pre-grep-guide's sed-range path) ---
|
|
165
184
|
|
|
166
|
-
/// Record one read of `rel` (project-root-relative source path)
|
|
167
|
-
/// dir when this read crossed the fanout threshold
|
|
168
|
-
/// delivered), else null. Writes nothing to stdout: a
|
|
169
|
-
/// ONE JSON value, so only the entry point may
|
|
170
|
-
|
|
185
|
+
/// Record one read of `rel` (project-root-relative source path) by `reader`
|
|
186
|
+
/// ([`readerOf`]). Returns the dir when this read crossed the fanout threshold
|
|
187
|
+
/// (the hint is marked as delivered), else null. Writes nothing to stdout: a
|
|
188
|
+
/// hook's stdout is parsed as ONE JSON value, so only the entry point may
|
|
189
|
+
/// write, and only once.
|
|
190
|
+
function trackRead(root, rel, now = Date.now(), reader = null) {
|
|
171
191
|
if (!rel || rel.startsWith('..') || path.isAbsolute(rel)) return null;
|
|
172
192
|
const dir = path.dirname(rel);
|
|
173
193
|
if (!dir || dir === '.' || dir === '') return null; // top-level file: not fanout
|
|
174
194
|
|
|
175
|
-
const state = loadState(root, now);
|
|
195
|
+
const state = loadState(root, now, reader);
|
|
176
196
|
recordRead(state, dir, now, rel);
|
|
177
197
|
let fired = false;
|
|
178
198
|
// During the startup build the overview would list part of the dir as the
|
|
@@ -181,7 +201,7 @@ function trackRead(root, rel, now = Date.now()) {
|
|
|
181
201
|
markHint(state, dir, now);
|
|
182
202
|
fired = true;
|
|
183
203
|
}
|
|
184
|
-
saveState(root, state);
|
|
204
|
+
saveState(root, state, reader);
|
|
185
205
|
if (!fired) {
|
|
186
206
|
// Outcome proxy: a source read that didn't trip the fanout hint still ran.
|
|
187
207
|
// Record it (best-effort) so `stats` can measure the model's read fan-out —
|
|
@@ -231,8 +251,8 @@ function buildFanoutHint(root, dir, { maxBytes } = {}) {
|
|
|
231
251
|
|
|
232
252
|
/// trackRead + buildFanoutHint for one read. Returns the hint text when the
|
|
233
253
|
/// hint fired with an overview, else null. The caller emits it.
|
|
234
|
-
function trackReadAndMaybeHint(root, rel, now = Date.now()) {
|
|
235
|
-
const dir = trackRead(root, rel, now);
|
|
254
|
+
function trackReadAndMaybeHint(root, rel, now = Date.now(), reader = null) {
|
|
255
|
+
const dir = trackRead(root, rel, now, reader);
|
|
236
256
|
return dir === null ? null : buildFanoutHint(root, dir);
|
|
237
257
|
}
|
|
238
258
|
|
|
@@ -262,7 +282,7 @@ function runMain() {
|
|
|
262
282
|
rel = indexKey(root, path.relative(root, filePath));
|
|
263
283
|
} catch { return; }
|
|
264
284
|
|
|
265
|
-
const hint = trackReadAndMaybeHint(root, rel);
|
|
285
|
+
const hint = trackReadAndMaybeHint(root, rel, Date.now(), readerOf(input));
|
|
266
286
|
// Emit via the PreToolUse allow+additionalContext envelope (shared
|
|
267
287
|
// hook-emit.js). Bare stdout on a PreToolUse exit-0 lands in the debug log
|
|
268
288
|
// only and never reaches the model (CC docs v2026-06); the additionalContext
|
|
@@ -276,7 +296,7 @@ if (require.main === module) {
|
|
|
276
296
|
}
|
|
277
297
|
|
|
278
298
|
module.exports = {
|
|
279
|
-
isSourceFile, dirOf, cwdHash, statePath,
|
|
299
|
+
isSourceFile, dirOf, cwdHash, statePath, readerOf,
|
|
280
300
|
loadState, saveState, recordRead, shouldHint, markHint,
|
|
281
301
|
buildHintWithAnswer, isSilenced, isAnswerDisabled,
|
|
282
302
|
trackReadAndMaybeHint, // v0.49 — shared with pre-grep-guide's sed-range path
|
|
@@ -54,8 +54,8 @@ function cwdHash(cwd) {
|
|
|
54
54
|
// other. Flag paths are byte-identical to what each hook wrote before.
|
|
55
55
|
//
|
|
56
56
|
// pre-read-guide.js is deliberately NOT folded in: its `.code-graph-readfan-*`
|
|
57
|
-
// file is a JSON state document keyed on the cwd
|
|
58
|
-
// cooldown flag — same directory, different thing.
|
|
57
|
+
// file is a JSON state document keyed on the cwd and session, not a
|
|
58
|
+
// per-command cooldown flag — same directory, different thing.
|
|
59
59
|
function makeCooldown(prefix) {
|
|
60
60
|
const commandHash = (cmd) =>
|
|
61
61
|
crypto.createHash('sha1').update(String(cmd)).digest('hex').slice(0, 12);
|
|
@@ -50,10 +50,9 @@ const COOLDOWNS = {
|
|
|
50
50
|
overview: 5 * 60 * 1000, // 5min — module structure rarely changes mid-session
|
|
51
51
|
callgraph: 60 * 1000, // 1min
|
|
52
52
|
search: 60 * 1000, // 1min
|
|
53
|
-
symptom: 10 * 60 * 1000, // 10min — Phase E meta-advisory hint, low value to repeat
|
|
54
53
|
};
|
|
55
54
|
|
|
56
|
-
// Project-scoped (see cwdHash in tmp-dir.js). There are only
|
|
55
|
+
// Project-scoped (see cwdHash in tmp-dir.js). There are only four flag names
|
|
57
56
|
// here, so an un-scoped flag was effectively a machine-wide mute: one `impact`
|
|
58
57
|
// push in any repo silenced the next 30s of impact pushes in every other repo,
|
|
59
58
|
// and `overview` did it for five minutes.
|
|
@@ -360,50 +359,7 @@ function detectIntents(msg) {
|
|
|
360
359
|
};
|
|
361
360
|
}
|
|
362
361
|
|
|
363
|
-
|
|
364
|
-
// baseline (60%) show the failure mode "user phrases a problem without giving
|
|
365
|
-
// a symbol/path/file — Claude defaults to bash grep". The 4 existing channels
|
|
366
|
-
// (intent / qualified symbol / file path / any symbol) all miss on these
|
|
367
|
-
// prompts. SYMPTOM_PATTERNS catches the bug-flavored prompts so we can emit
|
|
368
|
-
// ONE-LINE prose hint (no CLI execution — different from the other 4 paths
|
|
369
|
-
// that inject results). Keeps noise low while planting the routing seed.
|
|
370
|
-
const SYMPTOM_PATTERNS = [
|
|
371
|
-
// English symptom / failure-mode markers
|
|
372
|
-
/\bbug\b/i,
|
|
373
|
-
/\bcrash(?:ed|ing|es)?\b/i,
|
|
374
|
-
/\bbroken\b/i,
|
|
375
|
-
/\bnot work(?:ing)?\b/i,
|
|
376
|
-
/\bdoesn'?t work\b/i,
|
|
377
|
-
/\bfail(?:ed|ing|s|ure)?\b/i,
|
|
378
|
-
/\bwhy (?:does|is|are|isn'?t|doesn'?t|won'?t)/i,
|
|
379
|
-
/\bmissing\b/i,
|
|
380
|
-
// Chinese symptom / failure markers
|
|
381
|
-
/有\s?bug/i,
|
|
382
|
-
/又挂/,
|
|
383
|
-
/又失败/,
|
|
384
|
-
/挂了/,
|
|
385
|
-
/失败了/,
|
|
386
|
-
/卡死/,
|
|
387
|
-
/卡住/,
|
|
388
|
-
/不准/,
|
|
389
|
-
/不对/,
|
|
390
|
-
/缺失/,
|
|
391
|
-
/丢失/,
|
|
392
|
-
/没响应/,
|
|
393
|
-
/出错/,
|
|
394
|
-
/报错/,
|
|
395
|
-
/为什么/,
|
|
396
|
-
/怎么(?:修|解决)/,
|
|
397
|
-
/哪里[\s\S]{0,5}(?:错|有问题|不对)/, // 哪里写错 / 哪里出错 / 哪里有问题 / 哪里报错了
|
|
398
|
-
/出了什么问题/,
|
|
399
|
-
];
|
|
400
|
-
|
|
401
|
-
function hasSymptom(msg) {
|
|
402
|
-
if (!msg || typeof msg !== 'string') return false;
|
|
403
|
-
return SYMPTOM_PATTERNS.some(p => p.test(msg));
|
|
404
|
-
}
|
|
405
|
-
|
|
406
|
-
function determineQueryType(intents, symbols, filePaths, isCoolingDownFn, message = '') {
|
|
362
|
+
function determineQueryType(intents, symbols, filePaths, isCoolingDownFn) {
|
|
407
363
|
const hasStrict = symbols.symbols.length > 0 && !symbols.lowConfidence;
|
|
408
364
|
const hasQualified = symbols.symbols.some(s => s.includes('::'));
|
|
409
365
|
const hasAny = intents.impact || intents.modify || intents.implement || intents.understand || intents.callgraph || intents.search;
|
|
@@ -428,13 +384,11 @@ function determineQueryType(intents, symbols, filePaths, isCoolingDownFn, messag
|
|
|
428
384
|
if ((intents.search || intents.implement || hasQualified) && hasStrict && !cd('search', sym)) return { type: 'search', symbol: sym };
|
|
429
385
|
if ((intents.understand || !hasAny) && hasStrict && !cd('search', sym)) return { type: 'search', symbol: sym };
|
|
430
386
|
|
|
431
|
-
//
|
|
432
|
-
//
|
|
433
|
-
//
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
|
|
387
|
+
// No anchor, no query. A prompt with failure words and nothing else used to
|
|
388
|
+
// get a `[code-graph:hint]` line pointing at search/module_overview; in era E
|
|
389
|
+
// it fired 9 times outside this plugin's own repos, and none of the 130 tool
|
|
390
|
+
// calls in the 15 after each used code-graph (P2-1,
|
|
391
|
+
// tasks/specs/p2-zero-effect-injections.md).
|
|
438
392
|
return null;
|
|
439
393
|
}
|
|
440
394
|
|
|
@@ -526,21 +480,10 @@ function runMain() {
|
|
|
526
480
|
const intents = detectIntents(message);
|
|
527
481
|
// Key the cooldowns on the resolved project root, not the raw shell cwd, so a
|
|
528
482
|
// `cd` into a subdir does not read as a different project and re-fire.
|
|
529
|
-
const query = determineQueryType(intents, symbols, filePaths, (type, key) => isCoolingDown(type, cwd, key)
|
|
483
|
+
const query = determineQueryType(intents, symbols, filePaths, (type, key) => isCoolingDown(type, cwd, key));
|
|
530
484
|
|
|
531
485
|
if (!query) return;
|
|
532
486
|
|
|
533
|
-
// Phase E: symptom-hint is prose-only (no CLI execution). Emit + cooldown
|
|
534
|
-
// before the result-fetching paths so it can short-circuit cleanly.
|
|
535
|
-
if (query.type === 'symptom-hint') {
|
|
536
|
-
markCooldown('symptom', cwd);
|
|
537
|
-
process.stdout.write(
|
|
538
|
-
'[code-graph:hint] indexed repo — for vague-symptom prompts, try `code-graph-mcp search "<symptom words>"` ' +
|
|
539
|
-
'or `module_overview <suspected-dir>` to surface candidate code structurally. Skip if not searching code.\n'
|
|
540
|
-
);
|
|
541
|
-
return;
|
|
542
|
-
}
|
|
543
|
-
|
|
544
487
|
// A partial index answers wrongly, not just briefly (D5). Return before the
|
|
545
488
|
// cooldown so the same question is answered once the build is done.
|
|
546
489
|
if (require('./project-root').indexBuildInProgress(cwd)) return;
|
|
@@ -631,4 +574,4 @@ if (require.main === module) {
|
|
|
631
574
|
runMain();
|
|
632
575
|
}
|
|
633
576
|
|
|
634
|
-
module.exports = { ambiguityContext, COOLDOWNS, shouldSkip, extractFilePaths, extractSymbols, detectIntents, scoreIntent, INTENT_PATTERNS, INTENT_THRESHOLD, determineQueryType, computeQuietHooks, STOP_WORDS, PLAIN_WORD_EXCLUDE,
|
|
577
|
+
module.exports = { ambiguityContext, COOLDOWNS, shouldSkip, extractFilePaths, extractSymbols, detectIntents, scoreIntent, INTENT_PATTERNS, INTENT_THRESHOLD, determineQueryType, computeQuietHooks, STOP_WORDS, PLAIN_WORD_EXCLUDE, buildRunEnv, childBudgetMs, CHILD_TIMEOUT_MS };
|
|
@@ -41,7 +41,7 @@ jobs:
|
|
|
41
41
|
# refuses a snapshot that has no checksum sidecar.
|
|
42
42
|
- name: Build snapshot
|
|
43
43
|
run: |
|
|
44
|
-
npx -y -p @sdsrs/code-graph@0.
|
|
44
|
+
npx -y -p @sdsrs/code-graph@0.186.0 code-graph-mcp snapshot create --out "code-graph-snapshot-${GITHUB_SHA:0:7}.db.zst"
|
|
45
45
|
- name: Upload to release
|
|
46
46
|
env:
|
|
47
47
|
GH_TOKEN: ${{ github.token }}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@sdsrs/code-graph",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.186.0",
|
|
4
4
|
"description": "MCP server that indexes codebases into an AST knowledge graph with semantic search, call graph traversal, and HTTP route tracing",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
"node": ">=16"
|
|
36
36
|
},
|
|
37
37
|
"optionalDependencies": {
|
|
38
|
-
"@sdsrs/code-graph-linux-x64": "0.
|
|
39
|
-
"@sdsrs/code-graph-linux-arm64": "0.
|
|
40
|
-
"@sdsrs/code-graph-darwin-x64": "0.
|
|
41
|
-
"@sdsrs/code-graph-darwin-arm64": "0.
|
|
42
|
-
"@sdsrs/code-graph-win32-x64": "0.
|
|
38
|
+
"@sdsrs/code-graph-linux-x64": "0.186.0",
|
|
39
|
+
"@sdsrs/code-graph-linux-arm64": "0.186.0",
|
|
40
|
+
"@sdsrs/code-graph-darwin-x64": "0.186.0",
|
|
41
|
+
"@sdsrs/code-graph-darwin-arm64": "0.186.0",
|
|
42
|
+
"@sdsrs/code-graph-win32-x64": "0.186.0"
|
|
43
43
|
}
|
|
44
44
|
}
|