@sdsrs/code-graph 0.74.0 → 0.74.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.
@@ -4,7 +4,7 @@
4
4
  "author": {
5
5
  "name": "sdsrs"
6
6
  },
7
- "version": "0.74.0",
7
+ "version": "0.74.1",
8
8
  "keywords": [
9
9
  "code-graph",
10
10
  "ast",
@@ -480,11 +480,14 @@ function migrateLegacyMemoryDir({ cwd, home } = {}) {
480
480
  // 制品(升级自动迁移),再安装/刷新。
481
481
  function maybeAutoAdopt({ cwd, home, env, scriptPath } = {}) {
482
482
  env = env || process.env;
483
+ // Consistent return shape: every path carries `migrated`. The two pre-gate
484
+ // early returns run before migration, so they report the zero result.
485
+ const noMigration = { memoryIndexPruned: false, legacyDetailRemoved: false };
483
486
  if (env.CODE_GRAPH_NO_AUTO_ADOPT === '1') {
484
- return { attempted: false, reason: 'opted-out' };
487
+ return { attempted: false, reason: 'opted-out', migrated: noMigration };
485
488
  }
486
489
  if (!isPluginModeInstall(scriptPath || __dirname)) {
487
- return { attempted: false, reason: 'not-plugin-mode' };
490
+ return { attempted: false, reason: 'not-plugin-mode', migrated: noMigration };
488
491
  }
489
492
  // Clean legacy memory-dir artifacts before installing the new CLAUDE.md scheme.
490
493
  const migrated = migrateLegacyMemoryDir({ cwd, home });
@@ -322,6 +322,7 @@ test('maybeAutoAdopt skips when CODE_GRAPH_NO_AUTO_ADOPT=1', () => {
322
322
  try {
323
323
  const res = maybeAutoAdopt({ cwd: sb.cwd, home: sb.home, scriptPath: PLUGIN_SCRIPTS, env: { CODE_GRAPH_NO_AUTO_ADOPT: '1' } });
324
324
  assert.strictEqual(res.reason, 'opted-out');
325
+ assert.deepStrictEqual(res.migrated, { memoryIndexPruned: false, legacyDetailRemoved: false }, 'consistent migrated shape on early return');
325
326
  assert.strictEqual(isAdopted({ cwd: sb.cwd }), false);
326
327
  } finally { sb.cleanup(); }
327
328
  });
@@ -331,6 +332,7 @@ test('maybeAutoAdopt skips when not plugin-mode (npm install path)', () => {
331
332
  try {
332
333
  const res = maybeAutoAdopt({ cwd: sb.cwd, home: sb.home, scriptPath: '/usr/local/lib/node_modules/@sdsrs/code-graph/claude-plugin/scripts', env: {} });
333
334
  assert.strictEqual(res.reason, 'not-plugin-mode');
335
+ assert.deepStrictEqual(res.migrated, { memoryIndexPruned: false, legacyDetailRemoved: false }, 'consistent migrated shape on early return');
334
336
  assert.strictEqual(isAdopted({ cwd: sb.cwd }), false);
335
337
  } finally { sb.cleanup(); }
336
338
  });
@@ -33,17 +33,17 @@ function computeQuietHooks({ env = {} } = {}) {
33
33
  // SessionStart project-map injection gate. Beyond the (already default-quiet)
34
34
  // verbose opt-in, the map is now also ADOPTED-ONLY: cross-project measurement
35
35
  // (memory cross-project-interference) found the ≈2 KB dump is zero-referenced
36
- // in projects the user hasn't adopted into their MEMORY.md workflow, so it only
37
- // earns its standing-context cost for adopted projects. Unadopted projects get
38
- // no map even under CODE_GRAPH_VERBOSE_HOOKS / legacy QUIET_HOOKS=0.
36
+ // in projects the user hasn't adopted (no code-graph block in CLAUDE.md), so it
37
+ // only earns its standing-context cost for adopted projects. Unadopted projects
38
+ // get no map even under CODE_GRAPH_VERBOSE_HOOKS / legacy QUIET_HOOKS=0.
39
39
  function shouldInjectMap({ available, quietHooks, adopted } = {}) {
40
40
  return !!(available && !quietHooks && adopted);
41
41
  }
42
42
 
43
43
  // v0.63 — SessionStart "live context": the recent-change blast radius from the
44
44
  // AST index. UNLIKE injectProjectMap (default-OFF because the static module map
45
- // duplicates MEMORY.md + the on-demand project_map tool), this is git-delta-
46
- // derived — it changes every session and MEMORY.md cannot carry it, so it earns
45
+ // duplicates the CLAUDE.md block + the on-demand project_map tool), this is git-delta-
46
+ // derived — it changes every session and the static CLAUDE.md block cannot carry it, so it earns
47
47
  // being ON by default for adopted projects. It is the graph-unique, actionable
48
48
  // counterpart to mem's SessionStart dashboard (which pushes recent activity to
49
49
  // create engagement). Selectivity is automatic: a session with no recently
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@sdsrs/code-graph",
3
- "version": "0.74.0",
3
+ "version": "0.74.1",
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.74.0",
39
- "@sdsrs/code-graph-linux-arm64": "0.74.0",
40
- "@sdsrs/code-graph-darwin-x64": "0.74.0",
41
- "@sdsrs/code-graph-darwin-arm64": "0.74.0",
42
- "@sdsrs/code-graph-win32-x64": "0.74.0"
38
+ "@sdsrs/code-graph-linux-x64": "0.74.1",
39
+ "@sdsrs/code-graph-linux-arm64": "0.74.1",
40
+ "@sdsrs/code-graph-darwin-x64": "0.74.1",
41
+ "@sdsrs/code-graph-darwin-arm64": "0.74.1",
42
+ "@sdsrs/code-graph-win32-x64": "0.74.1"
43
43
  }
44
44
  }