sigmap 6.10.9 → 6.10.11
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 +89 -129
- package/CHANGELOG.md +29 -0
- package/README.md +15 -14
- package/gen-context.js +409 -85
- package/package.json +3 -3
- package/packages/cli/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/src/discovery/r-manifest.js +176 -0
- package/src/extractors/deps.js +30 -1
- package/src/extractors/r.js +182 -45
- package/src/graph/builder.js +133 -24
- package/src/graph/impact.js +6 -1
- package/src/mcp/handlers.js +60 -93
- package/src/mcp/server.js +1 -1
- package/src/retrieval/ranker.js +80 -6
package/AGENTS.md
CHANGED
|
@@ -61,9 +61,10 @@ Always run `sigmap ask` or `sigmap --query` before searching for files relevant
|
|
|
61
61
|
src/extractors/python_ast.py ← ast
|
|
62
62
|
```
|
|
63
63
|
|
|
64
|
-
## changes (last 5 commits —
|
|
64
|
+
## changes (last 5 commits — 19 minutes ago)
|
|
65
65
|
```
|
|
66
|
-
src/
|
|
66
|
+
src/mcp/handlers.js +_readContextFiles ~flushBlock ~readContext ~explainFile
|
|
67
|
+
src/retrieval/ranker.js +_mergeSigIndex +_buildSigIndexFromCache +_enrichSigIndexFromStrategy ~_parseContextFile
|
|
67
68
|
```
|
|
68
69
|
|
|
69
70
|
## packages
|
|
@@ -189,93 +190,6 @@ function adapt(context, adapterName, opts = {}) → string
|
|
|
189
190
|
|
|
190
191
|
## src
|
|
191
192
|
|
|
192
|
-
### src/mcp/tools.js
|
|
193
|
-
```
|
|
194
|
-
module.exports = { TOOLS }
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
### src/health/scorer.js
|
|
198
|
-
```
|
|
199
|
-
module.exports = { score }
|
|
200
|
-
function score(cwd) → { * score: number, * grad
|
|
201
|
-
```
|
|
202
|
-
|
|
203
|
-
### src/extractors/coverage.js
|
|
204
|
-
```
|
|
205
|
-
module.exports = { buildTestIndex, isTested }
|
|
206
|
-
function walkFiles(dir)
|
|
207
|
-
function buildTestIndex(cwd, testDirs)
|
|
208
|
-
function isTested(funcName, testIndex)
|
|
209
|
-
```
|
|
210
|
-
|
|
211
|
-
### src/extractors/css.js
|
|
212
|
-
```
|
|
213
|
-
module.exports = { extract }
|
|
214
|
-
function extract(src) → string[]
|
|
215
|
-
```
|
|
216
|
-
|
|
217
|
-
### src/extractors/sql.js
|
|
218
|
-
```
|
|
219
|
-
module.exports = { extract }
|
|
220
|
-
function extract(src) → string[]
|
|
221
|
-
function _cleanName(raw)
|
|
222
|
-
function _normalizeParams(raw)
|
|
223
|
-
```
|
|
224
|
-
|
|
225
|
-
### src/extractors/graphql.js
|
|
226
|
-
```
|
|
227
|
-
module.exports = { extract }
|
|
228
|
-
function extract(src) → string[]
|
|
229
|
-
```
|
|
230
|
-
|
|
231
|
-
### src/extractors/protobuf.js
|
|
232
|
-
```
|
|
233
|
-
module.exports = { extract }
|
|
234
|
-
function extract(src) → string[]
|
|
235
|
-
```
|
|
236
|
-
|
|
237
|
-
### src/extractors/terraform.js
|
|
238
|
-
```
|
|
239
|
-
module.exports = { extract }
|
|
240
|
-
function extract(src) → string[]
|
|
241
|
-
```
|
|
242
|
-
|
|
243
|
-
### src/extractors/markdown.js
|
|
244
|
-
```
|
|
245
|
-
module.exports = { extract }
|
|
246
|
-
function extract(src) → string[]
|
|
247
|
-
```
|
|
248
|
-
|
|
249
|
-
### src/extractors/properties.js
|
|
250
|
-
```
|
|
251
|
-
module.exports = { extract }
|
|
252
|
-
function extract(src) → string[]
|
|
253
|
-
```
|
|
254
|
-
|
|
255
|
-
### src/extractors/toml.js
|
|
256
|
-
```
|
|
257
|
-
module.exports = { extract }
|
|
258
|
-
function extract(src) → string[]
|
|
259
|
-
```
|
|
260
|
-
|
|
261
|
-
### src/extractors/xml.js
|
|
262
|
-
```
|
|
263
|
-
module.exports = { extract }
|
|
264
|
-
function extract(src) → string[]
|
|
265
|
-
```
|
|
266
|
-
|
|
267
|
-
### src/extractors/patterns.js
|
|
268
|
-
```
|
|
269
|
-
module.exports = { extract }
|
|
270
|
-
function extract(src) → string[]
|
|
271
|
-
```
|
|
272
|
-
|
|
273
|
-
### src/extractors/python_dataclass.js
|
|
274
|
-
```
|
|
275
|
-
module.exports = { extract }
|
|
276
|
-
function extract(src) → string[]
|
|
277
|
-
```
|
|
278
|
-
|
|
279
193
|
### src/extractors/typescript_react.js
|
|
280
194
|
```
|
|
281
195
|
module.exports = { extract }
|
|
@@ -383,20 +297,6 @@ function getChangedFiles(files, cache) → { changed: string[], unch
|
|
|
383
297
|
function updateCacheEntries(cache, extracted)
|
|
384
298
|
```
|
|
385
299
|
|
|
386
|
-
### src/mcp/handlers.js
|
|
387
|
-
```
|
|
388
|
-
module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact }
|
|
389
|
-
function readContext(args, cwd)
|
|
390
|
-
function searchSignatures(args, cwd)
|
|
391
|
-
function getMap(args, cwd)
|
|
392
|
-
function createCheckpoint(args, cwd)
|
|
393
|
-
function getRouting(args, cwd)
|
|
394
|
-
function explainFile(args, cwd)
|
|
395
|
-
function listModules(args, cwd)
|
|
396
|
-
function queryContext(args, cwd)
|
|
397
|
-
function getImpact(args, cwd)
|
|
398
|
-
```
|
|
399
|
-
|
|
400
300
|
### src/tracking/logger.js
|
|
401
301
|
```
|
|
402
302
|
module.exports = { logRun, readLog, summarize }
|
|
@@ -459,21 +359,6 @@ function loadIgnorePatterns(cwd)
|
|
|
459
359
|
function matchesIgnorePattern(dirName, patterns)
|
|
460
360
|
```
|
|
461
361
|
|
|
462
|
-
### src/retrieval/ranker.js
|
|
463
|
-
```
|
|
464
|
-
module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, detectIntent }
|
|
465
|
-
function _computePenalty(filePath)
|
|
466
|
-
function _computeHubs(graph)
|
|
467
|
-
function _isHub(filePath)
|
|
468
|
-
function scoreFile(filePath, sigs, queryTokens, weights) → { score: number, signals:
|
|
469
|
-
function rank(query, sigIndex, opts) → { file: string, score: nu
|
|
470
|
-
function _parseContextFile(contextPath) → Map<string, string[]>
|
|
471
|
-
function buildSigIndex(cwd, opts) → Map<string, string[]>
|
|
472
|
-
function formatRankTable(results, query) → string
|
|
473
|
-
function formatRankJSON(results, query) → object
|
|
474
|
-
function detectIntent(query)
|
|
475
|
-
```
|
|
476
|
-
|
|
477
362
|
### src/plan/planner.js
|
|
478
363
|
```
|
|
479
364
|
module.exports = { createPlan }
|
|
@@ -557,14 +442,6 @@ def extract(filepath)
|
|
|
557
442
|
def main()
|
|
558
443
|
```
|
|
559
444
|
|
|
560
|
-
### src/extractors/r.js
|
|
561
|
-
```
|
|
562
|
-
module.exports = { extract }
|
|
563
|
-
function extract(src) → string[]
|
|
564
|
-
function readBalancedParens(src, openIdx, cap = 4096)
|
|
565
|
-
function normalizeParams(raw)
|
|
566
|
-
```
|
|
567
|
-
|
|
568
445
|
### src/discovery/source-root-resolver.js
|
|
569
446
|
```
|
|
570
447
|
module.exports = { resolveSourceRoots }
|
|
@@ -624,15 +501,65 @@ function buildReverseGraph(graph)
|
|
|
624
501
|
function analyze(files, cwd)
|
|
625
502
|
```
|
|
626
503
|
|
|
504
|
+
### src/discovery/r-manifest.js
|
|
505
|
+
```
|
|
506
|
+
module.exports = { readDescription, readNamespace, collectLocalDefs }
|
|
507
|
+
function readDescription(cwd) → object|null
|
|
508
|
+
function splitDeps(value)
|
|
509
|
+
function readNamespace(cwd) → object|null
|
|
510
|
+
function splitArgs(raw)
|
|
511
|
+
function stripQuotes(s)
|
|
512
|
+
function collectLocalDefs(rFiles) → Map<string, string>
|
|
513
|
+
```
|
|
514
|
+
|
|
515
|
+
### src/extractors/deps.js
|
|
516
|
+
```
|
|
517
|
+
module.exports = { extractPythonDeps, extractTSDeps, extractRDeps, buildReverseDepMap }
|
|
518
|
+
function extractPythonDeps(src) → string[]
|
|
519
|
+
function extractTSDeps(src) → string[]
|
|
520
|
+
function extractRDeps(src) → string[]
|
|
521
|
+
function buildReverseDepMap(forwardMap) → Map<string, string[]>
|
|
522
|
+
```
|
|
523
|
+
|
|
524
|
+
### src/extractors/r.js
|
|
525
|
+
```
|
|
526
|
+
module.exports = { extract }
|
|
527
|
+
function extract(src) → string[]
|
|
528
|
+
function collectRoxygenHints(src)
|
|
529
|
+
function pickRoxygenLine(block, tag)
|
|
530
|
+
function applyHint(hints, name)
|
|
531
|
+
function extractListMethods(body, cap)
|
|
532
|
+
function inAnyRange(pos, ranges)
|
|
533
|
+
function readFirstStringArg(body)
|
|
534
|
+
function readBalancedParens(src, openIdx, cap = 16384)
|
|
535
|
+
function normalizeParams(raw)
|
|
536
|
+
```
|
|
537
|
+
|
|
627
538
|
### src/graph/builder.js
|
|
628
539
|
```
|
|
629
|
-
module.exports = { build, buildFromCwd, extractFileDeps }
|
|
540
|
+
module.exports = { build, buildFromCwd, extractFileDeps, normalizePath }
|
|
541
|
+
function normalizePath(p)
|
|
630
542
|
function resolveJsPath(dir, importStr, fileSet) → string|null
|
|
631
|
-
function
|
|
632
|
-
function
|
|
543
|
+
function escapeRegex(s)
|
|
544
|
+
function resolveRPath(dir, importStr, fileSet, cwd)
|
|
545
|
+
function extractFileDeps(filePath, content, fileSet, cwd, ctx) → string[]
|
|
546
|
+
function build(files, cwd, ctx) → { forward: Map<string,str
|
|
633
547
|
function buildFromCwd(cwd, opts) → { forward: Map<string,str
|
|
634
548
|
```
|
|
635
549
|
|
|
550
|
+
### src/graph/impact.js
|
|
551
|
+
```
|
|
552
|
+
module.exports = { getImpact, analyzeImpact, formatImpact, formatImpactJSON }
|
|
553
|
+
function normalizePath(p)
|
|
554
|
+
function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr
|
|
555
|
+
function isTestFile(f)
|
|
556
|
+
function isRouteFile(f)
|
|
557
|
+
function getImpact(changedFile, graph, opts) → { * changed: string, * di
|
|
558
|
+
function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o
|
|
559
|
+
function formatImpact(result) → string
|
|
560
|
+
function formatImpactJSON(result) → object
|
|
561
|
+
```
|
|
562
|
+
|
|
636
563
|
### src/mcp/server.js
|
|
637
564
|
```
|
|
638
565
|
module.exports = { start }
|
|
@@ -641,3 +568,36 @@ function respondError(id, code, message)
|
|
|
641
568
|
function dispatch(msg, cwd)
|
|
642
569
|
function start(cwd)
|
|
643
570
|
```
|
|
571
|
+
|
|
572
|
+
### src/mcp/handlers.js
|
|
573
|
+
```
|
|
574
|
+
module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact }
|
|
575
|
+
function _readContextFiles(cwd)
|
|
576
|
+
function readContext(args, cwd)
|
|
577
|
+
function searchSignatures(args, cwd)
|
|
578
|
+
function getMap(args, cwd)
|
|
579
|
+
function createCheckpoint(args, cwd)
|
|
580
|
+
function getRouting(args, cwd)
|
|
581
|
+
function explainFile(args, cwd)
|
|
582
|
+
function listModules(args, cwd)
|
|
583
|
+
function queryContext(args, cwd)
|
|
584
|
+
function getImpact(args, cwd)
|
|
585
|
+
```
|
|
586
|
+
|
|
587
|
+
### src/retrieval/ranker.js
|
|
588
|
+
```
|
|
589
|
+
module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, detectIntent }
|
|
590
|
+
function _computePenalty(filePath)
|
|
591
|
+
function _computeHubs(graph)
|
|
592
|
+
function _isHub(filePath)
|
|
593
|
+
function scoreFile(filePath, sigs, queryTokens, weights) → { score: number, signals:
|
|
594
|
+
function rank(query, sigIndex, opts) → { file: string, score: nu
|
|
595
|
+
function _parseContextFile(contextPath) → Map<string, string[]>
|
|
596
|
+
function _mergeSigIndex(target, source)
|
|
597
|
+
function _buildSigIndexFromCache(cwd) → Map<string, string[]>
|
|
598
|
+
function _enrichSigIndexFromStrategy(cwd, index) → Map<string, string[]>
|
|
599
|
+
function buildSigIndex(cwd, opts) → Map<string, string[]>
|
|
600
|
+
function formatRankTable(results, query) → string
|
|
601
|
+
function formatRankJSON(results, query) → object
|
|
602
|
+
function detectIntent(query)
|
|
603
|
+
```
|
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,35 @@ Format: [Semantic Versioning](https://semver.org/)
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## [6.10.11] — 2026-05-22
|
|
14
|
+
|
|
15
|
+
### Fixed
|
|
16
|
+
|
|
17
|
+
- **Test assertions** — Updated integration tests to verify correct benchmark date (2026-05-22) and language count (31 with R + GDScript support). Tests now validate version.json metrics consistency across all documentation files.
|
|
18
|
+
|
|
19
|
+
---
|
|
20
|
+
|
|
21
|
+
## [6.10.10] — 2026-05-22
|
|
22
|
+
|
|
23
|
+
### Added
|
|
24
|
+
|
|
25
|
+
- **First-class R support** — R was already in the language detector and had an extractor, but several gaps stopped it from being usable end-to-end:
|
|
26
|
+
- Registered `.r`/`.R` in `gen-context.js` `EXT_MAP` so the main pipeline actually invokes the R extractor (previously wired into the eval/analyzer path only).
|
|
27
|
+
- Extended the dependency-graph builder (`src/graph/builder.js`) with an R branch: parses `source("path/file.R")` calls and, for R packages, resolves `localPkg::fn` references to the file that defines `fn` via a one-pass symbol scan over `R/`. `buildFromCwd` defaults now include `R/` and `inst/` dirs and Shiny entry files (`app.R`, `server.R`, `ui.R`, `global.R`).
|
|
28
|
+
- Extended the R extractor (`src/extractors/r.js`) with R6 class detection (`Name <- R6Class("Name", public = list(...))`), S7 class detection (`Name <- new_class("Name", ...)` + `method(generic, Name) <- function(...)`), and roxygen2 docstring hints appended to function/class sigs (mirroring the Python extractor's docstring pattern).
|
|
29
|
+
- New `src/discovery/r-manifest.js` module with zero-dep parsers for `DESCRIPTION` (Debian-control format, handles continuation lines and version constraints) and `NAMESPACE` (`export`, `exportPattern`, `exportMethods`, `S3method`, `importFrom`).
|
|
30
|
+
- Added `extractRDeps` to `src/extractors/deps.js` for the dep-map section, recognising `library()`/`require()`/`requireNamespace("…")` and `pkg::fn`, skipping R base packages.
|
|
31
|
+
- Extended the ranker's hub heuristic to recognise `R/utils.R`, `R/zzz.R`, `R/globals.R` and `*.r/*.R` files in the common hub-name set.
|
|
32
|
+
- Test fixture `test/fixtures/r-package/` (DESCRIPTION + NAMESPACE + `R/`) and 8 new tests in `test/r-language.test.js` cover manifest parsing, `source()` edge emission, namespace-aware resolution, and hub detection. Existing `test/fixtures/r.r` extended with R6/S7/richer roxygen2 (closes #190).
|
|
33
|
+
|
|
34
|
+
### Fixed
|
|
35
|
+
|
|
36
|
+
- **MCP handler improvements** — Merged hot-cold cache and context-cold support into MCP index. MCP tools (`read_context`, `search_signatures`, `get_map`) now correctly serve signatures from multiple sources: primary context file (copilot-instructions.md), cold storage (context-cold.md), and sig-cache index. Fixes issue where MCP clients received partial results when using hot-cold or per-module output strategies.
|
|
37
|
+
- **Ranker hot-cold support** — Extended `buildSigIndex()` to merge signature indexes from multiple sources (primary file + context-cold.md + sig-cache). Added internal helper functions `_mergeSigIndex()`, `_buildSigIndexFromCache()`, and `_enrichSigIndexFromStrategy()` to support hot-cold and memory-efficient strategies without API breakage. Allows monorepo and per-module output strategies to serve complete signatures to rank and MCP handlers.
|
|
38
|
+
- **Windows path normalization in get_impact** — Implement case-insensitive path lookups in dependency graph for Windows compatibility. All paths in forward/reverse maps now normalized to lowercase, enabling `get_impact` to work correctly when file paths have different case (e.g., `src/Ledger/equity_ledger.py` vs `src/ledger/equity_ledger.py`). Applied normalization uniformly across JS, Python, Go, Rust, JVM, Ruby, and R import detection (closes #193).
|
|
39
|
+
|
|
40
|
+
---
|
|
41
|
+
|
|
13
42
|
## [6.10.9] — 2026-05-12
|
|
14
43
|
|
|
15
44
|
### Changed
|
package/README.md
CHANGED
|
@@ -47,10 +47,11 @@ SigMap extracts function and class signatures from your codebase and feeds the r
|
|
|
47
47
|
|
|
48
48
|
## Why SigMap?
|
|
49
49
|
|
|
50
|
-
- **
|
|
51
|
-
- **
|
|
50
|
+
- **78.9% hit@5** — right file found in top 5 results (vs 13.6% baseline)
|
|
51
|
+
- **97.9% token reduction** — 278K instead of 13.5M tokens across 21 repos
|
|
52
52
|
- **52.2% task success rate** — up from 10% without context
|
|
53
|
-
- **1.
|
|
53
|
+
- **1.66 prompts per task** — down from 2.84 (40.6% fewer retries)
|
|
54
|
+
- **31 languages supported** — TypeScript, Python, Go, Rust, Java, R, and 25 others
|
|
54
55
|
- **No vendor lock-in** — works with any AI assistant or local LLM
|
|
55
56
|
- **No API costs** — use local models (Ollama, llama.cpp, vLLM) with zero token fees
|
|
56
57
|
- **Full privacy** — keep your code and context on your machine
|
|
@@ -86,14 +87,14 @@ Ask → Rank → Context → Validate → Judge → Learn
|
|
|
86
87
|
## Benchmark
|
|
87
88
|
|
|
88
89
|
```
|
|
89
|
-
Benchmark : sigmap-v6.10-main
|
|
90
|
-
Date : 2026-05-
|
|
91
|
-
|
|
92
|
-
Hit@5 : 80
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
90
|
+
Benchmark : sigmap-v6.10-main (21 repositories, including R language)
|
|
91
|
+
Date : 2026-05-22
|
|
92
|
+
|
|
93
|
+
Hit@5 : 80% (baseline 13.6% — 5.9× lift)
|
|
94
|
+
Token reduction: 96.5% (across 21 repos)
|
|
95
|
+
Prompt reduction : 41.4% (2.84 → 1.67 prompts per task)
|
|
96
|
+
Task success : 53.3% (baseline 10%)
|
|
97
|
+
Repos tested : 21 (JavaScript, Python, Go, Rust, Java, R, C++, C#, Dart, Swift, Ruby, PHP, Scala, Kotlin, and more)
|
|
97
98
|
```
|
|
98
99
|
|
|
99
100
|
Measured on 90 coding tasks across 18 real public repos. No LLM API — fully reproducible.
|
|
@@ -232,7 +233,7 @@ sigmap --health
|
|
|
232
233
|
| Benchmark methodology | [benchmark.html](https://manojmallick.github.io/sigmap/guide/benchmark.html) |
|
|
233
234
|
| Config reference | [config.html](https://manojmallick.github.io/sigmap/guide/config.html) |
|
|
234
235
|
| Roadmap | [roadmap.html](https://manojmallick.github.io/sigmap/guide/roadmap.html) |
|
|
235
|
-
|
|
|
236
|
+
| 31 languages | [generalization.html](https://manojmallick.github.io/sigmap/guide/generalization.html) |
|
|
236
237
|
|
|
237
238
|
---
|
|
238
239
|
|
|
@@ -277,9 +278,9 @@ See [.github/PULL_REQUEST_TEMPLATE.md](.github/PULL_REQUEST_TEMPLATE.md) for the
|
|
|
277
278
|
|
|
278
279
|
---
|
|
279
280
|
|
|
280
|
-
##
|
|
281
|
+
## 31 languages
|
|
281
282
|
|
|
282
|
-
TypeScript · JavaScript · Python · Java · Kotlin · Go · Rust · C# · C/C++ · Ruby · PHP · Swift · Dart · Scala · Vue · Svelte · HTML · CSS/SCSS · YAML · Shell · SQL · GraphQL · Terraform · Protobuf · Dockerfile · TOML · XML · Properties · Markdown
|
|
283
|
+
TypeScript · JavaScript · Python · Java · Kotlin · Go · Rust · C# · C/C++ · Ruby · PHP · Swift · Dart · Scala · Vue · Svelte · HTML · CSS/SCSS · YAML · Shell · SQL · GraphQL · Terraform · Protobuf · Dockerfile · TOML · XML · Properties · Markdown · R · GDScript
|
|
283
284
|
|
|
284
285
|
All implemented with zero external dependencies.
|
|
285
286
|
|