Skip to content

Latest commit

 

History

History
1000 lines (885 loc) · 32.9 KB

File metadata and controls

1000 lines (885 loc) · 32.9 KB

SigMap — AGENTS.md

Instructions for Codex-style agents working in this repository.

Append Strategy (Required)

When writing generated signature content, never overwrite human-written notes above the auto-generated marker. Everything above the marker (like these notes) is preserved verbatim; everything below it is regenerated by gen-context.js.

Each generated context file carries one canonical SigMap commands guidance block (emitted from formatOutput, identical across every context file). Signatures keep their full parameter lists and return types — the token budget drops whole low-priority files rather than collapsing signatures to bare line anchors.

Auto-generated signatures

Code signatures

SigMap commands

When Command
Before answering a question about code sigmap ask "<your question>"
To rank files by topic sigmap --query "<topic>"
After changing config or source dirs sigmap validate
To verify an AI answer is grounded sigmap judge --response <file>

Always run sigmap ask (or sigmap --query) before searching for files relevant to a task.

deps

src/extractors/python_ast.py ← ast

changes (last 5 commits — 8 minutes ago)

src/format/usage-guidance.js                  +usageBlock
src/mcp/handlers.js                           +readMemory  ~getLines
src/mcp/server.js                             ~dispatch
src/session/notes.js                          +notesPath  +_currentBranch  +addNote  +readNotes
packages/adapters/claude.js                   ~format
packages/adapters/codex.js                    ~write  ~format
packages/adapters/copilot.js                  ~format
packages/adapters/cursor.js                   ~format
packages/adapters/gemini.js                   ~format
packages/adapters/openai.js                   ~format
packages/adapters/windsurf.js                 ~format
src/format/verify-report.js                   +escapeHtml  +toneFor  +labelFor  +renderReportHtml
src/verify/closest-match.js                   +levenshtein  +suggestionConfidence  +closestMatch  +buildSymbolCandidates
src/verify/hallucination-guard.js             +is  +isTestPath  +loadScripts  ~is
src/verify/parsers.js                         +extractNpmScripts  ~extractImports

packages

packages/adapters/claude.js

module.exports = { name, format, outputPath, write }  :124-124
function format(context, opts = {}) → string  :58-69
function _confidenceMeta(opts)  :71-78
function outputPath(cwd) → string  :85-87
function write(context, cwd, opts = {})  :96-122

packages/adapters/codex.js

module.exports = { name, format, outputPath, write }  :74-74
function format(context, opts = {}) → string  :27-30
function outputPath(cwd) → string  :37-39
function write(context, cwd, opts = {})  :49-72

packages/adapters/copilot.js

module.exports = { name, format, outputPath, write }  :93-93
function format(context, opts = {}) → string  :25-40
function _confidenceMeta(opts)  :42-49
function outputPath(cwd) → string  :56-58
function write(context, cwd, opts = {})  :68-91

packages/adapters/cursor.js

module.exports = { name, format, outputPath }  :56-56
function format(context, opts = {}) → string  :23-36
function _confidenceMeta(opts)  :38-45
function outputPath(cwd) → string  :52-54

packages/adapters/gemini.js

module.exports = { name, format, outputPath, write }  :104-104
function format(context, opts = {}) → string  :31-51
function outputPath(cwd) → string  :58-60
function write(context, cwd, opts = {})  :70-93
function _confidenceMeta(opts)  :95-102

packages/adapters/openai.js

module.exports = { name, format, outputPath }  :70-70
function format(context, opts = {}) → string  :29-49
function outputPath(cwd) → string  :57-59
function _confidenceMeta(opts)  :61-68

packages/adapters/windsurf.js

module.exports = { name, format, outputPath }  :56-56
function format(context, opts = {}) → string  :23-36
function _confidenceMeta(opts)  :38-45
function outputPath(cwd) → string  :52-54

packages/adapters/index.js

