sigmap 5.9.0 → 6.0.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.
package/AGENTS.md CHANGED
@@ -12,20 +12,21 @@ Use this marker block for all appendable context files:
12
12
  ## Auto-generated signatures
13
13
  <!-- Updated by gen-context.js -->
14
14
  You are a coding assistant with full knowledge of this codebase.
15
- Below are the code signatures extracted by SigMap v5.7.0 on 2026-04-17T21:17:18.905Z.
15
+ Below are the code signatures extracted by SigMap v6.0.1 on 2026-04-21T10:54:32.005Z.
16
16
 
17
17
  Use these signatures to answer questions about the code accurately.
18
18
 
19
19
  ## Code Signatures
20
20
 
21
- <!-- Generated by SigMap gen-context.js v5.7.0 -->
21
+ <!-- Generated by SigMap gen-context.js v6.0.1 -->
22
22
  <!-- DO NOT EDIT below the marker line — run gen-context.js to regenerate -->
23
23
 
24
24
  # Code signatures
25
25
 
26
- ## changes (last 5 commits — 7 minutes ago)
26
+ ## changes (last 5 commits — 11 minutes ago)
27
27
  ```
28
- src/analysis/coverage-score.js ~coverageScore ~_walk
28
+ src/extractors/typescript.js ~extractInterfaceMembers ~extractClassMembers
29
+ packages/adapters/codex.js ~format
29
30
  ```
30
31
 
31
32
  ## packages
@@ -36,14 +37,6 @@ module.exports = { CLI_ENTRY, run }
36
37
  function run(argv, cwd) → void
37
38
  ```
38
39
 
39
- ### packages/adapters/codex.js
40
- ```
41
- module.exports = { name, format, outputPath, write }
42
- function format(context, opts = {}) → string
43
- function outputPath(cwd) → string
44
- function write(context, cwd, opts = {})
45
- ```
46
-
47
40
  ### packages/adapters/index.js
48
41
  ```
49
42
  module.exports = { getAdapter, listAdapters, adapt, outputsToAdapters }
