sigmap 6.10.9 → 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 +75 -109
- package/CHANGELOG.md +19 -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 +133 -24
- 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,9 +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/
|
|
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
|
|
67
72
|
```
|
|
68
73
|
|
|
69
74
|
## packages
|
|
@@ -189,87 +194,6 @@ function adapt(context, adapterName, opts = {}) → string
|
|
|
189
194
|
|
|
190
195
|
## src
|
|
191
196
|
|
|
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
197
|
### src/extractors/python_dataclass.js
|
|
274
198
|
```
|
|
275
199
|
module.exports = { extract }
|
|
@@ -459,21 +383,6 @@ function loadIgnorePatterns(cwd)
|
|
|
459
383
|
function matchesIgnorePattern(dirName, patterns)
|
|
460
384
|
```
|
|
461
385
|
|
|
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
386
|
### src/plan/planner.js
|
|
478
387
|
```
|
|
479
388
|
module.exports = { createPlan }
|
|
@@ -557,14 +466,6 @@ def extract(filepath)
|
|
|
557
466
|
def main()
|
|
558
467
|
```
|
|
559
468
|
|
|
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
469
|
### src/discovery/source-root-resolver.js
|
|
569
470
|
```
|
|
570
471
|
module.exports = { resolveSourceRoots }
|
|
@@ -624,15 +525,65 @@ function buildReverseGraph(graph)
|
|
|
624
525
|
function analyze(files, cwd)
|
|
625
526
|
```
|
|
626
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
|
+
|
|
627
562
|
### src/graph/builder.js
|
|
628
563
|
```
|
|
629
|
-
module.exports = { build, buildFromCwd, extractFileDeps }
|
|
564
|
+
module.exports = { build, buildFromCwd, extractFileDeps, normalizePath }
|
|
565
|
+
function normalizePath(p)
|
|
630
566
|
function resolveJsPath(dir, importStr, fileSet) → string|null
|
|
631
|
-
function
|
|
632
|
-
function
|
|
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
|
|
633
571
|
function buildFromCwd(cwd, opts) → { forward: Map<string,str
|
|
634
572
|
```
|
|
635
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
|
+
|
|
636
587
|
### src/mcp/server.js
|
|
637
588
|
```
|
|
638
589
|
module.exports = { start }
|
|
@@ -641,3 +592,18 @@ function respondError(id, code, message)
|
|
|
641
592
|
function dispatch(msg, cwd)
|
|
642
593
|
function start(cwd)
|
|
643
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,25 @@ 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
|
+
|
|
13
32
|
## [6.10.9] — 2026-05-12
|
|
14
33
|
|
|
15
34
|
### Changed
|