module.exports = { getAdapter, listAdapters, adapt, outputsToAdapters }  :81-81
function getAdapter(name) → { name: string, format: F  :26-38
function listAdapters() → string[]  :44-46
function adapt(context, adapterName, opts = {}) → string  :55-64
function outputsToAdapters(outputs) → string[]  :72-79

packages/adapters/llm-full.js

module.exports = { name: 'llm-full', format, outputPath, write }  :4-4
function outputPath(cwd)  :6-6
function format(context, opts)  :8-20
function write(context, cwd, opts)  :22-25

packages/adapters/willow.js

module.exports = { name, format, outputPath, write }  :200-200
function format(context, opts = {}) → string  :36-40
function outputPath(cwd) → string  :47-49
function generateAtomId(filepath) → string  :57-63
async function fetchWithTimeout(url, opts, timeoutMs) → Promise<Response>  :72-80
async function postAtomWithRetry(atom, mcpUrl, timeoutMs, maxRetries) → Promise<boolean>  :90-142
async function write(context, cwd, opts = {}) → Promise<void>  :155-198

packages/cli/index.js

module.exports = { CLI_ENTRY, run }  :58-63
function run(argv, cwd) → void  :36-56

packages/core/README.md

h1 sigmap-core
h2 Installation
h2 Quick start
h2 API reference
h3 `extract(src, language)` → `string[]`
h3 `rank(query, sigIndex, opts?)` → `Result[]`
h3 `buildSigIndex(cwd)` → `Map<string, string[]>`
h3 `scan(sigs, filePath)` → `{ safe: string[], redacted: boolean }`
h3 `score(cwd)` → `HealthResult`
h2 Migration from v2.3 and earlier
h2 v3.0 — Multi-Adapter Architecture (released)
h2 Zero dependencies
code-fence bash
code-fence plain
code-fence js
code-fence ---

packages/core/index.js

module.exports = { extract, rank, buildSigIndex, scan, score, adapt }  :254-267
function _resolveExtractor(language)  :64-71
function extract(src, language) → string[]  :91-120
function rank(query, sigIndex, opts) → { file: string, score: nu  :143-150
function buildSigIndex(cwd) → Map<string, string[]>  :162-169
function scan(sigs, filePath) → { safe: string[], redacte  :185-192
function score(cwd) → { * score: number, * grad  :215-222
function adapt(context, adapterName, opts = {}) → string  :241-249

src

src/format/usage-guidance.js

module.exports = { usageBlock }  :28-28
function usageBlock()  :12-26

src/mcp/handlers.js

module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getImpact, getLines, readMemory }  :551-551
function _readContextFiles(cwd)  :10-17
function readContext(args, cwd)  :32-62
function searchSignatures(args, cwd)  :70-95
function getMap(args, cwd)  :103-126
function createCheckpoint(args, cwd)  :138-215
function getRouting(args, cwd)  :224-261
function explainFile(args, cwd)  :269-356
function listModules(args, cwd)  :364-403
function queryContext(args, cwd)  :411-429
function getImpact(args, cwd)  :437-449
function getLines(args, cwd)  :458-506
function readMemory(args, cwd)  :514-549

src/mcp/server.js

module.exports = { start }  :132-132
function respond(id, result)  :28-30
function respondError(id, code, message)  :32-36
function dispatch(msg, cwd)  :41-99
function start(cwd)  :104-130

src/mcp/tools.js

module.exports = { TOOLS }  :220-220

src/session/notes.js

module.exports = { notesPath, addNote, readNotes, formatNotes, clearNotes }  :99-99
function notesPath(cwd)  :23-25
function _currentBranch(cwd)  :27-35
function addNote(cwd, text, opts = {})  :45-58
function readNotes(cwd, limit = 0) → object[]  :66-78
function formatNotes(notes)  :81-91
function clearNotes(cwd)  :94-97

src/analysis/coverage-score.js

module.exports = { coverageScore, CODE_EXTS }  :105-105
function coverageScore(cwd, fileEntries, config)  :41-90
function _walk(dir, excludeSet, out)  :92-103

src/analysis/diagnostics.js

module.exports = { formatFileDecision, computeFileMetrics, explainInclusion, explainExclusion, estimateTokens }  :80-86
function estimateTokens(text)  :14-16
function formatFileDecision(entry, decision, reason, score = null)  :18-26
function computeFileMetrics(entry)  :28-41
function explainInclusion(fileEntries, budgetLimit)  :43-74
function explainExclusion(dropped, reason)  :76-78

src/cache/sig-cache.js

module.exports = { loadCache, saveCache, getChangedFiles, updateCacheEntries }  :105-105
function cachePath(cwd)  :19-21
function loadCache(cwd, currentVersion) → Map<string, { mtime: numb  :32-42
function saveCache(cwd, currentVersion, cache)  :51-61
function getChangedFiles(files, cache) → { changed: string[], unch  :71-88
function updateCacheEntries(cache, extracted)  :96-103

src/config/defaults.js

module.exports = { DEFAULTS }  :155-155

src/config/loader.js

module.exports = { loadConfig, loadBaseConfig }  :313-313
function loadBaseConfig(extendsVal, cwd)  :9-54
function detectAutoSrcDirs(cwd, excludeList) → string[]  :99-114
function _legacyDetectAutoSrcDirs(cwd, excludeList) → string[]  :123-225
function loadConfig(cwd) → object  :236-307
function deepClone(obj)  :309-311

src/discovery/framework-detector.js

module.exports = { detectFrameworks }  :7-7
function detectFrameworks(cwd)  :9-57
function _readDeps(cwd)  :59-64
function _readFile(p)  :66-68
function _existsAnywhere(cwd, filename, maxDepth)  :70-74
function _walkFind(dir, name, depth)  :76-88

src/discovery/language-detector.js

module.exports = { detectLanguages }  :7-7
function detectLanguages(cwd)  :26-61
function _walkDepth(dir, depth, extCount)  :63-76

src/discovery/r-manifest.js

module.exports = { readDescription, readNamespace, collectLocalDefs }  :176-176
function readDescription(cwd) → object|null  :28-59
function splitDeps(value)  :66-71
function readNamespace(cwd) → object|null  :88-132
function splitArgs(raw)  :134-136
function stripQuotes(s)  :138-140
function collectLocalDefs(rFiles) → Map<string, string>  :150-174

src/discovery/sigmapignore.js

module.exports = { loadIgnorePatterns, matchesIgnorePattern }  :6-6
function loadIgnorePatterns(cwd)  :8-19
function matchesIgnorePattern(dirName, patterns)  :21-29

src/discovery/source-root-registry.js

module.exports = { REGISTRY }  :175-175

src/discovery/source-root-resolver.js

module.exports = { resolveSourceRoots }  :11-11
function resolveSourceRoots(cwd, opts = {})  :16-72
function _detectMonorepo(cwd)  :74-83
function _enumerateCandidates(cwd, isMonorepo, ignorePatterns, excludeList)  :85-142
function _applySpecialRules(scored, cwd, primaryFw, fwEntry, frameworks)  :144-179
function _dedupeNested(scored)  :181-192
function _computeConfidence(frameworks, languages, scoredCount)  :194-198

src/discovery/source-root-scorer.js

module.exports = { scoreCandidate, getRecentlyChangedDirs, ROOT_ENTRYPOINTS, JVM_PATH_PATTERN }  :103-103
function getRecentlyChangedDirs(cwd)  :36-41
function scoreCandidate(dirName, fullPath, context)  :43-89
function _countSourceFiles(dir, depth)  :91-101

src/eval/analyzer.js

module.exports = { analyzeFiles, formatAnalysisTable, formatAnalysisJSON }  :235-235
function isDockerfile(name)  :49-51
function getExtractorName(filePath)  :53-59
function tokenCount(sigs)  :62-64
function hasCoverage(filePath, cwd)  :70-85
function loadExtractor(name, cwd)  :91-100
function analyzeFiles(files, cwd, opts) → object[]  :113-170
function formatAnalysisTable(stats, showSlow) → string  :179-213
function formatAnalysisJSON(stats) → object  :221-233

src/eval/runner.js

module.exports = { run, rank, loadTasks, buildSigIndex, formatTable, formatMetrics, tokenize }  :308-308
function buildSigIndex(cwd) → Map<string, string[]>  :39-81
function tokenize(text) → string[]  :93-105
function scoreFile(sigs, queryTokens) → number  :119-136
function rank(query, index, topK = 10) → { file: string, score: nu  :146-157
function estimateTokens(sigs) → number  :168-171
function loadTasks(tasksFile) → Array<{id:string, query:s  :184-206
function run(tasksFile, cwd, opts = {}) → { * tasks: Array<{id, que  :224-271
function formatTable(taskResults) → string  :282-290
function formatMetrics(metrics) → string  :297-306

src/eval/scorer.js

module.exports = { hitAtK, reciprocalRank, precisionAtK, aggregate, firstRank }  :126-126
function firstRank(ranked, expected) → number  :22-29
function normalizePath(p) → string  :38-40
function hitAtK(ranked, expected, k = 5) → 0|1  :49-51
function reciprocalRank(ranked, expected) → number  :59-62
function precisionAtK(ranked, expected, k = 5) → number  :72-78
function aggregate(results, k = 5) → { * hitAt5: number, // fr  :93-120
function round(x)  :122-124

src/eval/usefulness-scorer.js

module.exports = { scoreUsefulness, computeUsefulnessStats }  :3-3
function scoreUsefulness(taskResult, rankingScore)  :11-38
function computeUsefulnessStats(taskResults)  :40-66

src/extractors/coverage.js

module.exports = { buildTestIndex, isTested }  :79-79
function walkFiles(dir)  :6-20
function buildTestIndex(cwd, testDirs)  :22-62
function isTested(funcName, testIndex)  :64-77

src/extractors/cpp.js

module.exports = { extract }  :69-69
function extract(src) → string[]  :8-69
function extractBlock(src, startIndex)  :36-45
function extractMembers(block)  :47-57
function normalizeParams(params)  :59-62
function normalizeType(type)  :64-67

src/extractors/csharp.js

module.exports = { extract }  :59-59
function extract(src) → string[]  :8-59
function extractBlock(src, startIndex)  :27-36
function extractMembers(block)  :38-47
function normalizeParams(params)  :49-52
function normalizeType(type)  :54-57

src/extractors/css.js

module.exports = { extract }  :69-69
function extract(src) → string[]  :8-17

src/extractors/dart.js

module.exports = { extract }  :60-60
function extract(src) → string[]  :8-60
function extractBlock(src, startIndex)  :34-43
function extractMembers(block)  :45-53
function normalizeParams(params)  :55-57

src/extractors/deps.js

module.exports = { extractPythonDeps, extractTSDeps, extractRDeps, buildReverseDepMap }  :110-110
function extractPythonDeps(src) → string[]  :26-41
function extractTSDeps(src) → string[]  :48-61
function extractRDeps(src) → string[]  :76-90
function buildReverseDepMap(forwardMap) → Map<string, string[]>  :97-108

src/extractors/dockerfile.js

module.exports = { extract }  :49-49
function extract(src) → string[]  :8-47

src/extractors/gdscript.js

module.exports = { extract }  :131-131
function extract(src) → string[]  :9-42
function extractInnerMembers(stripped, startIndex)  :98-114
function normalizeParams(params)  :116-129

src/extractors/generic.js

module.exports = { extract }  :2-2
function extract(src)  :14-26

src/extractors/go.js

module.exports = { extract }  :65-65
function extract(src) → string[]  :8-65
function extractBlock(src, startIndex)  :39-48
function extractInterfaceMethods(block)  :50-58
function normalizeParams(params)  :60-63

src/extractors/graphql.js

module.exports = { extract }  :66-66
function extract(src) → string[]  :11-66

src/extractors/html.js

module.exports = { extract }  :39-39
function extract(src) → string[]  :9-37

src/extractors/java.js

module.exports = { extract }  :60-60
function extract(src) → string[]  :8-60
function extractBlock(src, startIndex)  :27-37
function extractMembers(block)  :39-48
function normalizeParams(params)  :50-53
function normalizeType(type)  :55-58

src/extractors/javascript.js

module.exports = { extract }  :147-147
function extract(src) → string[]  :12-113
function extractBlock(src, startIndex)  :88-98
function extractClassMembers(block, returnHints)  :103-124
function buildReturnHints(src)  :119-121
function normalizeType(type)  :133-136
function formatReturnHint(type)  :138-140
function normalizeParams(params)  :142-145

src/extractors/kotlin.js

module.exports = { extract }  :66-66
function extract(src) → string[]  :8-66
function extractBlock(src, startIndex)  :34-43
function extractMembers(block)  :45-66
function normalizeParams(params)  :57-64

src/extractors/line-anchor.js

module.exports = { lineAt, anchor, withAnchor }  :52-52
function lineAt(src, idx) → number  :22-29
function anchor(start, end) → string  :37-39
function withAnchor(sig, start, end) → string  :48-50

src/extractors/markdown.js

module.exports = { extract }  :30-30
function extract(src) → string[]  :10-28

src/extractors/patterns.js

module.exports = { extract }  :135-135
function extract(src) → string[]  :10-133

src/extractors/php.js

module.exports = { extract }  :71-71
function extract(src) → string[]  :8-71
function extractBlock(src, startIndex)  :37-46
function extractMembers(block)  :48-71
function normalizeParams(params)  :61-64
function normalizeType(type)  :66-69

src/extractors/prdiff.js

module.exports = { diffSignatures, extractName }  :45-45
function diffSignatures(baseSigs, currentSigs) → {added:string[], removed:  :9-36
function extractName(sig)  :38-43

src/extractors/properties.js

module.exports = { extract }  :37-37
function extract(src) → string[]  :10-35

src/extractors/protobuf.js

module.exports = { extract }  :63-63
function extract(src) → string[]  :10-63

src/extractors/python.js

module.exports = { extract, tryNativeExtract }  :262-262
function pyBlockEnd(srcLines, startLine) → number  :14-24
function tryNativeExtract(filePath) → string[]|null  :32-44
function extract(src, filePath) → string[]  :55-140
function extractClassMethods(stripped, startIndex)  :142-161
function tryExtractDataclassFields(stripped, classIndex)  :163-177
function tryExtractBaseModelFields(stripped, bodyStart)  :179-194
function extractClassConstants(stripped, startIndex)  :196-210
function extractReturnType(sigLine)  :212-218
function normalizeParams(params)  :220-238
function extractDocHint(src, fnName, fnSigLine)  :240-260

src/extractors/python_ast.py

def annotation_to_str(node)  :25-48  # Convert an AST annotation node to a string representation
def format_args(args_node)  :51-103  # Format a function arguments node into a compact signature st
def get_decorator_names(node)  :106-120  # Return a list of decorator name strings for a function/class
def is_dataclass(node)  :123-124
def is_basemodel(bases)  :127-133  # Check if class bases include BaseModel or BaseSettings
def is_optional_annotation(annotation)  :136-146  # Check if an annotation represents an Optional type
def get_docstring_hint(node)  :149-158  # Extract first sentence of docstring, if present
def extract_dataclass_fields(class_node)  :161-171  # Return a collapsed fields string for a @dataclass class
def extract_basemodel_fields(class_node)  :174-190  # Return a compact {required*, optional
def extract_class_constants(class_node)  :193-213  # Yield ALL_CAPS constant assignments from class body
def extract_method_sig(func_node)  :222-229  # Format a method signature string (already indented by caller
def extract_function_sig(func_node, src_lines)  :232-241  # Format a top-level function signature string
def extract_fastapi_routes(tree, src_lines)  :244-265  # Extract FastAPI route signatures from top-level decorated fu
def extract(filepath)  :268-338
def main()  :341-351

src/extractors/python_dataclass.js

module.exports = { extract }  :77-77
function extract(src) → string[]  :10-75

src/extractors/r.js

module.exports = { extract }  :273-273
function extract(src) → string[]  :20-117
function collectRoxygenHints(src)  :125-153
function pickRoxygenLine(block, tag)  :155-169
function applyHint(hints, name)  :171-174
function extractListMethods(body, cap)  :180-193
function inAnyRange(pos, ranges)  :195-200
function readFirstStringArg(body)  :203-206
function readBalancedParens(src, openIdx, cap = 16384)  :214-237
function normalizeParams(raw)  :244-271

src/extractors/ruby.js

module.exports = { extract }  :54-54
function extract(src) → string[]  :8-38
function normalizeParams(params)  :40-43
function extractReturnHint(stripped, index)  :45-52

src/extractors/rust.js

module.exports = { extract }  :82-82
function extract(src) → string[]  :8-82
function extractBlock(src, startIndex)  :48-57
function extractMethods(block)  :59-82
function normalizeParams(params)  :69-72
function extractReturnType(afterParen)  :74-82

src/extractors/scala.js

module.exports = { extract }  :76-76
function extract(src) → string[]  :8-76
function extractBlock(src, startIndex)  :39-48
function extractMembers(block)  :50-76
function normalizeParams(params)  :62-69
function normalizeType(type)  :71-74

src/extractors/shell.js

module.exports = { extract }  :43-43
function extract(src) → string[]  :8-43

src/extractors/sql.js

module.exports = { extract }  :93-93
function extract(src) → string[]  :10-78
function _cleanName(raw)  :80-82
function _normalizeParams(raw)  :84-91

src/extractors/svelte.js

module.exports = { extract }  :58-58
function extract(src) → string[]  :8-58
function normalizeParams(params)  :48-51
function normalizeType(type)  :53-56

src/extractors/swift.js

module.exports = { extract }  :73-73
function extract(src) → string[]  :8-73
function extractBlock(src, startIndex)  :34-43
function extractMembers(block)  :45-73
function normalizeParams(params)  :56-63
function extractArrowType(str)  :65-73

src/extractors/terraform.js

module.exports = { extract }  :74-74
function extract(src) → string[]  :11-74

src/extractors/todos.js

module.exports = { extractTodos }  :26-26
function extractTodos(src) → {line:number, tag:string,  :8-24

src/extractors/toml.js

module.exports = { extract }  :42-42
function extract(src) → string[]  :10-40

src/extractors/typescript.js

module.exports = { extract }  :221-221
function extract(src) → string[]  :12-117
function extractBlock(src, startIndex)  :160-170
function extractInterfaceMembers(block)  :174-188
function extractClassMembers(block)  :195-221
function normalizeParams(params)  :216-219

src/extractors/typescript_react.js

module.exports = { extract }  :60-60
function extract(src) → string[]  :10-20

src/extractors/vue.js

module.exports = { extract }  :80-80
function extract(src) → string[]  :8-35
function normalizeParams(params)  :70-73
function normalizeType(type)  :75-78

src/extractors/vue_sfc.js

module.exports = { extract }  :99-99
function extract(src) → string[]  :10-68

src/extractors/xml.js

module.exports = { extract }  :46-46
function extract(src) → string[]  :10-44

src/extractors/yaml.js

module.exports = { extract }  :59-59
function extract(src) → string[]  :8-57

src/format/benchmark-report.js

module.exports = { loadBenchmarkReports, buildBenchmarkSummary, generateBenchmarkReportHtml, writeBenchmarkReport }  :438-443
function escapeHtml(value)  :6-12
function formatInt(value)  :14-18
function formatCompact(value)  :20-26
function formatPct(value, digits = 1)  :28-32
function formatMaybePct(value, digits = 1)  :34-38
function formatRatio(value, digits = 1)  :40-44
function formatMoney(value)  :46-50
function durationLabel(ms)  :52-60
function maxOrZero(values)  :62-65
function readJson(filePath)  :67-74
function loadBenchmarkReports(cwd)  :76-86
function buildRetrievalSummary(retrieval)  :88-123
function buildBenchmarkSummary(reports, matrixSummary)  :125-159
function renderCard(label, value, hint, tone)  :161-170
function renderProgress(label, value, max, suffix)  :172-185
function renderMatrixSection(matrix)  :187-211
function renderTokenSection(token)  :213-239
function renderRetrievalSection(retrieval)  :241-268
function renderQualitySection(quality)  :270-296
function renderTaskSection(task)  :298-327
function generateBenchmarkReportHtml(reports, opts = {})  :329-388
function writeBenchmarkReport(cwd, opts = {})  :426-436

src/format/cache.js

module.exports = { formatCache, formatCachePayload }  :53-53
function formatCache(content) → string  :19-27
function formatCachePayload(content, model) → string  :37-51

src/format/dashboard.js

module.exports = { generateDashboardHtml, renderHistoryCharts, computeExtractorCoverage, percentile, overBudgetStreak }  :525-525
function toNumber(v)  :13-16
function percentile(values, p)  :18-30
function overBudgetStreak(entries)  :32-40
function loadConfig(cwd)  :42-50
function shouldExclude(rel, excludeSet)  :52-59
function detectLanguage(filePath)  :61-86
function walkFiles(dir, maxDepth, depth, out, excludeSet)  :88-106
function computeExtractorCoverage(cwd)  :108-140
function readBenchmarkTrend(cwd)  :142-204
function lineChartSvg(values, title, ySuffix)  :206-255
function barChartSvg(perLanguage)  :257-292
function sparkline(values)  :294-305
function escapeAttr(s)  :307-311
function readTokenReduction(cwd)  :316-350
function tokenReductionPanelHtml(tr)  :352-405
function buildDashboardData(cwd, health)  :407-444
function generateDashboardHtml(cwd, health)  :446-496
function renderHistoryCharts(cwd, health)  :498-523

src/format/llm-txt.js

module.exports = { format, outputPath }  :3-3
function outputPath(cwd)  :5-5
function format(context, cwd, version)  :7-28

src/format/llms-txt.js

module.exports = { format, outputPath }  :5-5
function outputPath(cwd)  :7-7
function getShortCommit(cwd)  :9-12
function detectVersion(cwd)  :14-20
function format(context, cwd, writtenFiles, sigmapVersion)  :22-70

src/format/verify-report.js

module.exports = { renderReportHtml, renderReportMarkdown, escapeHtml }  :164-164
function escapeHtml(value)  :23-29
function toneFor(issue)  :31-35
function labelFor(issue)  :37-39
function renderReportHtml(result, opts = {}) → string  :48-115
function renderReportMarkdown(result)  :144-162

src/graph/builder.js

module.exports = { build, buildFromCwd, extractFileDeps, normalizePath }  :386-386
function normalizePath(p)  :17-19
function resolveJsPath(dir, importStr, fileSet) → string|null  :40-54
function escapeRegex(s)  :61-63
function resolveRPath(dir, importStr, fileSet, cwd)  :65-80
function extractFileDeps(filePath, content, fileSet, cwd, ctx) → string[]  :94-239
function build(files, cwd, ctx) → { forward: Map<string,str  :283-318
function buildFromCwd(cwd, opts) → { forward: Map<string,str  :330-384

src/graph/impact.js

module.exports = { getImpact, analyzeImpact, formatImpact, formatImpactJSON }  :240-240
function normalizePath(p)  :16-18
function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr  :33-70
function isTestFile(f)  :92-92
function isRouteFile(f)  :93-93
function getImpact(changedFile, graph, opts) → { * changed: string, * di  :116-142
function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o  :156-171
function formatImpact(result) → string  :183-221
function formatImpactJSON(result) → object  :229-238

src/health/scorer.js

module.exports = { score }  :152-152
function score(cwd) → { * score: number, * grad  :30-150

src/judge/judge-engine.js

module.exports = { groundedness, judge }  :122-122
function tokenize(text)  :14-16
function groundedness(response, context)  :18-26
function extractContextFiles(context, cwd)  :37-59
function judge(response, context, opts = {})  :61-120

src/learning/weights.js

module.exports = { BASELINE, DECAY, MAX_MULT, MIN_MULT, weightsPath, clampMultiplier, normalizeFile, loadWeights, saveWeights, updateWeights, boostFiles, penalizeFiles, resetWeights, exportWeights, importWeights }  :154-170
function weightsPath(cwd)  :11-13
function clampMultiplier(value)  :15-20
function normalizeFile(cwd, filePath)  :22-31
function sanitizeWeights(cwd, weights)  :33-46
function loadWeights(cwd)  :48-55
function saveWeights(cwd, weights)  :57-76
function updateWeights(cwd, opts = {})  :78-109
function boostFiles(cwd, files, amount = 0.15)  :111-113
function penalizeFiles(cwd, files, amount = 0.10)  :115-117
function resetWeights(cwd)  :119-122
function exportWeights(cwd, outputPath)  :124-134
function importWeights(cwd, importPath, replace)  :136-152

src/map/class-hierarchy.js

module.exports = { analyze }  :117-117
function analyze(files, cwd)  :16-117

src/map/import-graph.js

module.exports = { analyze, extractImports, buildReverseGraph, resolveJsPath, detectCycles }  :185-185
function extractImports(filePath, content, fileSet)  :22-76
function resolveJsPath(dir, importStr, fileSet)  :78-95
function detectCycles(graph)  :100-126
function buildReverseGraph(graph)  :131-140
function analyze(files, cwd)  :145-183

src/map/route-table.js

module.exports = { analyze }  :127-127
function shouldSkipFile(rel)  :18-21
function analyze(files, cwd)  :23-125

src/plan/planner.js

module.exports = { createPlan }  :10-10
function createPlan(goal, cwd, config)  :12-65

src/retrieval/ranker.js

module.exports = { rank, buildSigIndex, scoreFile, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, detectIntent }  :556-556
function _computePenalty(filePath)  :61-68
function _computeHubs(graph)  :71-82
function _isHub(filePath)  :85-89
function scoreFile(filePath, sigs, queryTokens, weights) → { score: number, signals:  :100-157
function rank(query, sigIndex, opts) → { file: string, score: nu  :173-294
function _parseContextFile(contextPath) → Map<string, string[]>  :330-362
function _mergeSigIndex(target, source)  :365-373
function _buildSigIndexFromCache(cwd) → Map<string, string[]>  :380-400
function _enrichSigIndexFromStrategy(cwd, index) → Map<string, string[]>  :408-414
function buildSigIndex(cwd, opts) → Map<string, string[]>  :431-464
function formatRankTable(results, query) → string  :473-509
function formatRankJSON(results, query) → object  :518-533
function detectIntent(query)  :548-554

src/retrieval/tokenizer.js

module.exports = { tokenize, STOP_WORDS }  :54-54
function tokenize(text, opts) → string[]  :31-52

src/routing/classifier.js

module.exports = { classify, classifyAll }  :102-102
function classify(filePath, sigs) → 'fast'|'balanced'|'powerf  :15-83
function classifyAll(fileEntries, cwd) → { fast: string[], balance  :92-100

src/routing/hints.js

module.exports = { TIERS, formatRoutingSection }  :103-103
function formatRoutingSection(groups) → string  :66-101

src/security/patterns.js

module.exports = { PATTERNS }  :51-51

src/security/scanner.js

module.exports = { scan }  :36-36
function scan(signatures, filePath) → { safe: string[], redacte  :14-34

src/session/memory.js

module.exports = { loadSession, saveSession, mergeSessionContext, clearSession }  :6-6
function sessionPath(cwd)  :10-12
function loadSession(cwd)  :14-24
function saveSession(cwd, { intent, topFiles, query })  :26-35
function mergeSessionContext(scores, session, currentIntent)  :40-51
function clearSession(cwd)  :53-56

src/tracking/logger.js

module.exports = { logRun, readLog, summarize }  :115-115
function logRun(entry, cwd)  :27-52
function readLog(cwd) → object[]  :59-74
function summarize(entries) → object  :81-113

src/verify/closest-match.js

module.exports = { levenshtein, closestMatch, buildSymbolCandidates, suggestionConfidence, formatSuggestion }  :139-145
function levenshtein(a, b, max = Infinity)  :20-47
function suggestionConfidence(distance, targetLen)  :50-55
function closestMatch(target, candidates, opts = {}) → { name, file, line, dista  :67-98
function buildSymbolCandidates(sigIndex)  :104-126
function formatSuggestion(match, asCall)  :129-137

src/verify/hallucination-guard.js

module.exports = { verify, buildSymbolSet, loadDeps, loadScripts, isTestPath }  :310-310
function isTestPath(p)  :28-28
function buildSymbolSet(cwd)  :66-84
function loadDeps(cwd)  :87-100
function loadScripts(cwd)  :103-112
function defaultFileExists(cwd, ref)  :115-123
function defaultRelativeResolvable(cwd, mod, fileBasenames)  :126-143
function verify(answerText, cwd, opts = {}) → { issues: object[], summa  :167-286

src/verify/parsers.js

module.exports = { extractCodeBlocks, extractFilePaths, extractImports, extractSymbols, extractNpmScripts }  :194-200
function extractCodeBlocks(text) → { lang: string, content:   :29-53
function extractFilePaths(text) → { path: string, line: num  :62-80
function extractImports(text) → { module: string, kind: '  :87-142
function extractNpmScripts(text) → { name: string, line: num  :151-167
function extractSymbols(text) → { name: string, line: num  :175-192

src/workspace/detector.js

module.exports = { detectWorkspaces, inferPackage, scopeToPackage }  :4-4
function detectWorkspaces(cwd)  :6-36
function inferPackage(query, workspaceDirs, cwd)  :39-61
function _getMatchLength(name, token)  :63-68
function scopeToPackage(filePath, packageDir)  :71-85