sigmap 6.15.0 → 7.0.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 CHANGED
@@ -4,44 +4,14 @@ Instructions for Codex-style agents working in this repository.
4
4
 
5
5
  ## Append Strategy (Required)
6
6
 
7
- When writing generated signature content, never overwrite human-written notes above the marker.
8
-
9
- Use this marker block for all appendable context files:
10
-
11
- ```
12
- ## Tools
13
-
14
- <!-- sigmap-tools -->
15
-
16
- ```json
17
- [
18
- {
19
- "name": "sigmap_ask",
20
- "description": "Rank source files by relevance to a natural-language query. Run before exploring the codebase.",
21
- "command": "sigmap ask \"$QUERY\""
22
- },
23
- {
24
- "name": "sigmap_validate",
25
- "description": "Validate SigMap config and measure context coverage. Run after changing config or source dirs.",
26
- "command": "sigmap validate"
27
- },
28
- {
29
- "name": "sigmap_judge",
30
- "description": "Score an LLM response for groundedness against source context. Use to verify answer quality.",
31
- "command": "sigmap judge --response \"$RESPONSE\" --context \"$CONTEXT\""
32
- },
33
- {
34
- "name": "sigmap_query",
35
- "description": "Rank all files by relevance using TF-IDF and write a focused mini-context.",
36
- "command": "sigmap --query \"$QUERY\" --context"
37
- },
38
- {
39
- "name": "sigmap_weights",
40
- "description": "Show learned file-ranking multipliers accumulated from past sessions.",
41
- "command": "sigmap weights"
42
- }
43
- ]
44
- ```
7
+ When writing generated signature content, never overwrite human-written notes
8
+ above the auto-generated marker. Everything above the marker (like these notes)
9
+ is preserved verbatim; everything below it is regenerated by `gen-context.js`.
10
+
11
+ Each generated context file carries one canonical SigMap commands guidance block
12
+ (emitted from `formatOutput`, identical across every context file). Signatures
13
+ keep their full parameter lists and return types — the token budget drops whole
14
+ low-priority files rather than collapsing signatures to bare line anchors.
45
15
 
46
16
  ## Auto-generated signatures
47
17
  <!-- Updated by gen-context.js -->
@@ -51,30 +21,130 @@ Use this marker block for all appendable context files:
51
21
 
52
22
  | When | Command |
53
23
  |------|---------|
54
- | Before answering a question | `sigmap ask "<your question>"` |
55
- | After code changes | `sigmap validate` |
56
- | To query by topic | `sigmap --query "<topic>"` |
24
+ | Before answering a question about code | `sigmap ask "<your question>"` |
25
+ | To rank files by topic | `sigmap --query "<topic>"` |
26
+ | After changing config or source dirs | `sigmap validate` |
27
+ | To verify an AI answer is grounded | `sigmap judge --response <file>` |
28
+
29
+ Always run `sigmap ask` (or `sigmap --query`) before searching for files relevant to a task.
57
30
 
58
- Always run `sigmap ask` or `sigmap --query` before searching for files relevant to a task.
59
31
  ## deps
60
32
  ```
61
33
  src/extractors/python_ast.py ← ast
62
34
  ```
63
35
 
64
- ## changes (last 5 commits — 19 minutes ago)
36
+ ## changes (last 5 commits — 8 minutes ago)
65
37
  ```
