sigmap 7.14.0 → 7.15.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.15.0] — 2026-06-18
14
+
15
+ Minor release — `sigmap conventions --ci` (grounded codegen, Layer 3 polish).
16
+
17
+ ### Added
18
+ - **`sigmap conventions --ci` — gate CI on convention consistency (#322):** completes the consistency-tracking story started by `--report` (v7.14.0). A CI gate that fails when a repo's overall convention consistency falls below a threshold (`--min`, default 0.70), and — with `--no-regress` — also fails when the score dropped vs the last recorded snapshot (best-effort). New zero-dependency, bundle-safe `src/conventions/ci.js` (`ciGate`) reuses `overallScore`; the command is read-only (reads the last `.context/conventions-history.ndjson` snapshot for `--no-regress`, never appends) and exits non-zero on failure, so it drops straight into CI. `--json` for machine output. The remaining `conventions` flags (`--fix`, `--update`) and the §9 LLM A/B benchmark are follow-ups.
19
+
20
+ ---
21
+
13
22
  ## [7.14.0] — 2026-06-17
14
23
 
15
24
  Minor release — `sigmap conventions --report` (grounded codegen, Layer 3 polish).
package/gen-context.js CHANGED
@@ -30,6 +30,58 @@ function __require(key) {
30
30
  // ── ./src/review/review-pr ──
31
31
  // ── ./src/create/orchestrate ──
32
32
  // ── ./src/conventions/report ──
33
+ // ── ./src/conventions/ci ──
34
+ __factories["./src/conventions/ci"] = function(module, exports) {
35
+
36
+ /**
37
+ * Convention CI gate (IMPL.md §4 — `conventions --ci`).
38
+ *
39
+ * Fails CI when a repo's overall convention consistency is below a threshold,
40
+ * and optionally when it regresses vs the last recorded run. Builds on the
41
+ * `--report` score. Pure, zero-dependency, bundle-safe.
42
+ */
43
+
44
+ const { overallScore } = __require('./src/conventions/report');
45
+
46
+ const DEFAULT_MIN = 0.7;
47
+ const EPS = 1e-9;
48
+
49
+ /**
50
+ * Evaluate the consistency gate.
51
+ * @param {object} result an `extractConventions` result
52
+ * @param {object} [opts]
53
+ * @param {number} [opts.min=0.7] minimum overall consistency (0–1)
54
+ * @param {boolean} [opts.noRegress=false] also fail if the score dropped vs prior
55
+ * @param {object|null} [prior] the previous snapshot (from `report.snapshot`)
56
+ * @returns {{ score:number, min:number, ok:boolean, regressed:boolean, reasons:string[] }}
57
+ */
58
+ function ciGate(result, opts = {}, prior = null) {
59
+ const min = opts.min != null ? opts.min : DEFAULT_MIN;
60
+ const score = overallScore(result);
61
+ const reasons = [];
62
+ let ok = true;
63
+
64
+ if (score < min) {
65
+ ok = false;
66
+ reasons.push(`consistency ${(score * 100).toFixed(0)}% below min ${(min * 100).toFixed(0)}%`);
67
+ }
68
+
69
+ let regressed = false;
70
+ if (opts.noRegress && prior && typeof prior.score === 'number') {
71
+ if (score < prior.score - EPS) {
72
+ regressed = true;
73
+ ok = false;
74
+ reasons.push(`consistency dropped ${(prior.score * 100).toFixed(0)}% → ${(score * 100).toFixed(0)}%`);
75
+ }
76
+ }
77
+
78
+ return { score, min, ok, regressed, reasons };
79
+ }
80
+
81
+ module.exports = { ciGate, DEFAULT_MIN };
82
+
83
+ };
84
+
33
85
  __factories["./src/conventions/report"] = function(module, exports) {
34
86
 
35
87
  /**
@@ -7538,7 +7590,7 @@ __factories["./src/mcp/server"] = function(module, exports) {
7538
7590
 
7539
7591
  const SERVER_INFO = {
7540
7592
  name: 'sigmap',
7541
- version: '7.14.0',
7593
+ version: '7.15.0',
7542
7594
  description: 'SigMap MCP server — code signatures on demand',
7543
7595
  };
7544
7596
 
@@ -13216,7 +13268,7 @@ function __tryGit(args, opts = {}) {
13216
13268
  catch (_) { return ''; }
13217
13269
  }
13218
13270
 
13219
- const VERSION = '7.14.0';
13271
+ const VERSION = '7.15.0';
13220
13272
  const MARKER = '\n\n## Auto-generated signatures\n<!-- Updated by gen-context.js -->\n';
13221
13273
 
13222
13274
  function requireSourceOrBundled(key) {
@@ -16411,6 +16463,34 @@ function main() {
16411
16463
  process.exit(0);
16412
16464
  }
16413
16465
 
16466
+ // `--ci`: gate — fail when overall consistency is below a threshold (or regresses).
16467
+ if (args.includes('--ci')) {
16468
+ const { ciGate } = requireSourceOrBundled('./src/conventions/ci');
16469
+ const minIdx = args.indexOf('--min');
16470
+ const min = minIdx !== -1 && args[minIdx + 1] ? parseFloat(args[minIdx + 1]) : undefined;
16471
+ const noRegress = args.includes('--no-regress');
16472
+ let prior = null;
16473
+ if (noRegress) {
16474
+ try {
16475
+ const lines = fs.readFileSync(path.join(cwd, '.context', 'conventions-history.ndjson'), 'utf8').split('\n').filter(Boolean);
16476
+ if (lines.length) prior = JSON.parse(lines[lines.length - 1]);
16477
+ } catch (_) {}
16478
+ }
16479
+ const gate = ciGate(result, { min, noRegress }, prior);
16480
+ if (jsonOut) {
16481
+ process.stdout.write(JSON.stringify(gate) + '\n');
16482
+ process.exit(gate.ok ? 0 : 1);
16483
+ }
16484
+ const pctC = (n) => `${(n * 100).toFixed(0)}%`;
16485
+ if (gate.ok) {
16486
+ console.log(`[sigmap] conventions --ci ✓ PASS — consistency ${pctC(gate.score)} (min ${pctC(gate.min)})`);
16487
+ process.exit(0);
16488
+ }
16489
+ console.log(`[sigmap] conventions --ci ✗ FAIL — consistency ${pctC(gate.score)} (min ${pctC(gate.min)})`);
16490
+ for (const r of gate.reasons) console.log(` • ${r}`);
16491
+ process.exit(1);
16492
+ }
16493
+
16414
16494
  // `--report`: consistency audit + score + trend vs the last run.
16415
16495
  if (args.includes('--report')) {
16416
16496
  const { scoreReport, snapshot } = requireSourceOrBundled('./src/conventions/report');
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.14.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
12
+ # Version: 7.15.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.14.0 | Benchmark: sigmap-v7.0-main (2026-06-14)
12
+ # Version: 7.15.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.14.0",
3
+ "version": "7.15.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.14.0",
3
+ "version": "7.15.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.14.0",
3
+ "version": "7.15.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,48 @@
1
+ 'use strict';
2
+
3
+ /**
4
+ * Convention CI gate (IMPL.md §4 — `conventions --ci`).
5
+ *
6
+ * Fails CI when a repo's overall convention consistency is below a threshold,
7
+ * and optionally when it regresses vs the last recorded run. Builds on the
8
+ * `--report` score. Pure, zero-dependency, bundle-safe.
9
+ */
10
+
11
+ const { overallScore } = require('./report');
12
+
13
+ const DEFAULT_MIN = 0.7;
14
+ const EPS = 1e-9;
15
+
16
+ /**
17
+ * Evaluate the consistency gate.
18
+ * @param {object} result an `extractConventions` result
19
+ * @param {object} [opts]
20
+ * @param {number} [opts.min=0.7] minimum overall consistency (0–1)
21
+ * @param {boolean} [opts.noRegress=false] also fail if the score dropped vs prior
22
+ * @param {object|null} [prior] the previous snapshot (from `report.snapshot`)
23
+ * @returns {{ score:number, min:number, ok:boolean, regressed:boolean, reasons:string[] }}
24
+ */
25
+ function ciGate(result, opts = {}, prior = null) {
26
+ const min = opts.min != null ? opts.min : DEFAULT_MIN;
27
+ const score = overallScore(result);
28
+ const reasons = [];
29
+ let ok = true;
30
+
31
+ if (score < min) {
32
+ ok = false;
33
+ reasons.push(`consistency ${(score * 100).toFixed(0)}% below min ${(min * 100).toFixed(0)}%`);
34
+ }
35
+
36
+ let regressed = false;
37
+ if (opts.noRegress && prior && typeof prior.score === 'number') {
38
+ if (score < prior.score - EPS) {
39
+ regressed = true;
40
+ ok = false;
41
+ reasons.push(`consistency dropped ${(prior.score * 100).toFixed(0)}% → ${(score * 100).toFixed(0)}%`);
42
+ }
43
+ }
44
+
45
+ return { score, min, ok, regressed, reasons };
46
+ }
47
+
48
+ module.exports = { ciGate, DEFAULT_MIN };
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.14.0',
21
+ version: '7.15.0',
22
22
  description: 'SigMap MCP server — code signatures on demand',
23
23
  };
24
24