sigmap 8.28.1 → 8.30.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
@@ -28,23 +28,63 @@ low-priority files rather than collapsing signatures to bare line anchors.
28
28
 
29
29
  Always run `sigmap ask` (or `sigmap --query`) before searching for files relevant to a task.
30
30
 
31
- ## deps
32
- ```
33
- src/extractors/python_ast.py ast
34
- ```
35
-
36
- ## changes (last 5 commits — 0 seconds ago)
37
- ```
38
- src/extractors/csharp.js ~extract ~extractMembers
39
- src/extractors/dart.js ~extract ~extractMembers
40
- src/extractors/go.js ~extract ~extractInterfaceMethods
41
- src/extractors/java.js ~extract ~extractMembers
42
- src/extractors/kotlin.js ~extract ~extractMembers
43
- src/extractors/php.js ~extract ~extractMembers
44
- src/extractors/rust.js ~extract ~extractMethods ~extractReturnType
45
- src/extractors/scala.js ~extract ~extractMembers
46
- src/extractors/swift.js ~extract ~extractMembers ~extractArrowType
47
- src/evidence/pack.js +riskFactorsFor ~parseAnchor ~buildEvidencePack ~formatMarkdown
31
+ ## todos
32
+ ```
33
+ gen-context.js:22350 # TODO: s');
34
+ ```
35
+
36
+ ## changes (last 5 commits — 10 days ago)
37
+ ```
38
+ src/graph/builder.js ~extractFileDeps
39
+ src/retrieval/ranker.js ~_buildSigIndexFromCache ~_enrichSigIndexFromStrategy
40
+ gen-context.js +whose +extractClassMembers +stripComments +maskCode
41
+ src/extractors/javascript.js +whose +extractClassMembers ~whose ~extractClassMembers
42
+ src/extractors/scan.js +stripComments +maskCode +readBalanced
43
+ src/extractors/typescript.js +extractClassMembers ~extractClassMembers ~extract ~extractBlock
44
+ src/verify/arity.js +exist +cleanSig +parseParams +buildArityIndex
45
+ src/verify/hallucination-guard.js +whose ~buildSymbolSet ~verify
46
+ ```
47
+
48
+ ## .
49
+
50
+ ### gen-context.js
51
+ ```
52
+ function __require(key) :9-20
53
+ function __git(args, opts = {}) :21630-21633
54
+ function __tryGit(args, opts = {}) :21634-21637
55
+ function requireSourceOrBundled(key) :21642-21649
56
+ function isDockerfile(filename) :21695-21697
57
+ function loadIgnorePatterns(cwd) :21702-21715
58
+ function matchesIgnore(relPath, patterns) :21717-21738
59
+ function walkDir(dir, exclude, maxDepth, depth = 0) :21743-21766
60
+ function buildFileList(cwd, config) :21768-21779
61
+ function collectTestEntries(cwd, config, existing) :21790-21816 # Source files a project declares as its own entrypoints in pa
62
+ function declaredEntrypoints(cwd, config, existing) :21818-21838
63
+ function getExtractor(name) :21844-21854
64
+ function detectAndExtract(filePath, content, maxSigsPerFile) :21856-21874
65
+ function extractFileDeps(filePath, content, config) → string[] :21876-21886 # Extract absolute dependency paths from a single file
66
+ function extractSignatureName(sig) :21888-21892
67
+ function annotateCoverage(sigs, testIndex, enabled) :21894-21904
68
+ function nextRecentMtime() :21925-21927
69
+ function estimateTokens(str) → number :21929-21931 # Estimate token count from character count (chars/4, ±5%)
70
+ function isTestFile(filePath) :21933-21935
71
+ function isConfigFile(filePath) :21937-21940
72
+ function isGeneratedFile(filePath) :21942-21944
73
+ function isMockFile(filePath) :21946-21951
74
+ function computeEffectiveMaxTokens(fileEntries, config) → number :21968-22006 # Compute the effective token budget based on repo size and co
75
+ function applyTokenBudget(fileEntries, maxTokens) :22008-22076
76
+ function getRecentlyCommittedFiles(cwd, count) :22107-22115
77
+ … +45 more signatures
78
+ ```
79
+
80
+ ### gen-project-map.js
81
+ ```
82
+ function detectInvokedAs() :27-37
83
+ function walkDir(dir, excludeSet, maxDepth, depth, results) :77-90
84
+ function buildFileList(cwd, srcDirs, exclude, maxDepth) :92-103
85
+ function runAnalyzer(name, files, cwd) :108-116
86
+ function formatOutput(sections) :121-151
87
+ function main() :156-191
48
88
  ```
49
89
 
50
90
  ## packages
@@ -52,106 +92,60 @@ src/evidence/pack.js +riskFactorsFor ~parseAnchor ~bu
52
92
  ### packages/adapters/claude.js
53
93
  ```
54
94
  module.exports = { name, format, outputPath, write } :124-124
55
- function format(context, opts = {}) → string :58-69
95
+ function format(context, opts = {}) → string :58-69 # Format context suited for CLAUDE
56
96
  function _confidenceMeta(opts) :71-78
57
- function outputPath(cwd) → string :85-87
58
- function write(context, cwd, opts = {}) :96-122
97
+ function outputPath(cwd) → string :85-87 # Return the output file path for this adapter
98
+ function write(context, cwd, opts = {}) :96-122 # Write signatures into CLAUDE
59
99
  ```
60
100
 
61
101
  ### packages/adapters/codex.js
62
102
  ```
63
103
  module.exports = { name, format, outputPath, write } :74-74
64
- function format(context, opts = {}) → string :27-30
65
- function outputPath(cwd) → string :37-39
66
- function write(context, cwd, opts = {}) :49-72
104
+ function format(context, opts = {}) → string :27-30 # Format context for AGENTS
105
+ function outputPath(cwd) → string :37-39 # Return the output file path for this adapter
106
+ function write(context, cwd, opts = {}) :49-72 # Write signatures into AGENTS
67
107
  ```
68
108
 
69
109
  ### packages/adapters/copilot.js
70
110
  ```
71
111
  module.exports = { name, format, outputPath, write } :93-93
72
- function format(context, opts = {}) → string :25-40
112
+ function format(context, opts = {}) → string :25-40 # Format context for GitHub Copilot instructions
73
113
  function _confidenceMeta(opts) :42-49
74
- function outputPath(cwd) → string :56-58
75
- function write(context, cwd, opts = {}) :68-91
114
+ function outputPath(cwd) → string :56-58 # Return the output file path for this adapter
115
+ function write(context, cwd, opts = {}) :68-91 # Write signatures into copilot-instructions
76
116
  ```
77
117
 
78
118
  ### packages/adapters/cursor.js
79
119
  ```
80
120
  module.exports = { name, format, outputPath } :56-56
81
- function format(context, opts = {}) → string :23-36
121
+ function format(context, opts = {}) → string :23-36 # Format context for Cursor rules file
82
122
  function _confidenceMeta(opts) :38-45
83
- function outputPath(cwd) → string :52-54
123
+ function outputPath(cwd) → string :52-54 # Return the output file path for this adapter
84
124
  ```
85
125
 
86
126
  ### packages/adapters/gemini.js
87
127
  ```
88
128
  module.exports = { name, format, outputPath, write } :104-104
89
- function format(context, opts = {}) → string :31-51
90
- function outputPath(cwd) → string :58-60
91
- function write(context, cwd, opts = {}) :70-93
129
+ function format(context, opts = {}) → string :31-51 # Format context as a Gemini system instruction
130
+ function outputPath(cwd) → string :58-60 # Return the output file path for this adapter
131
+ function write(context, cwd, opts = {}) :70-93 # Write signatures into gemini-context
92
132
  function _confidenceMeta(opts) :95-102