66
- src/mcp/handlers.js +_readContextFiles ~flushBlock ~readContext ~explainFile
67
- src/retrieval/ranker.js +_mergeSigIndex +_buildSigIndexFromCache +_enrichSigIndexFromStrategy ~_parseContextFile
38
+ src/format/usage-guidance.js +usageBlock
39
+ src/mcp/handlers.js +readMemory ~getLines
40
+ src/mcp/server.js ~dispatch
41
+ src/session/notes.js +notesPath +_currentBranch +addNote +readNotes
42
+ packages/adapters/claude.js ~format
43
+ packages/adapters/codex.js ~write ~format
44
+ packages/adapters/copilot.js ~format
45
+ packages/adapters/cursor.js ~format
46
+ packages/adapters/gemini.js ~format
47
+ packages/adapters/openai.js ~format
48
+ packages/adapters/windsurf.js ~format
49
+ src/format/verify-report.js +escapeHtml +toneFor +labelFor +renderReportHtml
50
+ src/verify/closest-match.js +levenshtein +suggestionConfidence +closestMatch +buildSymbolCandidates
51
+ src/verify/hallucination-guard.js +is +isTestPath +loadScripts ~is
52
+ src/verify/parsers.js +extractNpmScripts ~extractImports
68
53
  ```
69
54
 
70
55
  ## packages
71
56
 
57
+ ### packages/adapters/claude.js
58
+ ```
59
+ module.exports = { name, format, outputPath, write } :124-124
60
+ function format(context, opts = {}) → string :58-69
61
+ function _confidenceMeta(opts) :71-78
62
+ function outputPath(cwd) → string :85-87
63
+ function write(context, cwd, opts = {}) :96-122
64
+ ```
65
+
66
+ ### packages/adapters/codex.js
67
+ ```
68
+ module.exports = { name, format, outputPath, write } :74-74
69
+ function format(context, opts = {}) → string :27-30
70
+ function outputPath(cwd) → string :37-39
71
+ function write(context, cwd, opts = {}) :49-72
72
+ ```
73
+
74
+ ### packages/adapters/copilot.js
75
+ ```
76
+ module.exports = { name, format, outputPath, write } :93-93
77
+ function format(context, opts = {}) → string :25-40
78
+ function _confidenceMeta(opts) :42-49
79
+ function outputPath(cwd) → string :56-58
80
+ function write(context, cwd, opts = {}) :68-91
81
+ ```
82
+
83
+ ### packages/adapters/cursor.js
84
+ ```
85
+ module.exports = { name, format, outputPath } :56-56
86
+ function format(context, opts = {}) → string :23-36
87
+ function _confidenceMeta(opts) :38-45
88
+ function outputPath(cwd) → string :52-54
89
+ ```
90
+
91
+ ### packages/adapters/gemini.js
92
+ ```
93
+ module.exports = { name, format, outputPath, write } :104-104
94
+ function format(context, opts = {}) → string :31-51
95
+ function outputPath(cwd) → string :58-60
96
+ function write(context, cwd, opts = {}) :70-93
97
+ function _confidenceMeta(opts) :95-102
98
+ ```
99
+
100
+ ### packages/adapters/openai.js
101
+ ```
102
+ module.exports = { name, format, outputPath } :70-70
103
+ function format(context, opts = {}) → string :29-49
104
+ function outputPath(cwd) → string :57-59
105
+ function _confidenceMeta(opts) :61-68
106
+ ```
107
+
108
+ ### packages/adapters/windsurf.js
109
+ ```
110
+ module.exports = { name, format, outputPath } :56-56
111
+ function format(context, opts = {}) → string :23-36
112
+ function _confidenceMeta(opts) :38-45
113
+ function outputPath(cwd) → string :52-54
114
+ ```
115
+
116
+ ### packages/adapters/index.js
117
+ ```
118
+ module.exports = { getAdapter, listAdapters, adapt, outputsToAdapters } :81-81
119
+ function getAdapter(name) → { name: string, format: F :26-38
120
+ function listAdapters() → string[] :44-46
121
+ function adapt(context, adapterName, opts = {}) → string :55-64
122
+ function outputsToAdapters(outputs) → string[] :72-79
123
+ ```
124
+
72
125
  ### packages/adapters/llm-full.js
73
126
  ```
74
- module.exports = { name: 'llm-full', format, outputPath, write }
75
- function outputPath(cwd)
76
- function format(context, opts)
77
- function write(context, cwd, opts)
127
+ module.exports = { name: 'llm-full', format, outputPath, write } :4-4
128
+ function outputPath(cwd) :6-6
129
+ function format(context, opts) :8-20
130
+ function write(context, cwd, opts) :22-25
131
+ ```
132
+
133
+ ### packages/adapters/willow.js
134
+ ```
135
+ module.exports = { name, format, outputPath, write } :200-200
136
+ function format(context, opts = {}) → string :36-40
137
+ function outputPath(cwd) → string :47-49
138
+ function generateAtomId(filepath) → string :57-63
139
+ async function fetchWithTimeout(url, opts, timeoutMs) → Promise<Response> :72-80
140
+ async function postAtomWithRetry(atom, mcpUrl, timeoutMs, maxRetries) → Promise<boolean> :90-142
141
+ async function write(context, cwd, opts = {}) → Promise<void> :155-198
142
+ ```
143
+
144
+ ### packages/cli/index.js
145
+ ```
146
+ module.exports = { CLI_ENTRY, run } :58-63
147
+ function run(argv, cwd) → void :36-56
78
148
  ```
79
149
 
80
150
  ### packages/core/README.md
@@ -97,507 +167,834 @@ code-fence js
97
167
  code-fence ---
98
168
  ```
99
169
 
100
- ### packages/adapters/copilot.js
170
+ ### packages/core/index.js
101
171
  ```
102
- module.exports = { name, format, outputPath, write }
103
- function format(context, opts = {}) → string
104
- function _confidenceMeta(opts)
105
- function outputPath(cwd) → string
106
- function write(context, cwd, opts = {})
172
+ module.exports = { extract, rank, buildSigIndex, scan, score, adapt } :254-267
173
+ function _resolveExtractor(language) :64-71
174
+ function extract(src, language) → string[] :91-120
175
+ function rank(query, sigIndex, opts) → { file: string, score: nu :143-150
176
+ function buildSigIndex(cwd) Map<string, string[]> :162-169
177
+ function scan(sigs, filePath) → { safe: string[], redacte :185-192
178
+ function score(cwd) → { * score: number, * grad :215-222
179
+ function adapt(context, adapterName, opts = {}) → string :241-249
107
180
  ```
108
181
 
109
- ### packages/adapters/cursor.js
182
+ ## src
183
+
184
+ ### src/format/usage-guidance.js
110
185
  ```
111
- module.exports = { name, format, outputPath }
112
- function format(context, opts = {}) → string
113
- function _confidenceMeta(opts)
114
- function outputPath(cwd) → string
186
+ module.exports = { usageBlock } :28-28
187
+ function usageBlock() :12-26
115
188
  ```
116
189
 
117
- ### packages/adapters/gemini.js
190
+ ### src/mcp/handlers.js
118
191
  ```
119
- module.exports = { name, format, outputPath, write }
120
- function format(context, opts = {}) → string
121
- function outputPath(cwd) → string
122
- function write(context, cwd, opts = {})
123
- function _confidenceMeta(opts)
192
+ module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact, getLines, readMemory } :551-551
193
+ function _readContextFiles(cwd) :10-17
194
+ function readContext(args, cwd) :32-62
195
+ function searchSignatures(args, cwd) :70-95
196
+ function getMap(args, cwd) :103-126
197
+ function createCheckpoint(args, cwd) :138-215
198
+ function getRouting(args, cwd) :224-261
199
+ function explainFile(args, cwd) :269-356
200
+ function listModules(args, cwd) :364-403
201
+ function queryContext(args, cwd) :411-429
202
+ function getImpact(args, cwd) :437-449
203
+ function getLines(args, cwd) :458-506
204
+ function readMemory(args, cwd) :514-549
124
205
  ```
125
206
 
126
- ### packages/adapters/openai.js
207
+ ### src/mcp/server.js
127
208
  ```
128
- module.exports = { name, format, outputPath }
129
- function format(context, opts = {}) → string
130
- function outputPath(cwd) string
131
- function _confidenceMeta(opts)
209
+ module.exports = { start } :132-132
210
+ function respond(id, result) :28-30
211
+ function respondError(id, code, message) :32-36
212
+ function dispatch(msg, cwd) :41-99
213
+ function start(cwd) :104-130
132
214
  ```
133
215
 
134
- ### packages/adapters/windsurf.js
216
+ ### src/mcp/tools.js
135
217
  ```
136
- module.exports = { name, format, outputPath }
137
- function format(context, opts = {}) → string
138
- function _confidenceMeta(opts)
139
- function outputPath(cwd) → string
218
+ module.exports = { TOOLS } :220-220
140
219
  ```
141
220
 
142
- ### packages/adapters/claude.js
221
+ ### src/session/notes.js
143
222
  ```
144
- module.exports = { name, format, outputPath, write }
145
- function format(context, opts = {}) → string
146
- function _confidenceMeta(opts)
147
- function outputPath(cwd) string
148
- function write(context, cwd, opts = {})
223
+ module.exports = { notesPath, addNote, readNotes, formatNotes, clearNotes } :99-99
224
+ function notesPath(cwd) :23-25
225
+ function _currentBranch(cwd) :27-35
226
+ function addNote(cwd, text, opts = {}) :45-58
227
+ function readNotes(cwd, limit = 0) → object[] :66-78
228
+ function formatNotes(notes) :81-91
229
+ function clearNotes(cwd) :94-97
149
230
  ```
150
231
 
151
- ### packages/adapters/codex.js
232
+ ### src/analysis/coverage-score.js
152
233
  ```
153
- module.exports = { name, format, outputPath, write }
154
- function format(context, opts = {}) → string
155
- function outputPath(cwd) string
156
- function write(context, cwd, opts = {})
234
+ module.exports = { coverageScore, CODE_EXTS } :105-105
235
+ function coverageScore(cwd, fileEntries, config) :41-90
236
+ function _walk(dir, excludeSet, out) :92-103
157
237
  ```
158
238
 
159
- ### packages/adapters/index.js
239
+ ### src/analysis/diagnostics.js
160
240
  ```
161
- module.exports = { getAdapter, listAdapters, adapt, outputsToAdapters }
162
- function getAdapter(name) → { name: string, format: F
163
- function listAdapters() string[]
164
- function adapt(context, adapterName, opts = {}) → string
165
- function outputsToAdapters(outputs) → string[]
241
+ module.exports = { formatFileDecision, computeFileMetrics, explainInclusion, explainExclusion, estimateTokens } :80-86
242
+ function estimateTokens(text) :14-16
243
+ function formatFileDecision(entry, decision, reason, score = null) :18-26
244
+ function computeFileMetrics(entry) :28-41
245
+ function explainInclusion(fileEntries, budgetLimit) :43-74
246
+ function explainExclusion(dropped, reason) :76-78
166
247
  ```
167
248
 
168
- ### packages/adapters/willow.js
249
+ ### src/cache/sig-cache.js
169
250
  ```
170
- module.exports = { name, format, outputPath, write }
171
- function format(context, opts = {}) → string
172
- function outputPath(cwd) → string
173
- function generateAtomId(filepath) string
174
- async function fetchWithTimeout(url, opts, timeoutMs) → Promise<Response>
175
- async function postAtomWithRetry(atom, mcpUrl, timeoutMs, maxRetries) → Promise<boolean>
176
- async function write(context, cwd, opts = {}) → Promise<void>
251
+ module.exports = { loadCache, saveCache, getChangedFiles, updateCacheEntries } :105-105
252
+ function cachePath(cwd) :19-21
253
+ function loadCache(cwd, currentVersion) → Map<string, { mtime: numb :32-42
254
+ function saveCache(cwd, currentVersion, cache) :51-61
255
+ function getChangedFiles(files, cache) → { changed: string[], unch :71-88
256
+ function updateCacheEntries(cache, extracted) :96-103
177
257
  ```
178
258
 
179
- ### packages/core/index.js
259
+ ### src/config/defaults.js
180
260
  ```
181
- module.exports = { extract, rank, buildSigIndex, scan, score, adapt }
182
- function _resolveExtractor(language)
183
- function extract(src, language) → string[]
184
- function rank(query, sigIndex, opts) → { file: string, score: nu
185
- function buildSigIndex(cwd) → Map<string, string[]>
186
- function scan(sigs, filePath) → { safe: string[], redacte
187
- function score(cwd) → { * score: number, * grad
188
- function adapt(context, adapterName, opts = {}) → string
261
+ module.exports = { DEFAULTS } :155-155
189
262
  ```
190
263
 
191
- ## src
264
+ ### src/config/loader.js
265
+ ```
266
+ module.exports = { loadConfig, loadBaseConfig } :313-313
267
+ function loadBaseConfig(extendsVal, cwd) :9-54
268
+ function detectAutoSrcDirs(cwd, excludeList) → string[] :99-114
269
+ function _legacyDetectAutoSrcDirs(cwd, excludeList) → string[] :123-225
270
+ function loadConfig(cwd) → object :236-307
271
+ function deepClone(obj) :309-311
272
+ ```
192
273
 
193
- ### src/extractors/typescript_react.js
274
+ ### src/discovery/framework-detector.js
194
275
  ```
195
- module.exports = { extract }
196
- function extract(src) → string[]
276
+ module.exports = { detectFrameworks } :7-7
277
+ function detectFrameworks(cwd) :9-57
278
+ function _readDeps(cwd) :59-64
279
+ function _readFile(p) :66-68
280
+ function _existsAnywhere(cwd, filename, maxDepth) :70-74
281
+ function _walkFind(dir, name, depth) :76-88
197
282
  ```
198
283
 
199
- ### src/extractors/vue_sfc.js
284
+ ### src/discovery/language-detector.js
200
285
  ```
201
- module.exports = { extract }
202
- function extract(src) → string[]
286
+ module.exports = { detectLanguages } :7-7
287
+ function detectLanguages(cwd) :26-61
288
+ function _walkDepth(dir, depth, extCount) :63-76
203
289
  ```
204
290
 
205
- ### src/extractors/generic.js
291
+ ### src/discovery/r-manifest.js
206
292
  ```
207
- module.exports = { extract }
208
- function extract(src)
293
+ module.exports = { readDescription, readNamespace, collectLocalDefs } :176-176
294
+ function readDescription(cwd) → object|null :28-59
295
+ function splitDeps(value) :66-71
296
+ function readNamespace(cwd) → object|null :88-132
297
+ function splitArgs(raw) :134-136
298
+ function stripQuotes(s) :138-140
299
+ function collectLocalDefs(rFiles) → Map<string, string> :150-174
209
300
  ```
210
301
 
211
- ### src/format/llm-txt.js
302
+ ### src/discovery/sigmapignore.js
212
303
  ```
213
- module.exports = { format, outputPath }
214
- function outputPath(cwd)
215
- function format(context, cwd, version)
304
+ module.exports = { loadIgnorePatterns, matchesIgnorePattern } :6-6
305
+ function loadIgnorePatterns(cwd) :8-19
306
+ function matchesIgnorePattern(dirName, patterns) :21-29
216
307
  ```
217
308
 
218
- ### src/format/llms-txt.js
309
+ ### src/discovery/source-root-registry.js
219
310
  ```
220
- module.exports = { format, outputPath }
221
- function outputPath(cwd)
222
- function getShortCommit(cwd)
223
- function detectVersion(cwd)
224
- function format(context, cwd, writtenFiles, sigmapVersion)
311
+ module.exports = { REGISTRY } :175-175
225
312
  ```
226
313
 
227
- ### src/format/dashboard.js
314
+ ### src/discovery/source-root-resolver.js
228
315
  ```
229
- module.exports = { generateDashboardHtml, renderHistoryCharts, computeExtractorCoverage, percentile, overBudgetStreak }
230
- function toNumber(v)
231
- function percentile(values, p)
232
- function overBudgetStreak(entries)
233
- function loadConfig(cwd)
234
- function shouldExclude(rel, excludeSet)
235
- function detectLanguage(filePath)
236
- function walkFiles(dir, maxDepth, depth, out, excludeSet)
237
- function computeExtractorCoverage(cwd)
238
- function readBenchmarkTrend(cwd)
239
- function lineChartSvg(values, title, ySuffix)
240
- function barChartSvg(perLanguage)
241
- function sparkline(values)
242
- function buildDashboardData(cwd, health)
243
- function generateDashboardHtml(cwd, health)
244
- function renderHistoryCharts(cwd, health)
316
+ module.exports = { resolveSourceRoots } :11-11
317
+ function resolveSourceRoots(cwd, opts = {}) :16-72
318
+ function _detectMonorepo(cwd) :74-83
319
+ function _enumerateCandidates(cwd, isMonorepo, ignorePatterns, excludeList) :85-142
320
+ function _applySpecialRules(scored, cwd, primaryFw, fwEntry, frameworks) :144-179
321
+ function _dedupeNested(scored) :181-192
322
+ function _computeConfidence(frameworks, languages, scoredCount) :194-198
245
323
  ```
246
324
 
247
- ### src/judge/judge-engine.js
325
+ ### src/discovery/source-root-scorer.js
248
326
  ```
249
- module.exports = { groundedness, judge }
250
- function tokenize(text)
251
- function groundedness(response, context)
252
- function extractContextFiles(context, cwd)
253
- function judge(response, context, opts = {})
327
+ module.exports = { scoreCandidate, getRecentlyChangedDirs, ROOT_ENTRYPOINTS, JVM_PATH_PATTERN } :103-103
328
+ function getRecentlyChangedDirs(cwd) :36-41
329
+ function scoreCandidate(dirName, fullPath, context) :43-89
330
+ function _countSourceFiles(dir, depth) :91-101
254
331
  ```
255
332
 
256
- ### src/format/benchmark-report.js
333
+ ### src/eval/analyzer.js
257
334
  ```
258
- module.exports = { loadBenchmarkReports, buildBenchmarkSummary, generateBenchmarkReportHtml, writeBenchmarkReport }
259
- function escapeHtml(value)
260
- function formatInt(value)
261
- function formatCompact(value)
262
- function formatPct(value, digits = 1)
263
- function formatMaybePct(value, digits = 1)
264
- function formatRatio(value, digits = 1)
265
- function formatMoney(value)
266
- function durationLabel(ms)
267
- function maxOrZero(values)
268
- function readJson(filePath)
269
- function loadBenchmarkReports(cwd)
270
- function buildRetrievalSummary(retrieval)
271
- function buildBenchmarkSummary(reports, matrixSummary)
272
- function renderCard(label, value, hint, tone)
273
- function renderProgress(label, value, max, suffix)
274
- function renderMatrixSection(matrix)
275
- function renderTokenSection(token)
276
- function renderRetrievalSection(retrieval)
277
- function renderQualitySection(quality)
278
- function renderTaskSection(task)
279
- function generateBenchmarkReportHtml(reports, opts = {})
280
- function writeBenchmarkReport(cwd, opts = {})
335
+ module.exports = { analyzeFiles, formatAnalysisTable, formatAnalysisJSON } :235-235
336
+ function isDockerfile(name) :49-51
337
+ function getExtractorName(filePath) :53-59
338
+ function tokenCount(sigs) :62-64
339
+ function hasCoverage(filePath, cwd) :70-85
340
+ function loadExtractor(name, cwd) :91-100
341
+ function analyzeFiles(files, cwd, opts) → object[] :113-170
342
+ function formatAnalysisTable(stats, showSlow) → string :179-213
343
+ function formatAnalysisJSON(stats) → object :221-233
281
344
  ```
282
345
 
283
- ### src/analysis/coverage-score.js
346
+ ### src/eval/runner.js
284
347
  ```
285
- module.exports = { coverageScore, CODE_EXTS }
286
- function coverageScore(cwd, fileEntries, config)
287
- function _walk(dir, excludeSet, out)
348
+ module.exports = { run, rank, loadTasks, buildSigIndex, formatTable, formatMetrics, tokenize } :308-308
349
+ function buildSigIndex(cwd) → Map<string, string[]> :39-81
350
+ function tokenize(text) string[] :93-105
351
+ function scoreFile(sigs, queryTokens) → number :119-136
352
+ function rank(query, index, topK = 10) → { file: string, score: nu :146-157
353
+ function estimateTokens(sigs) → number :168-171
354
+ function loadTasks(tasksFile) → Array<{id:string, query:s :184-206
355
+ function run(tasksFile, cwd, opts = {}) → { * tasks: Array<{id, que :224-271
356
+ function formatTable(taskResults) → string :282-290
357
+ function formatMetrics(metrics) → string :297-306
288
358
  ```
289
359
 
290
- ### src/cache/sig-cache.js
360
+ ### src/eval/scorer.js
291
361
  ```
292
- module.exports = { loadCache, saveCache, getChangedFiles, updateCacheEntries }
293
- function cachePath(cwd)
294
- function loadCache(cwd, currentVersion) → Map<string, { mtime: numb
295
- function saveCache(cwd, currentVersion, cache)
296
- function getChangedFiles(files, cache) → { changed: string[], unch
297
- function updateCacheEntries(cache, extracted)
362
+ module.exports = { hitAtK, reciprocalRank, precisionAtK, aggregate, firstRank } :126-126
363
+ function firstRank(ranked, expected) → number :22-29
364
+ function normalizePath(p) → string :38-40
365
+ function hitAtK(ranked, expected, k = 5) → 0|1 :49-51
366
+ function reciprocalRank(ranked, expected) → number :59-62
367
+ function precisionAtK(ranked, expected, k = 5) → number :72-78
368
+ function aggregate(results, k = 5) → { * hitAt5: number, // fr :93-120
369
+ function round(x) :122-124
298
370
  ```
299
371
 
300
- ### src/tracking/logger.js
372
+ ### src/eval/usefulness-scorer.js
301
373
  ```
302
- module.exports = { logRun, readLog, summarize }
303
- function logRun(entry, cwd)
304
- function readLog(cwd) → object[]
305
- function summarize(entries) → object
374
+ module.exports = { scoreUsefulness, computeUsefulnessStats } :3-3
375
+ function scoreUsefulness(taskResult, rankingScore) :11-38
376
+ function computeUsefulnessStats(taskResults) :40-66
306
377
  ```
307
378
 
308
- ### src/extractors/typescript.js
379
+ ### src/extractors/coverage.js
309
380
  ```
310
- module.exports = { extract }
311
- function extract(src) → string[]
312
- function extractBlock(src, startIndex)
313
- function extractInterfaceMembers(block)
314
- function extractClassMembers(block)
315
- function normalizeParams(params)
381
+ module.exports = { buildTestIndex, isTested } :79-79
382
+ function walkFiles(dir) :6-20
383
+ function buildTestIndex(cwd, testDirs) :22-62
384
+ function isTested(funcName, testIndex) :64-77
316
385
  ```
317
386
 
318
- ### src/learning/weights.js
387
+ ### src/extractors/cpp.js
319
388
  ```
320
- module.exports = { BASELINE, DECAY, MAX_MULT, MIN_MULT, weightsPath, clampMultiplier, normalizeFile, loadWeights, saveWeights, updateWeights, boostFiles, penalizeFiles, resetWeights, exportWeights, importWeights }
321
- function weightsPath(cwd)
322
- function clampMultiplier(value)
323
- function normalizeFile(cwd, filePath)
324
- function sanitizeWeights(cwd, weights)
325
- function loadWeights(cwd)
326
- function saveWeights(cwd, weights)
327
- function updateWeights(cwd, opts = {})
328
- function boostFiles(cwd, files, amount = 0.15)
329
- function penalizeFiles(cwd, files, amount = 0.10)
330
- function resetWeights(cwd)
331
- function exportWeights(cwd, outputPath)
332
- function importWeights(cwd, importPath, replace)
389
+ module.exports = { extract } :69-69
390
+ function extract(src) → string[] :8-69
391
+ function extractBlock(src, startIndex) :36-45
392
+ function extractMembers(block) :47-57
393
+ function normalizeParams(params) :59-62
394
+ function normalizeType(type) :64-67
333
395
  ```
334
396
 
335
- ### src/config/loader.js
397
+ ### src/extractors/csharp.js
336
398
  ```
337
- module.exports = { loadConfig, loadBaseConfig }
338
- function loadBaseConfig(extendsVal, cwd)
339
- function detectAutoSrcDirs(cwd, excludeList) → string[]
340
- function _legacyDetectAutoSrcDirs(cwd, excludeList) → string[]
341
- function loadConfig(cwd) → object
342
- function deepClone(obj)
399
+ module.exports = { extract } :59-59
400
+ function extract(src) → string[] :8-59
401
+ function extractBlock(src, startIndex) :27-36
402
+ function extractMembers(block) :38-47
403
+ function normalizeParams(params) :49-52
404
+ function normalizeType(type) :54-57
343
405
  ```
344
406
 
345
- ### src/discovery/framework-detector.js
407
+ ### src/extractors/css.js
346
408
  ```
347
- module.exports = { detectFrameworks }
348
- function detectFrameworks(cwd)
349
- function _readDeps(cwd)
350
- function _readFile(p)
351
- function _existsAnywhere(cwd, filename, maxDepth)
352
- function _walkFind(dir, name, depth)
409
+ module.exports = { extract } :69-69
410
+ function extract(src) → string[] :8-17
353
411
  ```
354
412
 
355
- ### src/discovery/sigmapignore.js
413
+ ### src/extractors/dart.js
356
414
  ```
357
- module.exports = { loadIgnorePatterns, matchesIgnorePattern }
358
- function loadIgnorePatterns(cwd)
359
- function matchesIgnorePattern(dirName, patterns)
415
+ module.exports = { extract } :60-60
416
+ function extract(src) → string[] :8-60
417
+ function extractBlock(src, startIndex) :34-43
418
+ function extractMembers(block) :45-53
419
+ function normalizeParams(params) :55-57
360
420
  ```
361
421
 
362
- ### src/plan/planner.js
422
+ ### src/extractors/deps.js
363
423
  ```
364
- module.exports = { createPlan }
365
- function createPlan(goal, cwd, config)
424
+ module.exports = { extractPythonDeps, extractTSDeps, extractRDeps, buildReverseDepMap } :110-110
425
+ function extractPythonDeps(src) string[] :26-41
426
+ function extractTSDeps(src) → string[] :48-61
427
+ function extractRDeps(src) → string[] :76-90
428
+ function buildReverseDepMap(forwardMap) → Map<string, string[]> :97-108
366
429
  ```
367
430
 
368
- ### src/session/memory.js
431
+ ### src/extractors/dockerfile.js
369
432
  ```
370
- module.exports = { loadSession, saveSession, mergeSessionContext, clearSession }
371
- function sessionPath(cwd)
372
- function loadSession(cwd)
373
- function saveSession(cwd, { intent, topFiles, query })
374
- function mergeSessionContext(scores, session, currentIntent)
375
- function clearSession(cwd)
433
+ module.exports = { extract } :49-49
434
+ function extract(src) → string[] :8-47
376
435
  ```
377
436
 
378
- ### src/config/defaults.js
437
+ ### src/extractors/gdscript.js
379
438
  ```
380
- module.exports = { DEFAULTS }
439
+ module.exports = { extract } :131-131
440
+ function extract(src) → string[] :9-42
441
+ function extractInnerMembers(stripped, startIndex) :98-114
442
+ function normalizeParams(params) :116-129
381
443
  ```
382
444
 
383
- ### src/discovery/source-root-scorer.js
445
+ ### src/extractors/generic.js
384
446
  ```
385
- module.exports = { scoreCandidate, getRecentlyChangedDirs, ROOT_ENTRYPOINTS, JVM_PATH_PATTERN }
386
- function getRecentlyChangedDirs(cwd)
387
- function scoreCandidate(dirName, fullPath, context)
388
- function _countSourceFiles(dir, depth)
447
+ module.exports = { extract } :2-2
448
+ function extract(src) :14-26
389
449
  ```
390
450
 
391
- ### src/eval/usefulness-scorer.js
451
+ ### src/extractors/go.js
392
452
  ```
393
- module.exports = { scoreUsefulness, computeUsefulnessStats }
394
- function scoreUsefulness(taskResult, rankingScore)
395
- function computeUsefulnessStats(taskResults)
453
+ module.exports = { extract } :65-65
454
+ function extract(src) → string[] :8-65
455
+ function extractBlock(src, startIndex) :39-48
456
+ function extractInterfaceMethods(block) :50-58
457
+ function normalizeParams(params) :60-63
396
458
  ```
397
459
 
398
- ### src/workspace/detector.js
460
+ ### src/extractors/graphql.js
399
461
  ```
400
- module.exports = { detectWorkspaces, inferPackage, scopeToPackage }
401
- function detectWorkspaces(cwd)
402
- function inferPackage(query, workspaceDirs, cwd)
403
- function _getMatchLength(name, token)
404
- function scopeToPackage(filePath, packageDir)
462
+ module.exports = { extract } :66-66
463
+ function extract(src) → string[] :11-66
405
464
  ```
406
465
 
407
- ### src/discovery/source-root-registry.js
466
+ ### src/extractors/html.js
467
+ ```
468
+ module.exports = { extract } :39-39
469
+ function extract(src) → string[] :9-37
470
+ ```
471
+
472
+ ### src/extractors/java.js
473
+ ```
474
+ module.exports = { extract } :60-60
475
+ function extract(src) → string[] :8-60
476
+ function extractBlock(src, startIndex) :27-37
477
+ function extractMembers(block) :39-48
478
+ function normalizeParams(params) :50-53
479
+ function normalizeType(type) :55-58
480
+ ```
481
+
482
+ ### src/extractors/javascript.js
483
+ ```
484
+ module.exports = { extract } :147-147
485
+ function extract(src) → string[] :12-113
486
+ function extractBlock(src, startIndex) :88-98
487
+ function extractClassMembers(block, returnHints) :103-124
488
+ function buildReturnHints(src) :119-121
489
+ function normalizeType(type) :133-136
490
+ function formatReturnHint(type) :138-140
491
+ function normalizeParams(params) :142-145
492
+ ```
493
+
494
+ ### src/extractors/kotlin.js
495
+ ```
496
+ module.exports = { extract } :66-66
497
+ function extract(src) → string[] :8-66
498
+ function extractBlock(src, startIndex) :34-43
499
+ function extractMembers(block) :45-66
500
+ function normalizeParams(params) :57-64
501
+ ```
502
+
503
+ ### src/extractors/line-anchor.js
504
+ ```
505
+ module.exports = { lineAt, anchor, withAnchor } :52-52
506
+ function lineAt(src, idx) → number :22-29
507
+ function anchor(start, end) → string :37-39
508
+ function withAnchor(sig, start, end) → string :48-50
509
+ ```
510
+
511
+ ### src/extractors/markdown.js
512
+ ```
513
+ module.exports = { extract } :30-30
514
+ function extract(src) → string[] :10-28
515
+ ```
516
+
517
+ ### src/extractors/patterns.js
518
+ ```
519
+ module.exports = { extract } :135-135
520
+ function extract(src) → string[] :10-133
521
+ ```
522
+
523
+ ### src/extractors/php.js
524
+ ```
525
+ module.exports = { extract } :71-71
526
+ function extract(src) → string[] :8-71
527
+ function extractBlock(src, startIndex) :37-46
528
+ function extractMembers(block) :48-71
529
+ function normalizeParams(params) :61-64
530
+ function normalizeType(type) :66-69
531
+ ```
532
+
533
+ ### src/extractors/prdiff.js
534
+ ```
535
+ module.exports = { diffSignatures, extractName } :45-45
536
+ function diffSignatures(baseSigs, currentSigs) → {added:string[], removed: :9-36
537
+ function extractName(sig) :38-43
538
+ ```
539
+
540
+ ### src/extractors/properties.js
408
541
  ```
409
- module.exports = { REGISTRY }
542
+ module.exports = { extract } :37-37
543
+ function extract(src) → string[] :10-35
544
+ ```
545
+
546
+ ### src/extractors/protobuf.js
547
+ ```
548
+ module.exports = { extract } :63-63
549
+ function extract(src) → string[] :10-63
410
550
  ```
411
551
 
412
552
  ### src/extractors/python.js
413
553
  ```
414
- module.exports = { extract, tryNativeExtract }
415
- function tryNativeExtract(filePath) → string[]|null
416
- function extract(src, filePath) → string[]
417
- function extractClassMethods(stripped, startIndex)
418
- function tryExtractDataclassFields(stripped, classIndex)
419
- function tryExtractBaseModelFields(stripped, bodyStart)
420
- function extractClassConstants(stripped, startIndex)
421
- function extractReturnType(sigLine)
422
- function normalizeParams(params)
423
- function extractDocHint(src, fnName, fnSigLine)
554
+ module.exports = { extract, tryNativeExtract } :262-262
555
+ function pyBlockEnd(srcLines, startLine) → number :14-24
556
+ function tryNativeExtract(filePath) → string[]|null :32-44
557
+ function extract(src, filePath) → string[] :55-140
558
+ function extractClassMethods(stripped, startIndex) :142-161
559
+ function tryExtractDataclassFields(stripped, classIndex) :163-177
560
+ function tryExtractBaseModelFields(stripped, bodyStart) :179-194
561
+ function extractClassConstants(stripped, startIndex) :196-210
562
+ function extractReturnType(sigLine) :212-218
563
+ function normalizeParams(params) :220-238
564
+ function extractDocHint(src, fnName, fnSigLine) :240-260
424
565
  ```
425
566
 
426
567
  ### src/extractors/python_ast.py
427
568
  ```
428
- def annotation_to_str(node) # Convert an AST annotation node to a string representation
429
- def format_args(args_node) # Format a function arguments node into a compact signature st
430
- def get_decorator_names(node) # Return a list of decorator name strings for a function/class
431
- def is_dataclass(node)
432
- def is_basemodel(bases) # Check if class bases include BaseModel or BaseSettings
433
- def is_optional_annotation(annotation) # Check if an annotation represents an Optional type
434
- def get_docstring_hint(node) # Extract first sentence of docstring, if present
435
- def extract_dataclass_fields(class_node) # Return a collapsed fields string for a @dataclass class
436
- def extract_basemodel_fields(class_node) # Return a compact {required*, optional
437
- def extract_class_constants(class_node) # Yield ALL_CAPS constant assignments from class body
438
- def extract_method_sig(func_node) # Format a method signature string (already indented by caller
439
- def extract_function_sig(func_node, src_lines) # Format a top-level function signature string
440
- def extract_fastapi_routes(tree, src_lines) # Extract FastAPI route signatures from top-level decorated fu
441
- def extract(filepath)
442
- def main()
569
+ def annotation_to_str(node) :25-48 # Convert an AST annotation node to a string representation
570
+ def format_args(args_node) :51-103 # Format a function arguments node into a compact signature st
571
+ def get_decorator_names(node) :106-120 # Return a list of decorator name strings for a function/class
572
+ def is_dataclass(node) :123-124
573
+ def is_basemodel(bases) :127-133 # Check if class bases include BaseModel or BaseSettings
574
+ def is_optional_annotation(annotation) :136-146 # Check if an annotation represents an Optional type
575
+ def get_docstring_hint(node) :149-158 # Extract first sentence of docstring, if present
576
+ def extract_dataclass_fields(class_node) :161-171 # Return a collapsed fields string for a @dataclass class
577
+ def extract_basemodel_fields(class_node) :174-190 # Return a compact {required*, optional
578
+ def extract_class_constants(class_node) :193-213 # Yield ALL_CAPS constant assignments from class body
579
+ def extract_method_sig(func_node) :222-229 # Format a method signature string (already indented by caller
580
+ def extract_function_sig(func_node, src_lines) :232-241 # Format a top-level function signature string
581
+ def extract_fastapi_routes(tree, src_lines) :244-265 # Extract FastAPI route signatures from top-level decorated fu
582
+ def extract(filepath) :268-338
583
+ def main() :341-351
443
584
  ```
444
585
 
445
- ### src/discovery/source-root-resolver.js
586
+ ### src/extractors/python_dataclass.js
446
587
  ```
447
- module.exports = { resolveSourceRoots }
448
- function resolveSourceRoots(cwd, opts = {})
449
- function _detectMonorepo(cwd)
450
- function _enumerateCandidates(cwd, isMonorepo, ignorePatterns, excludeList)
451
- function _applySpecialRules(scored, cwd, primaryFw, fwEntry, frameworks)
452
- function _dedupeNested(scored)
453
- function _computeConfidence(frameworks, languages, scoredCount)
588
+ module.exports = { extract } :77-77
589
+ function extract(src) string[] :10-75
454
590
  ```
455
591
 
456
- ### src/extractors/gdscript.js
592
+ ### src/extractors/r.js
457
593
  ```
458
- module.exports = { extract }
459
- function extract(src) → string[]
460
- function extractInnerMembers(stripped, startIndex)
461
- function normalizeParams(params)
594
+ module.exports = { extract } :273-273
595
+ function extract(src) → string[] :20-117
596
+ function collectRoxygenHints(src) :125-153
597
+ function pickRoxygenLine(block, tag) :155-169
598
+ function applyHint(hints, name) :171-174
599
+ function extractListMethods(body, cap) :180-193
600
+ function inAnyRange(pos, ranges) :195-200
601
+ function readFirstStringArg(body) :203-206
602
+ function readBalancedParens(src, openIdx, cap = 16384) :214-237
603
+ function normalizeParams(raw) :244-271
462
604
  ```
463
605
 
464
- ### src/discovery/language-detector.js
606
+ ### src/extractors/ruby.js
465
607
  ```
466
- module.exports = { detectLanguages }
467
- function detectLanguages(cwd)
468
- function _walkDepth(dir, depth, extCount)
608
+ module.exports = { extract } :54-54
609
+ function extract(src) → string[] :8-38
610
+ function normalizeParams(params) :40-43
611
+ function extractReturnHint(stripped, index) :45-52
469
612
  ```
470
613
 
471
- ### src/eval/analyzer.js
614
+ ### src/extractors/rust.js
472
615
  ```
473
- module.exports = { analyzeFiles, formatAnalysisTable, formatAnalysisJSON }
474
- function isDockerfile(name)
475
- function getExtractorName(filePath)
476
- function tokenCount(sigs)
477
- function hasCoverage(filePath, cwd)
478
- function loadExtractor(name, cwd)
479
- function analyzeFiles(files, cwd, opts) → object[]
480
- function formatAnalysisTable(stats, showSlow) → string
481
- function formatAnalysisJSON(stats) → object
616
+ module.exports = { extract } :82-82
617
+ function extract(src) → string[] :8-82
618
+ function extractBlock(src, startIndex) :48-57
619
+ function extractMethods(block) :59-82
620
+ function normalizeParams(params) :69-72
621
+ function extractReturnType(afterParen) :74-82
482
622
  ```
483
623
 
484
- ### src/analysis/diagnostics.js
624
+ ### src/extractors/scala.js
485
625
  ```
486
- module.exports = { formatFileDecision, computeFileMetrics, explainInclusion, explainExclusion, estimateTokens }
487
- function estimateTokens(text)
488
- function formatFileDecision(entry, decision, reason, score = null)
489
- function computeFileMetrics(entry)
490
- function explainInclusion(fileEntries, budgetLimit)
491
- function explainExclusion(dropped, reason)
626
+ module.exports = { extract } :76-76
627
+ function extract(src) → string[] :8-76
628
+ function extractBlock(src, startIndex) :39-48
629
+ function extractMembers(block) :50-76
630
+ function normalizeParams(params) :62-69
631
+ function normalizeType(type) :71-74
492
632
  ```
493
633
 
494
- ### src/map/import-graph.js
634
+ ### src/extractors/shell.js
495
635
  ```
496
- module.exports = { analyze, extractImports, buildReverseGraph, resolveJsPath, detectCycles }
497
- function extractImports(filePath, content, fileSet)
498
- function resolveJsPath(dir, importStr, fileSet)
499
- function detectCycles(graph)
500
- function buildReverseGraph(graph)
501
- function analyze(files, cwd)
636
+ module.exports = { extract } :43-43
637
+ function extract(src) string[] :8-43
502
638
  ```
503
639
 
504
- ### src/discovery/r-manifest.js
640
+ ### src/extractors/sql.js
505
641
  ```
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>
642
+ module.exports = { extract } :93-93
643
+ function extract(src) → string[] :10-78
644
+ function _cleanName(raw) :80-82
645
+ function _normalizeParams(raw) :84-91
513
646
  ```
514
647
 
515
- ### src/extractors/deps.js
648
+ ### src/extractors/svelte.js
516
649
  ```
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[]>
650
+ module.exports = { extract } :58-58
651
+ function extract(src) → string[] :8-58
652
+ function normalizeParams(params) :48-51
653
+ function normalizeType(type) :53-56
522
654
  ```
523
655
 
524
- ### src/extractors/r.js
656
+ ### src/extractors/swift.js
657
+ ```
658
+ module.exports = { extract } :73-73
659
+ function extract(src) → string[] :8-73
660
+ function extractBlock(src, startIndex) :34-43
661
+ function extractMembers(block) :45-73
662
+ function normalizeParams(params) :56-63
663
+ function extractArrowType(str) :65-73
664
+ ```
665
+
666
+ ### src/extractors/terraform.js
667
+ ```
668
+ module.exports = { extract } :74-74
669
+ function extract(src) → string[] :11-74
670
+ ```
671
+
672
+ ### src/extractors/todos.js
673
+ ```
674
+ module.exports = { extractTodos } :26-26
675
+ function extractTodos(src) → {line:number, tag:string, :8-24
676
+ ```
677
+
678
+ ### src/extractors/toml.js
679
+ ```
680
+ module.exports = { extract } :42-42
681
+ function extract(src) → string[] :10-40
682
+ ```
683
+
684
+ ### src/extractors/typescript.js
685
+ ```
686
+ module.exports = { extract } :221-221
687
+ function extract(src) → string[] :12-117
688
+ function extractBlock(src, startIndex) :160-170
689
+ function extractInterfaceMembers(block) :174-188
690
+ function extractClassMembers(block) :195-221
691
+ function normalizeParams(params) :216-219
525
692
  ```
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)
693
+
694
+ ### src/extractors/typescript_react.js
695
+ ```
696
+ module.exports = { extract } :60-60
697
+ function extract(src) → string[] :10-20
698
+ ```
699
+
700
+ ### src/extractors/vue.js
701
+ ```
702
+ module.exports = { extract } :80-80
703
+ function extract(src) → string[] :8-35
704
+ function normalizeParams(params) :70-73
705
+ function normalizeType(type) :75-78
706
+ ```
707
+
708
+ ### src/extractors/vue_sfc.js
709
+ ```
710
+ module.exports = { extract } :99-99
711
+ function extract(src) → string[] :10-68
712
+ ```
713
+
714
+ ### src/extractors/xml.js
715
+ ```
716
+ module.exports = { extract } :46-46
717
+ function extract(src) → string[] :10-44
718
+ ```
719
+
720
+ ### src/extractors/yaml.js
721
+ ```
722
+ module.exports = { extract } :59-59
723
+ function extract(src) → string[] :8-57
724
+ ```
725
+
726
+ ### src/format/benchmark-report.js
727
+ ```
728
+ module.exports = { loadBenchmarkReports, buildBenchmarkSummary, generateBenchmarkReportHtml, writeBenchmarkReport } :438-443
729
+ function escapeHtml(value) :6-12
730
+ function formatInt(value) :14-18
731
+ function formatCompact(value) :20-26
732
+ function formatPct(value, digits = 1) :28-32
733
+ function formatMaybePct(value, digits = 1) :34-38
734
+ function formatRatio(value, digits = 1) :40-44
735
+ function formatMoney(value) :46-50
736
+ function durationLabel(ms) :52-60
737
+ function maxOrZero(values) :62-65
738
+ function readJson(filePath) :67-74
739
+ function loadBenchmarkReports(cwd) :76-86
740
+ function buildRetrievalSummary(retrieval) :88-123
741
+ function buildBenchmarkSummary(reports, matrixSummary) :125-159
742
+ function renderCard(label, value, hint, tone) :161-170
743
+ function renderProgress(label, value, max, suffix) :172-185
744
+ function renderMatrixSection(matrix) :187-211
745
+ function renderTokenSection(token) :213-239
746
+ function renderRetrievalSection(retrieval) :241-268
747
+ function renderQualitySection(quality) :270-296
748
+ function renderTaskSection(task) :298-327
749
+ function generateBenchmarkReportHtml(reports, opts = {}) :329-388
750
+ function writeBenchmarkReport(cwd, opts = {}) :426-436
751
+ ```
752
+
753
+ ### src/format/cache.js
754
+ ```
755
+ module.exports = { formatCache, formatCachePayload } :53-53
756
+ function formatCache(content) → string :19-27
757
+ function formatCachePayload(content, model) → string :37-51
758
+ ```
759
+
760
+ ### src/format/dashboard.js
761
+ ```
762
+ module.exports = { generateDashboardHtml, renderHistoryCharts, computeExtractorCoverage, percentile, overBudgetStreak } :525-525
763
+ function toNumber(v) :13-16
764
+ function percentile(values, p) :18-30
765
+ function overBudgetStreak(entries) :32-40
766
+ function loadConfig(cwd) :42-50
767
+ function shouldExclude(rel, excludeSet) :52-59
768
+ function detectLanguage(filePath) :61-86
769
+ function walkFiles(dir, maxDepth, depth, out, excludeSet) :88-106
770
+ function computeExtractorCoverage(cwd) :108-140
771
+ function readBenchmarkTrend(cwd) :142-204
772
+ function lineChartSvg(values, title, ySuffix) :206-255
773
+ function barChartSvg(perLanguage) :257-292
774
+ function sparkline(values) :294-305
775
+ function escapeAttr(s) :307-311
776
+ function readTokenReduction(cwd) :316-350
777
+ function tokenReductionPanelHtml(tr) :352-405
778
+ function buildDashboardData(cwd, health) :407-444
779
+ function generateDashboardHtml(cwd, health) :446-496
780
+ function renderHistoryCharts(cwd, health) :498-523
781
+ ```
782
+
783
+ ### src/format/llm-txt.js
784
+ ```
785
+ module.exports = { format, outputPath } :3-3
786
+ function outputPath(cwd) :5-5
787
+ function format(context, cwd, version) :7-28
788
+ ```
789
+
790
+ ### src/format/llms-txt.js
791
+ ```
792
+ module.exports = { format, outputPath } :5-5
793
+ function outputPath(cwd) :7-7
794
+ function getShortCommit(cwd) :9-12
795
+ function detectVersion(cwd) :14-20
796
+ function format(context, cwd, writtenFiles, sigmapVersion) :22-70
797
+ ```
798
+
799
+ ### src/format/verify-report.js
800
+ ```
801
+ module.exports = { renderReportHtml, renderReportMarkdown, escapeHtml } :164-164
802
+ function escapeHtml(value) :23-29
803
+ function toneFor(issue) :31-35
804
+ function labelFor(issue) :37-39
805
+ function renderReportHtml(result, opts = {}) → string :48-115
806
+ function renderReportMarkdown(result) :144-162
536
807
  ```
