@sdsrs/code-graph 0.136.0 → 0.137.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/README.md CHANGED
@@ -536,6 +536,7 @@ defaults are what you get by doing nothing.
536
536
  | `CODE_GRAPH_HOOK_INDEX=on\|off` | Force the incremental-index hook on or off instead of letting it decide. |
537
537
  | `CODE_GRAPH_MODEL_DIR=<dir>` | Load the embedding model from here (air-gapped installs). |
538
538
  | `CODE_GRAPH_DISABLE_MODEL_DOWNLOAD=1` | Never fetch the model; fail instead. |
539
+ | `CODE_GRAPH_REQUIRE_MODEL=1` | Test-only: make the embedding tests FAIL when no model can be loaded instead of self-skipping. Set by the release gate and the cache-warm cron, which supply pinned weights — without it those tests pass by doing nothing on any runner with no cached model. |
539
540
  | `CODE_GRAPH_MAX_FILE_SIZE=<bytes>` | Skip files larger than this (default 1 MiB). |
540
541
  | `CODE_GRAPH_MAX_CODE_LEN=<bytes>` | Truncate stored per-node source at this length. |
541
542
  | `CODE_GRAPH_PARSE_TIMEOUT_MS=<ms>` | Per-file parse timeout. |
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "sdsrs"
6
6
  },
7
- "version": "0.136.0",
7
+ "version": "0.137.0",
8
8
  "keywords": [
9
9
  "code-graph",
10
10
  "ast",
@@ -336,7 +336,13 @@ function runOverviewAnswer(opts = {}) {
336
336
  // green against it.
337
337
  const verdict = classifyRun(res, { exitOneIsNoHits: false });
338
338
  if (verdict !== 'ok') {
339
- return { status: verdict };
339
+ // Same arm as the three sibling runners: an exhausted hook budget reaches
340
+ // `classifyRun` as a synthetic timeout, so without this it is reported as
341
+ // a bare `unavailable` — indistinguishable from a wedged or broken binary.
342
+ // This runner is the read-fanout hint's only answer path, and its budget is
343
+ // the one most often already spent (pre-read runs after a SessionStart that
344
+ // already burned six children), so it is the worst place to lose the cause.
345
+ return { status: verdict, ...(res.budgetExhausted ? { reason: 'budget' } : {}) };
340
346
  }
341
347
  const out = (res.stdout || '').trim();
342
348
  if (isEmptyAnswer(out)) return { status: 'no-hits' };
@@ -316,6 +316,13 @@ function runMain() {
316
316
  ...(pattern ? { pattern } : {}),
317
317
  fallthrough: answer.status,
318
318
  reason: answer.status,
319
+ // Sub-divides `unavailable` without touching it: a starved hook and a
320
+ // wedged binary arrive under the same word and only one of them means
321
+ // something is broken. It cannot ride in `reason` — src/cli/usage.rs:448
322
+ // scores `reason:"unavailable"` as an inconclusive follow-up, so a new
323
+ // value there would silently re-file every budget skip as "the inline
324
+ // answer was insufficient". Same field pre-grep-guide.js:790 uses.
325
+ ...(answer.reason ? { fallthrough_reason: answer.reason } : {}),
319
326
  // Attribute the skip to the mode that burned the attempt — the LAST mode
320
327
  // tried, so a callgraph miss that fell through to grep is charged to grep,
321
328
  // matching the fallback order above. Without this the aggregator files
@@ -192,7 +192,15 @@ function trackReadAndMaybeHint(root, rel, now = Date.now()) {
192
192
  // 'no-binary' (delivered overview dark — binary missing) vs 'unavailable'
193
193
  // (binary ran but failed/timed out) vs 'no-hits'. Mirrors pre-grep-guide
194
194
  // so the read-fanout funnel can tell a dark flagship apart from no result.
195
+ //
196
+ // `fallthrough_reason` sub-divides 'unavailable' rather than replacing it:
197
+ // a spent hook budget and a wedged binary are the same word here, and only
198
+ // the former is the healthy-hook-answers-nothing case NEW-08 traded a kill
199
+ // for. It cannot go in `reason` — src/cli/usage.rs:448 scores
200
+ // `reason:"unavailable"` as an inconclusive follow-up, so a new value there
201
+ // would re-file every budget skip as "the answer was insufficient".
195
202
  ...(answered ? {} : { reason: answer.status }),
203
+ ...(answered || !answer.reason ? {} : { fallthrough_reason: answer.reason }),
196
204
  });
197
205
  // Compound-grep sibling sweep: emit via the PreToolUse allow+additionalContext
198
206
  // envelope (shared hook-emit.js). Bare stdout on a PreToolUse exit-0 lands in
@@ -35,7 +35,7 @@ jobs:
35
35
  node-version: '20'
36
36
  - name: Build snapshot
37
37
  run: |
38
- npx -y -p @sdsrs/code-graph@0.136.0 code-graph-mcp snapshot create --out snapshot.db
38
+ npx -y -p @sdsrs/code-graph@0.137.0 code-graph-mcp snapshot create --out snapshot.db
39
39
  zstd -9 snapshot.db -o snapshot.db.zst
40
40
  mv snapshot.db.zst "code-graph-snapshot-${GITHUB_SHA:0:7}.db.zst"
41
41
  - name: Upload to release
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdsrs/code-graph",
3
- "version": "0.136.0",
3
+ "version": "0.137.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.136.0",
39
- "@sdsrs/code-graph-linux-arm64": "0.136.0",
40
- "@sdsrs/code-graph-darwin-x64": "0.136.0",
41
- "@sdsrs/code-graph-darwin-arm64": "0.136.0",
42
- "@sdsrs/code-graph-win32-x64": "0.136.0"
38
+ "@sdsrs/code-graph-linux-x64": "0.137.0",
39
+ "@sdsrs/code-graph-linux-arm64": "0.137.0",
40
+ "@sdsrs/code-graph-darwin-x64": "0.137.0",
41
+ "@sdsrs/code-graph-darwin-arm64": "0.137.0",
42
+ "@sdsrs/code-graph-win32-x64": "0.137.0"
43
43
  }
44
44
  }