sigmap 6.10.7 → 6.10.10
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 +81 -107
- package/CHANGELOG.md +35 -0
- package/gen-context.js +298 -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 +149 -22
- package/src/graph/impact.js +6 -1
- package/src/mcp/server.js +1 -1
- package/src/retrieval/ranker.js +21 -2
package/AGENTS.md
CHANGED
|
@@ -61,10 +61,14 @@ 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 — 23 minutes ago)
|
|
65
65
|
```
|
|
66
|
-
src/
|
|
67
|
-
src/
|
|
66
|
+
src/discovery/r-manifest.js +readDescription +splitDeps +readNamespace +splitArgs
|
|
67
|
+
src/extractors/deps.js +extractRDeps ~extractTSDeps ~buildReverseDepMap
|
|
68
|
+
src/extractors/r.js +members +regex +definitions +body
|
|
69
|
+
src/graph/builder.js +normalizePath +escapeRegex +resolveRPath +extractFileDeps
|
|
70
|
+
src/graph/impact.js +normalizePath ~isRouteFile ~getImpact
|
|
71
|
+
src/retrieval/ranker.js ~_computeHubs ~_isHub
|
|
68
72
|
```
|
|
69
73
|
|
|
70
74
|
## packages
|
|
@@ -190,87 +194,6 @@ function adapt(context, adapterName, opts = {}) → string
|
|
|
190
194
|
|
|
191
195
|
## src
|
|
192
196
|
|
|
193
|
-
### src/mcp/tools.js
|
|
194
|
-
```
|
|
195
|
-
module.exports = { TOOLS }
|
|
196
|
-
```
|
|
197
|
-
|
|
198
|
-
### src/health/scorer.js
|
|
199
|
-
```
|
|
200
|
-
module.exports = { score }
|
|
201
|
-
function score(cwd) → { * score: number, * grad
|
|
202
|
-
```
|
|
203
|
-
|
|
204
|
-
### src/extractors/coverage.js
|
|
205
|
-
```
|
|
206
|
-
module.exports = { buildTestIndex, isTested }
|
|
207
|
-
function walkFiles(dir)
|
|
208
|
-
function buildTestIndex(cwd, testDirs)
|
|
209
|
-
function isTested(funcName, testIndex)
|
|
210
|
-
```
|
|
211
|
-
|
|
212
|
-
### src/extractors/css.js
|
|
213
|
-
```
|
|
214
|
-
module.exports = { extract }
|
|
215
|
-
function extract(src) → string[]
|
|
216
|
-
```
|
|
217
|
-
|
|
218
|
-
### src/extractors/sql.js
|
|
219
|
-
```
|
|
220
|
-
module.exports = { extract }
|
|
221
|
-
function extract(src) → string[]
|
|
222
|
-
function _cleanName(raw)
|
|
223
|
-
function _normalizeParams(raw)
|
|
224
|
-
```
|
|
225
|
-
|
|
226
|
-
### src/extractors/graphql.js
|
|
227
|
-
```
|
|
228
|
-
module.exports = { extract }
|
|
229
|
-
function extract(src) → string[]
|
|
230
|
-
```
|
|
231
|
-
|
|
232
|
-
### src/extractors/protobuf.js
|
|
233
|
-
```
|
|
234
|
-
module.exports = { extract }
|
|
235
|
-
function extract(src) → string[]
|
|
236
|
-
```
|
|
237
|
-
|
|
238
|
-
### src/extractors/terraform.js
|
|
239
|
-
```
|
|
240
|
-
module.exports = { extract }
|
|
241
|
-
function extract(src) → string[]
|
|
242
|
-
```
|
|
243
|
-
|
|
244
|
-
### src/extractors/markdown.js
|
|
245
|
-
```
|
|
246
|
-
module.exports = { extract }
|
|
247
|
-
function extract(src) → string[]
|
|
248
|
-
```
|
|
249
|
-
|
|
250
|
-
### src/extractors/properties.js
|
|
251
|
-
```
|
|
252
|
-
module.exports = { extract }
|
|
253
|
-
function extract(src) → string[]
|
|
254
|
-
```
|
|
255
|
-
|
|
256
|
-
### src/extractors/toml.js
|
|
257
|
-
```
|
|
258
|
-
module.exports = { extract }
|
|
259
|
-
function extract(src) → string[]
|
|
260
|
-
```
|
|
261
|
-
|
|
262
|
-
### src/extractors/xml.js
|
|
263
|
-
```
|
|
264
|
-
module.exports = { extract }
|
|
265
|
-
function extract(src) → string[]
|
|
266
|
-
```
|
|
267
|
-
|
|
268
|
-
### src/extractors/patterns.js
|
|
269
|
-
```
|
|
270
|
-
module.exports = { extract }
|
|
271
|
-
function extract(src) → string[]
|
|
272
|
-
```
|
|
273
|
-
|
|
274
197
|
### src/extractors/python_dataclass.js
|
|
275
198
|
```
|
|
276
199
|
module.exports = { extract }
|
|
@@ -460,21 +383,6 @@ function loadIgnorePatterns(cwd)
|
|
|
460
383
|
function matchesIgnorePattern(dirName, patterns)
|
|
461
384
|
```
|
|
462
385
|
|
|
463
|
-
### src/retrieval/ranker.js
|
|
464
|
-
```
|
|
465
|
-
module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, detectIntent }
|
|
466
|
-
function _computePenalty(filePath)
|
|
467
|
-
function _computeHubs(graph)
|
|
468
|
-
function _isHub(filePath)
|
|
469
|
-
function scoreFile(filePath, sigs, queryTokens, weights) → { score: number, signals:
|
|
470
|
-
function rank(query, sigIndex, opts) → { file: string, score: nu
|
|
471
|
-
function _parseContextFile(contextPath) → Map<string, string[]>
|
|
472
|
-
function buildSigIndex(cwd, opts) → Map<string, string[]>
|
|
473
|
-
function formatRankTable(results, query) → string
|
|
474
|
-
function formatRankJSON(results, query) → object
|
|
475
|
-
function detectIntent(query)
|
|
476
|
-
```
|
|
477
|
-
|
|
478
386
|
### src/plan/planner.js
|
|
479
387
|
```
|
|
480
388
|
module.exports = { createPlan }
|
|
@@ -558,14 +466,6 @@ def extract(filepath)
|
|
|
558
466
|
def main()
|
|
559
467
|
```
|
|
560
468
|
|
|
561
|
-
### src/extractors/r.js
|
|
562
|
-
```
|
|
563
|
-
module.exports = { extract }
|
|
564
|
-
function extract(src) → string[]
|
|
565
|
-
function readBalancedParens(src, openIdx, cap = 4096)
|
|
566
|
-
function normalizeParams(raw)
|
|
567
|
-
```
|
|
568
|
-
|
|
569
469
|
### src/discovery/source-root-resolver.js
|
|
570
470
|
```
|
|
571
471
|
module.exports = { resolveSourceRoots }
|
|
@@ -625,6 +525,65 @@ function buildReverseGraph(graph)
|
|
|
625
525
|
function analyze(files, cwd)
|
|
626
526
|
```
|
|
627
527
|
|
|
528
|
+
### src/discovery/r-manifest.js
|
|
529
|
+
```
|
|
530
|
+
module.exports = { readDescription, readNamespace, collectLocalDefs }
|
|
531
|
+
function readDescription(cwd) → object|null
|
|
532
|
+
function splitDeps(value)
|
|
533
|
+
function readNamespace(cwd) → object|null
|
|
534
|
+
function splitArgs(raw)
|
|
535
|
+
function stripQuotes(s)
|
|
536
|
+
function collectLocalDefs(rFiles) → Map<string, string>
|
|
537
|
+
```
|
|
538
|
+
|
|
539
|
+
### src/extractors/deps.js
|
|
540
|
+
```
|
|
541
|
+
module.exports = { extractPythonDeps, extractTSDeps, extractRDeps, buildReverseDepMap }
|
|
542
|
+
function extractPythonDeps(src) → string[]
|
|
543
|
+
function extractTSDeps(src) → string[]
|
|
544
|
+
function extractRDeps(src) → string[]
|
|
545
|
+
function buildReverseDepMap(forwardMap) → Map<string, string[]>
|
|
546
|
+
```
|
|
547
|
+
|
|
548
|
+
### src/extractors/r.js
|
|
549
|
+
```
|
|
550
|
+
module.exports = { extract }
|
|
551
|
+
function extract(src) → string[]
|
|
552
|
+
function collectRoxygenHints(src)
|
|
553
|
+
function pickRoxygenLine(block, tag)
|
|
554
|
+
function applyHint(hints, name)
|
|
555
|
+
function extractListMethods(body, cap)
|
|
556
|
+
function inAnyRange(pos, ranges)
|
|
557
|
+
function readFirstStringArg(body)
|
|
558
|
+
function readBalancedParens(src, openIdx, cap = 16384)
|
|
559
|
+
function normalizeParams(raw)
|
|
560
|
+
```
|
|
561
|
+
|
|
562
|
+
### src/graph/builder.js
|
|
563
|
+
```
|
|
564
|
+
module.exports = { build, buildFromCwd, extractFileDeps, normalizePath }
|
|
565
|
+
function normalizePath(p)
|
|
566
|
+
function resolveJsPath(dir, importStr, fileSet) → string|null
|
|
567
|
+
function escapeRegex(s)
|
|
568
|
+
function resolveRPath(dir, importStr, fileSet, cwd)
|
|
569
|
+
function extractFileDeps(filePath, content, fileSet, cwd, ctx) → string[]
|
|
570
|
+
function build(files, cwd, ctx) → { forward: Map<string,str
|
|
571
|
+
function buildFromCwd(cwd, opts) → { forward: Map<string,str
|
|
572
|
+
```
|
|
573
|
+
|
|
574
|
+
### src/graph/impact.js
|
|
575
|
+
```
|
|
576
|
+
module.exports = { getImpact, analyzeImpact, formatImpact, formatImpactJSON }
|
|
577
|
+
function normalizePath(p)
|
|
578
|
+
function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr
|
|
579
|
+
function isTestFile(f)
|
|
580
|
+
function isRouteFile(f)
|
|
581
|
+
function getImpact(changedFile, graph, opts) → { * changed: string, * di
|
|
582
|
+
function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o
|
|
583
|
+
function formatImpact(result) → string
|
|
584
|
+
function formatImpactJSON(result) → object
|
|
585
|
+
```
|
|
586
|
+
|
|
628
587
|
### src/mcp/server.js
|
|
629
588
|
```
|
|
630
589
|
module.exports = { start }
|
|
@@ -633,3 +592,18 @@ function respondError(id, code, message)
|
|
|
633
592
|
function dispatch(msg, cwd)
|
|
634
593
|
function start(cwd)
|
|
635
594
|
```
|
|
595
|
+
|
|
596
|
+
### src/retrieval/ranker.js
|
|
597
|
+
```
|
|
598
|
+
module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, detectIntent }
|
|
599
|
+
function _computePenalty(filePath)
|
|
600
|
+
function _computeHubs(graph)
|
|
601
|
+
function _isHub(filePath)
|
|
602
|
+
function scoreFile(filePath, sigs, queryTokens, weights) → { score: number, signals:
|
|
603
|
+
function rank(query, sigIndex, opts) → { file: string, score: nu
|
|
604
|
+
function _parseContextFile(contextPath) → Map<string, string[]>
|
|
605
|
+
function buildSigIndex(cwd, opts) → Map<string, string[]>
|
|
606
|
+
function formatRankTable(results, query) → string
|
|
607
|
+
function formatRankJSON(results, query) → object
|
|
608
|
+
function detectIntent(query)
|
|
609
|
+
```
|
package/CHANGELOG.md
CHANGED
|
@@ -10,6 +10,41 @@ Format: [Semantic Versioning](https://semver.org/)
|
|
|
10
10
|
|
|
11
11
|
---
|
|
12
12
|
|
|
13
|
+
## [6.10.10] — 2026-05-12
|
|
14
|
+
|
|
15
|
+
### Added
|
|
16
|
+
|
|
17
|
+
- **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:
|
|
18
|
+
- 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).
|
|
19
|
+
- 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`).
|
|
20
|
+
- 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).
|
|
21
|
+
- 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`).
|
|
22
|
+
- Added `extractRDeps` to `src/extractors/deps.js` for the dep-map section, recognising `library()`/`require()`/`requireNamespace("…")` and `pkg::fn`, skipping R base packages.
|
|
23
|
+
- 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.
|
|
24
|
+
- 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).
|
|
25
|
+
|
|
26
|
+
### Fixed
|
|
27
|
+
|
|
28
|
+
- **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).
|
|
29
|
+
|
|
30
|
+
---
|
|
31
|
+
|
|
32
|
+
## [6.10.9] — 2026-05-12
|
|
33
|
+
|
|
34
|
+
### Changed
|
|
35
|
+
|
|
36
|
+
- **Documentation updates** — Updated roadmap to reflect v6.10.8 completion with Python import detection in builder.js for get_impact MCP tool.
|
|
37
|
+
|
|
38
|
+
---
|
|
39
|
+
|
|
40
|
+
## [6.10.8] — 2026-05-12
|
|
41
|
+
|
|
42
|
+
### Fixed
|
|
43
|
+
|
|
44
|
+
- **Python absolute imports in builder.js for get_impact** — Added Python absolute import detection to `src/graph/builder.js` used by the `get_impact` MCP tool. Previously only `import-graph.js` had this support, causing `get_impact` to return empty blast radius for Python monorepos. Now both tools correctly detect `from package.module import X` patterns (closes #187).
|
|
45
|
+
|
|
46
|
+
---
|
|
47
|
+
|
|
13
48
|
## [6.10.7] — 2026-05-12
|
|
14
49
|
|
|
15
50
|
### Fixed
|