537
808
 
538
809
  ### src/graph/builder.js
539
810
  ```
540
- module.exports = { build, buildFromCwd, extractFileDeps, normalizePath }
541
- function normalizePath(p)
542
- function resolveJsPath(dir, importStr, fileSet) → string|null
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
547
- function buildFromCwd(cwd, opts) → { forward: Map<string,str
811
+ module.exports = { build, buildFromCwd, extractFileDeps, normalizePath } :386-386
812
+ function normalizePath(p) :17-19
813
+ function resolveJsPath(dir, importStr, fileSet) → string|null :40-54
814
+ function escapeRegex(s) :61-63
815
+ function resolveRPath(dir, importStr, fileSet, cwd) :65-80
816
+ function extractFileDeps(filePath, content, fileSet, cwd, ctx) → string[] :94-239
817
+ function build(files, cwd, ctx) → { forward: Map<string,str :283-318
818
+ function buildFromCwd(cwd, opts) → { forward: Map<string,str :330-384
548
819
  ```
549
820
 
550
821
  ### src/graph/impact.js
551
822
  ```
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
823
+ module.exports = { getImpact, analyzeImpact, formatImpact, formatImpactJSON } :240-240
824
+ function normalizePath(p) :16-18
825
+ function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr :33-70
826
+ function isTestFile(f) :92-92
827
+ function isRouteFile(f) :93-93
828
+ function getImpact(changedFile, graph, opts) → { * changed: string, * di :116-142
829
+ function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o :156-171
830
+ function formatImpact(result) → string :183-221
831
+ function formatImpactJSON(result) → object :229-238
561
832
  ```
