sigmap 7.19.0 → 7.21.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,24 @@ Format: [Semantic Versioning](https://semver.org/)
10
10
 
11
11
  ---
12
12
 
13
+ ## [7.21.0] — 2026-06-18
14
+
15
+ Minor release — LLM ablation runner gains a Gemini (AI Studio) provider.
16
+
17
+ ### Added
18
+ - **Gemini provider for the §9 LLM A/B ablation runner (#340):** `scripts/run-llm-ablation.mjs` now supports Google Gemini via the AI Studio / Generative Language API (`generateContent`) alongside Anthropic. The provider is auto-detected from whichever key is present (`GEMINI_API_KEY` / `GOOGLE_API_KEY` → gemini; `ANTHROPIC_API_KEY` → anthropic); `--provider` and `--model` override, with a sensible default model per provider (`gemini-2.0-flash` / `claude-sonnet-4-6`). The no-key path lists both providers and exits 0. Run with `GEMINI_API_KEY=… npm run benchmark:llm-ablation`. The network fetch stays confined to `scripts/` — never the published library surface; the offline harness (`src/eval/llm-ablation.js`) is unchanged.
19
+
20
+ ---
21
+
22
+ ## [7.20.0] — 2026-06-18
23
+
24
+ Minor release — `init` writes a Creation workflow block into CLAUDE.md (grounded codegen, Gap 2 §6.2 — completes the plan).
25
+
26
+ ### Added
27
+ - **`sigmap --init` documents the grounded-creation workflow in CLAUDE.md (#337):** the final IMPL item. `--init` now injects a marker-delimited "Creation workflow" block describing the four-stage pipeline (`scaffold` → `verify-plan` → `verify-ai-output` → `review-pr`, orchestrated by `sigmap create`) so an agent reading CLAUDE.md knows the guard-rail workflow exists. New zero-dependency, bundle-safe `src/init/creation-workflow.js` (`renderCreationWorkflowBlock`, `injectCreationWorkflow`); idempotent and marker-scoped (`<!-- sigmap-creation-workflow:start -->` … `:end -->`), it creates CLAUDE.md if absent, preserves human content, and coexists with the conventions + auto-generated-signatures blocks. **With this, every item in the grounded-codegen implementation plan is shipped** (the §9 LLM A/B ablation is built and offline-tested; a live run needs only an API key).
28
+
29
+ ---
30
+
13
31
  ## [7.19.0] — 2026-06-18
14
32
 
15
33
  Minor release — scaffold persistence (grounded codegen, Gap 2 §6.2).
package/gen-context.js CHANGED
@@ -35,6 +35,69 @@ function __require(key) {
35
35
  // ── ./src/conventions/fix ──
36
36
  // ── ./src/conventions/update ──
37
37
  // ── ./src/scaffold/persist ──
38
+ // ── ./src/init/creation-workflow ──
39
+ __factories["./src/init/creation-workflow"] = function(module, exports) {
40
+
41
+ /**
42
+ * Creation-workflow CLAUDE.md block (IMPL.md §6.2 — 2f).
43
+ *
44
+ * `sigmap --init` injects this block so an agent reading CLAUDE.md knows the
45
+ * grounded-creation guard-rail workflow exists: scaffold → verify-plan →
46
+ * verify-ai-output → review-pr, orchestrated by `sigmap create`. Idempotent and
47
+ * marker-scoped — it never touches human content or the conventions /
48
+ * auto-generated-signatures blocks. Pure string transforms; zero-dependency,
49
+ * bundle-safe.
50
+ */
51
+
52
+ const START = '<!-- sigmap-creation-workflow:start -->';
53
+ const END = '<!-- sigmap-creation-workflow:end -->';
54
+
55
+ /** Render the Creation workflow block (including its start/end markers). */
56
+ function renderCreationWorkflowBlock() {
57
+ return [
58
+ START,
59
+ '## Creation workflow (SigMap)',
60
+ '',
61
+ 'When creating or changing code, run the grounded-creation pipeline so each step is verified against the live index:',
62
+ '',
63
+ '1. **`sigmap scaffold "<name>"`** — propose a convention-matched file/structure (refuses if conventions are inconsistent).',
64
+ '2. **`sigmap verify-plan <plan.md>`** — check the plan against the live index (files/symbols exist, blast radius, scope).',
65
+ '3. **`sigmap verify-ai-output <answer.md>`** — flag fake files/symbols/imports in the generated output (offline).',
66
+ '4. **`sigmap review-pr`** — audit the diff for scope drift, god-node edits, missing tests, and security files.',
67
+ '',
68
+ 'Or run all four in one pass with **`sigmap create "<task>"`** (`1/4`…`4/4` numbering, single pass/fail).',
69
+ '',
70
+ '<sub>Generated by `sigmap --init` · refresh by re-running it.</sub>',
71
+ END,
72
+ ].join('\n');
73
+ }
74
+
75
+ /**
76
+ * Inject (or replace) the Creation workflow block in existing CLAUDE.md content.
77
+ * Replaces an existing marked block in place; appends one when absent.
78
+ * Idempotent — never touches content outside the markers.
79
+ * @param {string} existing current file content ('' if new)
80
+ * @param {string} block the block from `renderCreationWorkflowBlock`
81
+ * @returns {string}
82
+ */
83
+ function injectCreationWorkflow(existing, block) {
84
+ const src = String(existing || '');
85
+ const startIdx = src.indexOf(START);
86
+ if (startIdx !== -1) {
87
+ const endIdx = src.indexOf(END, startIdx);
88
+ if (endIdx !== -1) {
89
+ return src.slice(0, startIdx) + block + src.slice(endIdx + END.length);
90
+ }
91
+ }
92
+ if (src.trim() === '') return block + '\n';
93
+ const sep = src.endsWith('\n') ? '\n' : '\n\n';
94
+ return src + sep + block + '\n';
95
+ }
96
+
97
+ module.exports = { renderCreationWorkflowBlock, injectCreationWorkflow, START, END };
98
+
99
+ };
100
+
38
101
  __factories["./src/scaffold/persist"] = function(module, exports) {
39
102
 
40
103
  /**
@@ -7868,7 +7931,7 @@ __factories["./src/mcp/server"] = function(module, exports) {
7868
7931
 
7869
7932
  const SERVER_INFO = {
7870
7933
  name: 'sigmap',
7871
- version: '7.19.0',
7934
+ version: '7.21.0',
7872
7935
  description: 'SigMap MCP server — code signatures on demand',
7873
7936
  };
7874
7937
 
@@ -13546,7 +13609,7 @@ function __tryGit(args, opts = {}) {
13546
13609
  catch (_) { return ''; }
13547
13610
  }
13548
13611
 
13549
- const VERSION = '7.19.0';
13612
+ const VERSION = '7.21.0';
13550
13613
  const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
13551
13614
 
13552
13615
  function requireSourceOrBundled(key) {
@@ -17326,6 +17389,15 @@ function main() {
17326
17389
 
17327
17390
  if (args.includes('--init')) {
17328
17391
  writeInitConfig(cwd);
17392
+ // §6.2 (2f): document the grounded-creation workflow in CLAUDE.md (idempotent).
17393
+ try {
17394
+ const { renderCreationWorkflowBlock, injectCreationWorkflow } = requireSourceOrBundled('./src/init/creation-workflow');
17395
+ const claudePath = path.join(cwd, 'CLAUDE.md');
17396
+ let existing = '';
17397
+ try { if (fs.existsSync(claudePath)) existing = fs.readFileSync(claudePath, 'utf8'); } catch (_) {}
17398
+ fs.writeFileSync(claudePath, injectCreationWorkflow(existing, renderCreationWorkflowBlock()));
17399
+ console.log(`[sigmap] init → Creation workflow block in ${path.relative(cwd, claudePath) || 'CLAUDE.md'}`);
17400
+ } catch (_) {}
17329
17401
  process.exit(0);
17330
17402
  }
17331
17403
 
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.19.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
12
+ # Version: 7.21.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.19.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
12
+ # Version: 7.21.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.19.0",
3
+ "version": "7.21.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.19.0",
3
+ "version": "7.21.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.19.0",
3
+ "version": "7.21.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,59 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Creation-workflow CLAUDE.md block (IMPL.md §6.2 — 2f).
5
+ *
6
+ * `sigmap --init` injects this block so an agent reading CLAUDE.md knows the
7
+ * grounded-creation guard-rail workflow exists: scaffold → verify-plan →
8
+ * verify-ai-output → review-pr, orchestrated by `sigmap create`. Idempotent and
9
+ * marker-scoped — it never touches human content or the conventions /
10
+ * auto-generated-signatures blocks. Pure string transforms; zero-dependency,
11
+ * bundle-safe.
12
+ */
13
+
14
+ const START = '<!-- sigmap-creation-workflow:start -->';
15
+ const END = '<!-- sigmap-creation-workflow:end -->';
16
+
17
+ /** Render the Creation workflow block (including its start/end markers). */
18
+ function renderCreationWorkflowBlock() {
19
+ return [
20
+ START,
21
+ '## Creation workflow (SigMap)',
22
+ '',
23
+ 'When creating or changing code, run the grounded-creation pipeline so each step is verified against the live index:',
24
+ '',
25
+ '1. **`sigmap scaffold "<name>"`** — propose a convention-matched file/structure (refuses if conventions are inconsistent).',
26
+ '2. **`sigmap verify-plan <plan.md>`** — check the plan against the live index (files/symbols exist, blast radius, scope).',
27
+ '3. **`sigmap verify-ai-output <answer.md>`** — flag fake files/symbols/imports in the generated output (offline).',
28
+ '4. **`sigmap review-pr`** — audit the diff for scope drift, god-node edits, missing tests, and security files.',
29
+ '',
30
+ 'Or run all four in one pass with **`sigmap create "<task>"`** (`1/4`…`4/4` numbering, single pass/fail).',
31
+ '',
32
+ '<sub>Generated by `sigmap --init` · refresh by re-running it.</sub>',
33
+ END,
34
+ ].join('\n');
35
+ }
36
+
37
+ /**
38
+ * Inject (or replace) the Creation workflow block in existing CLAUDE.md content.
39
+ * Replaces an existing marked block in place; appends one when absent.
40
+ * Idempotent — never touches content outside the markers.
41
+ * @param {string} existing current file content ('' if new)
42
+ * @param {string} block the block from `renderCreationWorkflowBlock`
43
+ * @returns {string}
44
+ */
45
+ function injectCreationWorkflow(existing, block) {
46
+ const src = String(existing || '');
47
+ const startIdx = src.indexOf(START);
48
+ if (startIdx !== -1) {
49
+ const endIdx = src.indexOf(END, startIdx);
50
+ if (endIdx !== -1) {
51
+ return src.slice(0, startIdx) + block + src.slice(endIdx + END.length);
52
+ }
53
+ }
54
+ if (src.trim() === '') return block + '\n';
55
+ const sep = src.endsWith('\n') ? '\n' : '\n\n';
56
+ return src + sep + block + '\n';
57
+ }
58
+
59
+ module.exports = { renderCreationWorkflowBlock, injectCreationWorkflow, START, END };
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.19.0',
21
+ version: '7.21.0',
22
22
  description: 'SigMap MCP server — code signatures on demand',
23
23
  };
24
24