sigmap 2.0.0-beta.3 → 2.0.0-beta.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/CHANGELOG.md CHANGED
@@ -6,6 +6,28 @@ Format: [Semantic Versioning](https://semver.org/)
6
6
 
7
7
  ---
8
8
 
9
+ ## [2.0.0-beta.5] — 2026-04-03
10
+
11
+ ### Changed
12
+ - Prerelease version bumped from `2.0.0-beta.4` to `2.0.0-beta.5` across CLI, MCP server info, root package metadata, and VS Code extension metadata.
13
+
14
+ ### Validation gate
15
+ - 21/21 extractor tests passed
16
+ - 17/17 integration suites passed (including v2plus 3/3)
17
+
18
+ ---
19
+
20
+ ## [2.0.0-beta.4] — 2026-04-03
21
+
22
+ ### Changed
23
+ - Prerelease version bumped from `2.0.0-beta.3` to `2.0.0-beta.4` across CLI, MCP server info, root package metadata, and VS Code extension metadata.
24
+
25
+ ### Validation gate
26
+ - 21/21 extractor tests passed
27
+ - 17/17 integration suites passed (including v2plus 3/3)
28
+
29
+ ---
30
+
9
31
  ## [2.0.0-beta.3] — 2026-04-03
10
32
 
11
33
  ### Changed
package/gen-context.js CHANGED
@@ -3520,7 +3520,7 @@ const path = require('path');
3520
3520
  const os = require('os');
3521
3521
  const { execSync } = require('child_process');
3522
3522
 
3523
- const VERSION = '2.0.0-beta.3';
3523
+ const VERSION = '2.0.0-beta.5';
3524
3524
  const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
3525
3525
 
3526
3526
  function requireSourceOrBundled(key) {
@@ -3880,7 +3880,18 @@ function buildChangesSection(cwd, config, fileEntries) {
3880
3880
  cwd, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'],
3881
3881
  });
3882
3882
  } catch (_) {
3883
- range = 'HEAD~1..HEAD';
3883
+ // HEAD~n doesn't exist (shallow repo) — clamp to deepest valid ancestor
3884
+ let best = 1;
3885
+ for (let k = n - 1; k >= 2; k--) {
3886
+ try {
3887
+ execSync(`git rev-parse --verify HEAD~${k} 2>/dev/null`, {
3888
+ cwd, encoding: 'utf8', stdio: ['pipe', 'pipe', 'pipe'],
3889
+ });
3890
+ best = k;
3891
+ break;
3892
+ } catch (_) {}
3893
+ }
3894
+ range = `HEAD~${best}..HEAD`;
3884
3895
  }
3885
3896
 
3886
3897
  const namesOnly = execSync(`git diff ${range} --name-only 2>/dev/null`, {
@@ -3907,8 +3918,10 @@ function buildChangesSection(cwd, config, fileEntries) {
3907
3918
  continue;
3908
3919
  }
3909
3920
  const plus = [...diff.matchAll(/^\+.*(?:def\s+|function\s+|class\s+|func\s+)(\w+)/gm)].map((m) => `+${m[1]}`);
3910
- const mod = [...diff.matchAll(/^-.*(?:def\s+|function\s+|class\s+|func\s+)(\w+)/gm)].map((m) => `~${m[1]}`);
3911
- const delta = [...new Set([...plus, ...mod])].slice(0, 4).join(' ');
3921
+ const modDef = [...diff.matchAll(/^-.*(?:def\s+|function\s+|class\s+|func\s+)(\w+)/gm)].map((m) => `~${m[1]}`);
3922
+ // Also extract function names from @@ hunk headers (catches body-only changes like added comments/lines)
3923
+ const modCtx = [...diff.matchAll(/^@@[^@]*@@\s+(?:(?:async|export|public|private|static)\s+)*(?:def|function|class|func)\s+(\w+)/gm)].map((m) => `~${m[1]}`);
3924
+ const delta = [...new Set([...plus, ...modDef, ...modCtx])].slice(0, 4).join(' ');
3912
3925
  if (delta) {
3913
3926
  hasDelta = true;
3914
3927
  lines.push(`${rel.padEnd(45)} ${delta}`);
@@ -3933,9 +3946,17 @@ function resolveImpactRadius(fileEntries, cwd, config) {
3933
3946
 
3934
3947
  for (const entry of fileEntries) {
3935
3948
  const importer = path.relative(cwd, entry.filePath);
3949
+ const importerTop = importer.split('/')[0];
3936
3950
  for (const dep of (entry.deps || [])) {
3937
3951
  const depNorm = dep.replace(/\\/g, '/').replace(/^\.\//, '').replace(/\.[^.]+$/, '');
3938
- const matches = keys.filter((k) => k.norm.endsWith(depNorm) || k.base === depNorm || k.norm === depNorm);
3952
+ const matches = keys.filter((k) => {
3953
+ if (k.norm === depNorm) return true;
3954
+ // Path-segment or base-only match: both require same top-level directory
3955
+ // to prevent cross-subsystem matches (e.g. 'app' dep in server/ matching desktop/gui/app.py)
3956
+ const matchTop = k.rel.split('/')[0];
3957
+ if (k.norm.endsWith('/' + depNorm) || k.base === depNorm) return matchTop === importerTop;
3958
+ return false;
3959
+ });
3939
3960
  for (const m of matches) {
3940
3961
  if (!map.has(m.rel)) map.set(m.rel, []);
3941
3962
  map.get(m.rel).push(importer);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap",
3
- "version": "2.0.0-beta.3",
3
+ "version": "2.0.0-beta.5",
4
4
  "description": "Zero-dependency AI context engine — 97% token reduction. No npm install. Runs on Node 18+.",
5
5
  "main": "gen-context.js",
6
6
  "bin": {
package/src/mcp/server.js CHANGED
@@ -18,7 +18,7 @@ const { readContext, searchSignatures, getMap, createCheckpoint, getRouting, exp
18
18
 
19
19
  const SERVER_INFO = {
20
20
  name: 'sigmap',
21
- version: '2.0.0-beta.3',
21
+ version: '2.0.0-beta.5',
22
22
  description: 'SigMap MCP server — code signatures on demand',
23
23
  };
24
24