562
833
 
563
- ### src/mcp/server.js
834
+ ### src/health/scorer.js
564
835
  ```
565
- module.exports = { start }
566
- function respond(id, result)
567
- function respondError(id, code, message)
568
- function dispatch(msg, cwd)
569
- function start(cwd)
836
+ module.exports = { score } :152-152
837
+ function score(cwd) → { * score: number, * grad :30-150
570
838
  ```
571
839
 
572
- ### src/mcp/handlers.js
840
+ ### src/judge/judge-engine.js
841
+ ```
842
+ module.exports = { groundedness, judge } :122-122
843
+ function tokenize(text) :14-16
844
+ function groundedness(response, context) :18-26
845
+ function extractContextFiles(context, cwd) :37-59
846
+ function judge(response, context, opts = {}) :61-120
573
847
  ```
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)
848
+
849
+ ### src/learning/weights.js
850
+ ```
851
+ module.exports = { BASELINE, DECAY, MAX_MULT, MIN_MULT, weightsPath, clampMultiplier, normalizeFile, loadWeights, saveWeights, updateWeights, boostFiles, penalizeFiles, resetWeights, exportWeights, importWeights } :154-170
852
+ function weightsPath(cwd) :11-13
853
+ function clampMultiplier(value) :15-20
854
+ function normalizeFile(cwd, filePath) :22-31
855
+ function sanitizeWeights(cwd, weights) :33-46
856
+ function loadWeights(cwd) :48-55
857
+ function saveWeights(cwd, weights) :57-76
858
+ function updateWeights(cwd, opts = {}) :78-109
859
+ function boostFiles(cwd, files, amount = 0.15) :111-113
860
+ function penalizeFiles(cwd, files, amount = 0.10) :115-117
861
+ function resetWeights(cwd) :119-122
862
+ function exportWeights(cwd, outputPath) :124-134
863
+ function importWeights(cwd, importPath, replace) :136-152
864
+ ```
865
+
866
+ ### src/map/class-hierarchy.js
867
+ ```
868
+ module.exports = { analyze } :117-117
869
+ function analyze(files, cwd) :16-117
870
+ ```
871
+
872
+ ### src/map/import-graph.js
873
+ ```
874
+ module.exports = { analyze, extractImports, buildReverseGraph, resolveJsPath, detectCycles } :185-185
875
+ function extractImports(filePath, content, fileSet) :22-76
876
+ function resolveJsPath(dir, importStr, fileSet) :78-95
877
+ function detectCycles(graph) :100-126
878
+ function buildReverseGraph(graph) :131-140
879
+ function analyze(files, cwd) :145-183
880
+ ```
881
+
882
+ ### src/map/route-table.js
883
+ ```
884
+ module.exports = { analyze } :127-127
885
+ function shouldSkipFile(rel) :18-21
886
+ function analyze(files, cwd) :23-125
887
+ ```
888
+
889
+ ### src/plan/planner.js
890
+ ```
891
+ module.exports = { createPlan } :10-10
892
+ function createPlan(goal, cwd, config) :12-65
585
893
  ```
