sigmap 5.4.0 → 5.6.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/AGENTS.md +321 -346
- package/CHANGELOG.md +35 -0
- package/README.md +10 -6
- package/gen-context.js +462 -7
- package/package.json +1 -1
- package/packages/cli/package.json +1 -1
- package/packages/core/package.json +1 -1
- package/src/analysis/coverage-score.js +27 -7
- package/src/mcp/server.js +1 -1
package/AGENTS.md
CHANGED
|
@@ -12,75 +12,60 @@ 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.
|
|
15
|
+
Below are the code signatures extracted by SigMap v5.6.0 on 2026-04-17T17:05:56.879Z.
|
|
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.
|
|
21
|
+
<!-- Generated by SigMap gen-context.js v5.6.0 -->
|
|
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 —
|
|
26
|
+
## changes (last 5 commits — 9 minutes ago)
|
|
27
27
|
```
|
|
28
|
-
src/
|
|
29
|
-
src/format/dashboard.js ~computeExtractorCoverage ~readBenchmarkTrend
|
|
30
|
-
src/judge/judge-engine.js +tokenize +groundedness +extractContextFiles +judge
|
|
31
|
-
src/learning/weights.js +weightsPath +clampMultiplier +normalizeFile +sanitizeWeights
|
|
32
|
-
src/mcp/handlers.js ~queryContext ~getImpact
|
|
33
|
-
src/retrieval/ranker.js ~scoreFile ~rank
|
|
34
|
-
packages/core/index.js ~extract
|
|
28
|
+
src/analysis/coverage-score.js ~coverageScore ~_walk
|
|
35
29
|
```
|
|
36
30
|
|
|
37
31
|
## packages
|
|
38
32
|
|
|
39
|
-
### packages/
|
|
40
|
-
```
|
|
41
|
-
h1 sigmap-core
|
|
42
|
-
h2 Installation
|
|
43
|
-
h2 Quick start
|
|
44
|
-
h2 API reference
|
|
45
|
-
h3 `extract(src, language)` → `string[]`
|
|
46
|
-
h3 `rank(query, sigIndex, opts?)` → `Result[]`
|
|
47
|
-
h3 `buildSigIndex(cwd)` → `Map<string, string[]>`
|
|
48
|
-
h3 `scan(sigs, filePath)` → `{ safe: string[], redacted: boolean }`
|
|
49
|
-
h3 `score(cwd)` → `HealthResult`
|
|
50
|
-
h2 Migration from v2.3 and earlier
|
|
51
|
-
h2 v3.0 — Multi-Adapter Architecture (released)
|
|
52
|
-
h2 Zero dependencies
|
|
53
|
-
code-fence bash
|
|
54
|
-
code-fence plain
|
|
55
|
-
code-fence js
|
|
56
|
-
code-fence ---
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### packages/core/index.js
|
|
33
|
+
### packages/cli/index.js
|
|
60
34
|
```
|
|
61
|
-
module.exports = {
|
|
62
|
-
function
|
|
63
|
-
function extract(src, language) → string[]
|
|
64
|
-
function rank(query, sigIndex, opts) → { file: string, score: nu
|
|
65
|
-
function buildSigIndex(cwd) → Map<string, string[]>
|
|
66
|
-
function scan(sigs, filePath) → { safe: string[], redacte
|
|
67
|
-
function score(cwd) → { * score: number, * grad
|
|
68
|
-
function adapt(context, adapterName, opts = {}) → string
|
|
35
|
+
module.exports = { CLI_ENTRY, run }
|
|
36
|
+
function run(argv, cwd) → void
|
|
69
37
|
```
|
|
70
38
|
|
|
71
|
-
### packages/adapters/
|
|
39
|
+
### packages/adapters/codex.js
|
|
72
40
|
```
|
|
73
41
|
module.exports = { name, format, outputPath, write }
|
|
74
42
|
function format(context, opts = {}) → string
|
|
75
|
-
function _confidenceMeta(opts)
|
|
76
43
|
function outputPath(cwd) → string
|
|
77
44
|
function write(context, cwd, opts = {})
|
|
78
45
|
```
|
|
79
46
|
|
|
80
|
-
### packages/adapters/
|
|
47
|
+
### packages/adapters/index.js
|
|
48
|
+
```
|
|
49
|
+
module.exports = { getAdapter, listAdapters, adapt, outputsToAdapters }
|
|
50
|
+
function getAdapter(name) → { name: string, format: F
|
|
51
|
+
function listAdapters() → string[]
|
|
52
|
+
function adapt(context, adapterName, opts = {}) → string
|
|
53
|
+
function outputsToAdapters(outputs) → string[]
|
|
54
|
+
```
|
|
55
|
+
|
|
56
|
+
### packages/adapters/llm-full.js
|
|
57
|
+
```
|
|
58
|
+
module.exports = { name: 'llm-full', format, outputPath, write }
|
|
59
|
+
function outputPath(cwd)
|
|
60
|
+
function format(context, opts)
|
|
61
|
+
function write(context, cwd, opts)
|
|
62
|
+
```
|
|
63
|
+
|
|
64
|
+
### packages/adapters/claude.js
|
|
81
65
|
```
|
|
82
66
|
module.exports = { name, format, outputPath, write }
|
|
83
67
|
function format(context, opts = {}) → string
|
|
68
|
+
function _confidenceMeta(opts)
|
|
84
69
|
function outputPath(cwd) → string
|
|
85
70
|
function write(context, cwd, opts = {})
|
|
86
71
|
```
|
|
@@ -111,23 +96,6 @@ function write(context, cwd, opts = {})
|
|
|
111
96
|
function _confidenceMeta(opts)
|
|
112
97
|
```
|
|
113
98
|
|
|
114
|
-
### packages/adapters/index.js
|
|
115
|
-
```
|
|
116
|
-
module.exports = { getAdapter, listAdapters, adapt, outputsToAdapters }
|
|
117
|
-
function getAdapter(name) → { name: string, format: F
|
|
118
|
-
function listAdapters() → string[]
|
|
119
|
-
function adapt(context, adapterName, opts = {}) → string
|
|
120
|
-
function outputsToAdapters(outputs) → string[]
|
|
121
|
-
```
|
|
122
|
-
|
|
123
|
-
### packages/adapters/llm-full.js
|
|
124
|
-
```
|
|
125
|
-
module.exports = { name: 'llm-full', format, outputPath, write }
|
|
126
|
-
function outputPath(cwd)
|
|
127
|
-
function format(context, opts)
|
|
128
|
-
function write(context, cwd, opts)
|
|
129
|
-
```
|
|
130
|
-
|
|
131
99
|
### packages/adapters/openai.js
|
|
132
100
|
```
|
|
133
101
|
module.exports = { name, format, outputPath }
|
|
@@ -144,172 +112,126 @@ function _confidenceMeta(opts)
|
|
|
144
112
|
function outputPath(cwd) → string
|
|
145
113
|
```
|
|
146
114
|
|
|
147
|
-
### packages/
|
|
148
|
-
```
|
|
149
|
-
module.exports = { CLI_ENTRY, run }
|
|
150
|
-
function run(argv, cwd) → void
|
|
151
|
-
```
|
|
152
|
-
|
|
153
|
-
## src
|
|
154
|
-
|
|
155
|
-
### src/config/loader.js
|
|
115
|
+
### packages/core/README.md
|
|
156
116
|
```
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
117
|
+
h1 sigmap-core
|
|
118
|
+
h2 Installation
|
|
119
|
+
h2 Quick start
|
|
120
|
+
h2 API reference
|
|
121
|
+
h3 `extract(src, language)` → `string[]`
|
|
122
|
+
h3 `rank(query, sigIndex, opts?)` → `Result[]`
|
|
123
|
+
h3 `buildSigIndex(cwd)` → `Map<string, string[]>`
|
|
124
|
+
h3 `scan(sigs, filePath)` → `{ safe: string[], redacted: boolean }`
|
|
125
|
+
h3 `score(cwd)` → `HealthResult`
|
|
126
|
+
h2 Migration from v2.3 and earlier
|
|
127
|
+
h2 v3.0 — Multi-Adapter Architecture (released)
|
|
128
|
+
h2 Zero dependencies
|
|
129
|
+
code-fence bash
|
|
130
|
+
code-fence plain
|
|
131
|
+
code-fence js
|
|
132
|
+
code-fence ---
|
|
162
133
|
```
|
|
163
134
|
|
|
164
|
-
###
|
|
135
|
+
### packages/core/index.js
|
|
165
136
|
```
|
|
166
|
-
module.exports = {
|
|
167
|
-
function
|
|
168
|
-
function
|
|
169
|
-
function
|
|
170
|
-
function
|
|
171
|
-
function
|
|
172
|
-
function
|
|
173
|
-
function
|
|
174
|
-
function computeExtractorCoverage(cwd)
|
|
175
|
-
function readBenchmarkTrend(cwd)
|
|
176
|
-
function lineChartSvg(values, title, ySuffix)
|
|
177
|
-
function barChartSvg(perLanguage)
|
|
178
|
-
function sparkline(values)
|
|
179
|
-
function buildDashboardData(cwd, health)
|
|
180
|
-
function generateDashboardHtml(cwd, health)
|
|
181
|
-
function renderHistoryCharts(cwd, health)
|
|
137
|
+
module.exports = { extract, rank, buildSigIndex, scan, score, adapt }
|
|
138
|
+
function _resolveExtractor(language)
|
|
139
|
+
function extract(src, language) → string[]
|
|
140
|
+
function rank(query, sigIndex, opts) → { file: string, score: nu
|
|
141
|
+
function buildSigIndex(cwd) → Map<string, string[]>
|
|
142
|
+
function scan(sigs, filePath) → { safe: string[], redacte
|
|
143
|
+
function score(cwd) → { * score: number, * grad
|
|
144
|
+
function adapt(context, adapterName, opts = {}) → string
|
|
182
145
|
```
|
|
183
146
|
|
|
184
|
-
|
|
185
|
-
```
|
|
186
|
-
module.exports = { groundedness, judge }
|
|
187
|
-
function tokenize(text)
|
|
188
|
-
function groundedness(response, context)
|
|
189
|
-
function extractContextFiles(context, cwd)
|
|
190
|
-
function judge(response, context, opts = {})
|
|
191
|
-
```
|
|
147
|
+
## src
|
|
192
148
|
|
|
193
|
-
### src/
|
|
149
|
+
### src/map/route-table.js
|
|
194
150
|
```
|
|
195
|
-
module.exports = {
|
|
196
|
-
function
|
|
197
|
-
function
|
|
198
|
-
function normalizeFile(cwd, filePath)
|
|
199
|
-
function sanitizeWeights(cwd, weights)
|
|
200
|
-
function loadWeights(cwd)
|
|
201
|
-
function saveWeights(cwd, weights)
|
|
202
|
-
function updateWeights(cwd, opts = {})
|
|
203
|
-
function boostFiles(cwd, files, amount = 0.15)
|
|
204
|
-
function penalizeFiles(cwd, files, amount = 0.10)
|
|
205
|
-
function resetWeights(cwd)
|
|
151
|
+
module.exports = { analyze }
|
|
152
|
+
function shouldSkipFile(rel)
|
|
153
|
+
function analyze(files, cwd)
|
|
206
154
|
```
|
|
207
155
|
|
|
208
|
-
### src/
|
|
156
|
+
### src/routing/classifier.js
|
|
209
157
|
```
|
|
210
|
-
module.exports = {
|
|
211
|
-
function
|
|
212
|
-
function
|
|
213
|
-
function getMap(args, cwd)
|
|
214
|
-
function createCheckpoint(args, cwd)
|
|
215
|
-
function getRouting(args, cwd)
|
|
216
|
-
function explainFile(args, cwd)
|
|
217
|
-
function listModules(args, cwd)
|
|
218
|
-
function queryContext(args, cwd)
|
|
219
|
-
function getImpact(args, cwd)
|
|
158
|
+
module.exports = { classify, classifyAll }
|
|
159
|
+
function classify(filePath, sigs) → 'fast'|'balanced'|'powerf
|
|
160
|
+
function classifyAll(fileEntries, cwd) → { fast: string[], balance
|
|
220
161
|
```
|
|
221
162
|
|
|
222
|
-
### src/
|
|
163
|
+
### src/routing/hints.js
|
|
223
164
|
```
|
|
224
|
-
module.exports = {
|
|
225
|
-
function
|
|
226
|
-
function respondError(id, code, message)
|
|
227
|
-
function dispatch(msg, cwd)
|
|
228
|
-
function start(cwd)
|
|
165
|
+
module.exports = { TIERS, formatRoutingSection }
|
|
166
|
+
function formatRoutingSection(groups) → string
|
|
229
167
|
```
|
|
230
168
|
|
|
231
|
-
### src/
|
|
169
|
+
### src/security/patterns.js
|
|
232
170
|
```
|
|
233
|
-
module.exports = {
|
|
234
|
-
function scoreFile(filePath, sigs, queryTokens, weights) → number
|
|
235
|
-
function rank(query, sigIndex, opts) → { file: string, score: nu
|
|
236
|
-
function _parseContextFile(contextPath) → Map<string, string[]>
|
|
237
|
-
function buildSigIndex(cwd, opts) → Map<string, string[]>
|
|
238
|
-
function formatRankTable(results, query) → string
|
|
239
|
-
function formatRankJSON(results, query) → object
|
|
240
|
-
function detectIntent(query)
|
|
171
|
+
module.exports = { PATTERNS }
|
|
241
172
|
```
|
|
242
173
|
|
|
243
|
-
### src/
|
|
174
|
+
### src/security/scanner.js
|
|
244
175
|
```
|
|
245
|
-
module.exports = {
|
|
246
|
-
function
|
|
247
|
-
function _walk(dir, excludeSet, out)
|
|
176
|
+
module.exports = { scan }
|
|
177
|
+
function scan(signatures, filePath) → { safe: string[], redacte
|
|
248
178
|
```
|
|
249
179
|
|
|
250
|
-
### src/
|
|
180
|
+
### src/tracking/logger.js
|
|
251
181
|
```
|
|
252
|
-
module.exports = {
|
|
182
|
+
module.exports = { logRun, readLog, summarize }
|
|
183
|
+
function logRun(entry, cwd)
|
|
184
|
+
function readLog(cwd) → object[]
|
|
185
|
+
function summarize(entries) → object
|
|
253
186
|
```
|
|
254
187
|
|
|
255
|
-
### src/
|
|
188
|
+
### src/extractors/cpp.js
|
|
256
189
|
```
|
|
257
|
-
module.exports = {
|
|
258
|
-
function
|
|
259
|
-
function
|
|
260
|
-
function
|
|
261
|
-
function
|
|
262
|
-
function
|
|
263
|
-
function analyzeFiles(files, cwd, opts) → object[]
|
|
264
|
-
function formatAnalysisTable(stats, showSlow) → string
|
|
265
|
-
function formatAnalysisJSON(stats) → object
|
|
190
|
+
module.exports = { extract }
|
|
191
|
+
function extract(src) → string[]
|
|
192
|
+
function extractBlock(src, startIndex)
|
|
193
|
+
function extractMembers(block)
|
|
194
|
+
function normalizeParams(params)
|
|
195
|
+
function normalizeType(type)
|
|
266
196
|
```
|
|
267
197
|
|
|
268
|
-
### src/
|
|
198
|
+
### src/extractors/csharp.js
|
|
269
199
|
```
|
|
270
|
-
module.exports = {
|
|
271
|
-
function
|
|
272
|
-
function
|
|
273
|
-
function
|
|
274
|
-
function
|
|
275
|
-
function
|
|
276
|
-
function loadTasks(tasksFile) → Array<{id:string, query:s
|
|
277
|
-
function run(tasksFile, cwd, opts = {}) → { * tasks: Array<{id, que
|
|
278
|
-
function formatTable(taskResults) → string
|
|
279
|
-
function formatMetrics(metrics) → string
|
|
200
|
+
module.exports = { extract }
|
|
201
|
+
function extract(src) → string[]
|
|
202
|
+
function extractBlock(src, startIndex)
|
|
203
|
+
function extractMembers(block)
|
|
204
|
+
function normalizeParams(params)
|
|
205
|
+
function normalizeType(type)
|
|
280
206
|
```
|
|
281
207
|
|
|
282
|
-
### src/
|
|
208
|
+
### src/extractors/dart.js
|
|
283
209
|
```
|
|
284
|
-
module.exports = {
|
|
285
|
-
function
|
|
286
|
-
function
|
|
287
|
-
function
|
|
288
|
-
function
|
|
289
|
-
function precisionAtK(ranked, expected, k = 5) → number
|
|
290
|
-
function aggregate(results, k = 5) → { * hitAt5: number, // fr
|
|
291
|
-
function round(x)
|
|
210
|
+
module.exports = { extract }
|
|
211
|
+
function extract(src) → string[]
|
|
212
|
+
function extractBlock(src, startIndex)
|
|
213
|
+
function extractMembers(block)
|
|
214
|
+
function normalizeParams(params)
|
|
292
215
|
```
|
|
293
216
|
|
|
294
|
-
### src/extractors/
|
|
217
|
+
### src/extractors/deps.js
|
|
295
218
|
```
|
|
296
|
-
module.exports = {
|
|
297
|
-
function
|
|
298
|
-
function
|
|
299
|
-
function
|
|
219
|
+
module.exports = { extractPythonDeps, extractTSDeps, buildReverseDepMap }
|
|
220
|
+
function extractPythonDeps(src) → string[]
|
|
221
|
+
function extractTSDeps(src) → string[]
|
|
222
|
+
function buildReverseDepMap(forwardMap) → Map<string, string[]>
|
|
300
223
|
```
|
|
301
224
|
|
|
302
|
-
### src/extractors/
|
|
225
|
+
### src/extractors/go.js
|
|
303
226
|
```
|
|
304
227
|
module.exports = { extract }
|
|
305
228
|
function extract(src) → string[]
|
|
306
229
|
function extractBlock(src, startIndex)
|
|
307
|
-
function
|
|
230
|
+
function extractInterfaceMethods(block)
|
|
308
231
|
function normalizeParams(params)
|
|
309
|
-
function normalizeType(type)
|
|
310
232
|
```
|
|
311
233
|
|
|
312
|
-
### src/extractors/
|
|
234
|
+
### src/extractors/java.js
|
|
313
235
|
```
|
|
314
236
|
module.exports = { extract }
|
|
315
237
|
function extract(src) → string[]
|
|
@@ -319,13 +241,19 @@ function normalizeParams(params)
|
|
|
319
241
|
function normalizeType(type)
|
|
320
242
|
```
|
|
321
243
|
|
|
322
|
-
### src/extractors/
|
|
244
|
+
### src/extractors/javascript.js
|
|
323
245
|
```
|
|
324
246
|
module.exports = { extract }
|
|
325
247
|
function extract(src) → string[]
|
|
248
|
+
function extractBlock(src, startIndex)
|
|
249
|
+
function extractClassMembers(block, returnHints)
|
|
250
|
+
function buildReturnHints(src)
|
|
251
|
+
function normalizeType(type)
|
|
252
|
+
function formatReturnHint(type)
|
|
253
|
+
function normalizeParams(params)
|
|
326
254
|
```
|
|
327
255
|
|
|
328
|
-
### src/extractors/
|
|
256
|
+
### src/extractors/kotlin.js
|
|
329
257
|
```
|
|
330
258
|
module.exports = { extract }
|
|
331
259
|
function extract(src) → string[]
|
|
@@ -334,48 +262,55 @@ function extractMembers(block)
|
|
|
334
262
|
function normalizeParams(params)
|
|
335
263
|
```
|
|
336
264
|
|
|
337
|
-
### src/extractors/
|
|
338
|
-
```
|
|
339
|
-
module.exports = { extractPythonDeps, extractTSDeps, buildReverseDepMap }
|
|
340
|
-
function extractPythonDeps(src) → string[]
|
|
341
|
-
function extractTSDeps(src) → string[]
|
|
342
|
-
function buildReverseDepMap(forwardMap) → Map<string, string[]>
|
|
343
|
-
```
|
|
344
|
-
|
|
345
|
-
### src/extractors/dockerfile.js
|
|
265
|
+
### src/extractors/php.js
|
|
346
266
|
```
|
|
347
267
|
module.exports = { extract }
|
|
348
268
|
function extract(src) → string[]
|
|
269
|
+
function extractBlock(src, startIndex)
|
|
270
|
+
function extractMembers(block)
|
|
271
|
+
function normalizeParams(params)
|
|
272
|
+
function normalizeType(type)
|
|
349
273
|
```
|
|
350
274
|
|
|
351
|
-
### src/extractors/
|
|
275
|
+
### src/extractors/prdiff.js
|
|
352
276
|
```
|
|
353
|
-
module.exports = {
|
|
354
|
-
function
|
|
277
|
+
module.exports = { diffSignatures, extractName }
|
|
278
|
+
function diffSignatures(baseSigs, currentSigs) → {added:string[], removed:
|
|
279
|
+
function extractName(sig)
|
|
355
280
|
```
|
|
356
281
|
|
|
357
|
-
### src/extractors/
|
|
282
|
+
### src/extractors/python.js
|
|
358
283
|
```
|
|
359
284
|
module.exports = { extract }
|
|
360
285
|
function extract(src) → string[]
|
|
361
|
-
function
|
|
362
|
-
function
|
|
286
|
+
function extractClassMethods(stripped, startIndex)
|
|
287
|
+
function tryExtractDataclassFields(stripped, classIndex)
|
|
288
|
+
function tryExtractBaseModelFields(stripped, bodyStart)
|
|
289
|
+
function extractClassConstants(stripped, startIndex)
|
|
290
|
+
function extractReturnType(sigLine)
|
|
363
291
|
function normalizeParams(params)
|
|
292
|
+
function extractDocHint(src, fnName, fnSigLine)
|
|
364
293
|
```
|
|
365
294
|
|
|
366
|
-
### src/extractors/
|
|
295
|
+
### src/extractors/ruby.js
|
|
367
296
|
```
|
|
368
297
|
module.exports = { extract }
|
|
369
298
|
function extract(src) → string[]
|
|
299
|
+
function normalizeParams(params)
|
|
300
|
+
function extractReturnHint(stripped, index)
|
|
370
301
|
```
|
|
371
302
|
|
|
372
|
-
### src/extractors/
|
|
303
|
+
### src/extractors/rust.js
|
|
373
304
|
```
|
|
374
305
|
module.exports = { extract }
|
|
375
306
|
function extract(src) → string[]
|
|
307
|
+
function extractBlock(src, startIndex)
|
|
308
|
+
function extractMethods(block)
|
|
309
|
+
function normalizeParams(params)
|
|
310
|
+
function extractReturnType(afterParen)
|
|
376
311
|
```
|
|
377
312
|
|
|
378
|
-
### src/extractors/
|
|
313
|
+
### src/extractors/scala.js
|
|
379
314
|
```
|
|
380
315
|
module.exports = { extract }
|
|
381
316
|
function extract(src) → string[]
|
|
@@ -385,116 +320,121 @@ function normalizeParams(params)
|
|
|
385
320
|
function normalizeType(type)
|
|
386
321
|
```
|
|
387
322
|
|
|
388
|
-
### src/extractors/
|
|
323
|
+
### src/extractors/svelte.js
|
|
389
324
|
```
|
|
390
325
|
module.exports = { extract }
|
|
391
326
|
function extract(src) → string[]
|
|
392
|
-
function extractBlock(src, startIndex)
|
|
393
|
-
function extractClassMembers(block, returnHints)
|
|
394
|
-
function buildReturnHints(src)
|
|
395
|
-
function normalizeType(type)
|
|
396
|
-
function formatReturnHint(type)
|
|
397
327
|
function normalizeParams(params)
|
|
328
|
+
function normalizeType(type)
|
|
398
329
|
```
|
|
399
330
|
|
|
400
|
-
### src/extractors/
|
|
331
|
+
### src/extractors/swift.js
|
|
401
332
|
```
|
|
402
333
|
module.exports = { extract }
|
|
403
334
|
function extract(src) → string[]
|
|
404
335
|
function extractBlock(src, startIndex)
|
|
405
336
|
function extractMembers(block)
|
|
406
337
|
function normalizeParams(params)
|
|
338
|
+
function extractArrowType(str)
|
|
407
339
|
```
|
|
408
340
|
|
|
409
|
-
### src/extractors/
|
|
341
|
+
### src/extractors/todos.js
|
|
410
342
|
```
|
|
411
|
-
module.exports = {
|
|
412
|
-
function
|
|
343
|
+
module.exports = { extractTodos }
|
|
344
|
+
function extractTodos(src) → {line:number, tag:string,
|
|
413
345
|
```
|
|
414
346
|
|
|
415
|
-
### src/extractors/
|
|
347
|
+
### src/extractors/typescript.js
|
|
416
348
|
```
|
|
417
349
|
module.exports = { extract }
|
|
418
350
|
function extract(src) → string[]
|
|
351
|
+
function extractBlock(src, startIndex)
|
|
352
|
+
function extractInterfaceMembers(block)
|
|
353
|
+
function extractClassMembers(block)
|
|
354
|
+
function normalizeParams(params)
|
|
419
355
|
```
|
|
420
356
|
|
|
421
|
-
### src/extractors/
|
|
357
|
+
### src/extractors/vue.js
|
|
422
358
|
```
|
|
423
359
|
module.exports = { extract }
|
|
424
360
|
function extract(src) → string[]
|
|
425
|
-
function extractBlock(src, startIndex)
|
|
426
|
-
function extractMembers(block)
|
|
427
361
|
function normalizeParams(params)
|
|
428
362
|
function normalizeType(type)
|
|
429
363
|
```
|
|
430
364
|
|
|
431
|
-
### src/
|
|
365
|
+
### src/eval/scorer.js
|
|
432
366
|
```
|
|
433
|
-
module.exports = {
|
|
434
|
-
function
|
|
435
|
-
function
|
|
367
|
+
module.exports = { hitAtK, reciprocalRank, precisionAtK, aggregate, firstRank }
|
|
368
|
+
function firstRank(ranked, expected) → number
|
|
369
|
+
function normalizePath(p) → string
|
|
370
|
+
function hitAtK(ranked, expected, k = 5) → 0|1
|
|
371
|
+
function reciprocalRank(ranked, expected) → number
|
|
372
|
+
function precisionAtK(ranked, expected, k = 5) → number
|
|
373
|
+
function aggregate(results, k = 5) → { * hitAt5: number, // fr
|
|
374
|
+
function round(x)
|
|
436
375
|
```
|
|
437
376
|
|
|
438
|
-
### src/
|
|
377
|
+
### src/eval/runner.js
|
|
439
378
|
```
|
|
440
|
-
module.exports = {
|
|
441
|
-
function
|
|
379
|
+
module.exports = { run, rank, loadTasks, buildSigIndex, formatTable, formatMetrics, tokenize }
|
|
380
|
+
function buildSigIndex(cwd) → Map<string, string[]>
|
|
381
|
+
function tokenize(text) → string[]
|
|
382
|
+
function scoreFile(sigs, queryTokens) → number
|
|
383
|
+
function rank(query, index, topK = 10) → { file: string, score: nu
|
|
384
|
+
function estimateTokens(sigs) → number
|
|
385
|
+
function loadTasks(tasksFile) → Array<{id:string, query:s
|
|
386
|
+
function run(tasksFile, cwd, opts = {}) → { * tasks: Array<{id, que
|
|
387
|
+
function formatTable(taskResults) → string
|
|
388
|
+
function formatMetrics(metrics) → string
|
|
442
389
|
```
|
|
443
390
|
|
|
444
|
-
### src/
|
|
391
|
+
### src/retrieval/tokenizer.js
|
|
445
392
|
```
|
|
446
|
-
module.exports = {
|
|
447
|
-
function
|
|
393
|
+
module.exports = { tokenize, STOP_WORDS }
|
|
394
|
+
function tokenize(text, opts) → string[]
|
|
448
395
|
```
|
|
449
396
|
|
|
450
|
-
### src/
|
|
397
|
+
### src/graph/builder.js
|
|
451
398
|
```
|
|
452
|
-
module.exports = {
|
|
453
|
-
function
|
|
454
|
-
function
|
|
455
|
-
function
|
|
456
|
-
function
|
|
457
|
-
function extractClassConstants(stripped, startIndex)
|
|
458
|
-
function extractReturnType(sigLine)
|
|
459
|
-
function normalizeParams(params)
|
|
460
|
-
function extractDocHint(src, fnName, fnSigLine)
|
|
399
|
+
module.exports = { build, buildFromCwd, extractFileDeps }
|
|
400
|
+
function resolveJsPath(dir, importStr, fileSet) → string|null
|
|
401
|
+
function extractFileDeps(filePath, content, fileSet) → string[]
|
|
402
|
+
function build(files, cwd) → { forward: Map<string,str
|
|
403
|
+
function buildFromCwd(cwd, opts) → { forward: Map<string,str
|
|
461
404
|
```
|
|
462
405
|
|
|
463
|
-
### src/
|
|
406
|
+
### src/graph/impact.js
|
|
464
407
|
```
|
|
465
|
-
module.exports = {
|
|
466
|
-
function
|
|
408
|
+
module.exports = { getImpact, analyzeImpact, formatImpact, formatImpactJSON }
|
|
409
|
+
function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr
|
|
410
|
+
function isTestFile(f)
|
|
411
|
+
function isRouteFile(f)
|
|
412
|
+
function getImpact(changedFile, graph, opts) → { * changed: string, * di
|
|
413
|
+
function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o
|
|
414
|
+
function formatImpact(result) → string
|
|
415
|
+
function formatImpactJSON(result) → object
|
|
467
416
|
```
|
|
468
417
|
|
|
469
|
-
### src/
|
|
418
|
+
### src/mcp/tools.js
|
|
470
419
|
```
|
|
471
|
-
module.exports = {
|
|
472
|
-
function extract(src) → string[]
|
|
473
|
-
function normalizeParams(params)
|
|
474
|
-
function extractReturnHint(stripped, index)
|
|
420
|
+
module.exports = { TOOLS }
|
|
475
421
|
```
|
|
476
422
|
|
|
477
|
-
### src/
|
|
423
|
+
### src/health/scorer.js
|
|
478
424
|
```
|
|
479
|
-
module.exports = {
|
|
480
|
-
function
|
|
481
|
-
function extractBlock(src, startIndex)
|
|
482
|
-
function extractMethods(block)
|
|
483
|
-
function normalizeParams(params)
|
|
484
|
-
function extractReturnType(afterParen)
|
|
425
|
+
module.exports = { score }
|
|
426
|
+
function score(cwd) → { * score: number, * grad
|
|
485
427
|
```
|
|
486
428
|
|
|
487
|
-
### src/extractors/
|
|
429
|
+
### src/extractors/coverage.js
|
|
488
430
|
```
|
|
489
|
-
module.exports = {
|
|
490
|
-
function
|
|
491
|
-
function
|
|
492
|
-
function
|
|
493
|
-
function normalizeParams(params)
|
|
494
|
-
function normalizeType(type)
|
|
431
|
+
module.exports = { buildTestIndex, isTested }
|
|
432
|
+
function walkFiles(dir)
|
|
433
|
+
function buildTestIndex(cwd, testDirs)
|
|
434
|
+
function isTested(funcName, testIndex)
|
|
495
435
|
```
|
|
496
436
|
|
|
497
|
-
### src/extractors/
|
|
437
|
+
### src/extractors/css.js
|
|
498
438
|
```
|
|
499
439
|
module.exports = { extract }
|
|
500
440
|
function extract(src) → string[]
|
|
@@ -508,22 +448,16 @@ function _cleanName(raw)
|
|
|
508
448
|
function _normalizeParams(raw)
|
|
509
449
|
```
|
|
510
450
|
|
|
511
|
-
### src/extractors/
|
|
451
|
+
### src/extractors/graphql.js
|
|
512
452
|
```
|
|
513
453
|
module.exports = { extract }
|
|
514
454
|
function extract(src) → string[]
|
|
515
|
-
function normalizeParams(params)
|
|
516
|
-
function normalizeType(type)
|
|
517
455
|
```
|
|
518
456
|
|
|
519
|
-
### src/extractors/
|
|
457
|
+
### src/extractors/protobuf.js
|
|
520
458
|
```
|
|
521
459
|
module.exports = { extract }
|
|
522
460
|
function extract(src) → string[]
|
|
523
|
-
function extractBlock(src, startIndex)
|
|
524
|
-
function extractMembers(block)
|
|
525
|
-
function normalizeParams(params)
|
|
526
|
-
function extractArrowType(str)
|
|
527
461
|
```
|
|
528
462
|
|
|
529
463
|
### src/extractors/terraform.js
|
|
@@ -532,65 +466,58 @@ module.exports = { extract }
|
|
|
532
466
|
function extract(src) → string[]
|
|
533
467
|
```
|
|
534
468
|
|
|
535
|
-
### src/extractors/
|
|
469
|
+
### src/extractors/markdown.js
|
|
536
470
|
```
|
|
537
|
-
module.exports = {
|
|
538
|
-
function
|
|
471
|
+
module.exports = { extract }
|
|
472
|
+
function extract(src) → string[]
|
|
539
473
|
```
|
|
540
474
|
|
|
541
|
-
### src/extractors/
|
|
475
|
+
### src/extractors/properties.js
|
|
542
476
|
```
|
|
543
477
|
module.exports = { extract }
|
|
544
478
|
function extract(src) → string[]
|
|
545
479
|
```
|
|
546
480
|
|
|
547
|
-
### src/extractors/
|
|
481
|
+
### src/extractors/toml.js
|
|
548
482
|
```
|
|
549
483
|
module.exports = { extract }
|
|
550
484
|
function extract(src) → string[]
|
|
551
|
-
function extractBlock(src, startIndex)
|
|
552
|
-
function extractInterfaceMembers(block)
|
|
553
|
-
function extractClassMembers(block)
|
|
554
|
-
function normalizeParams(params)
|
|
555
485
|
```
|
|
556
486
|
|
|
557
|
-
### src/extractors/
|
|
487
|
+
### src/extractors/xml.js
|
|
558
488
|
```
|
|
559
489
|
module.exports = { extract }
|
|
560
490
|
function extract(src) → string[]
|
|
561
491
|
```
|
|
562
492
|
|
|
563
|
-
### src/extractors/
|
|
493
|
+
### src/extractors/patterns.js
|
|
564
494
|
```
|
|
565
495
|
module.exports = { extract }
|
|
566
496
|
function extract(src) → string[]
|
|
567
|
-
function normalizeParams(params)
|
|
568
|
-
function normalizeType(type)
|
|
569
497
|
```
|
|
570
498
|
|
|
571
|
-
### src/extractors/
|
|
499
|
+
### src/extractors/python_dataclass.js
|
|
572
500
|
```
|
|
573
501
|
module.exports = { extract }
|
|
574
502
|
function extract(src) → string[]
|
|
575
503
|
```
|
|
576
504
|
|
|
577
|
-
### src/extractors/
|
|
505
|
+
### src/extractors/typescript_react.js
|
|
578
506
|
```
|
|
579
507
|
module.exports = { extract }
|
|
580
508
|
function extract(src) → string[]
|
|
581
509
|
```
|
|
582
510
|
|
|
583
|
-
### src/extractors/
|
|
511
|
+
### src/extractors/vue_sfc.js
|
|
584
512
|
```
|
|
585
513
|
module.exports = { extract }
|
|
586
514
|
function extract(src) → string[]
|
|
587
515
|
```
|
|
588
516
|
|
|
589
|
-
### src/
|
|
517
|
+
### src/extractors/generic.js
|
|
590
518
|
```
|
|
591
|
-
module.exports = {
|
|
592
|
-
function
|
|
593
|
-
function formatCachePayload(content, model) → string
|
|
519
|
+
module.exports = { extract }
|
|
520
|
+
function extract(src)
|
|
594
521
|
```
|
|
595
522
|
|
|
596
523
|
### src/format/llm-txt.js
|
|
@@ -609,94 +536,142 @@ function detectVersion(cwd)
|
|
|
609
536
|
function format(context, cwd, writtenFiles, sigmapVersion)
|
|
610
537
|
```
|
|
611
538
|
|
|
612
|
-
### src/
|
|
613
|
-
```
|
|
614
|
-
module.exports = { build, buildFromCwd, extractFileDeps }
|
|
615
|
-
function resolveJsPath(dir, importStr, fileSet) → string|null
|
|
616
|
-
function extractFileDeps(filePath, content, fileSet) → string[]
|
|
617
|
-
function build(files, cwd) → { forward: Map<string,str
|
|
618
|
-
function buildFromCwd(cwd, opts) → { forward: Map<string,str
|
|
619
|
-
```
|
|
620
|
-
|
|
621
|
-
### src/graph/impact.js
|
|
622
|
-
```
|
|
623
|
-
module.exports = { getImpact, analyzeImpact, formatImpact, formatImpactJSON }
|
|
624
|
-
function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr
|
|
625
|
-
function isTestFile(f)
|
|
626
|
-
function isRouteFile(f)
|
|
627
|
-
function getImpact(changedFile, graph, opts) → { * changed: string, * di
|
|
628
|
-
function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o
|
|
629
|
-
function formatImpact(result) → string
|
|
630
|
-
function formatImpactJSON(result) → object
|
|
631
|
-
```
|
|
632
|
-
|
|
633
|
-
### src/health/scorer.js
|
|
539
|
+
### src/eval/analyzer.js
|
|
634
540
|
```
|
|
635
|
-
module.exports = {
|
|
636
|
-
function
|
|
541
|
+
module.exports = { analyzeFiles, formatAnalysisTable, formatAnalysisJSON }
|
|
542
|
+
function isDockerfile(name)
|
|
543
|
+
function getExtractorName(filePath)
|
|
544
|
+
function tokenCount(sigs)
|
|
545
|
+
function hasCoverage(filePath, cwd)
|
|
546
|
+
function loadExtractor(name, cwd)
|
|
547
|
+
function analyzeFiles(files, cwd, opts) → object[]
|
|
548
|
+
function formatAnalysisTable(stats, showSlow) → string
|
|
549
|
+
function formatAnalysisJSON(stats) → object
|
|
637
550
|
```
|
|
638
551
|
|
|
639
|
-
### src/
|
|
552
|
+
### src/config/defaults.js
|
|
640
553
|
```
|
|
641
|
-
module.exports = {
|
|
642
|
-
function analyze(files, cwd)
|
|
554
|
+
module.exports = { DEFAULTS }
|
|
643
555
|
```
|
|
644
556
|
|
|
645
|
-
### src/
|
|
557
|
+
### src/config/loader.js
|
|
646
558
|
```
|
|
647
|
-
module.exports = {
|
|
648
|
-
function
|
|
649
|
-
function
|
|
650
|
-
function
|
|
651
|
-
function
|
|
559
|
+
module.exports = { loadConfig, loadBaseConfig }
|
|
560
|
+
function loadBaseConfig(extendsVal, cwd)
|
|
561
|
+
function detectAutoSrcDirs(cwd, excludeList) → string[]
|
|
562
|
+
function loadConfig(cwd) → object
|
|
563
|
+
function deepClone(obj)
|
|
652
564
|
```
|
|
653
565
|
|
|
654
|
-
### src/
|
|
566
|
+
### src/format/dashboard.js
|
|
655
567
|
```
|
|
656
|
-
module.exports = {
|
|
657
|
-
function
|
|
658
|
-
function
|
|
568
|
+
module.exports = { generateDashboardHtml, renderHistoryCharts, computeExtractorCoverage, percentile, overBudgetStreak }
|
|
569
|
+
function toNumber(v)
|
|
570
|
+
function percentile(values, p)
|
|
571
|
+
function overBudgetStreak(entries)
|
|
572
|
+
function loadConfig(cwd)
|
|
573
|
+
function shouldExclude(rel, excludeSet)
|
|
574
|
+
function detectLanguage(filePath)
|
|
575
|
+
function walkFiles(dir, maxDepth, depth, out, excludeSet)
|
|
576
|
+
function computeExtractorCoverage(cwd)
|
|
577
|
+
function readBenchmarkTrend(cwd)
|
|
578
|
+
function lineChartSvg(values, title, ySuffix)
|
|
579
|
+
function barChartSvg(perLanguage)
|
|
580
|
+
function sparkline(values)
|
|
581
|
+
function buildDashboardData(cwd, health)
|
|
582
|
+
function generateDashboardHtml(cwd, health)
|
|
583
|
+
function renderHistoryCharts(cwd, health)
|
|
659
584
|
```
|
|
660
585
|
|
|
661
|
-
### src/
|
|
586
|
+
### src/judge/judge-engine.js
|
|
662
587
|
```
|
|
663
|
-
module.exports = {
|
|
588
|
+
module.exports = { groundedness, judge }
|
|
589
|
+
function tokenize(text)
|
|
590
|
+
function groundedness(response, context)
|
|
591
|
+
function extractContextFiles(context, cwd)
|
|
592
|
+
function judge(response, context, opts = {})
|
|
664
593
|
```
|
|
665
594
|
|
|
666
|
-
### src/
|
|
595
|
+
### src/learning/weights.js
|
|
667
596
|
```
|
|
668
|
-
module.exports = {
|
|
669
|
-
function
|
|
597
|
+
module.exports = { BASELINE, DECAY, MAX_MULT, MIN_MULT, weightsPath, clampMultiplier, normalizeFile, loadWeights, saveWeights, updateWeights, boostFiles, penalizeFiles, resetWeights }
|
|
598
|
+
function weightsPath(cwd)
|
|
599
|
+
function clampMultiplier(value)
|
|
600
|
+
function normalizeFile(cwd, filePath)
|
|
601
|
+
function sanitizeWeights(cwd, weights)
|
|
602
|
+
function loadWeights(cwd)
|
|
603
|
+
function saveWeights(cwd, weights)
|
|
604
|
+
function updateWeights(cwd, opts = {})
|
|
605
|
+
function boostFiles(cwd, files, amount = 0.15)
|
|
606
|
+
function penalizeFiles(cwd, files, amount = 0.10)
|
|
607
|
+
function resetWeights(cwd)
|
|
670
608
|
```
|
|
671
609
|
|
|
672
|
-
### src/
|
|
610
|
+
### src/mcp/handlers.js
|
|
673
611
|
```
|
|
674
|
-
module.exports = {
|
|
675
|
-
function
|
|
676
|
-
function
|
|
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)
|
|
677
622
|
```
|
|
678
623
|
|
|
679
|
-
### src/
|
|
624
|
+
### src/retrieval/ranker.js
|
|
680
625
|
```
|
|
681
|
-
module.exports = {
|
|
682
|
-
function
|
|
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)
|
|
683
634
|
```
|
|
684
635
|
|
|
685
|
-
### src/
|
|
686
|
-
```
|
|
687
|
-
module.exports = {
|
|
636
|
+
### src/format/benchmark-report.js
|
|
637
|
+
```
|
|
638
|
+
module.exports = { loadBenchmarkReports, buildBenchmarkSummary, generateBenchmarkReportHtml, writeBenchmarkReport }
|
|
639
|
+
function escapeHtml(value)
|
|
640
|
+
function formatInt(value)
|
|
641
|
+
function formatCompact(value)
|
|
642
|
+
function formatPct(value, digits = 1)
|
|
643
|
+
function formatMaybePct(value, digits = 1)
|
|
644
|
+
function formatRatio(value, digits = 1)
|
|
645
|
+
function formatMoney(value)
|
|
646
|
+
function durationLabel(ms)
|
|
647
|
+
function maxOrZero(values)
|
|
648
|
+
function readJson(filePath)
|
|
649
|
+
function loadBenchmarkReports(cwd)
|
|
650
|
+
function buildRetrievalSummary(retrieval)
|
|
651
|
+
function buildBenchmarkSummary(reports, matrixSummary)
|
|
652
|
+
function renderCard(label, value, hint, tone)
|
|
653
|
+
function renderProgress(label, value, max, suffix)
|
|
654
|
+
function renderMatrixSection(matrix)
|
|
655
|
+
function renderTokenSection(token)
|
|
656
|
+
function renderRetrievalSection(retrieval)
|
|
657
|
+
function renderQualitySection(quality)
|
|
658
|
+
function renderTaskSection(task)
|
|
659
|
+
function generateBenchmarkReportHtml(reports, opts = {})
|
|
660
|
+
function writeBenchmarkReport(cwd, opts = {})
|
|
688
661
|
```
|
|
689
662
|
|
|
690
|
-
### src/
|
|
663
|
+
### src/analysis/coverage-score.js
|
|
691
664
|
```
|
|
692
|
-
module.exports = {
|
|
693
|
-
function
|
|
665
|
+
module.exports = { coverageScore, CODE_EXTS }
|
|
666
|
+
function coverageScore(cwd, fileEntries, config)
|
|
667
|
+
function _walk(dir, excludeSet, out)
|
|
694
668
|
```
|
|
695
669
|
|
|
696
|
-
### src/
|
|
670
|
+
### src/mcp/server.js
|
|
697
671
|
```
|
|
698
|
-
module.exports = {
|
|
699
|
-
function
|
|
700
|
-
function
|
|
701
|
-
function
|
|
672
|
+
module.exports = { start }
|
|
673
|
+
function respond(id, result)
|
|
674
|
+
function respondError(id, code, message)
|
|
675
|
+
function dispatch(msg, cwd)
|
|
676
|
+
function start(cwd)
|
|
702
677
|
```
|