@@ -144,21 +137,15 @@ function score(cwd) → { * score: number, * grad
144
137
  function adapt(context, adapterName, opts = {}) → string
145
138
  ```
146
139
 
147
- ## src
148
-
149
- ### src/map/route-table.js
140
+ ### packages/adapters/codex.js
150
141
  ```
151
- module.exports = { analyze }
152
- function shouldSkipFile(rel)
153
- function analyze(files, cwd)
142
+ module.exports = { name, format, outputPath, write }
143
+ function format(context, opts = {}) → string
144
+ function outputPath(cwd) → string
145
+ function write(context, cwd, opts = {})
154
146
  ```
155
147
 
156
- ### src/routing/classifier.js
157
- ```
158
- module.exports = { classify, classifyAll }
159
- function classify(filePath, sigs) → 'fast'|'balanced'|'powerf
160
- function classifyAll(fileEntries, cwd) → { fast: string[], balance
161
- ```
148
+ ## src
162
149
 
163
150
  ### src/routing/hints.js
164
151
  ```
@@ -177,14 +164,6 @@ module.exports = { scan }
177
164
  function scan(signatures, filePath) → { safe: string[], redacte
178
165
  ```
179
166
 
180
- ### src/tracking/logger.js
181
- ```
182
- module.exports = { logRun, readLog, summarize }
183
- function logRun(entry, cwd)
184
- function readLog(cwd) → object[]
185
- function summarize(entries) → object
186
- ```
187
-
188
167
  ### src/extractors/cpp.js
189
168
  ```
190
169
  module.exports = { extract }
@@ -344,16 +323,6 @@ module.exports = { extractTodos }
344
323
  function extractTodos(src) → {line:number, tag:string,
345
324
  ```
346
325
 
347
- ### src/extractors/typescript.js
348
- ```
349
- module.exports = { extract }
350
- function extract(src) → string[]
351
- function extractBlock(src, startIndex)
352
- function extractInterfaceMembers(block)
353
- function extractClassMembers(block)
354
- function normalizeParams(params)
355
- ```
356
-
357
326
  ### src/extractors/vue.js
358
327
  ```
359
328
  module.exports = { extract }
@@ -607,32 +576,6 @@ function penalizeFiles(cwd, files, amount = 0.10)
607
576
  function resetWeights(cwd)
608
577
  ```
609
578
 
610
- ### src/mcp/handlers.js
611
- ```
612
- module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact }
613
- function readContext(args, cwd)
614
- function searchSignatures(args, cwd)
615
- function getMap(args, cwd)
616
- function createCheckpoint(args, cwd)
617
- function getRouting(args, cwd)
618
- function explainFile(args, cwd)
619
- function listModules(args, cwd)
620
- function queryContext(args, cwd)
621
- function getImpact(args, cwd)
622
- ```
623
-
624
- ### src/retrieval/ranker.js
625
- ```
626
- module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, detectIntent }
627
- function scoreFile(filePath, sigs, queryTokens, weights) → number
628
- function rank(query, sigIndex, opts) → { file: string, score: nu
629
- function _parseContextFile(contextPath) → Map<string, string[]>
630
- function buildSigIndex(cwd, opts) → Map<string, string[]>
631
- function formatRankTable(results, query) → string
632
- function formatRankJSON(results, query) → object
633
- function detectIntent(query)
634
- ```
635
-
636
579
  ### src/format/benchmark-report.js
637
580
  ```
638
581
  module.exports = { loadBenchmarkReports, buildBenchmarkSummary, generateBenchmarkReportHtml, writeBenchmarkReport }
@@ -667,6 +610,60 @@ function coverageScore(cwd, fileEntries, config)
667
610
  function _walk(dir, excludeSet, out)
668
611
  ```
669
612
 
613
+ ### src/tracking/logger.js
614
+ ```
615
+ module.exports = { logRun, readLog, summarize }
616
+ function logRun(entry, cwd)
617
+ function readLog(cwd) → object[]
618
+ function summarize(entries) → object
619
+ ```
620
+
621
+ ### src/cache/sig-cache.js
622
+ ```
623
+ module.exports = { loadCache, saveCache, getChangedFiles, updateCacheEntries }
624
+ function cachePath(cwd)
625
+ function loadCache(cwd, currentVersion) → Map<string, { mtime: numb
626
+ function saveCache(cwd, currentVersion, cache)
627
+ function getChangedFiles(files, cache) → { changed: string[], unch
628
+ function updateCacheEntries(cache, extracted)
629
+ ```
630
+
631
+ ### src/extractors/typescript.js
632
+ ```
633
+ module.exports = { extract }
634
+ function extract(src) → string[]
635
+ function extractBlock(src, startIndex)
636
+ function extractInterfaceMembers(block)
637
+ function extractClassMembers(block)
638
+ function normalizeParams(params)
639
+ ```
640
+
641
+ ### src/mcp/handlers.js
642
+ ```
643
+ module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact }
644
+ function readContext(args, cwd)
645
+ function searchSignatures(args, cwd)
646
+ function getMap(args, cwd)
647
+ function createCheckpoint(args, cwd)
648
+ function getRouting(args, cwd)
649
+ function explainFile(args, cwd)
650
+ function listModules(args, cwd)
651
+ function queryContext(args, cwd)
652
+ function getImpact(args, cwd)
653
+ ```
654
+
655
+ ### src/retrieval/ranker.js
656
+ ```
657
+ module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, detectIntent }
658
+ function scoreFile(filePath, sigs, queryTokens, weights) → number
659
+ function rank(query, sigIndex, opts) → { file: string, score: nu
660
+ function _parseContextFile(contextPath) → Map<string, string[]>
661
+ function buildSigIndex(cwd, opts) → Map<string, string[]>
662
+ function formatRankTable(results, query) → string
663
+ function formatRankJSON(results, query) → object
664
+ function detectIntent(query)
665
+ ```
666
+
670
667
  ### src/mcp/server.js
671
668
  ```
672
669
  module.exports = { start }
package/CHANGELOG.md CHANGED
@@ -10,6 +10,37 @@ Format: [Semantic Versioning](https://semver.org/)
10
10
 
11
11
  ---
12
12
 
13
+ ## [6.0.1] — 2026-04-21
14
+
15
+ ### Fixed
16
+
17
+ - **TypeScript extractor guard clauses (#97)** — `extractClassMembers` now skips control-flow keywords (`if`, `for`, `while`, `switch`, `do`, `try`, `catch`, `finally`, `else`) that were incorrectly emitted as method signatures when they appeared inside class bodies.
18
+ - **Codex/AGENTS.md adapter preamble (#96)** — `packages/adapters/codex.js` no longer delegates to the OpenAI adapter. Output is now clean `# Code signatures\n\n<context>` markdown with no "You are a coding assistant…" preamble, no HTML comment metadata block, and no duplicate headers.
19
+
20
+ ---
21
+
22
+ ## [6.0.0] — 2026-04-19
23
+
24
+ ### Added
25
+
26
+ - **Graph-boosted retrieval (v6.0)** — `rank()` in `src/retrieval/ranker.js` now accepts `opts.graph`. After scoring all files, a +0.4 `graphBoost` weight is added to 1-hop forward-import neighbors of any file with `score > 0`. Measured lift: +1.1pp (82.2% → 83.3% hit@5 using ranker.js on 90 benchmark tasks).
27
+ - **`DEFAULT_WEIGHTS.graphBoost: 0.4`** — new weight constant; path-normalized relative↔absolute conversion handles the sigIndex/graph format mismatch.
28
+ - **Incremental signature cache (`src/cache/sig-cache.js`)** — `loadCache`, `saveCache`, `getChangedFiles`, `updateCacheEntries` persist extracted signatures keyed by absolute path + mtime to `.sigmap-cache.json`. Version-keyed so upgrades automatically bust the cache. Ready to wire into `gen-context.js` for 80–95% speed reduction on re-runs.
29
+ - **Graph-boosted MCP `query_context`** — `src/mcp/handlers.js` now builds a dependency graph via `buildFromCwd` and passes it to `rank()`, giving agents multi-hop neighbor boosting for free.
30
+ - **README rewrite** — full 15-section conversion-optimised README (tagline, npx demo, ❌/✅ replace table, workflow arrow, canonical benchmark block, install options, integrations, try-it, start guide, why-not-embeddings, license).
31
+ - **`test/integration/v591-readme.test.js`** — 50 tests covering all 15 README sections and consistency rules.
32
+ - **`version.json` updated** — bumped to `6.0.0`, `benchmark_id` to `sigmap-v6.0-main`, metrics updated from live benchmark run: `overall_token_reduction_pct: 96.9`, `retrieval_lift: 5.8`, `graph_boosted_hit_at_5: 0.833`.
33
+
34
+ ### Changed
35
+
36
+ - **All package versions** synced to `6.0.0` via `scripts/sync-versions.mjs`.
37
+ - **`retrieval_lift`** corrected from 5.9× to 5.8× (actual benchmark run average).
38
+ - **`overall_token_reduction_pct`** corrected from 98.1% to 96.9% (simple average across 18 repos from live matrix run; 98.1% was a weighted-by-size figure from a prior run).
39
+ - **`task_success_proxy_pct`** corrected from 53.3% to 52.2% (live benchmark confirms 47/90 correct).
40
+ - **`prompts_per_task`** corrected from 1.67 to 1.68 (live benchmark output).
41
+
42
+ ---
43
+
13
44
  ## [5.9.0] — 2026-04-18
14
45
 
15
46
  ### Added