93
133
  ```
94
134
 
95
- ### packages/adapters/index.js
96
- ```
97
- module.exports = { getAdapter, listAdapters, adapt, outputsToAdapters } :81-81
98
- function getAdapter(name) → { name: string, format: F :26-38
99
- function listAdapters() → string[] :44-46
100
- function adapt(context, adapterName, opts = {}) → string :55-64
101
- function outputsToAdapters(outputs) → string[] :72-79
102
- ```
103
-
104
- ### packages/adapters/llm-full.js
105
- ```
106
- module.exports = { name: 'llm-full', format, outputPath, write } :4-4
107
- function outputPath(cwd) :6-6
108
- function format(context, opts) :8-20
109
- function write(context, cwd, opts) :22-25
110
- ```
111
-
112
135
  ### packages/adapters/openai.js
113
136
  ```
114
137
  module.exports = { name, format, outputPath } :70-70
115
- function format(context, opts = {}) → string :29-49
116
- function outputPath(cwd) → string :57-59
138
+ function format(context, opts = {}) → string :29-49 # Format context as an OpenAI system prompt
139
+ function outputPath(cwd) → string :57-59 # Return the output file path for this adapter
117
140
  function _confidenceMeta(opts) :61-68
118
141
  ```
119
142
 
120
- ### packages/adapters/willow.js
121
- ```
122
- module.exports = { name, format, outputPath, write } :200-200
123
- function format(context, opts = {}) → string :36-40
124
- function outputPath(cwd) → string :47-49
125
- function generateAtomId(filepath) → string :57-63
126
- async function fetchWithTimeout(url, opts, timeoutMs) → Promise<Response> :72-80
127
- async function postAtomWithRetry(atom, mcpUrl, timeoutMs, maxRetries) → Promise<boolean> :90-142
128
- async function write(context, cwd, opts = {}) → Promise<void> :155-198
129
- ```
130
-
131
143
  ### packages/adapters/windsurf.js
132
144
  ```
133
145
  module.exports = { name, format, outputPath } :56-56
134
- function format(context, opts = {}) → string :23-36
146
+ function format(context, opts = {}) → string :23-36 # Format context for Windsurf rules file
135
147
  function _confidenceMeta(opts) :38-45
136
- function outputPath(cwd) → string :52-54
137
- ```
138
-
139
- ### packages/cli/index.js
140
- ```
141
- module.exports = { CLI_ENTRY, run } :58-63
142
- function run(argv, cwd) → void :36-56
143
- ```
144
-
145
- ### packages/core/index.js
146
- ```
147
- module.exports = { extract, rank, buildSigIndex, scan, score, adapt } :254-267
148
- function _resolveExtractor(language) :64-71
149
- function extract(src, language) → string[] :91-120
150
- function rank(query, sigIndex, opts) → { file: string, score: nu :143-150
151
- function buildSigIndex(cwd) → Map<string, string[]> :162-169
152
- function scan(sigs, filePath) → { safe: string[], redacte :185-192
153
- function score(cwd) → { * score: number, * grad :215-222
154
- function adapt(context, adapterName, opts = {}) → string :241-249
148
+ function outputPath(cwd) → string :52-54 # Return the output file path for this adapter
155
149
  ```
156
150
 
157
151
  ### packages/core/README.md
@@ -176,128 +170,52 @@ code-fence ---
176
170
 
177
171
  ## src
178
172
 
179
- ### src/config/defaults.js
180
- ```
181
- module.exports = { DEFAULTS } :165-165
182
- ```
183
-
184
- ### src/extractors/csharp.js
185
- ```
186
- module.exports = { extract } :71-71
187
- function extract(src) → string[] :12-71
188
- function extractBlock(src, startIndex) :35-44
189
- function extractMembers(block) :46-59
190
- function normalizeParams(params) :61-64
191
- function normalizeType(type) :66-69
192
- ```
193
-
194
- ### src/extractors/dart.js
195
- ```
196
- module.exports = { extract } :84-84
197
- function extract(src) → string[] :12-84
198
- function extractBlock(src, startIndex) :54-63
199
- function extractMembers(block) :65-77
200
- function normalizeParams(params) :79-81
201
- ```
202
-
203
- ### src/extractors/go.js
204
- ```
205
- module.exports = { extract } :81-81
206
- function extract(src) → string[] :12-81
207
- function extractBlock(src, startIndex) :51-60
208
- function extractInterfaceMethods(block) :62-74
209
- function normalizeParams(params) :76-79
210
- ```
211
-
212
- ### src/extractors/java.js
213
- ```
214
- module.exports = { extract } :71-71
215
- function extract(src) → string[] :12-71
216
- function extractBlock(src, startIndex) :34-44
217
- function extractMembers(block) :46-59
218
- function normalizeParams(params) :61-64
219
- function normalizeType(type) :66-69
220
- ```
221
-
222
- ### src/extractors/kotlin.js
223
- ```
224
- module.exports = { extract } :90-90
225
- function extract(src) → string[] :12-90
226
- function extractBlock(src, startIndex) :54-63
227
- function extractMembers(block) :65-90
228
- function normalizeParams(params) :81-88
229
- ```
230
-
231
- ### src/extractors/php.js
232
- ```
233
- module.exports = { extract } :96-96
234
- function extract(src) → string[] :12-96
235
- function extractBlock(src, startIndex) :58-67
236
- function extractMembers(block) :69-96
237
- function normalizeParams(params) :86-89
238
- function normalizeType(type) :91-94
239
- ```
240
-
241
- ### src/extractors/rust.js
242
- ```
243
- module.exports = { extract } :110-110
244
- function extract(src) → string[] :12-110
245
- function extractBlock(src, startIndex) :72-81
246
- function extractMethods(block) :83-110
247
- function normalizeParams(params) :97-100
248
- function extractReturnType(afterParen) :102-110
249
- ```
250
-
251
- ### src/extractors/scala.js
252
- ```
253
- module.exports = { extract } :88-88
254
- function extract(src) → string[] :12-88
255
- function extractBlock(src, startIndex) :47-56
256
- function extractMembers(block) :58-88
257
- function normalizeParams(params) :74-81
258
- function normalizeType(type) :83-86
259
- ```
260
-
261
- ### src/extractors/swift.js
173
+ ### src/graph/builder.js
262
174
  ```
263
- module.exports = { extract } :97-97
264
- function extract(src) → string[] :12-97
265
- function extractBlock(src, startIndex) :54-63
266
- function extractMembers(block) :65-97
267
- function normalizeParams(params) :80-87
268
- function extractArrowType(str) :89-97
175
+ module.exports = { build, buildFromCwd, extractFileDeps, normalizePath, loadAliasMap, resolveAlias } :503-503
176
+ function normalizePath(p) :18-20
177
+ function probeJs(base, fileSet) → string|null :41-54 # Probe an absolute base path for a JS/TS module file in fileS
178
+ function resolveJsPath(dir, importStr, fileSet) → string|null :63-65 # Resolve a JS/TS relative import string to an absolute path i
179
+ function stripJsonc(src) :71-85 # Strip comments and trailing commas so a tsconfig/jsconfig (J
180
+ function loadAliasMap(cwd) → { baseUrl: string|null, e :97-118 # Load the JS/TS path-alias map from tsconfig
181
+ function resolveAlias(spec, aliasMap, fileSet) → string|null :127-151 # Resolve a non-relative JS/TS import specifier through the al
182
+ function escapeRegex(s) :158-160 # Resolve an R `source(
183
+ function resolveRPath(dir, importStr, fileSet, cwd) :162-177
184
+ function extractFileDeps(filePath, content, fileSet, cwd, ctx) → string[] :191-287 # Extract absolute dependency paths from a single file
185
+ function build(files, cwd, ctx) → { forward: Map<string,str :396-435 # Build a forward and reverse dependency graph for all given f
186
+ function buildFromCwd(cwd, opts) → { forward: Map<string,str :447-501 # Build a dependency graph scoped to a single cwd by walking a
269
187
  ```
270
188
 
271
189
  ### src/mcp/server.js
272
190
  ```
273
- module.exports = { start } :141-141
191
+ module.exports = { start } :142-142
274
192
  function respond(id, result) :28-30
275
193
  function respondError(id, code, message) :32-36
276
- function dispatch(msg, cwd) :41-108
277
- function start(cwd) :113-139
278
- ```
279
-
280
- ### src/retrieval/enrich-from-maps.js
281
- ```
282
- module.exports = { enrichWithSurfaces } :55-55
283
- function enrichWithSurfaces(index, cwd) → number :25-53
194
+ function dispatch(msg, cwd) :41-109
195
+ function start(cwd) :114-140
284
196
  ```
285
197
 
286
- ### src/analysis/coverage-score.js
287
- ```
288
- module.exports = { coverageScore, CODE_EXTS } :105-105
289
- function coverageScore(cwd, fileEntries, config) :41-90
290
- function _walk(dir, excludeSet, out) :92-103
291
- ```
292
-
293
- ### src/analysis/diagnostics.js
198
+ ### src/retrieval/ranker.js
294
199
  ```
295
- module.exports = { formatFileDecision, computeFileMetrics, explainInclusion, explainExclusion, estimateTokens } :80-86
296
- function estimateTokens(text) :14-16
297
- function formatFileDecision(entry, decision, reason, score = null) :18-26
298
- function computeFileMetrics(entry) :28-41
299
- function explainInclusion(fileEntries, budgetLimit) :43-74
300
- function explainExclusion(dropped, reason) :76-78
200
+ module.exports = { rank, buildSigIndex, scoreFile, _queryWants, detectIntents, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, CENTRALITY_BLEND_WEIGHT, detectIntent } :760-760
201
+ function _queryWants(queryTokens) :85-92 # Which penalised categories the query is explicitly asking fo
202
+ function _computePenalty(filePath, wants) :94-108
203
+ function _computeHubs(graph) :111-122
204
+ function _graphKeys(p) :129-133
205
+ function _graphGet(map, absPath) :134-140
206
+ function _registerKeys(map, absPath, value) :141-143
207
+ function _isHub(filePath) :145-149
208
+ function scoreFile(filePath, sigs, queryTokens, weights, wants) → { score: number, signals: :160-221 # Score a single file against a query, returning detailed sign
209
+ function rank(query, sigIndex, opts) → { file: string, score: nu :241-331 # Rank all files in a signature index against a query
210
+ function _parseContextFile(contextPath) → Map<string, string[]> :478-510 # Parse a single context file into a Map<filePath, string[]>
211
+ function _mergeSigIndex(target, source) :513-521 # Merge source index into target; prefer non-empty sig lists
212
+ function _buildSigIndexFromCache(cwd) → Map<string, string[]> :528-548 # Load signatures from
213
+ function _enrichSigIndexFromStrategy(cwd, index) → Map<string, string[]> :556-587 # Hot-cold and per-module strategies store most signatures out
214
+ function buildSigIndex(cwd, opts) → Map<string, string[]> :604-637 # Build a signature index from the generated context file
215
+ function formatRankTable(results, query) → string :646-682 # Format ranked results as a markdown table string
216
+ function formatRankJSON(results, query) → object :691-706 # Format ranked results as a structured JSON-serialisable obje
217
+ function detectIntents(query) → string[] :739-753 # Every intent whose pattern matches, strongest first
218
+ function detectIntent(query) :756-758 # Primary intent
301
219
  ```
302
220
 
303
221
  ### src/cache/freshen.js
@@ -305,91 +223,97 @@ function explainExclusion(dropped, reason) :76-78
305
223
  module.exports = { freshen } :123-123
306
224
  function _readConfig(cwd) :35-40
307
225
  function _pkgVersion(cwd) :42-45
308
- function _contextMtime(cwd) :48-54
226
+ function _contextMtime(cwd) :48-54 # Newest mtime among existing generated context files, or 0 if
309
227
  function _walk(dir, exclude, out, depth, maxDepth) :56-66
310
- function freshen(cwd, opts = {}) → number :74-121
228
+ function freshen(cwd, opts = {}) → number :74-121 # Re-extract source files changed since the last generate; dro
311
229
  ```
312
230
 
313
- ### src/cache/sig-cache.js
231
+ ### src/config/defaults.js
314
232
  ```
315
- module.exports = { loadCache, saveCache, getChangedFiles, updateCacheEntries } :105-105
316
- function cachePath(cwd) :19-21
317
- function loadCache(cwd, currentVersion) → Map<string, { mtime: numb :32-42
318
- function saveCache(cwd, currentVersion, cache) :51-61
319
- function getChangedFiles(files, cache) → { changed: string[], unch :71-88
320
- function updateCacheEntries(cache, extracted) :96-103
233
+ module.exports = { DEFAULTS } :175-175
321
234
  ```
322
235
 
323
236
  ### src/config/loader.js
324
237
  ```
325
238
  module.exports = { loadConfig, loadBaseConfig } :313-313
326
- function loadBaseConfig(extendsVal, cwd) :9-54
327
- function detectAutoSrcDirs(cwd, excludeList) → string[] :99-114
328
- function _legacyDetectAutoSrcDirs(cwd, excludeList) → string[] :123-225
329
- function loadConfig(cwd) → object :236-307
239
+ function loadBaseConfig(extendsVal, cwd) :9-64
240
+ function detectAutoSrcDirs(cwd, excludeList) → string[] :99-114 # Detect source directories for the given project root
241
+ function _legacyDetectAutoSrcDirs(cwd, excludeList) → string[] :123-218 # Legacy source directory detection (fallback)
242
+ function loadConfig(cwd) → object :236-307 # Load and merge configuration for a given working directory
330
243
  function deepClone(obj) :309-311
331
244
  ```
332
245
 
246
+ ### src/config/tune.js
247
+ ```
248
+ module.exports = { buildTuneProposal, applyTuneProposal, formatTuneProposal, JUNK_DIRS, TOKENS_PER_FILE } :210-210
249
+ function _readUserConfig(cwd) :45-51 # Raw user config file content, or null when absent/unparsable
250
+ function _countSourceFiles(cwd, roots, exclude, depth = 5) :54-72 # Count source files under `roots` (relative to cwd), depth-ca
251
+ function _monorepoMarker(cwd) :75-84 # The workspace marker present at cwd, or null
252
+ function buildTuneProposal(cwd) → { changes: Array<{key:str :94-176 # Build the recommended config diff for a repo
253
+ function applyTuneProposal(cwd, proposal) → { path: string, applied: :184-190 # Merge a proposal's changes into gen-context
254
+ function formatTuneProposal(proposal) :193-208 # Human rendering of a proposal (one block per change, reason
255
+ ```
256
+
333
257
  ### src/conventions/ci.js
334
258
  ```
335
259
  module.exports = { ciGate, DEFAULT_MIN } :48-48
336
- function ciGate(result, opts = {}, prior = null) → { score:number, min:numbe :25-46
260
+ function ciGate(result, opts = {}, prior = null) → { score:number, min:numbe :25-46 # Evaluate the consistency gate
337
261
  ```
338
262
 
339
263
  ### src/conventions/conflicts.js
340
264
  ```
341
265
  module.exports = { analyzeConflicts, toNamingStyle, renameSuggestion } :111-111
342
- function _splitName(filename) :13-18
343
- function _words(stem) :21-29
344
- function toNamingStyle(stem, style) → string :39-49
345
- function renameSuggestion(filename, dominantStyle) :52-56
346
- function analyzeConflicts(result) → { hasConflicts: boolean, :72-109
266
+ function _splitName(filename) :13-18 # Split a file name into its stem (before the first dot) and t
267
+ function _words(stem) :21-29 # Break a stem into lowercase word parts regardless of its cur
268
+ function toNamingStyle(stem, style) → string :39-49 # Convert a file stem to a target naming style
269
+ function renameSuggestion(filename, dominantStyle) :52-56 # Rename suggestion to bring a file to the dominant naming sty
270
+ function analyzeConflicts(result) → { hasConflicts: boolean, :72-109 # Analyze an `extractConventions` result for conflicts
347
271
  ```
348
272
 
349
273
  ### src/conventions/extract.js
350
274
  ```
351
275
  module.exports = { classifyNaming, scoreConvention, extractConventions } :188-188
352
- function classifyNaming(basename) → 'PascalCase'|'camelCase'| :40-51
353
- function scoreConvention(labels, refs) → { dominant: string|null, :65-103
354
- function _jsExportStyle(src) :106-188
355
- function _detectTestFramework(cwd, files) :122-150
356
- function extractConventions(cwd, files) → { fileNaming: object, exp :159-186
276
+ function classifyNaming(basename) → 'PascalCase'|'camelCase'| :40-51 # Classify a file's base name (without extension) into a namin
277
+ function scoreConvention(labels, refs) → { dominant: string|null, :65-103 # Score a set of categorical observations into a dominant conv
278
+ function _jsExportStyle(src) :106-188 # Detect JS/TS export style for a single file's source
279
+ function _detectTestFramework(cwd, files) :122-150 # Detect the test framework in use from manifests + source heu
280
+ function extractConventions(cwd, files) → { fileNaming: object, exp :159-186 # Extract repo coding conventions for the scoped languages (TS
357
281
  ```
358
282
 
359
283
  ### src/conventions/fix.js
360
284
  ```
361
285
  module.exports = { buildFixList } :61-61
362
- function _renamePath(relPath, style) :24-31
363
- function buildFixList(cwd, files, conventions) → { dominant: string|null, :40-59
286
+ function _renamePath(relPath, style) :24-31 # Rename a file path's basename to the target naming style (ke
287
+ function buildFixList(cwd, files, conventions) → { dominant: string|null, :40-59 # Build the exhaustive rename checklist for the dominant file-
364
288
  ```
365
289
 
366
290
  ### src/conventions/inject.js
367
291
  ```
368
292
  module.exports = { renderConventionsBlock, injectConventions, START, END } :98-98
369
293
  function _conventionLine(label, conv) :29-38
370
- function renderConventionsBlock(result, version) → string :46-72
371
- function injectConventions(existing, block) → string :82-96
294
+ function renderConventionsBlock(result, version) → string :46-72 # Render the conventions block (including its start/end marker
295
+ function injectConventions(existing, block) → string :82-96 # Inject (or replace) the conventions block in existing CLAUDE
372
296
  ```
373
297
 
374
298
  ### src/conventions/report.js
375
299
  ```
376
300
  module.exports = { scoreReport, snapshot, overallScore } :75-75
377
- function overallScore(result) :14-22
378
- function scoreReport(result, prior) → { conventions: object[], :31-55
379
- function snapshot(result, ts) :62-73
301
+ function overallScore(result) :14-22 # File-count-weighted mean of the scored conventions' dominant
302
+ function scoreReport(result, prior) → { conventions: object[], :31-55 # Build a consistency report with trend vs a prior snapshot
303
+ function snapshot(result, ts) :62-73 # A compact, persistable snapshot of a run (one line in the hi
380
304
  ```
381
305
 
382
306
  ### src/conventions/update.js
383
307
  ```
384
308
  module.exports = { changedSince, planUpdate } :46-46
385
- function changedSince(files, sinceMs) → string[] :20-26
386
- function planUpdate(cwd, files, snapshotPath) → { snapshotExists: boolean :35-44
309
+ function changedSince(files, sinceMs) → string[] :20-26 # Source files modified after a reference time
310
+ function planUpdate(cwd, files, snapshotPath) → { snapshotExists: boolean :35-44 # Decide whether the conventions snapshot needs a rescan
387
311
  ```
388
312
 
389
313
  ### src/create/orchestrate.js
390
314
  ```
391
315
  module.exports = { orchestrate, TOTAL } :86-86
392
- function orchestrate(ctx = {}, cwd) → { task: string|null, step :34-84
316
+ function orchestrate(ctx = {}, cwd) → { task: string|null, step :34-84 # Run the create pipeline over whatever inputs are available
393
317
  ```
394
318
 
395
319
  ### src/daemon/daemon.js
@@ -398,52 +322,12 @@ module.exports = { start, stop, status, pidFile, logFile, isAlive, readPid } :2
398
322
  function daemonDir(cwd) :22-24
399
323
  function pidFile(cwd) :26-28
400
324
  function logFile(cwd) :30-32
401
- function isAlive(pid) :35-44
402
- function readPid(cwd) :47-55
325
+ function isAlive(pid) :35-44 # True if a process with this PID exists (signal 0 probes with
326
+ function readPid(cwd) :47-55 # Read the recorded PID, or null if the file is missing/unpars
403
327
  function removePidFile(cwd) :57-61
404
328
  function status(cwd) → { running: boolean, pid: :66-72
405
- function start(cwd, opts = {}) → { status: 'started'|'alre :82-105
406
- function stop(cwd) → { status: 'stopped'|'not- :112-124
407
- ```
408
-
409
- ### src/discovery/framework-detector.js
410
- ```
411
- module.exports = { detectFrameworks } :7-7
412
- function detectFrameworks(cwd) :9-57
413
- function _readDeps(cwd) :59-64
414
- function _readFile(p) :66-68
415
- function _existsAnywhere(cwd, filename, maxDepth) :70-74
416
- function _walkFind(dir, name, depth) :76-88
417
- ```
418
-
419
- ### src/discovery/language-detector.js
420
- ```
421
- module.exports = { detectLanguages } :7-7
422
- function detectLanguages(cwd) :26-61
423
- function _walkDepth(dir, depth, extCount) :63-76
424
- ```
425
-
426
- ### src/discovery/r-manifest.js
427
- ```
428
- module.exports = { readDescription, readNamespace, collectLocalDefs } :176-176
429
- function readDescription(cwd) → object|null :28-59
430
- function splitDeps(value) :66-71
431
- function readNamespace(cwd) → object|null :88-132
432
- function splitArgs(raw) :134-136
433
- function stripQuotes(s) :138-140
434
- function collectLocalDefs(rFiles) → Map<string, string> :150-174
435
- ```
436
-
437
- ### src/discovery/sigmapignore.js
438
- ```
439
- module.exports = { loadIgnorePatterns, matchesIgnorePattern } :6-6
440
- function loadIgnorePatterns(cwd) :8-19
441
- function matchesIgnorePattern(dirName, patterns) :21-29
442
- ```
443
-
444
- ### src/discovery/source-root-registry.js
445
- ```
446
- module.exports = { REGISTRY } :175-175
329
+ function start(cwd, opts = {}) → { status: 'started'|'alre :82-105 # Launch a detached `--watch` process
330
+ function stop(cwd) → { status: 'stopped'|'not- :112-124 # Stop the running watcher (SIGTERM) and clear its PID file
447
331
  ```
448
332
 
449
333
  ### src/discovery/source-root-resolver.js
@@ -471,386 +355,220 @@ module.exports = { diagnose, formatDoctor, formatDoctorJSON } :236-236
471
355
  function _short(p, cwd) :37-40
472
356
  function _contextFiles(cwd) :42-49
473
357
  function _mcpTargets(cwd) :51-65
474
- function _countChangedSince(cwd, srcDirs, config, ctxMtime) :68-94
475
- function diagnose(cwd, opts = {}) → { checks: Array<{id,label :101-180
476
- function formatDoctor(result) :216-229
477
- function formatDoctorJSON(result) :232-234
358
+ function _countChangedSince(cwd, srcDirs, config, ctxMtime) :68-94 # Count code files under srcDirs modified after the context wa
359
+ function diagnose(cwd, opts = {}) → { checks: Array<{id,label :101-178 # Run all diagnostic checks
360
+ function formatDoctor(result) :216-229 # Human-readable checklist
361
+ function formatDoctorJSON(result) :232-234 # Machine-readable result
478
362
  ```
479
363
 
480
- ### src/eval/analyzer.js
364
+ ### src/eval/corpus.js
481
365
  ```
482
- module.exports = { analyzeFiles, formatAnalysisTable, formatAnalysisJSON } :235-235
483
- function isDockerfile(name) :49-51
484
- function getExtractorName(filePath) :53-59
485
- function tokenCount(sigs) :62-64
486
- function hasCoverage(filePath, cwd) :70-85
487
- function loadExtractor(name, cwd) :91-100
488
- function analyzeFiles(files, cwd, opts) → object[] :113-170
489
- function formatAnalysisTable(stats, showSlow) → string :179-213
490
- function formatAnalysisJSON(stats) → object :221-233
366
+ module.exports = { basenameTokens, queryLeakage, validateTasks, sizeBucket, BUCKET_LIMITS } :83-83
367
+ function basenameTokens(filePath) → string[] :31-34 # Stemmed tokens of a file path's basename (extension stripped
368
+ function queryLeakage(query, expectedFiles) → { leaked: string[], clean :42-51 # Leaked tokens between a query and its expected files' basena
369
+ function validateTasks(tasks) → { results: object[], hard :59-70 # Validate a task list: every task gets a leakage result; hard
370
+ function sizeBucket(fileCount) → 'small'|'medium'|'large' :77-81 # Size bucket for a repo by indexed file count
491
371
  ```
492
372
 
493
373
  ### src/eval/llm-ablation.js
494
374
  ```
495
375
  module.exports = { buildGrounding, scoreAnswer, scoreAnswerDetail, runAblation, aggregateRuns } :168-168
496
- function _cleanSig(sig) :19-21
497
- function buildGrounding(cwd, opts = {}) → string :34-70
498
- function scoreAnswerDetail(answerText, cwd) → { total: number, issues: :78-85
499
- function scoreAnswer(answerText, cwd) :88-90
500
- function runAblation(tasks, cwd, complete, opts = {}) → { tasks: object[], aggreg :102-137
501
- function _stats(nums) :140-144
502
- function aggregateRuns(aggregates) → { runs:number, n:number, :154-166
376
+ function _cleanSig(sig) :19-21 # Strip a signature's trailing line anchor (` :12-20`) for pro
377
+ function buildGrounding(cwd, opts = {}) → string :34-70 # Build the SigMap grounding block for a repo — what we prepen
378
+ function scoreAnswerDetail(answerText, cwd) → { total: number, issues: :78-85 # Score an answer: flagged codebase-fact errors + the issue li
379
+ function scoreAnswer(answerText, cwd) :88-90 # Count flagged codebase-fact errors in an answer (the §9 metr
380
+ function runAblation(tasks, cwd, complete, opts = {}) → { tasks: object[], aggreg :102-137 # Run the A/B ablation over a task corpus
381
+ function _stats(nums) :140-144 # mean/min/max of a number list (0s for an empty list)
382
+ function aggregateRuns(aggregates) → { runs:number, n:number, :154-166 # Aggregate several `runAblation` passes into a stable estimat
503
383
  ```
504
384
 
505
385
  ### src/eval/runner.js
506
386
  ```
507
- module.exports = { run, rank, loadTasks, buildSigIndex, formatTable, formatMetrics, tokenize } :256-256
508
- function buildSigIndex(cwd) → Map<string, string[]> :40-82
509
- function rank(query, index, topK = 10) → { file: string, score: nu :99-105
510
- function estimateTokens(sigs) → number :116-119
511
- function loadTasks(tasksFile) → Array<{id:string, query:s :132-154
512
- function run(tasksFile, cwd, opts = {}) → { * tasks: Array<{id, que :172-219
513
- function formatTable(taskResults) → string :230-238
514
- function formatMetrics(metrics) → string :245-254
515
- ```
516
-
517
- ### src/eval/scorer.js
518
- ```
519
- module.exports = { hitAtK, reciprocalRank, precisionAtK, aggregate, firstRank } :126-126
520
- function firstRank(ranked, expected) → number :22-29
521
- function normalizePath(p) → string :38-40
522
- function hitAtK(ranked, expected, k = 5) → 0|1 :49-51
523
- function reciprocalRank(ranked, expected) → number :59-62
524
- function precisionAtK(ranked, expected, k = 5) → number :72-78
525
- function aggregate(results, k = 5) → { * hitAt5: number, // fr :93-120
526
- function round(x) :122-124
527
- ```
528
-
529
- ### src/eval/usefulness-scorer.js
530
- ```
531
- module.exports = { scoreUsefulness, computeUsefulnessStats } :3-3
532
- function scoreUsefulness(taskResult, rankingScore) :11-38
533
- function computeUsefulnessStats(taskResults) :40-66
387
+ module.exports = { run, rank, loadTasks, buildSigIndex, formatTable, formatMetrics, tokenize } :226-226
388
+ function buildSigIndex(cwd) → Map<string, string[]> :40-47 # Read the generated context file and build a simple signature
389
+ function rank(query, index, topK = 10, opts = {}) → { file: string, score: nu :64-71 # Rank all files in the index against a query with the identif
390
+ function estimateTokens(sigs) → number :82-85 # Estimate token count from character count (chars/4, ±5%)
391
+ function loadTasks(tasksFile) → Array<{id:string, query:s :98-121 # Load tasks from a JSONL file
392
+ function run(tasksFile, cwd, opts = {}) → { * tasks: Array<{id, que :139-189 # Run all tasks in tasksFile against the repo at cwd
393
+ function formatTable(taskResults) → string :200-208 # Format task results as a markdown table string
394
+ function formatMetrics(metrics) → string :215-224 # Format aggregate metrics as a human-readable string
534
395
  ```
535
396
 
536
397
  ### src/evidence/pack.js
537
398
  ```
538
399
  module.exports = { buildEvidencePack, formatJSON, formatMarkdown, parseAnchor, riskLabelFor, riskFactorsFor, findRelatedTests, SCHEMA_VERSION, SCHEMA_URL, TEST_DISCOVERY } :326-337
539
- function parseAnchor(sig) → { symbol: string, start: :64-72
540
- function riskLabelFor(relPath) → 'generated'|'test'|'migra :84-86
541
- function riskFactorsFor(relPath) → string[] :96-108
542
- function stemOf(relPath) :111-114
543
- function testTargetStem(relPath) → string :126-132
544
- function findRelatedTests(relPath, allFiles) → string[] :143-154
545
- function reasonFor(signals) :157-168
546
- function sigTokens(sigs) :171-173
547
- function canonicalize(value) → string :180-182
400
+ function parseAnchor(sig) → { symbol: string, start: :64-72 # Split a signature's ` :start-end` line anchor from its symb
401
+ function riskLabelFor(relPath) → 'generated'|'test'|'migra :84-86 # Classify a file into a risk label (C3, v8
402
+ function riskFactorsFor(relPath) → string[] :96-108 # Every risk category a file matches, in the same strict prece
403
+ function stemOf(relPath) :111-114 # Filename stem (basename minus the first extension chain)
404
+ function testTargetStem(relPath) → string :126-132 # Infer the implementation stem a test file targets, by stripp
405
+ function findRelatedTests(relPath, allFiles) → string[] :143-154 # Impl→test discovery (C2, v8
406
+ function reasonFor(signals) :157-168 # Map a ranker `signals` object into a short human-readable re
407
+ function sigTokens(sigs) :171-173 # Token estimate for a signature block (matches the ranker's h
408
+ function canonicalize(value) → string :180-182 # Stable stringify with recursively sorted object keys, for ha
548
409
  function sortKeys(value) :184-192
549
- function buildEvidencePack(query, cwd, opts = {}) → object :205-281
410
+ function buildEvidencePack(query, cwd, opts = {}) → object :205-281 # Build an Evidence Pack for a query
550
411
  function ranked0Empty(query) :284-286
551
- function formatJSON(pack) :289-291
552
- function formatMarkdown(pack) :294-324
412
+ function formatJSON(pack) :289-291 # Pretty-printed canonical JSON rendering of a pack
413
+ function formatMarkdown(pack) :294-315 # Markdown handoff rendering of a pack
553
414
  ```
554
415
 
555
- ### src/extractors/coverage.js
556
- ```
557
- module.exports = { buildTestIndex, isTested } :79-79
558
- function walkFiles(dir) :6-20
559
- function buildTestIndex(cwd, testDirs) :22-62
560
- function isTested(funcName, testIndex) :64-77
561
- ```
562
-
563
- ### src/extractors/cpp.js
416
+ ### src/extractors/csharp.js
564
417
  ```
565
- module.exports = { extract } :69-69
566
- function extract(src) → string[] :8-69
567
- function extractBlock(src, startIndex) :36-45
568
- function extractMembers(block) :47-57
569
- function normalizeParams(params) :59-62
570
- function normalizeType(type) :64-67
418
+ module.exports = { extract } :71-71
419
+ function extract(src) → string[] :12-71 # Extract signatures from C# source code
420
+ function extractBlock(src, startIndex) :35-44
421
+ function extractMembers(block) :46-59
422
+ function normalizeParams(params) :61-64
423
+ function normalizeType(type) :66-69
571
424
  ```
572
425
 
573
- ### src/extractors/css.js
426
+ ### src/extractors/dart.js
574
427
  ```
575
- module.exports = { extract } :69-69
576
- function extract(src) → string[] :8-17
428
+ module.exports = { extract } :84-84
429
+ function extract(src) → string[] :12-84 # Extract signatures from Dart source code
430
+ function extractBlock(src, startIndex) :54-63
431
+ function extractMembers(block) :65-77
432
+ function normalizeParams(params) :79-81
577
433
  ```
578
434
 
579
435
  ### src/extractors/deps.js
580
436
  ```
581
- module.exports = { extractPythonDeps, extractTSDeps, extractRDeps, buildReverseDepMap } :110-110
582
- function extractPythonDeps(src) → string[] :26-41
583
- function extractTSDeps(src) → string[] :48-61
584
- function extractRDeps(src) → string[] :76-90
585
- function buildReverseDepMap(forwardMap) → Map<string, string[]> :97-108
437
+ module.exports :110-110
438
+ function extractPythonDeps :26-41
439
+ function extractTSDeps :48-59
440
+ function extractRDeps :76-82
441
+ function buildReverseDepMap :97-108
586
442
  ```
587
443
 
588
444
  ### src/extractors/dispatch.js
589
445
  ```
590
446
  module.exports = { extractFile, langFor } :112-112
591
- function langFor(filePathOrName) :86-91
592
- function extractFile(filePathOrName, src) → string[] :99-110
447
+ function langFor(filePathOrName) :86-91 # Resolve a language key from a file path/name
448
+ function extractFile(filePathOrName, src) → string[] :99-110 # Extract signatures from a file's content using the right ext
593
449
  ```
594
450
 
595
- ### src/extractors/dockerfile.js
596
- ```
597
- module.exports = { extract } :49-49
598
- function extract(src) → string[] :8-47
599
- ```
600
-
601
- ### src/extractors/gdscript.js
602
- ```
603
- module.exports = { extract } :131-131
604
- function extract(src) → string[] :9-42
605
- function extractInnerMembers(stripped, startIndex) :98-114
606
- function normalizeParams(params) :116-129
607
- ```
608
-
609
- ### src/extractors/generic.js
610
- ```
611
- module.exports = { extract } :2-2
612
- function extract(src) :14-26
613
- ```
614
-
615
- ### src/extractors/graphql.js
451
+ ### src/extractors/go.js
616
452
  ```
617
- module.exports = { extract } :66-66
618
- function extract(src) → string[] :11-66
453
+ module.exports = { extract } :109-109
454
+ function extract(src) → string[] :12-109 # Extract signatures from Go source code
455
+ function extractBlock(src, startIndex) :55-64
456
+ function extractInterfaceMethods(block) :66-78
457
+ function normalizeParams(params) :80-83
458
+ function buildDocHints(src) :89-98
459
+ function firstDocSentence(block) :101-107
619
460
  ```
620
461
 
621
- ### src/extractors/html.js
462
+ ### src/extractors/java.js
622
463
  ```
623
- module.exports = { extract } :39-39
624
- function extract(src) → string[] :9-37
464
+ module.exports = { extract } :106-106
465
+ function extract(src) → string[] :12-106 # Extract signatures from Java source code
466
+ function extractBlock(src, startIndex) :38-48
467
+ function extractMembers(block) :50-64
468
+ function normalizeParams(params) :66-69
469
+ function normalizeType(type) :71-74
470
+ function buildDocHints(src) :82-95
471
+ function firstDocSentence(body) :98-104
625
472
  ```
626
473
 
627
474
  ### src/extractors/javascript.js
628
475
  ```
629
- module.exports = { extract } :147-147
630
- function extract(src) → string[] :13-112
631
- function extractBlock(src, startIndex) :88-98
632
- function extractClassMembers(block, returnHints) :103-124
633
- function buildReturnHints(src) :119-121
634
- function normalizeType(type) :133-136
635
- function formatReturnHint(type) :138-140
636
- function normalizeParams(params) :142-145
476
+ module.exports = { extract } :218-218
477
+ function extract(src) → string[] :14-95 # Extract signatures from JavaScript source code
478
+ function extractBlock(src, startIndex) :119-129
479
+ function extractClassMembers(block, maskedBlock, returnHints) :137-165
480
+ function buildReturnHints(src) :160-162
481
+ function buildDocHints(src) :177-193
482
+ function firstDocSentence(body) :196-202
483
+ function normalizeType(type) :204-207
484
+ function formatReturnHint(type) :209-211
485
+ function normalizeParams(params) :213-216
637
486
  ```
638
487
 
639
- ### src/extractors/line-anchor.js
488
+ ### src/extractors/kotlin.js
640
489
  ```
641
- module.exports = { lineAt, anchor, withAnchor } :52-52
642
- function lineAt(src, idx) → number :22-29
643
- function anchor(start, end) → string :37-39
644
- function withAnchor(sig, start, end) → string :48-50
490
+ module.exports = { extract } :90-90
491
+ function extract(src) → string[] :12-90 # Extract signatures from Kotlin source code
492
+ function extractBlock(src, startIndex) :54-63
493
+ function extractMembers(block) :65-90
494
+ function normalizeParams(params) :81-88
645
495
  ```
646
496
 
647
- ### src/extractors/markdown.js
497
+ ### src/extractors/line-anchor.js
648
498
  ```
649
- module.exports = { extract } :30-30
650
- function extract(src) → string[] :10-28
499
+ module.exports :52-52
500
+ function lineAt :22-29
501
+ function anchor :37-39
502
+ function withAnchor :48-50
651
503
  ```
652
504
 
653
- ### src/extractors/patterns.js
505
+ ### src/extractors/php.js
654
506
  ```
655
- module.exports = { extract } :135-135
656
- function extract(src) → string[] :10-133
507
+ module.exports = { extract } :96-96
508
+ function extract(src) → string[] :12-96 # Extract signatures from PHP source code
509
+ function extractBlock(src, startIndex) :58-67
510
+ function extractMembers(block) :69-96
511
+ function normalizeParams(params) :86-89
512
+ function normalizeType(type) :91-94
657
513
  ```
658
514
 
659
515
  ### src/extractors/prdiff.js
660
516
  ```
661
517
  module.exports = { diffSignatures, extractName } :70-70
662
- function diffSignatures(baseSigs, currentSigs) → {added:string[], removed: :9-36
663
- function extractName(sig) :47-70
664
- ```
665
-
666
- ### src/extractors/properties.js
667
- ```
668
- module.exports = { extract } :37-37
669
- function extract(src) → string[] :10-35
670
- ```
671
-
672
- ### src/extractors/protobuf.js
673
- ```
674
- module.exports = { extract } :63-63
675
- function extract(src) → string[] :10-63
676
- ```
677
-
678
- ### src/extractors/python_ast.py
679
- ```
680
- def annotation_to_str(node) :25-48 # Convert an AST annotation node to a string representation
681
- def format_args(args_node) :51-103 # Format a function arguments node into a compact signature st
682
- def get_decorator_names(node) :106-120 # Return a list of decorator name strings for a function/class
683
- def is_dataclass(node) :123-124
684
- def is_basemodel(bases) :127-133 # Check if class bases include BaseModel or BaseSettings
685
- def is_optional_annotation(annotation) :136-146 # Check if an annotation represents an Optional type
686
- def get_docstring_hint(node) :149-158 # Extract first sentence of docstring, if present
687
- def extract_dataclass_fields(class_node) :161-171 # Return a collapsed fields string for a @dataclass class
688
- def extract_basemodel_fields(class_node) :174-190 # Return a compact {required*, optional
689
- def extract_class_constants(class_node) :193-213 # Yield ALL_CAPS constant assignments from class body
690
- def extract_method_sig(func_node) :222-229 # Format a method signature string (already indented by caller
691
- def extract_function_sig(func_node, src_lines) :232-241 # Format a top-level function signature string
692
- def extract_fastapi_routes(tree, src_lines) :244-265 # Extract FastAPI route signatures from top-level decorated fu
693
- def extract(filepath) :268-338
694
- def main() :341-351
518
+ function diffSignatures(baseSigs, currentSigs) → {added:string[], removed: :9-36 # Compare signature arrays and produce compact diff markers
519
+ function extractName(sig) :47-70 # Extract the declared symbol name from a signature line
695
520
  ```
696
521
 
697
- ### src/extractors/python_dataclass.js
698
- ```
699
- module.exports = { extract } :77-77
700
- function extract(src) → string[] :10-75
701
- ```
702
-
703
- ### src/extractors/python.js
704
- ```
705
- module.exports = { extract, tryNativeExtract } :262-262
706
- function pyBlockEnd(srcLines, startLine) → number :14-24
707
- function tryNativeExtract(filePath) → string[]|null :32-44
708
- function extract(src, filePath) → string[] :55-140
709
- function extractClassMethods(stripped, startIndex) :142-161
710
- function tryExtractDataclassFields(stripped, classIndex) :163-177
711
- function tryExtractBaseModelFields(stripped, bodyStart) :179-194
712
- function extractClassConstants(stripped, startIndex) :196-210
713
- function extractReturnType(sigLine) :212-218
714
- function normalizeParams(params) :220-238
715
- function extractDocHint(src, fnName, fnSigLine) :240-260
716
- ```
717
-
718
- ### src/extractors/r.js
719
- ```
720
- module.exports = { extract } :273-273
721
- function extract(src) → string[] :20-117
722
- function collectRoxygenHints(src) :125-153
723
- function pickRoxygenLine(block, tag) :155-169
724
- function applyHint(hints, name) :171-174
725
- function extractListMethods(body, cap) :180-193
726
- function inAnyRange(pos, ranges) :195-200
727
- function readFirstStringArg(body) :203-206
728
- function readBalancedParens(src, openIdx, cap = 16384) :214-237
729
- function normalizeParams(raw) :244-271
730
- ```
731
-
732
- ### src/extractors/ruby.js
733
- ```
734
- module.exports = { extract } :54-54
735
- function extract(src) → string[] :8-38
736
- function normalizeParams(params) :40-43
737
- function extractReturnHint(stripped, index) :45-52
738
- ```
739
-
740
- ### src/extractors/shell.js
741
- ```
742
- module.exports = { extract } :43-43
743
- function extract(src) → string[] :8-43
744
- ```
745
-
746
- ### src/extractors/sql.js
747
- ```
748
- module.exports = { extract } :93-93
749
- function extract(src) → string[] :10-78
750
- function _cleanName(raw) :80-82
751
- function _normalizeParams(raw) :84-91
752
- ```
753
-
754
- ### src/extractors/svelte.js
755
- ```
756
- module.exports = { extract } :58-58
757
- function extract(src) → string[] :8-58
758
- function normalizeParams(params) :48-51
759
- function normalizeType(type) :53-56
760
- ```
761
-
762
- ### src/extractors/terraform.js
522
+ ### src/extractors/rust.js
763
523
  ```
764
- module.exports = { extract } :74-74
765
- function extract(src) → string[] :11-74
524
+ module.exports = { extract } :138-138
525
+ function extract(src) → string[] :12-116 # Extract signatures from Rust source code
526
+ function extractBlock(src, startIndex) :76-85
527
+ function extractMethods(block) :87-138
528
+ function normalizeParams(params) :102-105
529
+ function extractReturnType(afterParen) :107-138
530
+ function buildDocHints(src) :119-127
531
+ function firstDocSentence(block) :130-136
766
532
  ```
767
533
 
768
- ### src/extractors/todos.js
534
+ ### src/extractors/scala.js
769
535
  ```
770
- module.exports = { extractTodos } :26-26
771
- function extractTodos(src) → {line:number, tag:string, :8-24
536
+ module.exports = { extract } :88-88
537
+ function extract(src) → string[] :12-88 # Extract signatures from Scala source code
538
+ function extractBlock(src, startIndex) :47-56
539
+ function extractMembers(block) :58-88
540
+ function normalizeParams(params) :74-81
541
+ function normalizeType(type) :83-86
772
542
  ```
773
543
 
774
- ### src/extractors/toml.js
544
+ ### src/extractors/scan.js
775
545
  ```
776
- module.exports = { extract } :42-42
777
- function extract(src) → string[] :10-40
546
+ module.exports = { stripComments, maskCode, readBalanced } :91-91
547
+ function stripComments(src) → string :23-39 # Blank comments only — string-aware, so `//` or `/*` INSIDE a
548
+ function maskCode(src) → string :47-63 # Blank comments AND string/template contents (quotes included
549
+ function readBalanced(masked, openIdx, open = '(', close = ')', cap = 4000) → number :76-89 # Index of the delimiter that closes the one open at `openIdx`
778
550
  ```
779
551
 
780
- ### src/extractors/typescript_react.js
552
+ ### src/extractors/swift.js
781
553
  ```
782
- module.exports = { extract } :60-60
783
- function extract(src) → string[] :10-20
554
+ module.exports = { extract } :97-97
555
+ function extract(src) → string[] :12-97 # Extract signatures from Swift source code
556
+ function extractBlock(src, startIndex) :54-63
557
+ function extractMembers(block) :65-97
558
+ function normalizeParams(params) :80-87
559
+ function extractArrowType(str) :89-97
784
560
  ```
785
561
 
786
562
  ### src/extractors/typescript.js
787
563
  ```
788
- module.exports = { extract } :221-221
789
- function extract(src) → string[] :13-118
790
- function extractBlock(src, startIndex) :160-170
791
- function extractInterfaceMembers(block) :174-188
792
- function extractClassMembers(block) :195-221
793
- function normalizeParams(params) :216-219
794
- ```
795
-
796
- ### src/extractors/vue_sfc.js
797
- ```
798
- module.exports = { extract } :99-99
799
- function extract(src) → string[] :10-68
800
- ```
801
-
802
- ### src/extractors/vue.js
803
- ```
804
- module.exports = { extract } :80-80
805
- function extract(src) → string[] :8-35
806
- function normalizeParams(params) :70-73
807
- function normalizeType(type) :75-78
808
- ```
809
-
810
- ### src/extractors/xml.js
811
- ```
812
- module.exports = { extract } :46-46
813
- function extract(src) → string[] :10-44
814
- ```
815
-
816
- ### src/extractors/yaml.js
817
- ```
818
- module.exports = { extract } :59-59
819
- function extract(src) → string[] :8-57
820
- ```
821
-
822
- ### src/format/benchmark-report.js
823
- ```
824
- module.exports = { loadBenchmarkReports, buildBenchmarkSummary, generateBenchmarkReportHtml, writeBenchmarkReport } :438-443
825
- function escapeHtml(value) :6-12
826
- function formatInt(value) :14-18
827
- function formatCompact(value) :20-26
828
- function formatPct(value, digits = 1) :28-32
829
- function formatMaybePct(value, digits = 1) :34-38
830
- function formatRatio(value, digits = 1) :40-44
831
- function formatMoney(value) :46-50
832
- function durationLabel(ms) :52-60
833
- function maxOrZero(values) :62-65
834
- function readJson(filePath) :67-74
835
- function loadBenchmarkReports(cwd) :76-86
836
- function buildRetrievalSummary(retrieval) :88-123
837
- function buildBenchmarkSummary(reports, matrixSummary) :125-159
838
- function renderCard(label, value, hint, tone) :161-170
839
- function renderProgress(label, value, max, suffix) :172-185
840
- function renderMatrixSection(matrix) :187-211
841
- function renderTokenSection(token) :213-239
842
- function renderRetrievalSection(retrieval) :241-268
843
- function renderQualitySection(quality) :270-296
844
- function renderTaskSection(task) :298-327
845
- function generateBenchmarkReportHtml(reports, opts = {}) :329-388
846
- function writeBenchmarkReport(cwd, opts = {}) :426-436
847
- ```
848
-
849
- ### src/format/cache.js
850
- ```
851
- module.exports = { formatCache, formatCachePayload } :53-53
852
- function formatCache(content) → string :19-27
853
- function formatCachePayload(content, model) → string :37-51
564
+ module.exports = { extract } :326-326
565
+ function extract(src) → string[] :14-98 # Extract signatures from TypeScript source code
566
+ function extractBlock(src, startIndex) :195-205
567
+ function extractInterfaceMembers(block) :209-227
568
+ function extractClassMembers(block, maskedBlock) :234-318
569
+ function normalizeParams(params) :264-294
570
+ function buildDocHints(src) :299-315
571
+ function firstDocSentence(body) :318-324
854
572
  ```
855
573
 
856
574
  ### src/format/dashboard.js
@@ -886,17 +604,10 @@ function fmtDuration(ms) :45-51
886
604
  function fmtPct(p) :53-55
887
605
  function colorPct(p, text) :57-61
888
606
  function pad(s, w, align) :63-68
889
- function bar(pct, width) :71-76
890
- function impactBar(sharePct, width) :79-82
891
- function renderSummary(agg, opts = {}) → string :94-153
892
- function renderBreakdown(agg) → string :160-199
893
- ```
894
-
895
- ### src/format/llm-txt.js
896
- ```
897
- module.exports = { format, outputPath } :3-3
898
- function outputPath(cwd) :5-5
899
- function format(context, cwd, version) :7-28
607
+ function bar(pct, width) :71-76 # Solid horizontal efficiency bar with a dotted remainder
608
+ function impactBar(sharePct, width) :79-82 # Proportional impact bar (share of total saved)
609
+ function renderSummary(agg, opts = {}) → string :94-153 # Render the global summary + by-operation table
610
+ function renderBreakdown(agg) → string :160-199 # Render daily / weekly / monthly trend tables
900
611
  ```
901
612
 
902
613
  ### src/format/llms-txt.js
@@ -911,17 +622,17 @@ function format(context, cwd, writtenFiles, sigmapVersion) :21-69
911
622
  ### src/format/terse.js
912
623
  ```
913
624
  module.exports = { encodeTerseSig, encodeTerseSigs, measureTerse, splitAnchor } :86-86
914
- function splitAnchor(sig) → { text: string, suffix: s :25-30
915
- function encodeTerseSig(sig) → string :37-50
916
- function encodeTerseSigs(sigs) → string[] :57-59
917
- function _tokens(sigs) :62-64
918
- function measureTerse(sigsList) → { beforeTokens: number, a :72-84
625
+ function splitAnchor(sig) → { text: string, suffix: s :25-30 # Split a signature into the compactable text and the byte-pre
626
+ function encodeTerseSig(sig) → string :37-50 # Compact one signature line
627
+ function encodeTerseSigs(sigs) → string[] :57-59 # Compact an array of signature lines
628
+ function _tokens(sigs) :62-64 # Estimated tokens of joined signature lines (same chars/4 rul
629
+ function measureTerse(sigsList) → { beforeTokens: number, a :72-84 # Measure the real reduction terse encoding buys over a set of
919
630
  ```
920
631
 
921
632
  ### src/format/usage-guidance.js
922
633
  ```
923
634
  module.exports = { usageBlock } :28-28
924
- function usageBlock() :12-26
635
+ function usageBlock() :12-26 # Canonical "how to use SigMap" guidance block (v6
925
636
  ```
926
637
 
927
638
  ### src/format/verify-report.js
@@ -930,8 +641,8 @@ module.exports = { renderReportHtml, renderReportMarkdown, escapeHtml } :164-16
930
641
  function escapeHtml(value) :23-29
931
642
  function toneFor(issue) :31-35
932
643
  function labelFor(issue) :37-39
933
- function renderReportHtml(result, opts = {}) → string :48-115
934
- function renderReportMarkdown(result) :144-162
644
+ function renderReportHtml(result, opts = {}) → string :48-115 # Render the verify result to a full HTML document
645
+ function renderReportMarkdown(result) :144-162 # Compact Markdown rendering of the same result (CI / PR comme
935
646
  ```
936
647
 
937
648
  ### src/graph/blast-radius.js
@@ -940,81 +651,77 @@ module.exports = { methodBlastRadius, tierFor, DIRECT_WEIGHT, TRANSITIVE_WEIGHT
940
651
  function tierFor(score) :25-31
941
652
  function _normRel(p) :33-35
942
653
  function _bfs(seedIds, reverse, maxDepth) :38-60
943
- function methodBlastRadius(changedFiles, cwd, opts = {}) → { * available: boolean, * :78-130
654
+ function methodBlastRadius(changedFiles, cwd, opts = {}) → { * available: boolean, * :78-130 # Score the method-level blast radius of a changed-file list
944
655
  ```
945
656
 
946
- ### src/graph/builder.js
657
+ ### src/graph/call-graph.js
947
658
  ```
948
- module.exports = { build, buildFromCwd, extractFileDeps, normalizePath, loadAliasMap, resolveAlias } :494-494
949
- function normalizePath(p) :17-19
950
- function probeJs(base, fileSet) → string|null :40-53
951
- function resolveJsPath(dir, importStr, fileSet) → string|null :62-64
952
- function stripJsonc(src) :70-84
953
- function loadAliasMap(cwd) → { baseUrl: string|null, e :96-117
954
- function resolveAlias(spec, aliasMap, fileSet) → string|null :126-150
955
- function escapeRegex(s) :157-159
956
- function resolveRPath(dir, importStr, fileSet, cwd) :161-176
957
- function extractFileDeps(filePath, content, fileSet, cwd, ctx) → string[] :190-330
958
- function build(files, cwd, ctx) → { forward: Map<string,str :387-426
959
- function buildFromCwd(cwd, opts) → { forward: Map<string,str :438-492
659
+ module.exports = { buildCallGraph, buildCallFileGraph, methodImpact, methodCallees, formatCallGraph, formatCallGraphJSON, extractDefs, maskJs, maskPy, maskRust } :567-571
660
+ function normalizePath(p) :42-42
661
+ function toRel(cwd, f) :43-43
662
+ function symId(cwd, absFile, name) :44-44
663
+ function maskJs(src) :50-66
664
+ function maskRust(src) :71-92
665
+ function maskPy(src) :94-111
666
+ function matchDelim(masked, openIdx, open, close) :114-121
667
+ function lineAt(src, idx) :123-128
668
+ function jsDefs(masked) :133-199
669
+ function pyDefs(masked) :201-221
670
+ function goDefs(masked) :225-246
671
+ function javaDefs(masked) :251-274
672
+ function rustDefs(masked) :279-297
673
+ function maskFor(filePath, src) :301-306
674
+ function extractDefs(filePath, src) :308-316
675
+ function callsInRange(masked, start, end) :319-331
676
+ function _walk(dir, excludeSet, out, depth) :335-348
677
+ function buildCallGraph(cwd, opts = {}) → { * forward: Map<string,s :364-447 # Build the method-level call-graph for a project
678
+ function buildCallFileGraph(cwd, opts = {}) → { forward: Map<string,str :460-486 # Collapse the symbol-level call-graph to FILE-level bidirecti
679
+ function _resolveSymbol(symbol, defs) :489-494
680
+ function _bfs(seedIds, graph, maxDepth) :497-510
681
+ function methodImpact(symbol, cwd, opts = {}) → { symbol:string, resolved :520-526 # Method-level blast radius: everything that (transitively) ca
682
+ function methodCallees(symbol, cwd, opts = {}) → { symbol:string, resolved :532-538 # What `symbol` (transitively) calls
683
+ function formatCallGraph(result, kind) :541-553
684
+ … +1 more signatures
960
685
  ```
961
686
 
962
- ### src/graph/call-graph.js
687
+ ### src/graph/centrality.js
963
688
  ```
964
- module.exports = { buildCallGraph, buildCallFileGraph, methodImpact, methodCallees, formatCallGraph, formatCallGraphJSON, extractDefs, maskJs, maskPy, maskRust } :563-567
965
- function normalizePath(p) :41-41
966
- function toRel(cwd, f) :42-42
967
- function symId(cwd, absFile, name) :43-43
968
- function maskJs(src) :49-65
969
- function maskRust(src) :70-91
970
- function maskPy(src) :93-110
971
- function matchDelim(masked, openIdx, open, close) :113-120
972
- function lineAt(src, idx) :122-127
973
- function jsDefs(masked) :132-237
974
- function pyDefs(masked) :200-220
975
- function goDefs(masked) :224-344
976
- function javaDefs(masked) :250-367
977
- function rustDefs(masked) :278-401
978
- function maskFor(filePath, src) :300-305
979
- function extractDefs(filePath, src) :307-315
980
- function callsInRange(masked, start, end) :318-330
981
- function _walk(dir, excludeSet, out, depth) :334-347
982
- function buildCallGraph(cwd, opts = {}) → { * forward: Map<string,s :363-446
983
- function buildCallFileGraph(cwd, opts = {}) → { forward: Map<string,str :459-482
984
- function _resolveSymbol(symbol, defs) :485-490
985
- function _bfs(seedIds, graph, maxDepth) :493-506
986
- function methodImpact(symbol, cwd, opts = {}) → { symbol:string, resolved :516-522
987
- function methodCallees(symbol, cwd, opts = {}) → { symbol:string, resolved :528-534
988
- function formatCallGraph(result, kind) :537-549
989
- … +1 more signatures
689
+ module.exports = { computeCentrality, DAMPING, ITERATIONS } :61-61
690
+ function computeCentrality(graph) → Map<string, number> :27-59 # Compute a normalized centrality score for every file in a de
990
691
  ```
991
692
 
992
693
  ### src/graph/impact.js
993
694
  ```
994
695
  module.exports = { getImpact, analyzeImpact, formatImpact, formatImpactJSON } :240-240
995
696
  function normalizePath(p) :16-18
996
- function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr :33-70
697
+ function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr :33-70 # Walk the reverse graph from `startFile` using BFS up to `max
997
698
  function isTestFile(f) :92-92
998
699
  function isRouteFile(f) :93-93
999
- function getImpact(changedFile, graph, opts) → { * changed: string, * di :116-142
1000
- function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o :156-171
1001
- function formatImpact(result) → string :183-221
1002
- function formatImpactJSON(result) → object :229-238
700
+ function getImpact(changedFile, graph, opts) → { * changed: string, * di :116-142 # Compute the impact of changing `changedFile`
701
+ function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o :156-171 # Analyse the impact of one or more changed files, building th
702
+ function formatImpact(result) → string :183-221 # Format an impact result as a readable markdown string
703
+ function formatImpactJSON(result) → object :229-238 # Format an impact result as a JSON-serialisable object
704
+ ```
705
+
706
+ ### src/graph/path-key.js
707
+ ```
708
+ module.exports = { graphKey } :26-26
709
+ function graphKey(p) :22-24 # Canonical key for a filesystem path used as a graph node
1003
710
  ```
1004
711
 
1005
712
  ### src/health/scorer.js
1006
713
  ```
1007
714
  module.exports = { score, composeHealth } :227-227
1008
715
  function gradeFor(points) :52-57
1009
- function composeHealth(s) → object :66-117
1010
- function score(cwd) :123-225
716
+ function composeHealth(s) → object :66-117 # Pure scoring core
717
+ function score(cwd) :123-225 # Gather health signals from disk and score them
1011
718
  ```
1012
719
 
1013
720
  ### src/init/creation-workflow.js
1014
721
  ```
1015
722
  module.exports = { renderCreationWorkflowBlock, injectCreationWorkflow, START, END } :59-59
1016
- function renderCreationWorkflowBlock() :18-35
1017
- function injectCreationWorkflow(existing, block) → string :45-57
723
+ function renderCreationWorkflowBlock() :18-35 # Render the Creation workflow block (including its start/end
724
+ function injectCreationWorkflow(existing, block) → string :45-57 # Inject (or replace) the Creation workflow block in existing
1018
725
  ```
1019
726
 
1020
727
  ### src/judge/judge-engine.js
@@ -1022,28 +729,11 @@ function injectCreationWorkflow(existing, block) → string :45-57
1022
729
  module.exports = { groundedness, claimGrounding, judge } :182-182
1023
730
  function tokenize(text) :15-17
1024
731
  function groundedness(response, context) :19-27
1025
- function claimGrounding(response, context) → { total: number, grounded :48-78
732
+ function claimGrounding(response, context) → { total: number, grounded :48-78 # Claim-level grounding (v8
1026
733
  function extractContextFiles(context, cwd) :89-111
1027
734
  function judge(response, context, opts = {}) :113-180
1028
735
  ```
1029
736
 
1030
- ### src/learning/weights.js
1031
- ```
1032
- module.exports = { BASELINE, DECAY, MAX_MULT, MIN_MULT, weightsPath, clampMultiplier, normalizeFile, loadWeights, saveWeights, updateWeights, boostFiles, penalizeFiles, resetWeights, exportWeights, importWeights } :154-170
1033
- function weightsPath(cwd) :11-13
1034
- function clampMultiplier(value) :15-20
1035
- function normalizeFile(cwd, filePath) :22-31
1036
- function sanitizeWeights(cwd, weights) :33-46
1037
- function loadWeights(cwd) :48-55
1038
- function saveWeights(cwd, weights) :57-76
1039
- function updateWeights(cwd, opts = {}) :78-109
1040
- function boostFiles(cwd, files, amount = 0.15) :111-113
1041
- function penalizeFiles(cwd, files, amount = 0.10) :115-117
1042
- function resetWeights(cwd) :119-122
1043
- function exportWeights(cwd, outputPath) :124-134
1044
- function importWeights(cwd, importPath, replace) :136-152
1045
- ```
1046
-
1047
737
  ### src/map/build-ci.js
1048
738
  ```
1049
739
  module.exports = { analyze } :91-91
@@ -1054,12 +744,6 @@ function makeTargets(cwd, rows) :58-69
1054
744
  function analyze(files, cwd) :71-89
1055
745
  ```
1056
746
 
1057
- ### src/map/class-hierarchy.js
1058
- ```
1059
- module.exports = { analyze } :117-117
1060
- function analyze(files, cwd) :16-117
1061
- ```
1062
-
1063
747
  ### src/map/config-manifest.js
1064
748
  ```
1065
749
  module.exports = { analyze } :101-101
@@ -1074,19 +758,9 @@ function analyze(files, cwd) :83-99
1074
758
  ### src/map/env-schema.js
1075
759
  ```
1076
760
  module.exports = { analyze } :90-90
1077
- function collectMatches(re, content, into) :30-37
1078
- function readExampleKeys(cwd) :39-52
1079
- function analyze(files, cwd) :54-88
1080
- ```
1081
-
1082
- ### src/map/import-graph.js
1083
- ```
1084
- module.exports = { analyze, extractImports, buildReverseGraph, resolveJsPath, detectCycles } :185-185
1085
- function extractImports(filePath, content, fileSet) :22-76
1086
- function resolveJsPath(dir, importStr, fileSet) :78-95
1087
- function detectCycles(graph) :100-126
1088
- function buildReverseGraph(graph) :131-140
1089
- function analyze(files, cwd) :145-183
761
+ function collectMatches(re, content, into) :30-82
762
+ function readExampleKeys(cwd) :39-82
763
+ function analyze(files, cwd) :54-82
1090
764
  ```
1091
765
 
1092
766
  ### src/map/migrations.js
@@ -1096,21 +770,58 @@ function walk(dir, cwd, depth, out) :31-62
1096
770
  function analyze(files, cwd) :64-82
1097
771
  ```
1098
772
 
773
+ ### src/map/route-table.js
774
+ ```
775
+ module.exports = { analyze, collectRoutes } :139-139
776
+ function shouldSkipFile(rel) :18-21
777
+ function collectRoutes(files, cwd) → string :30-127 # Structured route rows across the supported frameworks — the
778
+ function analyze(files, cwd) :125-137
779
+ ```
780
+
781
+ ### src/mcp/handlers.js
782
+ ```
783
+ module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getMethodImpact, getImpact, getLines, readMemory, getCalleeSignatures, notifyFileCreated, notifySymbolAdded, notifyFileDeleted, getDiffContext, getArchitectureOverview, verifySuggestion, squeezeOutput, getBudget } :1017-1017
784
+ function _readContextFiles(cwd) :10-17
785
+ function readContext(args, cwd) :36-66 # read_context({ module
786
+ function searchSignatures(args, cwd) :74-100 # search_signatures({ query }) → string
787
+ function getMap(args, cwd) :108-131 # get_map({ type }) → string
788
+ function createCheckpoint(args, cwd) :143-215 # create_checkpoint({ note
789
+ function getRouting(args, cwd) :224-261 # get_routing({}) → string
790
+ function explainFile(args, cwd) :269-356 # explain_file({ path }) → string
791
+ function listModules(args, cwd) :364-403 # list_modules({}) → string
792
+ function queryContext(args, cwd) :411-445 # query_context({ query, topK
793
+ function getMethodImpact(args, cwd) :453-467 # get_method_impact({ symbol, direction
794
+ function getImpact(args, cwd) :475-487 # get_impact({ file, depth
795
+ function getLines(args, cwd) :496-544 # get_lines({ file, start, end }) → string
796
+ function readMemory(args, cwd) :552-587 # read_memory({ limit
797
+ function getBudget(args, cwd) :596-622 # get_budget({ session
798
+ function getCalleeSignatures(args, cwd) :631-676 # get_callee_signatures — return the exact defining signature(
799
+ function _pkgVersion(cwd) :683-686
800
+ function notifyFileCreated(args, cwd) :690-712 # notify_file_created — extract a file's signatures and index
801
+ function notifySymbolAdded(args, cwd) :715-735 # notify_symbol_added — append one signature to a file's live
802
+ function notifyFileDeleted(args, cwd) :738-752 # notify_file_deleted — drop a file's cache-overlay entry
803
+ function _changedFiles(cwd, args) :758-770 # List the files changed in the working tree, staged area, or
804
+ function getDiffContext(args, cwd) :779-850 # get_diff_context({ base
805
+ function getArchitectureOverview(args, cwd) :859-927 # get_architecture_overview({}) → string
806
+ function verifySuggestion(args, cwd) :937-972 # verify_suggestion({ code }) → string
807
+ function squeezeOutput(args, cwd) :982-1015 # squeeze_output({ content }) → string
808
+ ```
809
+
1099
810
  ### src/mcp/install.js
1100
811
  ```
1101
812
  module.exports = { CLIENTS, listClients, installClient, resolveTarget } :142-142
1102
- function resolveTarget(spec, cwd, home, useGlobal) :39-45
1103
- function listClients(opts = {}) :48-62
813
+ function resolveTarget(spec, cwd, home, useGlobal) :39-45 # Resolve the absolute config path for a client, honoring `glo
814
+ function listClients(opts = {}) :48-62 # List supported clients with their resolved target paths
1104
815
  function serverArgs(scriptPath) :64-66
1105
- function _installJson(filePath, scriptPath) :69-81
1106
- function _installZed(filePath, scriptPath) :84-96
1107
- function _installYaml(filePath, scriptPath) :99-117
1108
- function installClient(client, opts = {}) → client, label, path, stat :124-140
816
+ function _installJson(filePath, scriptPath) :69-81 # Install into a JSON `mcpServers` config (create file/dir if
817
+ function _installZed(filePath, scriptPath) :84-96 # Install into Zed's `context_servers` config (create file/dir
818
+ function _installYaml(filePath, scriptPath) :99-117 # Install into Codex CLI YAML (append block; create file if ab
819
+ function installClient(client, opts = {}) → client, label, path, stat :124-140 # Install the sigmap MCP server for a single client
1109
820
  ```
1110
821
 
1111
822
  ### src/mcp/tools.js
1112
823
  ```
1113
- module.exports = { TOOLS } :392-392
824
+ module.exports = { TOOLS } :418-418
1114
825
  ```
1115
826
 
1116
827
  ### src/nudge.js
@@ -1121,7 +832,7 @@ function defaultUsage() :20-25
1121
832
  function readUsage(cwd) :27-30
1122
833
  function writeUsageAtomic(cwd, usage) :32-38
1123
834
  function showStarNudge(write) :52-54
1124
- function checkStarNudge(cwd, runSuccess, opts = {}) → { usage, nudged :67-90
835
+ function checkStarNudge(cwd, runSuccess, opts = {}) → { usage, nudged :67-90 # Record one run and, when the thresholds are first met, show
1125
836
  ```
1126
837
 
1127
838
  ### src/plan/planner.js
@@ -1133,48 +844,48 @@ function createPlan(goal, cwd, config = {}) :12-94
1133
844
  ### src/plan/verify-plan.js
1134
845
  ```
1135
846
  module.exports = { verifyPlan, DEFAULT_BLAST_THRESHOLD, DEFAULT_SCOPE_THRESHOLD } :108-108
1136
- function _fileExists(cwd, ref) :24-30
1137
- function verifyPlan(planText, cwd, opts = {}) → { issues: object[], blast :42-106
847
+ function _fileExists(cwd, ref) :24-30 # Resolve a referenced path against cwd (handles a leading "
848
+ function verifyPlan(planText, cwd, opts = {}) → { issues: object[], blast :42-106 # Verify a plan against the live index
1138
849
  ```
1139
850
 
1140
851
  ### src/retrieval/bm25.js
1141
852
  ```
1142
- module.exports = { tokenize, stem, bm25rank, PATH_BOOST, STOP, expandQuery, EXPANSIONS, EXPANSION_WEIGHT } :195-195
1143
- function stem(w) → string :36-45
1144
- function tokenize(text) → string[] :54-65
1145
- function expandQuery(qToks) → Map<string, number> :132-141
1146
- function bm25rank(query, candidates) → Array<object & { score: n :154-193
853
+ module.exports = { tokenize, stem, bm25rank, PATH_BOOST, STOP, expandQuery, EXPANSIONS, EXPANSION_WEIGHT, DOC_WEIGHT, MODULE_DOC_RE, stripAnchor } :248-248
854
+ function stem(w) → string :36-45 # Light suffix stemmer — conservative, tuned for code identifi
855
+ function tokenize(text) → string[] :54-65 # Split on non-alphanumeric characters AND camelCase / snake_c
856
+ function stripAnchor(line) :126-128
857
+ function expandQuery(qToks) → Map<string, number> :159-168 # Expand stemmed query tokens with curated synonyms
858
+ function bm25rank(query, candidates, opts) → Array<object & { score: n :181-246 # BM25 re-rank of candidates against a query
1147
859
  ```
1148
860
 
1149
- ### src/retrieval/ranker.js
861
+ ### src/retrieval/enrich-from-maps.js
1150
862
  ```
1151
- module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, detectIntent } :598-598
1152
- function _computePenalty(filePath) :63-70
1153
- function _computeHubs(graph) :73-84
1154
- function _isHub(filePath) :87-91
1155
- function scoreFile(filePath, sigs, queryTokens, weights) → { score: number, signals: :102-159
1156
- function rank(query, sigIndex, opts) → { file: string, score: nu :177-302
1157
- function _parseContextFile(contextPath) → Map<string, string[]> :372-404
1158
- function _mergeSigIndex(target, source) :407-415
1159
- function _buildSigIndexFromCache(cwd) → Map<string, string[]> :422-442
1160
- function _enrichSigIndexFromStrategy(cwd, index) → Map<string, string[]> :450-456
1161
- function buildSigIndex(cwd, opts) → Map<string, string[]> :473-506
1162
- function formatRankTable(results, query) → string :515-551
1163
- function formatRankJSON(results, query) → object :560-575
1164
- function detectIntent(query) :590-596
863
+ module.exports = { enrichWithSurfaces } :55-55
864
+ function enrichWithSurfaces(index, cwd) → number :25-53 # Enrich a signature index with route pseudo-signatures
1165
865
  ```
1166
866
 
1167
- ### src/retrieval/tokenizer.js
867
+ ### src/retrieval/module-doc.js
1168
868
  ```
1169
- module.exports = { tokenize, STOP_WORDS } :54-54
1170
- function tokenize(text, opts) → string[] :31-52
869
+ module.exports = { extractModuleDoc, moduleDocSig, MAX_CHARS } :120-120
870
+ function _extOf(filePath) :33-36
871
+ function _cleanLine(line) :39-120 # Strip comment furniture, JSDoc tags, and markup from one raw
872
+ function extractModuleDoc(src, filePath) → string :55-117 # Extract a module's leading documentation prose
873
+ function moduleDocSig(src, filePath) :115-117 # Render as an index-only pseudo-signature, or '' when there i
874
+ ```
875
+
876
+ ### src/retrieval/sig-index-store.js
877
+ ```
878
+ module.exports = { writeFullIndex, readFullIndex, indexPath, SCHEMA, INDEX_FILE } :95-95
879
+ function indexPath(cwd) :34-36 # Absolute path to the retrieval index artifact
880
+ function writeFullIndex(cwd, fileEntries, opts = {}) → { path: string, files: nu :47-70 # Persist the complete signature index
881
+ function readFullIndex(cwd) → Map<string, string[]> :83-93 # Load the complete signature index, or an empty Map when abse
1171
882
  ```
1172
883
 
1173
884
  ### src/review/pr-evidence.js
1174
885
  ```
1175
886
  module.exports = { buildPrEvidence, formatPrEvidenceMarkdown } :157-157
1176
- function buildPrEvidence(changedFiles, cwd, opts = {}) → { scope:string, files:obj :31-84
1177
- function formatPrEvidenceMarkdown(evidence, opts = {}) :89-155
887
+ function buildPrEvidence(changedFiles, cwd, opts = {}) → { scope:string, files:obj :31-84 # Build the structured PR evidence for a changed-file list
888
+ function formatPrEvidenceMarkdown(evidence, opts = {}) :89-155 # Render the branded, deterministic "PR Evidence Report" Markd
1178
889
  ```
1179
890
 
1180
891
  ### src/review/review-pr.js
@@ -1182,57 +893,38 @@ function formatPrEvidenceMarkdown(evidence, opts = {}) :89-155
1182
893
  module.exports = { reviewPr, SECURITY_PATTERNS, GOD_NODE_THRESHOLD, SCOPE_DIR_THRESHOLD } :150-150
1183
894
  function isTestFile(p) :32-34
1184
895
  function isSource(p) :35-37
1185
- function reviewPr(changedFiles, cwd, opts = {}) → { findings: object[], bla :48-148
1186
- ```
1187
-
1188
- ### src/routing/classifier.js
1189
- ```
1190
- module.exports = { classify, classifyAll } :102-102
1191
- function classify(filePath, sigs) → 'fast'|'balanced'|'powerf :15-83
1192
- function classifyAll(fileEntries, cwd) → { fast: string[], balance :92-100
1193
- ```
1194
-
1195
- ### src/routing/hints.js
1196
- ```
1197
- module.exports = { TIERS, formatRoutingSection } :103-103
1198
- function formatRoutingSection(groups) → string :66-101
896
+ function reviewPr(changedFiles, cwd, opts = {}) → { findings: object[], bla :48-134 # Audit a changed-file list
1199
897
  ```
1200
898
 
1201
899
  ### src/scaffold/persist.js
1202
900
  ```
1203
901
  module.exports = { scaffoldPath, renderScaffoldMarkdown } :45-45
1204
- function scaffoldPath(cwd) :15-17
1205
- function renderScaffoldMarkdown(decision, opts = {}) → string :26-43
902
+ function scaffoldPath(cwd) :15-17 # Path to the persisted scaffold record
903
+ function renderScaffoldMarkdown(decision, opts = {}) → string :26-43 # Render an accepted scaffold decision to a markdown record
1206
904
  ```
1207
905
 
1208
906
  ### src/scaffold/propose.js
1209
907
  ```
1210
908
  module.exports = { proposeScaffold, DEFAULT_THRESHOLD, HARD_FLOOR } :112-112
1211
- function _tier(pct) :21-25
1212
- function _stem(name) :28-34
1213
- function _testFile(styledStem, framework, ext) :37-42
1214
- function proposeScaffold(name, conventions, opts = {}) → { ok:boolean, refused:boo :57-110
1215
- ```
1216
-
1217
- ### src/security/patterns.js
1218
- ```
1219
- module.exports = { PATTERNS } :51-51
909
+ function _tier(pct) :21-25 # Tier for a consistency score (matches the conventions tiers)
910
+ function _stem(name) :28-34 # Strip any extension/compound suffix from a requested name →
911
+ function _testFile(styledStem, framework, ext) :37-42 # Test file path for a styled stem given the detected framewor
912
+ function proposeScaffold(name, conventions, opts = {}) → { ok:boolean, refused:boo :57-110 # Propose a convention-matched scaffold, gated by a confidence
1220
913
  ```
1221
914
 
1222
- ### src/security/scanner.js
915
+ ### src/security/redact.js
1223
916
  ```
1224
- module.exports = { scan } :36-36
1225
- function scan(signatures, filePath) → { safe: string[], redacte :14-34
917
+ module.exports = { redactText } :56-56
918
+ function redactText(text) → { * text: string, redacte :30-54 # Redact secrets in arbitrary text
1226
919
  ```
1227
920
 
1228
- ### src/session/memory.js
921
+ ### src/session/memory-inspect.js
1229
922
  ```
1230
- module.exports = { loadSession, saveSession, mergeSessionContext, clearSession } :6-6
1231
- function sessionPath(cwd) :10-12
1232
- function loadSession(cwd) :14-24
1233
- function saveSession(cwd, { intent, topFiles, query }) :26-35
1234
- function mergeSessionContext(scores, session, currentIntent) :40-51
1235
- function clearSession(cwd) :53-56
923
+ module.exports = { inspectMemory, clearMemory, STORES, CLEARABLE } :86-86
924
+ function storePath(cwd, name) :25-27
925
+ function countEntries(kind, filePath) :29-42
926
+ function inspectMemory(cwd) → Array<{store:string, path :49-64 # Describe every cross-session store
927
+ function clearMemory(cwd, store) → string[] :72-84 # Delete one clearable store (or 'all' clearable stores)
1236
928
  ```
1237
929
 
1238
930
  ### src/session/notes.js
@@ -1240,16 +932,29 @@ function clearSession(cwd) :53-56
1240
932
  module.exports = { notesPath, addNote, readNotes, formatNotes, clearNotes } :93-93
1241
933
  function notesPath(cwd) :23-25
1242
934
  function _currentBranch(cwd) :27-29
1243
- function addNote(cwd, text, opts = {}) :39-52
1244
- function readNotes(cwd, limit = 0) → object[] :60-72
1245
- function formatNotes(notes) :75-85
1246
- function clearNotes(cwd) :88-91
935
+ function addNote(cwd, text, opts = {}) :39-52 # Append a note
936
+ function readNotes(cwd, limit = 0) → object[] :60-72 # Read notes in chronological order (oldest first)
937
+ function formatNotes(notes) :75-85 # Format notes as a Markdown list (pass already-ordered notes)
938
+ function clearNotes(cwd) :88-91 # Delete the notes log
939
+ ```
940
+
941
+ ### src/skills/skills.js
942
+ ```
943
+ module.exports = { SKILLS, SKILL_CLIENTS, renderSkill, renderAgentsBlock, injectSkillsBlock, installSkills, listSkillClients, clientPresent, START, END } :182-182
944
+ function _footer(version) :66-69
945
+ function renderSkill(client, skillName, version) :72-85 # Render one skill's client-specific file content
946
+ function renderAgentsBlock(version) :88-95 # Render the combined AGENTS
947
+ function injectSkillsBlock(existing, block) :103-118 # Inject (or replace) the skills block in AGENTS
948
+ function _writeIfChanged(filePath, content) :120-130
949
+ function installSkills(client, opts = {}) → { client, label, results: :137-159 # Install both skills for one client
950
+ function clientPresent(client, cwd) :162-165 # True when the client's parent artifact exists (plain-install
951
+ function listSkillClients(opts = {}) :168-180 # List clients with target paths, presence, and installed stat
1247
952
  ```
1248
953
 
1249
954
  ### src/squeeze/cilog.js
1250
955
  ```
1251
956
  module.exports = { squeezeCiLog, stripTimestamp, ERROR_RE } :71-71
1252
- function stripTimestamp(line) :17-19
957
+ function stripTimestamp(line) :17-19 # Remove a leading timestamp prefix from a single line
1253
958
  function squeezeCiLog(input, opts = {}) → { squeezed: string, kept: :27-69
1254
959
  ```
1255
960
 
@@ -1259,7 +964,7 @@ module.exports = { classify, countFrames } :115-115
1259
964
  function countFrames(lines) :32-38
1260
965
  function matchesStackTrace(input, lines) :40-50
1261
966
  function matchesCiLog(input, lines) :55-74
1262
- function matchesJsonPayload(input) :76-93
967
+ function matchesJsonPayload(input) :76-115
1263
968
  function classify(input) → { category: 'stacktrace'| :99-113
1264
969
  ```
1265
970
 
@@ -1268,8 +973,8 @@ function classify(input) → { category: 'stacktrace'| :99-113
1268
973
  module.exports = { squeeze, shouldPrompt, formatSummary, estimateTokens } :69-69
1269
974
  function estimateTokens(s) :17-17
1270
975
  function squeeze(input, opts = {}) → { category, confidence, o :24-49
1271
- function shouldPrompt(reduction, threshold) :52-55
1272
- function formatSummary(result) :58-67
976
+ function shouldPrompt(reduction, threshold) :52-55 # True when the reduction clears the threshold (accepts 0–1 or
977
+ function formatSummary(result) :58-67 # A compact human summary of what squeeze would do (for the pr
1273
978
  ```
1274
979
 
1275
980
  ### src/squeeze/jsonpayload.js
@@ -1282,41 +987,50 @@ function squeezeJsonPayload(input, opts = {}) → { squeezed, kept, strippe :41
1282
987
  ### src/squeeze/stacktrace.js
1283
988
  ```
1284
989
  module.exports = { squeezeStackTrace, parseFrame, isVendor, inSrcDirs, enrichFrame } :135-135
1285
- function parseFrame(line) :20-28
990
+ function parseFrame(line) :20-28 # Parse a frame line across JS/TS, Python, Java/Kotlin, Go, Ru
1286
991
  function isVendor(file) :30-30
1287
992
  function inSrcDirs(file, srcDirs) :32-38
1288
- function enrichFrame(frame, symbolIndex) :41-66
993
+ function enrichFrame(frame, symbolIndex) :41-66 # Look up the real signature for a frame in the SigMap symbol
1289
994
  function squeezeStackTrace(input, opts = {}) → { squeezed, kept, strippe :76-133
1290
995
  ```
1291
996
 
1292
997
  ### src/tracking/aggregate.js
1293
998
  ```
1294
999
  module.exports = { aggregate, bucketBy, parseSince, normalize } :195-195
1295
- function normalize(rec) :25-44
1000
+ function normalize(rec) :25-44 # Normalize one raw record into a canonical shape
1296
1001
  function normalizeOp(op) :46-49
1297
1002
  function num(v) :51-54
1298
- function parseSince(since, nowMs) → Date|null :63-75
1299
- function bucketBy(records, granularity) → Array<{key,count,baseline :83-100
1003
+ function parseSince(since, nowMs) → Date|null :63-75 # Parse a --since value into a cutoff Date (or null for "all t
1004
+ function bucketBy(records, granularity) → Array<{key,count,baseline :83-100 # Bucket records by calendar granularity
1300
1005
  function bucketKey(ts, granularity) :102-117
1301
- function aggregate(rawRecords, opts = {}) → object :129-193
1006
+ function aggregate(rawRecords, opts = {}) → object :129-193 # Full aggregation for the `gain` dashboard
1007
+ ```
1008
+
1009
+ ### src/tracking/budget.js
1010
+ ```
1011
+ module.exports = { sessionKey, budgetStatus, contextMtime, entryInSession } :113-113
1012
+ function sessionKey(env) :30-34 # Session key: SIGMAP_SESSION override, else UTC day bucket
1013
+ function contextMtime(cwd) :37-43 # Newest mtime (ms) among generated context files, or 0 if non
1014
+ function entryInSession(entry, session) :46-50 # Does a gain-log entry belong to this session
1015
+ function budgetStatus(cwd, opts = {}) → { * session: string, unit :70-111 # Session spend status
1302
1016
  ```
1303
1017
 
1304
1018
  ### src/tracking/logger.js
1305
1019
  ```
1306
- module.exports = { logRun, recordUsage, readLog, readGainLog, summarize, isTrackingEnabled, GAIN_FILE } :197-197
1307
- function logRun(entry, cwd) :30-55
1308
- function readLog(cwd) → object[] :62-77
1309
- function readGainLog(cwd) → object[] :84-96
1310
- function summarize(entries) → object :103-135
1311
- function isTrackingEnabled(config, argv) → boolean :147-153
1312
- function recordUsage(entry, cwd) :169-195
1020
+ module.exports = { logRun, recordUsage, readLog, readGainLog, summarize, isTrackingEnabled, GAIN_FILE } :199-199
1021
+ function logRun(entry, cwd) :30-55 # Append one run entry to the usage log
1022
+ function readLog(cwd) → object[] :62-77 # Read and parse all usage log entries
1023
+ function readGainLog(cwd) → object[] :84-96 # Read and parse all `gain` dashboard records (oldest first)
1024
+ function summarize(entries) → object :103-135 # Compute summary statistics from an array of log records
1025
+ function isTrackingEnabled(config, argv) → boolean :147-153 # Whether `gain` savings capture is enabled
1026
+ function recordUsage(entry, cwd) :169-197 # Append one operation to the usage log using the extended `ga
1313
1027
  ```
1314
1028
 
1315
1029
  ### src/tracking/pricing.js
1316
1030
  ```
1317
- module.exports = { PRICES, DEFAULT_MODEL, resolvePrice, listModels } :44-44
1318
- function resolvePrice(model) → { model: string, perMtok: :32-37
1319
- function listModels() → string[] :40-42
1031
+ module.exports = { PRICES, DEFAULT_MODEL, resolvePrice, listModels } :46-46
1032
+ function resolvePrice(model) → { model: string, perMtok: :34-39 # Resolve a price (USD per token) for a model name
1033
+ function listModels() → string[] :42-44
1320
1034
  ```
1321
1035
 
1322
1036
  ### src/util/git.js
@@ -1329,57 +1043,67 @@ function tryGit(args, opts = {}) :26-29
1329
1043
  ### src/util/truncate.js
1330
1044
  ```
1331
1045
  module.exports = { capWithNotice, capMembersWithNotice } :42-42
1332
- function capWithNotice(items, limit, label) → string[] :22-26
1333
- function capMembersWithNotice(members, limit, label = 'methods') → Array<{text:string :36-40
1046
+ function capWithNotice(items, limit, label) → string[] :22-26 # Cap a string array, appending a `… +N more <label>` marker w
1047
+ function capMembersWithNotice(members, limit, label = 'methods') → Array<{text:string :36-40 # Cap an array of member objects ({ text,
1048
+ ```
1049
+
1050
+ ### src/verify/arity.js
1051
+ ```
1052
+ module.exports = { parseParams, buildArityIndex, extractCallArgCounts, checkArity, cleanSig, EXACT_PARAM_EXTS } :180-180
1053
+ function cleanSig(sig) :35-37 # Strip the ` :start-end` anchor and ` # hint` tail from a s
1054
+ function parseParams(paramText) → { min: number, max: numbe :47-84 # Parse a parameter-list string into an arity range
1055
+ function buildArityIndex(sigIndex) → Map<string, { min, max, v :93-122 # Build a per-name arity index from a SigMap signature index
1056
+ function extractCallArgCounts(code) → { name: string, args: num :132-166 # Extract call sites with argument counts from answer code
1057
+ function checkArity(name, argCount, arityIndex) → null | { min, max, variad :172-178 # Check one call against the arity index
1334
1058
  ```
1335
1059
 
1336
1060
  ### src/verify/closest-match.js
1337
1061
  ```
1338
1062
  module.exports = { levenshtein, closestMatch, buildSymbolCandidates, suggestionConfidence, formatSuggestion } :139-145
1339
- function levenshtein(a, b, max = Infinity) :20-47
1340
- function suggestionConfidence(distance, targetLen) :50-55
1341
- function closestMatch(target, candidates, opts = {}) → { name, file, line, dista :67-98
1342
- function buildSymbolCandidates(sigIndex) :104-126
1343
- function formatSuggestion(match, asCall) :129-137
1063
+ function levenshtein(a, b, max = Infinity) :20-47 # Levenshtein edit distance with an early-exit ceiling
1064
+ function suggestionConfidence(distance, targetLen) :50-55 # Bucket a normalized edit distance into a confidence label (p
1065
+ function closestMatch(target, candidates, opts = {}) → { name, file, line, dista :67-98 # Find the nearest candidate name to `target`
1066
+ function buildSymbolCandidates(sigIndex) :104-126 # Build `[{ name, file, line }]` symbol candidates from a SigM
1067
+ function formatSuggestion(match, asCall) :129-137 # Format a suggestion object into a human one-liner for report
1344
1068
  ```
1345
1069
 
1346
1070
  ### src/verify/hallucination-guard.js
1347
1071
  ```
1348
- module.exports = { verify, buildSymbolSet, loadDeps, loadScripts, isTestPath } :345-345
1349
- function isTestPath(p) :29-29
1350
- function buildSymbolSet(cwd) :76-94
1351
- function loadDeps(cwd) :97-110
1352
- function loadScripts(cwd) :113-122
1353
- function defaultFileExists(cwd, ref) :125-133
1354
- function defaultRelativeResolvable(cwd, mod, fileBasenames) :136-153
1355
- function verify(answerText, cwd, opts = {}) → { issues: object[], summa :177-301
1072
+ module.exports = { verify, buildSymbolSet, loadDeps, loadScripts, isTestPath } :378-378
1073
+ function isTestPath(p) :30-30
1074
+ function buildSymbolSet(cwd) :77-97 # Build the set of known symbol identifiers from the SigMap si
1075
+ function loadDeps(cwd) :100-113 # Load declared dependency names from package
1076
+ function loadScripts(cwd) :116-125 # Load the set of npm script names declared in package
1077
+ function defaultFileExists(cwd, ref) :128-136 # Default file-existence check: resolve a referenced path agai
1078
+ function defaultRelativeResolvable(cwd, mod, fileBasenames) :139-156 # Default relative-import resolver: fs candidates + basename m
1079
+ function verify(answerText, cwd, opts = {}) → { issues: object[], summa :180-282 # Verify an AI answer against the repository
1356
1080
  ```
1357
1081
 
1358
1082
  ### src/verify/lib-index.js
1359
1083
  ```
1360
1084
  module.exports = { buildLibraryIndex, extractDtsExports, directDeps, resolveEntry, formatVersionPins, collectVersionPins, extractPyExports, pythonDirectDeps, findSitePackages, resolvePyEntry } :329-333
1361
- function extractDtsExports(src) → string[] :40-50
1362
- function directDeps(cwd) :68-79
1363
- function resolveEntry(cwd, dep) → { version: string|null, d :85-105
1364
- function extractPyExports(src) → string[] :118-146
1365
- function pythonDirectDeps(cwd) :149-172
1366
- function findSitePackages(cwd) :175-190
1367
- function normalizePy(name) :193-195
1368
- function findPyVersion(sitePkgsDir, dep) :198-207
1369
- function resolvePyEntry(sitePkgsDirs, dep) → { version: string|null, s :213-229
1370
- function buildLibraryIndex(cwd, opts = {}) → { symbols: Set<string>, l :240-292
1371
- function formatVersionPins(libraries) :295-299
1372
- function collectVersionPins(cwd, opts = {}) → { pins: string[], total: :311-327
1085
+ function extractDtsExports(src) → string[] :40-50 # Extract exported symbol names from a `
1086
+ function directDeps(cwd) :68-79 # Read direct dependency names declared in the project's packa
1087
+ function resolveEntry(cwd, dep) → { version: string|null, d :85-105 # Resolve an installed dependency's version + entry `
1088
+ function extractPyExports(src) → string[] :118-146 # Extract exported symbol names from a Python module's `__init
1089
+ function pythonDirectDeps(cwd) :149-172 # Read direct Python dependency names from requirements
1090
+ function findSitePackages(cwd) :175-190 # Locate the project's venv `site-packages` directories (no Py
1091
+ function normalizePy(name) :193-195 # PEP 503 name normalization (case-insensitive, `-`/`_`/`
1092
+ function findPyVersion(sitePkgsDir, dep) :198-207 # Find an installed distribution's version from its `*
1093
+ function resolvePyEntry(sitePkgsDirs, dep) → { version: string|null, s :213-229 # Resolve a Python dependency to its installed module entry fi
1094
+ function buildLibraryIndex(cwd, opts = {}) → { symbols: Set<string>, l :240-292 # Build the installed-library signature index for `cwd`
1095
+ function formatVersionPins(libraries) :295-299 # D8: render `name@version` pins for the typed/installed libra
1096
+ function collectVersionPins(cwd, opts = {}) → { pins: string[], total: :311-327 # D8: collect `name@version` pins for direct dependencies — ve
1373
1097
  ```
1374
1098
 
1375
1099
  ### src/verify/parsers.js
1376
1100
  ```
1377
1101
  module.exports = { extractCodeBlocks, extractFilePaths, extractImports, extractSymbols, extractNpmScripts } :211-217
1378
- function extractCodeBlocks(text) → { lang: string, content: :43-67
1379
- function extractFilePaths(text) → { path: string, line: num :76-97
1380
- function extractImports(text) → { module: string, kind: ' :104-159
1381
- function extractNpmScripts(text) → { name: string, line: num :168-184
1382
- function extractSymbols(text) → { name: string, line: num :192-209
1102
+ function extractCodeBlocks(text) → { lang: string, content: :43-155 # Extract fenced code blocks
1103
+ function extractFilePaths(text) → { path: string, line: num :76-95 # Extract file-path references (deduped, first-seen line kept)
1104
+ function extractImports(text) → { module: string, kind: ' :104-137 # Extract import / require statements
1105
+ function extractNpmScripts(text) → { name: string, line: num :168-184 # Extract npm/pnpm/yarn script invocations (`npm run <name>`)
1106
+ function extractSymbols(text) → { name: string, line: num :192-217 # Extract function/class symbol references that look like call
1383
1107
  ```
1384
1108
 
1385
1109
  ### src/wiki/generate.js
@@ -1387,20 +1111,11 @@ function extractSymbols(text) → { name: string, line: num :192-209
1387
1111
  module.exports = { buildWiki, renderWikiMarkdown } :250-250
1388
1112
  function _rel(cwd, f) :22-24
1389
1113
  function _pct(fraction) :26-28
1390
- function _identity(cwd) :31-37
1391
- function _modules(index) :40-67
1392
- function _flow(cwd) :70-97
1393
- function _conventions(cwd, index) :100-117
1114
+ function _identity(cwd) :31-37 # Project name + version from package
1115
+ function _modules(index) :40-67 # Module rollup from the signature index (keys are cwd-relativ
1116
+ function _flow(cwd) :70-97 # Hubs, entry points, and cycle count from the dependency grap
1117
+ function _conventions(cwd, index) :100-117 # Conventions summary; index keys are resolved back to absolut
1394
1118
  function _health(cwd) :119-127
1395
- function buildWiki(cwd, opts = {}) → { data: object, markdown: :137-162
1396
- function renderWikiMarkdown(data, sigmapVersion) → string :171-248
1397
- ```
1398
-
1399
- ### src/workspace/detector.js
1400
- ```
1401
- module.exports = { detectWorkspaces, inferPackage, scopeToPackage } :4-4
1402
- function detectWorkspaces(cwd) :6-36
1403
- function inferPackage(query, workspaceDirs, cwd) :39-61
1404
- function _getMatchLength(name, token) :63-68
1405
- function scopeToPackage(filePath, packageDir) :71-85
1119
+ function buildWiki(cwd, opts = {}) → { data: object, markdown: :137-162 # Build the wiki
1120
+ function renderWikiMarkdown(data, sigmapVersion) → string :171-248 # Render the narrative markdown
1406
1121
  ```