sigmap 7.16.0 → 7.17.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/CHANGELOG.md CHANGED
@@ -10,6 +10,15 @@ Format: [Semantic Versioning](https://semver.org/)
10
10
 
11
11
  ---
12
12
 
13
+ ## [7.17.0] — 2026-06-18
14
+
15
+ Minor release — `sigmap conventions --fix` (grounded codegen, Layer 3 — completes the conventions flags).
16
+
17
+ ### Added
18
+ - **`sigmap conventions --fix` — exhaustive rename/move checklist (#328):** the complete, actionable list of every source file whose name doesn't match the dominant convention, with full from→to paths, ready to paste into a task or PR. Distinct from `--conflicts` (a diagnostic summary with up to 3 example basenames) — `--fix` lists *every* offending file with its real path. New zero-dependency, bundle-safe `src/conventions/fix.js` (`buildFixList`) reuses `classifyNaming` + `toNamingStyle`; the command prints a checkbox checklist + count (or "no fixes needed") and is read-only (it never performs renames). `--json` for machine output. This completes the `conventions` flag set (`--conflicts`, `--inject`, `--report`, `--ci`, `--fix`).
19
+
20
+ ---
21
+
13
22
  ## [7.16.0] — 2026-06-18
14
23
 
15
24
  Minor release — LLM A/B hallucination ablation harness (grounded codegen, IMPL §9).
package/gen-context.js CHANGED
@@ -32,6 +32,68 @@ function __require(key) {
32
32
  // ── ./src/conventions/report ──
33
33
  // ── ./src/conventions/ci ──
34
34
  // ── ./src/eval/llm-ablation ──
35
+ // ── ./src/conventions/fix ──
36
+ __factories["./src/conventions/fix"] = function(module, exports) {
37
+
38
+ /**
39
+ * Convention fix list (IMPL.md §4 — `conventions --fix`).
40
+ *
41
+ * The complete, actionable rename checklist: every scoped source file whose
42
+ * name doesn't match the dominant file-naming convention, with full from→to
43
+ * paths. Distinct from `--conflicts` (a diagnostic summary with up to 3 example
44
+ * basenames) — `--fix` lists *every* offending file with its real path, ready
45
+ * to paste into a task or PR. Pure, zero-dependency, bundle-safe.
46
+ */
47
+
48
+ const path = require('path');
49
+ const { classifyNaming } = __require('./src/conventions/extract');
50
+ const { toNamingStyle } = __require('./src/conventions/conflicts');
51
+
52
+ const JS_TS_EXTS = new Set(['.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs']);
53
+ const PY_EXTS = new Set(['.py']);
54
+ const SCOPED_EXTS = new Set([...JS_TS_EXTS, ...PY_EXTS]);
55
+
56
+ const TEST_RE = /\.(test|spec)\.[jt]sx?$|(^|\/)test_|_test\.py$/;
57
+
58
+ /** Rename a file path's basename to the target naming style (keep dir + ext). */
59
+ function _renamePath(relPath, style) {
60
+ const dir = relPath.includes('/') ? relPath.slice(0, relPath.lastIndexOf('/') + 1) : '';
61
+ const base = relPath.includes('/') ? relPath.slice(relPath.lastIndexOf('/') + 1) : relPath;
62
+ const dot = base.indexOf('.');
63
+ const stem = dot > 0 ? base.slice(0, dot) : base;
64
+ const ext = dot > 0 ? base.slice(dot) : '';
65
+ return `${dir}${toNamingStyle(stem, style)}${ext}`;
66
+ }
67
+
68
+ /**
69
+ * Build the exhaustive rename checklist for the dominant file-naming convention.
70
+ * @param {string} cwd repo root (for relative paths)
71
+ * @param {string[]} files absolute source paths (e.g. from buildFileList)
72
+ * @param {object} conventions an `extractConventions` result (for the dominant style)
73
+ * @returns {{ dominant: string|null, renames: Array<{from:string,to:string,fromStyle:string}>, count: number }}
74
+ */
75
+ function buildFixList(cwd, files, conventions) {
76
+ const dominant = conventions && conventions.fileNaming && conventions.fileNaming.dominant;
77
+ if (!dominant) return { dominant: null, renames: [], count: 0 };
78
+
79
+ const renames = [];
80
+ for (const f of files || []) {
81
+ if (!SCOPED_EXTS.has(path.extname(f).toLowerCase())) continue;
82
+ if (TEST_RE.test(f)) continue;
83
+ const base = path.basename(f);
84
+ const style = classifyNaming(base);
85
+ if (style === 'other' || style === dominant) continue;
86
+ const rel = path.relative(cwd, f).replace(/\\/g, '/');
87
+ renames.push({ from: rel, to: _renamePath(rel, dominant), fromStyle: style });
88
+ }
89
+ renames.sort((a, b) => a.from.localeCompare(b.from));
90
+ return { dominant, renames, count: renames.length };
91
+ }
92
+
93
+ module.exports = { buildFixList };
94
+
95
+ };
96
+
35
97
  __factories["./src/eval/llm-ablation"] = function(module, exports) {
36
98
 
37
99
  /**
@@ -7707,7 +7769,7 @@ __factories["./src/mcp/server"] = function(module, exports) {
7707
7769
 
7708
7770
  const SERVER_INFO = {
7709
7771
  name: 'sigmap',
7710
- version: '7.16.0',
7772
+ version: '7.17.0',
7711
7773
  description: 'SigMap MCP server — code signatures on demand',
7712
7774
  };
7713
7775
 
@@ -13385,7 +13447,7 @@ function __tryGit(args, opts = {}) {
13385
13447
  catch (_) { return ''; }
13386
13448
  }
13387
13449
 
13388
- const VERSION = '7.16.0';
13450
+ const VERSION = '7.17.0';
13389
13451
  const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
13390
13452
 
13391
13453
  function requireSourceOrBundled(key) {
@@ -16580,6 +16642,28 @@ function main() {
16580
16642
  process.exit(0);
16581
16643
  }
16582
16644
 
16645
+ // `--fix`: exhaustive rename checklist — every file not matching the dominant style.
16646
+ if (args.includes('--fix')) {
16647
+ const { buildFixList } = requireSourceOrBundled('./src/conventions/fix');
16648
+ const fixList = buildFixList(cwd, files, result);
16649
+ if (jsonOut) {
16650
+ process.stdout.write(JSON.stringify(fixList) + '\n');
16651
+ process.exit(0);
16652
+ }
16653
+ console.log('[sigmap] conventions --fix (TS/JS/Python)');
16654
+ if (!fixList.dominant) {
16655
+ console.log(' no dominant file-naming convention — nothing to fix');
16656
+ process.exit(0);
16657
+ }
16658
+ if (fixList.count === 0) {
16659
+ console.log(` ✓ no fixes needed — every file matches ${fixList.dominant}`);
16660
+ process.exit(0);
16661
+ }
16662
+ console.log(` ${fixList.count} file${fixList.count === 1 ? '' : 's'} to rename to ${fixList.dominant}:`);
16663
+ for (const r of fixList.renames) console.log(` - [ ] ${r.from} → ${r.to}`);
16664
+ process.exit(0);
16665
+ }
16666
+
16583
16667
  // `--ci`: gate — fail when overall consistency is below a threshold (or regresses).
16584
16668
  if (args.includes('--ci')) {
16585
16669
  const { ciGate } = requireSourceOrBundled('./src/conventions/ci');
package/llms-full.txt CHANGED
@@ -9,7 +9,7 @@ the files relevant to the task — cutting tokens ~97% while keeping answers
9
9
  grounded. Deterministic, offline, no embeddings or vector database. Works with
10
10
  Claude, Cursor, GitHub Copilot, Aider, Windsurf, local LLMs, and MCP.
11
11
 
12
- # Version: 7.16.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
12
+ # Version: 7.17.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
13
13
  # Source: auto-generated from package.json, version.json, src/mcp/tools.js, src/config/defaults.js
14
14
  # Regenerate: npm run generate:llms | Validate: npm run validate:llms
15
15
 
package/llms.txt CHANGED
@@ -9,7 +9,7 @@ the files relevant to the task — cutting tokens ~97% while keeping answers
9
9
  grounded. Deterministic, offline, no embeddings or vector database. Works with
10
10
  Claude, Cursor, GitHub Copilot, Aider, Windsurf, local LLMs, and MCP.
11
11
 
12
- # Version: 7.16.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
12
+ # Version: 7.17.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
13
13
  # Source: auto-generated from package.json, version.json, src/mcp/tools.js, src/config/defaults.js
14
14
  # Regenerate: npm run generate:llms | Validate: npm run validate:llms
15
15
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap",
3
- "version": "7.16.0",
3
+ "version": "7.17.0",
4
4
  "description": "97% token reduction for AI coding. Extracts function & class signatures with TF-IDF ranking to feed only the right files to Claude, Cursor, Copilot, Aider, Windsurf, local LLMs & MCP. Zero dependencies, runs offline via npx.",
5
5
  "main": "packages/core/index.js",
6
6
  "exports": {
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap-cli",
3
- "version": "7.16.0",
3
+ "version": "7.17.0",
4
4
  "description": "SigMap CLI wrapper — thin adapter for programmatic CLI invocation",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "sigmap-core",
3
- "version": "7.16.0",
3
+ "version": "7.17.0",
4
4
  "description": "SigMap core library — zero-dependency code signature extraction, retrieval, and security scanning",
5
5
  "main": "index.js",
6
6
  "keywords": [
@@ -0,0 +1,58 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Convention fix list (IMPL.md §4 — `conventions --fix`).
5
+ *
6
+ * The complete, actionable rename checklist: every scoped source file whose
7
+ * name doesn't match the dominant file-naming convention, with full from→to
8
+ * paths. Distinct from `--conflicts` (a diagnostic summary with up to 3 example
9
+ * basenames) — `--fix` lists *every* offending file with its real path, ready
10
+ * to paste into a task or PR. Pure, zero-dependency, bundle-safe.
11
+ */
12
+
13
+ const path = require('path');
14
+ const { classifyNaming } = require('./extract');
15
+ const { toNamingStyle } = require('./conflicts');
16
+
17
+ const JS_TS_EXTS = new Set(['.js', '.jsx', '.ts', '.tsx', '.mjs', '.cjs']);
18
+ const PY_EXTS = new Set(['.py']);
19
+ const SCOPED_EXTS = new Set([...JS_TS_EXTS, ...PY_EXTS]);
20
+
21
+ const TEST_RE = /\.(test|spec)\.[jt]sx?$|(^|\/)test_|_test\.py$/;
22
+
23
+ /** Rename a file path's basename to the target naming style (keep dir + ext). */
24
+ function _renamePath(relPath, style) {
25
+ const dir = relPath.includes('/') ? relPath.slice(0, relPath.lastIndexOf('/') + 1) : '';
26
+ const base = relPath.includes('/') ? relPath.slice(relPath.lastIndexOf('/') + 1) : relPath;
27
+ const dot = base.indexOf('.');
28
+ const stem = dot > 0 ? base.slice(0, dot) : base;
29
+ const ext = dot > 0 ? base.slice(dot) : '';
30
+ return `${dir}${toNamingStyle(stem, style)}${ext}`;
31
+ }
32
+
33
+ /**
34
+ * Build the exhaustive rename checklist for the dominant file-naming convention.
35
+ * @param {string} cwd repo root (for relative paths)
36
+ * @param {string[]} files absolute source paths (e.g. from buildFileList)
37
+ * @param {object} conventions an `extractConventions` result (for the dominant style)
38
+ * @returns {{ dominant: string|null, renames: Array<{from:string,to:string,fromStyle:string}>, count: number }}
39
+ */
40
+ function buildFixList(cwd, files, conventions) {
41
+ const dominant = conventions && conventions.fileNaming && conventions.fileNaming.dominant;
42
+ if (!dominant) return { dominant: null, renames: [], count: 0 };
43
+
44
+ const renames = [];
45
+ for (const f of files || []) {
46
+ if (!SCOPED_EXTS.has(path.extname(f).toLowerCase())) continue;
47
+ if (TEST_RE.test(f)) continue;
48
+ const base = path.basename(f);
49
+ const style = classifyNaming(base);
50
+ if (style === 'other' || style === dominant) continue;
51
+ const rel = path.relative(cwd, f).replace(/\\/g, '/');
52
+ renames.push({ from: rel, to: _renamePath(rel, dominant), fromStyle: style });
53
+ }
54
+ renames.sort((a, b) => a.from.localeCompare(b.from));
55
+ return { dominant, renames, count: renames.length };
56
+ }
57
+
58
+ module.exports = { buildFixList };
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: '7.16.0',
21
+ version: '7.17.0',
22
22
  description: 'SigMap MCP server — code signatures on demand',
23
23
  };
24
24