586
894
 
587
895
  ### src/retrieval/ranker.js
588
896
  ```
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)
897
+ module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, detectIntent } :556-556
898
+ function _computePenalty(filePath) :61-68
899
+ function _computeHubs(graph) :71-82
900
+ function _isHub(filePath) :85-89
901
+ function scoreFile(filePath, sigs, queryTokens, weights) → { score: number, signals: :100-157
902
+ function rank(query, sigIndex, opts) → { file: string, score: nu :173-294
903
+ function _parseContextFile(contextPath) → Map<string, string[]> :330-362
904
+ function _mergeSigIndex(target, source) :365-373
905
+ function _buildSigIndexFromCache(cwd) → Map<string, string[]> :380-400
906
+ function _enrichSigIndexFromStrategy(cwd, index) → Map<string, string[]> :408-414
907
+ function buildSigIndex(cwd, opts) → Map<string, string[]> :431-464
908
+ function formatRankTable(results, query) → string :473-509
909
+ function formatRankJSON(results, query) → object :518-533
910
+ function detectIntent(query) :548-554
911
+ ```
912
+
913
+ ### src/retrieval/tokenizer.js
914
+ ```
915
+ module.exports = { tokenize, STOP_WORDS } :54-54
916
+ function tokenize(text, opts) → string[] :31-52
917
+ ```
918
+
919
+ ### src/routing/classifier.js
920
+ ```
921
+ module.exports = { classify, classifyAll } :102-102
922
+ function classify(filePath, sigs) → 'fast'|'balanced'|'powerf :15-83
923
+ function classifyAll(fileEntries, cwd) → { fast: string[], balance :92-100
924
+ ```
925
+
926
+ ### src/routing/hints.js
927
+ ```
928
+ module.exports = { TIERS, formatRoutingSection } :103-103
929
+ function formatRoutingSection(groups) → string :66-101
930
+ ```
931
+
932
+ ### src/security/patterns.js
933
+ ```
934
+ module.exports = { PATTERNS } :51-51
935
+ ```
936
+
937
+ ### src/security/scanner.js
938
+ ```
939
+ module.exports = { scan } :36-36
940
+ function scan(signatures, filePath) → { safe: string[], redacte :14-34
941
+ ```
942
+
943
+ ### src/session/memory.js
944
+ ```
945
+ module.exports = { loadSession, saveSession, mergeSessionContext, clearSession } :6-6
946
+ function sessionPath(cwd) :10-12
947
+ function loadSession(cwd) :14-24
948
+ function saveSession(cwd, { intent, topFiles, query }) :26-35
949
+ function mergeSessionContext(scores, session, currentIntent) :40-51
950
+ function clearSession(cwd) :53-56
951
+ ```
952
+
953
+ ### src/tracking/logger.js
954
+ ```
955
+ module.exports = { logRun, readLog, summarize } :115-115
956
+ function logRun(entry, cwd) :27-52
957
+ function readLog(cwd) → object[] :59-74
958
+ function summarize(entries) → object :81-113
959
+ ```
960
+
961
+ ### src/verify/closest-match.js
962
+ ```
963
+ module.exports = { levenshtein, closestMatch, buildSymbolCandidates, suggestionConfidence, formatSuggestion } :139-145
964
+ function levenshtein(a, b, max = Infinity) :20-47
965
+ function suggestionConfidence(distance, targetLen) :50-55
966
+ function closestMatch(target, candidates, opts = {}) → { name, file, line, dista :67-98
967
+ function buildSymbolCandidates(sigIndex) :104-126
968
+ function formatSuggestion(match, asCall) :129-137
969
+ ```
970
+
971
+ ### src/verify/hallucination-guard.js
972
+ ```
973
+ module.exports = { verify, buildSymbolSet, loadDeps, loadScripts, isTestPath } :310-310
974
+ function isTestPath(p) :28-28
975
+ function buildSymbolSet(cwd) :66-84
976
+ function loadDeps(cwd) :87-100
977
+ function loadScripts(cwd) :103-112
978
+ function defaultFileExists(cwd, ref) :115-123
979
+ function defaultRelativeResolvable(cwd, mod, fileBasenames) :126-143
980
+ function verify(answerText, cwd, opts = {}) → { issues: object[], summa :167-286
981
+ ```
982
+
983
+ ### src/verify/parsers.js
984
+ ```
985
+ module.exports = { extractCodeBlocks, extractFilePaths, extractImports, extractSymbols, extractNpmScripts } :194-200
986
+ function extractCodeBlocks(text) → { lang: string, content: :29-53
987
+ function extractFilePaths(text) → { path: string, line: num :62-80
988
+ function extractImports(text) → { module: string, kind: ' :87-142
989
+ function extractNpmScripts(text) → { name: string, line: num :151-167
990
+ function extractSymbols(text) → { name: string, line: num :175-192
991
+ ```
992
+
993
+ ### src/workspace/detector.js
994
+ ```
995
+ module.exports = { detectWorkspaces, inferPackage, scopeToPackage } :4-4
996
+ function detectWorkspaces(cwd) :6-36
997
+ function inferPackage(query, workspaceDirs, cwd) :39-61
998
+ function _getMatchLength(name, token) :63-68
999
+ function scopeToPackage(filePath, packageDir) :71-85
603
1000
  ```