agentleFS
Sign inSign up

sigmap

manojmallick/sigmap/AGENTS.md

Instructions for Codex-style agents working in this repository. 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…

AGENTS.md637 starsChanged 5 months ago
# 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
<!-- Updated by gen-context.js -->
# 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.

## todos
```
gen-context.js:27247  # TODO: s');
```

## changes (last 5 commits — 8 minutes ago)
```
src/deps/inventory.js                         +readText  +readJson  +exists  +stripXmlComments
src/deps/sbom.js                              +isExactVersion  +normalizeVersion  +purlEncode  +purlFor
src/extractors/dispatch.js                    ~extractFile  ~langFor
src/extractors/pipeline.js                    +platformFor  +sniffPlatform  +stripInlineComment  +unquote
src/extractors/yaml.js                        ~extract
src/graph/builder.js                          ~extractFileDeps  ~build  ~_configuredSrcDirs  ~buildFromCwd
src/graph/impact.js                           ~isRouteFile  ~getImpact  ~normalizePath
src/graph/path-key.js                         +displayPath  ~graphKey
src/learning/weights.js                       ~sanitizeWeights  ~updateWeights  ~importWeights  ~weightsPath
src/map/config-manifest.js                    +scopeSummary  ~readText  ~readJson  ~count
src/plan/planner.js                           ~createPlan
src/wiki/generate.js                          +_rel  ~_rel  ~_flow  ~_pct
gen-context.js                                +readText  +readJson  +exists  +stripXmlComments
```

## .

### gen-context.js
```
function __require(key)  :9-20
function __git(args, opts = {})  :26386-26389
function __tryGit(args, opts = {})  :26390-26393
function requireSourceOrBundled(key)  :26398-26405
function isDockerfile(filename)  :26424-26426
function loadIgnorePatterns(cwd)  :26431-26444
function matchesIgnore(relPath, patterns)  :26446-26467
function walkDir(dir, exclude, maxDepth, depth = 0)  :26472-26495
function buildFileList(cwd, config)  :26497-26508
function collectTestEntries(cwd, config, existing)  :26519-26545  # Source files a project declares as its own entrypoints in pa
function declaredEntrypoints(cwd, config, existing)  :26547-26567
function getExtractor(name)  :26573-26583
function _toolchainLabel()  :26593-26605
function detectAndExtract(filePath, content, maxSigsPerFile, exactness, cwd)  :26607-26698
function extractFileDeps(filePath, content, config) → string[]  :26700-26711  # Extract absolute dependency paths from a single file
function extractSignatureName(sig)  :26713-26717
function annotateCoverage(sigs, testIndex, enabled)  :26719-26729
function nextRecentMtime()  :26750-26752
function estimateTokens(str) → number  :26754-26756  # Estimate token count from character count (chars/4, ±5%)
function isTestFile(filePath)  :26758-26773
function isConfigFile(filePath)  :26775-26778
function isGeneratedFile(filePath)  :26780-26782
function isMockFile(filePath)  :26784-26789
function isEntryPointFile(filePath)  :26799-26804
function computeEffectiveMaxTokens(fileEntries, config) → number  :26821-26859  # , tests/, spec/, __tests__/, e2e/)
function pruneStaleContextSplits(cwd, keep) → string[]  :26876-26891  # Delete `
function applyTokenBudget(fileEntries, maxTokens)  :26893-26999
function getRecentlyCommittedFiles(cwd, count)  :27004-27012
function getDiffFiles(cwd, stagedOnly)  :27017-27027
function getFilesChangedSinceBase(cwd, baseRef)  :27029-27043
```

## packages

### packages/adapters/claude.js
```
module.exports = { name, format, outputPath, write }  :126-126
function format(context, opts = {}) → string  :58-69  # Format context suited for CLAUDE
function _confidenceMeta(opts)  :71-80
function outputPath(cwd) → string  :87-89  # Return the output file path for this adapter
function write(context, cwd, opts = {})  :98-124  # Write signatures into CLAUDE
```

### packages/adapters/copilot.js
```
module.exports = { name, format, outputPath, write }  :95-95
function format(context, opts = {}) → string  :25-40  # Format context for GitHub Copilot instructions
function _confidenceMeta(opts)  :42-51
function outputPath(cwd) → string  :58-60  # Return the output file path for this adapter
function write(context, cwd, opts = {})  :70-93  # Write signatures into copilot-instructions
```

### packages/core/index.js
```
module.exports = { extract, rank, buildSigIndex, scan, score, adapt }  :255-268
function _resolveExtractor(language)  :65-72
function extract(src, language) → string[]  :92-121  # Extract code signatures from source text for the given langu
function rank(query, sigIndex, opts) → { file: string, score: nu  :144-151  # Rank files in a signature index against a natural-language q
function buildSigIndex(cwd) → Map<string, string[]>  :163-170  # Build a file→signatures index from the generated context fil
function scan(sigs, filePath) → { safe: string[], redacte  :186-193  # Scan an array of signature strings for secrets and redact an
function score(cwd) → { * score: number, * grad  :216-223  # Compute a composite health score for the project at cwd
function adapt(context, adapterName, opts = {}) → string  :242-250  # Format a context string using the named output adapter
```

## src

### src/config/defaults.js
```
module.exports = { DEFAULTS }  :212-212
```

### src/deps/inventory.js
```
module.exports = { collectDependencies, versionPins, npmLockVersions, MANIFESTS, MAX_DEPS_PER_MANIFEST }  :538-544
function readText(p)  :32-32
function readJson(p)  :33-33
function exists(p)  :34-34
function stripXmlComments(src)  :37-37  # Strip XML comments so a commented-out <dependency> is never 
function stripHashComments(src)  :40-51  # Blank `#` comments outside quotes, preserving line structure
function tomlTables(src) → Array<{name:string, body:  :64-77  # Split a TOML document into `[table]` sections
function tomlTable(tables, name)  :80-83  # Body of the first table with this exact name, or '' when abs
function tomlValue(body, key)  :86-89  # `key = "value"` lookup inside a table body
function dep(ecosystem, name, version, scope, file)  :91-93
function npmDeps(cwd, rel, out)  :106-117
function npmLockVersions(cwd) → Map<string,string>  :124-144  # Exact installed versions from package-lock
function requirementsDeps(cwd, rel, out)  :152-164
function pyprojectDeps(cwd, rel, out)  :167-208  # `[project] dependencies` (PEP 621) and `[tool
function mavenDeps(cwd, rel, out)  :219-229  # Maven coordinates, with `${property}` placeholders resolved 
function gradleDeps(cwd, rel, out)  :250-263
function versionCatalogDeps(cwd, rel, out)  :266-294  # Gradle version catalog: [libraries] entries in gradle/libs
function goDeps(cwd, rel, out)  :300-317
function cargoDeps(cwd, rel, out)  :319-344
function gemfileDeps(cwd, rel, out)  :346-359
function composerDeps(cwd, rel, out)  :361-370
function csprojDeps(cwd, rel, out)  :372-383
function pubspecDeps(cwd, rel, out)  :385-405
function findCsproj(cwd)  :431-435  # Locate a single `*
function collectDependencies(cwd, opts = {}) → { * deps: Array<{ecosyste  :450-504  # Read every manifest at the repo root into a flat dependency 
function versionPins(inventory, opts = {}) → { pins: string[], total:   :516-536  # `name@version` pins for direct runtime dependencies — the de
```

### src/deps/sbom.js
```
module.exports = { buildSbom, formatSbom, summarize, purlFor, normalizeVersion, isExactVersion, SPEC_VERSION, PURL_TYPE }  :252-261
function isExactVersion(v)  :65-69  # True when a version string is an exact pin rather than a ran
function normalizeVersion(spec) → string  :83-92  # Best-effort exact version for a declared range
function purlEncode(segment)  :95-97  # Percent-encode a purl path segment, keeping the `/` that sep
function purlFor(d, version) → string  :103-129  # Build a Package URL for one dependency row
function buildSbom(cwd, opts = {}) → { bom: object, stats: { t  :142-224  # Build a CycloneDX 1
function formatSbom(bom)  :227-229  # Pretty-printed JSON rendering, stable across runs
function summarize(stats) → string[]  :236-250  # One-line human summary for stderr, disclosing how precise th
```

### src/extractors/dispatch.js
```
module.exports = { extractFile, langFor, EXT_MAP }  :144-144
function langFor(filePathOrName)  :109-120  # Resolve a language key from a file path/name
function extractFile(filePathOrName, src) → string[]  :128-142  # Extract signatures from a file's content using the right ext
```

### src/extractors/pipeline.js
```
module.exports = { extract, platformFor, sniffPlatform, scanYaml, PER_FILE_LIMIT }  :818-818
function platformFor(filePath) → string|null  :41-58  # Resolve a CI platform key from a file path, or null when the
function sniffPlatform(src) → string|null  :66-72  # Content sniff for workflow files sitting outside their conve
function stripInlineComment(line)  :79-92  # Strip an unquoted trailing `# comment` from a line
function unquote(v)  :94-100
function compact(v, limit = MAX_VALUE_CHARS)  :102-105
function flowList(v)  :108-112  # Parse a `[a, b, c]` flow sequence, else null
function scanYaml(src) → Array<{indent:number,key:  :126-182  # Scan YAML into a flat node list
function scopeEnd(nodes, i)  :196-207  # Exclusive end index of the block owned by nodes[i]
function childrenOf(nodes, i)  :210-212  # All descendants of nodes[i], including an item's sibling map
function directChildren(nodes, i)  :215-220  # Immediate children of nodes[i] — the shallowest descendant i
function topNode(nodes, key)  :223-226  # Find a top-level (indent 0) node by key
function directValue(nodes, i, key)  :235-238  # Value of an IMMEDIATE child key, or null
function directListValues(nodes, i, key)  :241-251  # listValues restricted to an immediate child key
function blockText(node)  :254-261  # First meaningful command inside a captured block scalar
function valueText(node)  :264-268  # Render a step/script value that may be an inline scalar or a
function childValue(nodes, i, key)  :271-275  # First descendant with this key, or null
function listValues(nodes, i, key) → string[]  :281-295  # Values of a key that may be a scalar, a flow list, or a bloc
function spanEnd(nodes, i, lastLine)  :298-301  # Last line covered by the block that starts at nodes[i]
function anchor(start, end)  :303-305
function secretsIn(lines, start, end)  :308-818  # Secret names referenced anywhere in a line range, sorted and
function githubTriggers(nodes)  :321-352  # Render the `on:` trigger block as `push[main], pull_request,
function githubSteps(nodes, stepsIdx)  :354-378
function githubActions(nodes, lines, fileName)  :380-449
function githubAction(nodes, lines, fileName)  :452-477  # ]` would read as one ambiguous list
function gitlabCi(nodes, lines)  :488-535
function circleCi(nodes, lines)  :541-594
function azurePipelines(nodes, lines)  :600-658
function bitbucket(nodes, lines)  :664-691
function drone(nodes, lines)  :697-722
```

### src/extractors/yaml.js
```
module.exports = { extract }  :77-77
function extract(src) → string[]  :14-75  # Extract signatures from YAML configuration files
```

### src/graph/builder.js
```
module.exports = { build, buildFromCwd, extractFileDeps, normalizePath, loadAliasMap, resolveAlias, _configuredSrcDirs, DEFAULT_SRC_DIRS, DEFAULT_WALK_DEPTH }  :575-575
function normalizePath(p)  :18-20
function probeJs(base, fileSet) → string|null  :42-55  # Probe an absolute base path for a JS/TS module file in fileS
function resolveJsPath(dir, importStr, fileSet) → string|null  :64-66  # Resolve a JS/TS relative import string to an absolute path i
function stripJsonc(src)  :72-86  # Strip comments and trailing commas so a tsconfig/jsconfig (J
function loadAliasMap(cwd) → { baseUrl: string|null, e  :98-119  # Load the JS/TS path-alias map from tsconfig
function resolveAlias(spec, aliasMap, fileSet) → string|null  :128-152  # Resolve a non-relative JS/TS import specifier through the al
function escapeRegex(s)  :159-161  # Resolve an R `source(
function resolveRPath(dir, importStr, fileSet, cwd)  :163-178
function extractFileDeps(filePath, content, fileSet, cwd, ctx) → string[]  :192-408  # Extract absolute dependency paths from a single file
function build(files, cwd, ctx) → { forward: Map<string,str  :425-470  # Build a forward and reverse dependency graph for all given f
function _configuredSrcDirs(cwd)  :490-497  # Source directories declared in the project's own config, or 
function buildFromCwd(cwd, opts) → { forward: Map<string,str  :515-573  # Build a dependency graph scoped to a single cwd by walking a
```

### src/graph/impact.js
```
module.exports = { getImpact, analyzeImpact, formatImpact, formatImpactJSON, isTestFile, isRouteFile }  :248-248
function normalizePath(p)  :17-19
function bfs(startFile, reverseGraph, maxDepth) → { direct: Set<string>, tr  :34-71  # Walk the reverse graph from `startFile` using BFS up to `max
function isTestFile(f)  :93-93
function isRouteFile(f)  :94-94
function getImpact(changedFile, graph, opts) → { * changed: string, * di  :117-150  # Compute the impact of changing `changedFile`
function analyzeImpact(changedFiles, cwd, opts) → { file: string, impact: o  :164-179  # Analyse the impact of one or more changed files, building th
function formatImpact(result) → string  :191-229  # Format an impact result as a readable markdown string
function formatImpactJSON(result) → object  :237-246  # Format an impact result as a JSON-serialisable object
```

### src/graph/path-key.js
```
module.exports = { graphKey, displayPath }  :56-56
function graphKey(p)  :22-24  # Canonical key for a filesystem path used as a graph node
function displayPath(key, cwd, realPaths) → string  :41-54  # Render a graph node key as a repo-relative path in its ORIGI
```

### src/learning/weights.js
```
module.exports = { BASELINE, DECAY, NEUTRAL_EPSILON, MAX_MULT, MIN_MULT, weightsPath, clampMultiplier, normalizeFile, loadWeights, saveWeights, updateWeights, boostFiles, penalizeFiles, resetWeights, exportWeights, importWeights }  :161-178
function weightsPath(cwd)  :14-16
function clampMultiplier(value)  :18-23
function normalizeFile(cwd, filePath)  :25-34
function sanitizeWeights(cwd, weights)  :36-49
function loadWeights(cwd)  :51-58
function saveWeights(cwd, weights)  :60-79
function updateWeights(cwd, opts = {})  :81-116
function boostFiles(cwd, files, amount = 0.15)  :118-120
function penalizeFiles(cwd, files, amount = 0.10)  :122-124
function resetWeights(cwd)  :126-129
function exportWeights(cwd, outputPath)  :131-141
function importWeights(cwd, importPath, replace)  :143-159
```

### src/map/config-manifest.js
```
module.exports = { analyze }  :102-102
function scopeSummary(deps)  :40-52  # `12 runtime, 3 dev` — scope counts for one manifest, most-im
function configFiles(cwd)  :54-60
function analyze(files, cwd)  :62-100
```

### src/mcp/server.js
```
module.exports = { start }  :185-185
function respond(id, result)  :40-42
function respondError(id, code, message)  :44-48
function dispatch(msg, cwd)  :53-152
function start(cwd)  :157-183
```

### src/plan/planner.js
```
module.exports = { createPlan }  :9-9
function createPlan(goal, cwd, config = {})  :11-87
```

### src/wiki/generate.js
```
module.exports = { buildWiki, renderWikiMarkdown }  :253-253
function _rel(cwd, f, realPaths)  :24-26
function _pct(fraction)  :28-30
function _identity(cwd)  :33-39  # Project name + version from package
function _modules(index)  :42-69  # Module rollup from the signature index (keys are cwd-relativ
function _flow(cwd)  :72-100  # Hubs, entry points, and cycle count from the dependency grap
function _conventions(cwd, index)  :103-120  # Conventions summary; index keys are resolved back to absolut
function _health(cwd)  :122-130
function buildWiki(cwd, opts = {}) → { data: object, markdown:  :140-165  # Build the wiki
function renderWikiMarkdown(data, sigmapVersion) → string  :174-251  # Render the narrative markdown
```

### src/config/loader.js
```
module.exports = { loadConfig, loadBaseConfig }  :363-363
function loadBaseConfig(extendsVal, cwd)  :9-64
function detectAutoSrcDirs(cwd, excludeList) → string[]  :99-114  # Detect source directories for the given project root
function _legacyDetectAutoSrcDirs(cwd, excludeList) → string[]  :123-228  # Legacy source directory detection (fallback)
function _isJvmLayout(cwd) → boolean  :250-259  # Directory depth needed to reach source under a JVM package l
function _applyJvmDepth(cfg, cwd, userSetDepth) → object  :272-277  # Raise `maxDepth` to the JVM depth when the layout needs it (
function loadConfig(cwd) → object  :285-357  # Load and merge configuration for a given working directory
function deepClone(obj)  :359-361
```

### src/config/tune.js
```
module.exports = { buildTuneProposal, applyTuneProposal, formatTuneProposal, JUNK_DIRS, TOKENS_PER_FILE }  :210-210
function _readUserConfig(cwd)  :45-51  # Raw user config file content, or null when absent/unparsable
function _countSourceFiles(cwd, roots, exclude, depth = 5)  :54-72  # Count source files under `roots` (relative to cwd), depth-ca
function _monorepoMarker(cwd)  :75-84  # The workspace marker present at cwd, or null
function buildTuneProposal(cwd) → { changes: Array<{key:str  :94-176  # Build the recommended config diff for a repo
function applyTuneProposal(cwd, proposal) → { path: string, applied:   :184-190  # Merge a proposal's changes into gen-context
function formatTuneProposal(proposal)  :193-208  # Human rendering of a proposal (one block per change, reason 
```

### src/conventions/ci.js
```
module.exports  :48-48
function ciGate  :25-46
```

### src/discovery/language-detector.js
```
module.exports = { detectLanguages }  :7-7
function detectLanguages(cwd)  :29-64
function _walkDepth(dir, depth, extCount)  :66-79
```

### src/discovery/source-root-registry.js
```
module.exports = { REGISTRY }  :184-184
```

### 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 }  :200-200
function getExtractorName(filePath)  :22-24
function tokenCount(sigs)  :27-29  # Rough token estimate: chars / 4
function hasCoverage(filePath, cwd)  :35-50  # Check whether a test file exists for this source file by loo
function loadExtractor(name, cwd)  :56-65  # Load an extractor module from src/extractors/ relative to cw
function analyzeFiles(files, cwd, opts) → object[]  :78-135  # Analyze a list of absolute file paths
function formatAnalysisTable(stats, showSlow) → string  :144-178  # Format stats as a markdown table
function formatAnalysisJSON(stats) → object  :186-198  # Format stats as a plain-object suitable for JSON
```

### src/eval/corpus.js
```
module.exports = { basenameTokens, queryLeakage, validateTasks, sizeBucket, BUCKET_LIMITS }  :83-83
function basenameTokens(filePath) → string[]  :31-34  # Stemmed tokens of a file path's basename (extension stripped
function queryLeakage(query, expectedFiles) → { leaked: string[], clean  :42-51  # Leaked tokens between a query and its expected files' basena
function validateTasks(tasks) → { results: object[], hard  :59-70  # Validate a task list: every task gets a leakage result; hard
function sizeBucket(fileCount) → 'small'|'medium'|'large'  :77-81  # Size bucket for a repo by indexed file count
```

### src/eval/runner.js
```
module.exports = { run, rank, loadTasks, buildSigIndex, formatTable, formatMetrics, tokenize }  :226-226
function buildSigIndex(cwd) → Map<string, string[]>  :40-47  # Read the generated context file and build a simple signature
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
function estimateTokens(sigs) → number  :82-85  # Estimate token count from character count (chars/4, ±5%)
function loadTasks(tasksFile) → Array<{id:string, query:s  :98-121  # Load tasks from a JSONL file
function run(tasksFile, cwd, opts = {}) → { * tasks: Array<{id, que  :139-189  # Run all tasks in tasksFile against the repo at cwd
function formatTable(taskResults) → string  :200-208  # Format task results as a markdown table string
function formatMetrics(metrics) → string  :215-224  # Format aggregate metrics as a human-readable string
```

### src/evidence/pack.js
```
module.exports = { buildEvidencePack, formatJSON, formatMarkdown, parseAnchor, riskLabelFor, riskFactorsFor, findRelatedTests, SCHEMA_VERSION, SCHEMA_URL, TEST_DISCOVERY }  :341-352
function parseAnchor(sig) → { symbol: string, start:   :65-73  # Split a signature's `  :start-end` line anchor from its symb
function riskLabelFor(relPath) → 'generated'|'test'|'migra  :85-87  # Classify a file into a risk label (C3, v8
function riskFactorsFor(relPath) → string[]  :97-109  # Every risk category a file matches, in the same strict prece
function stemOf(relPath)  :112-115  # Filename stem (basename minus the first extension chain)
function testTargetStem(relPath) → string  :127-133  # Infer the implementation stem a test file targets, by stripp
function findRelatedTests(relPath, allFiles) → string[]  :144-155  # Impl→test discovery (C2, v8
function reasonFor(signals)  :158-169  # Map a ranker `signals` object into a short human-readable re
function sigTokens(sigs)  :172-174  # Token estimate for a signature block (matches the ranker's h
function canonicalize(value) → string  :181-183  # Stable stringify with recursively sorted object keys, for ha
function sortKeys(value)  :185-193
function buildEvidencePack(query, cwd, opts = {}) → object  :207-296  # Build an Evidence Pack for a query
function ranked0Empty(query)  :299-301
function formatJSON(pack)  :304-306  # Pretty-printed canonical JSON rendering of a pack
function formatMarkdown(pack)  :309-330  # Markdown handoff rendering of a pack
```

### src/extractors/astro.js
```
module.exports = { extract }  :81-81
function extract(src) → string[]  :21-79  # Extract signatures from Astro components (
```

### src/extractors/component-surface.js
```
module.exports = { scanComponentMarkers, markersForClass, componentMembers }  :96-96
function scanComponentMarkers(stripped) → { decorated: Map<number,   :33-62  # Pre-pass over a whole (comment-stripped) source: component m
function markersForClass(decorated, stripped, classLineStart, matchText)  :69-75  # Component-marker lookup for one class match
function componentMembers(block) → Array<{text: string, star  :82-94  # Component surface member lines for a class body
```

### src/extractors/cpp.js
```
module.exports = { extract }  :82-82
function extract(src) → string[]  :21-82  # Extract signatures from C/C++ source code
function extractBlock(src, startIndex)  :49-58
function extractMembers(block)  :60-70
function normalizeParams(params)  :72-75
function normalizeType(type)  :77-80
```

### src/extractors/csharp.js
```
module.exports = { extract }  :84-84
function extract(src) → string[]  :24-84  # Extract signatures from C# source code
function extractBlock(src, startIndex)  :48-57
function extractMembers(block)  :59-72
function normalizeParams(params)  :74-77
function normalizeType(type)  :79-82
```

### src/extractors/css.js
```
module.exports = { extract }  :75-75
function extract(src) → string[]  :14-23  # Extract signatures from CSS/SCSS/SASS/Less source code
```

### src/extractors/dart.js
```
module.exports = { extract }  :97-97
function extract(src) → string[]  :24-97  # Extract signatures from Dart source code
function extractBlock(src, startIndex)  :67-76
function extractMembers(block)  :78-90
function normalizeParams(params)  :92-94
```

### src/extractors/deps.js
```
module.exports = { extractPythonDeps, extractTSDeps, extractRDeps, extractLuaDeps, extractElixirDeps, buildReverseDepMap }  :147-147
function extractPythonDeps(src) → string[]  :26-41  # Extract project-level import dependencies from Python source
function extractTSDeps(src) → string[]  :48-59  # Extract relative import dependencies from TypeScript/JavaScr
function extractRDeps(src) → string[]  :76-82  # Extract project-level import dependencies from R source
function extractLuaDeps(src) → string[]  :99-104  # Extract Lua require() module dependencies
function extractElixirDeps(src) → string[]  :114-121  # Extract Elixir module dependencies: `alias A
function stripLuaComments(src)  :123-127
function buildReverseDepMap(forwardMap) → Map<string, string[]>  :134-145  # Build reverse dependency map from forward map
```

### src/extractors/dockerfile.js
```
module.exports = { extract }  :55-55
function extract(src) → string[]  :14-53  # Extract signatures from Dockerfiles
```

### src/extractors/elixir.js
```
module.exports = { extract }  :141-141
function extract(src) → string[]  :25-83  # Extract signatures from Elixir source code (
function docText(rest, lines, i)  :86-100  # First sentence of a @doc/@moduledoc value; follows heredocs 
function normalizeParams(params)  :102-116
function stripComments(src)  :119-139  # Blank `#` comments while preserving line structure; strings 
```

### src/extractors/gdscript.js
```
module.exports = { extract }  :141-141
function extract(src) → string[]  :19-52  # Extract signatures from Godot GDScript source code
function extractInnerMembers(stripped, startIndex)  :108-124
function normalizeParams(params)  :126-139
```

### src/extractors/go.js
```
module.exports = { extract }  :173-173
function extract(src) → string[]  :33-173  # Extract signatures from Go source code
function extractBlock(stripped, masked, startIndex)  :114-123
function extractInterfaceMethods(block, maskedBlock)  :125-142
function normalizeParams(params)  :144-147
function buildDocHints(src)  :153-162
function firstDocSentence(block)  :165-171
```

### src/extractors/html.js
```
module.exports = { extract }  :45-45
function extract(src) → string[]  :15-35  # Extract signatures from HTML files
```

### src/extractors/java.js
```
module.exports = { extract }  :224-224
function extract(src) → string[]  :34-94  # Extract signatures from Java source code
function extractBlock(stripped, masked, startIndex)  :98-108
function extractMembers(block, maskedBlock, opts = {})  :119-182  # Member scan over a type body
function normalizeParams(params)  :184-187
function normalizeType(type)  :189-192
function buildDocHints(src)  :200-213
function firstDocSentence(body)  :216-222
```

### src/extractors/javascript.js
```
module.exports = { extract }  :253-253
function extract(src) → string[]  :19-138  # Extract signatures from JavaScript source code
function extractBlock(src, startIndex)  :140-150
function extractClassMembers(block, maskedBlock, returnHints)  :158-187
function buildReturnHints(src)  :194-205
function buildDocHints(src)  :212-228
function firstDocSentence(body)  :231-237
function normalizeType(type)  :239-242
function formatReturnHint(type)  :244-246
function normalizeParams(params)  :248-251
```

### src/extractors/kotlin.js
```
module.exports = { extract }  :103-103
function extract(src) → string[]  :24-103  # Extract signatures from Kotlin source code
function extractBlock(src, startIndex)  :67-76
function extractMembers(block)  :78-103
function normalizeParams(params)  :94-101
```

### src/extractors/lsp_symbols.js
```
module.exports = { extractViaLsp, acceptLabel, toolchainLabels, DEFAULT_SERVERS }  :190-190
function _resolveBinaryStat(cmd0)  :57-71
function _loadCache(cwd)  :73-83
function _saveCache()  :85-93
function _compact(s)  :95-97
function _render(symbols)  :100-132  # Flatten hierarchical symbols into the two-level signature vo
function extractViaLsp(filePath, src, serverOverrides, cwd) → { sigs: string[], label:   :143-177  # Extract signatures for a file via its registered language se
function acceptLabel(label)  :181-183  # Register a label once the caller has ACCEPTED the LSP result
function toolchainLabels()  :186-188  # Toolchain labels for servers whose results were actually use
```

### src/extractors/lua.js
```
module.exports = { extract }  :152-152
function extract(src) → string[]  :27-37  # Extract signatures from Lua source code
function pushUnique(out, seen, sig)  :62-66
function normalizeParams(params)  :68-75
function applyHint(hints, name)  :77-80
function collectDocHints(src)  :86-106  # Attach each contiguous `---` doc block to the next function-
function firstDocSentence(block)  :108-115
function stripLuaComments(src)  :118-150  # Strip Lua line and long comments while preserving strings en
```

### src/extractors/markdown.js
```
module.exports = { extract }  :35-35
function extract(src) → string[]  :15-35  # Lightweight markdown technical indexer
```

### src/extractors/php.js
```
module.exports = { extract }  :109-109
function extract(src) → string[]  :24-109  # Extract signatures from PHP source code
function extractBlock(src, startIndex)  :71-80
function extractMembers(block)  :82-109
function normalizeParams(params)  :99-102
function normalizeType(type)  :104-107
```

### src/extractors/properties.js
```
module.exports = { extract }  :42-42
function extract(src) → string[]  :15-40  # Extract signatures from
```

### src/extractors/python_dataclass.js
```
module.exports = { extract }  :79-79
function extract(src) → string[]  :12-77  # Extract Python dataclass, Pydantic model, and SQLAlchemy ORM
```

### src/extractors/python.js
```
module.exports = { extract, tryNativeExtract }  :270-270
function pyBlockEnd(srcLines, startLine) → number  :22-32  # 1-based line of the last source line belonging to a top-leve
function tryNativeExtract(filePath) → string[]|null  :40-52  # Try to extract signatures using the native Python AST extrac
function extract(src, filePath) → string[]  :63-148  # Extract signatures from Python source code
function extractClassMethods(stripped, startIndex)  :150-169
function tryExtractDataclassFields(stripped, classIndex)  :171-185
function tryExtractBaseModelFields(stripped, bodyStart)  :187-202
function extractClassConstants(stripped, startIndex)  :204-218
function extractReturnType(sigLine)  :220-226
function normalizeParams(params)  :228-246
function extractDocHint(src, fnName, fnSigLine)  :248-268
```

### src/extractors/r.js
```
module.exports = { extract }  :275-275
function extract(src) → string[]  :26-110  # Extract signatures from R source code
function collectRoxygenHints(src)  :127-153  # Collect roxygen2 docstring hints from the original (uncommen
function pickRoxygenLine(block, tag)  :157-171
function applyHint(hints, name)  :173-176
function extractListMethods(body, cap)  :182-195  # Extract method-like entries from the body of an R6/S7 list(
function inAnyRange(pos, ranges)  :197-202
function readFirstStringArg(body)  :205-208  # Extract the first quoted string from a comma-separated argum
function readBalancedParens(src, openIdx, cap = 16384)  :216-239  # Read a parenthesis-balanced substring starting at the positi
function normalizeParams(raw)  :246-273  # Compress whitespace inside a parameter list, collapse multi-
```

### src/extractors/ruby.js
```
module.exports = { extract }  :60-60
function extract(src) → string[]  :14-44  # Extract signatures from Ruby source code
function normalizeParams(params)  :46-49
function extractReturnHint(stripped, index)  :51-58
```

### src/extractors/rust.js
```
module.exports = { extract }  :151-151
function extract(src) → string[]  :25-151  # Extract signatures from Rust source code
function extractBlock(src, startIndex)  :89-98
function extractMethods(block)  :100-151
function normalizeParams(params)  :115-118
function extractReturnType(afterParen)  :120-151
function buildDocHints(src)  :132-140
function firstDocSentence(block)  :143-149
```

### src/extractors/scala.js
```
module.exports = { extract }  :101-101
function extract(src) → string[]  :24-101  # Extract signatures from Scala source code
function extractBlock(src, startIndex)  :60-69
function extractMembers(block)  :71-101
function normalizeParams(params)  :87-94
function normalizeType(type)  :96-99
```

### src/extractors/scan.js
```
module.exports = { stripComments, maskCode, readBalanced }  :91-91
function stripComments(src) → string  :23-39  # Blank comments only — string-aware, so `//` or `/*` INSIDE a
function maskCode(src) → string  :47-63  # Blank comments AND string/template contents (quotes included
function readBalanced(masked, openIdx, open = '(', close = ')', cap = 4000) → number  :76-89  # Index of the delimiter that closes the one open at `openIdx`
```

### src/extractors/scip_symbols.js
```
module.exports = { extractViaScip, acceptLabel, toolchainLabels }  :114-114
function _loadIndex(cwd)  :29-44
function _sigText(doc)  :47-51  # Fence interior of a SCIP documentation string, compacted to 
function _hint(doc)  :53-55
function _isMemberSymbol(symbol)  :58-61  # Member-of relation from SCIP symbol structure: `
function extractViaScip(filePath, cwd) → { sigs: string[], label:   :70-100  # Extract signatures for one file from the repo's SCIP index
function acceptLabel(label)  :105-107  # Register a label once the wiring has ACCEPTED the SCIP resul
function toolchainLabels()  :110-112  # Toolchain labels for indexes whose entries were actually use
```

### src/extractors/shell.js
```
module.exports = { extract }  :49-49
function extract(src) → string[]  :14-47  # Extract signatures from shell scripts (bash, zsh, fish)
```

### src/extractors/svelte.js
```
module.exports = { extract }  :64-64
function extract(src) → string[]  :14-64  # Extract signatures from Svelte components
function normalizeParams(params)  :54-57
function normalizeType(type)  :59-62
```

### src/extractors/swift.js
```
module.exports = { extract }  :110-110
function extract(src) → string[]  :24-110  # Extract signatures from Swift source code
function extractBlock(src, startIndex)  :67-76
function extractMembers(block)  :78-110
function normalizeParams(params)  :93-100
function extractArrowType(str)  :102-110
```

### src/extractors/toml.js
```
module.exports = { extract }  :47-47
function extract(src) → string[]  :15-42  # Extract signatures from TOML configuration files
```

### src/extractors/typescript_native.js
```
module.exports = { extract, resolveRepoTypescript }  :190-190
function resolveRepoTypescript(fromPath) → { ts: object, version: st  :38-51  # Resolve the target repo's own `typescript` package, walking 
function extract(src, filePath, ts) → string[]|null  :63-70  # Extract signatures from TypeScript source via the provided c
function _extract(src, filePath, ts)  :72-188
```

### src/extractors/typescript_react.js
```
module.exports = { extract }  :65-65
function extract(src) → string[]  :15-25  # Extract React component signatures from
```

### src/extractors/typescript.js
```
module.exports = { extract }  :349-349
function extract(src) → string[]  :19-349  # Extract signatures from TypeScript source code
function extractBlock(src, startIndex)  :218-228
function extractInterfaceMembers(block)  :232-250
function extractClassMembers(block, maskedBlock)  :257-349
function normalizeParams(params)  :287-317
function buildDocHints(src)  :322-338
function firstDocSentence(body)  :341-347
```

### src/extractors/vue_sfc.js
```
module.exports = { extract }  :101-101
function extract(src) → string[]  :12-29  # Extract Vue Single-File Component (SFC) signatures from
```

### src/extractors/xml.js
```
module.exports = { extract }  :48-48
function extract(src) → string[]  :12-46  # Lightweight XML config extractor
```

### src/graph/call-graph.js
```
module.exports = { buildCallGraph, buildTypeMap, receiverCallsInRange, javaTypeDecl, DEFAULT_WALK_DEPTH, buildCallFileGraph, methodImpact, methodCallees, formatCallGraph, formatCallGraphJSON, extractDefs, maskJs, maskPy, maskRust }  :850-854
function normalizePath(p)  :44-44
function toRel(cwd, f)  :45-45
function symId(cwd, absFile, name)  :46-46
function maskJs(src)  :52-68
function maskRust(src)  :73-94
function maskPy(src)  :96-113
function matchDelim(masked, openIdx, open, close)  :116-123
function lineAt(src, idx)  :125-130
function jsDefs(masked)  :135-201
function pyDefs(masked)  :203-223
function goDefs(masked)  :227-248
function javaTypeDecl(masked)  :264-854
function javaDefs(masked)  :291-327
function rustDefs(masked)  :332-350
function jvmBodyRange(masked, from) → {bodyStart:number, bodyEn  :361-374  # Body range for a JVM-family member that may use either a bra
function ktDefs(masked)  :380-401  # Kotlin `fun` definitions, including extension functions (`fu
function scalaDefs(masked)  :407-427  # Scala `def` definitions
function maskFor(filePath, src)  :429-434
function extractDefs(filePath, src)  :436-446
function callsInRange(masked, start, end)  :449-461
function receiverCallsInRange(masked, start, end)  :466-478
function buildTypeMap(masked)  :485-495
function _configuredSrcDirs(cwd)  :516-522  # Source directories declared in the project's own config, or 
function _walk(dir, excludeSet, out, depth, maxDepth)  :524-538
function buildCallGraph(cwd, opts = {}) → { * forward: Map<string,s  :554-730  # Build the method-level call-graph for a project
function buildCallFileGraph(cwd, opts = {}) → { forward: Map<string,str  :743-769  # Collapse the symbol-level call-graph to FILE-level bidirecti
function _resolveSymbol(symbol, defs)  :772-777
function _bfs(seedIds, graph, maxDepth)  :780-793
function methodImpact(symbol, cwd, opts = {}) → { symbol:string, resolved  :803-809  # Method-level blast radius: everything that (transitively) ca
```

### src/graph/centrality.js
```
module.exports = { computeCentrality, DAMPING, ITERATIONS }  :61-61
function computeCentrality(graph) → Map<string, number>  :27-59  # Compute a normalized centrality score for every file in a de
```

### src/judge/judge-engine.js
```
module.exports = { groundedness, claimGrounding, judge }  :256-256
function tokenize(text)  :15-17
function groundedness(response, context)  :19-27
function claimGrounding(response, context, opts = {}) → { total: number, grounded  :57-128  # Claim-level grounding (v8
function extractContextFiles(context, cwd)  :139-161
function judge(response, context, opts = {})  :163-254
```

### src/lsp/client.js
```
module.exports = { documentSymbols, parseFrames, frame, SESSION_TIMEOUT_MS }  :102-102
function frame(obj)  :23-26
function parseFrames(raw)  :29-42  # Parse Content-Length-framed JSON-RPC messages from a capture
function documentSymbols(cmd, filePath, src, languageId) → { symbols: object[], serv  :52-100  # One-shot documentSymbol session against a language server
```

### src/map/build-ci.js
```
module.exports = { analyze, collectTargets }  :100-100
function readJson(p)  :20-22
function npmScripts(cwd, rows)  :24-30
function ciWorkflows(cwd, rows)  :32-56
function makeTargets(cwd, rows)  :58-69
function collectTargets(cwd)  :75-81  # Structured build/CI target rows (#629): npm scripts, workflo
function analyze(files, cwd)  :83-98
```

### src/map/env-schema.js
```
module.exports = { analyze, collectEnvReads }  :111-111
function collectMatches(re, content, into)  :30-103
function readExampleKeys(cwd)  :39-103
function collectEnvReads(files, cwd) → Array<{name: string, file  :59-103  # Structured env reads with per-file attribution (#629): one r
function analyze(files, cwd)  :91-103
```

### src/map/knowledge-map.js
```
module.exports = { buildKnowledgeMap, loadOrBuild, upgradeImpact, fileNeighbors, envReaders, impactView, architectureView, relatedTestsView, canonicalJson, SCHEMA_VERSION }  :450-450
function _sortKeys(value)  :46-54  # Stable stringify: object keys sorted recursively (evidence-p
function canonicalJson(value)  :55-57
function _bareImports(src)  :60-67  # Bare (non-relative) import specifiers in a JS/TS source, roo
function buildKnowledgeMap(cwd) → { schema: number, nodes:   :77-231  # Build the unified knowledge map for a repo from existing pro
function loadOrBuild(cwd)  :234-256  # Load from
function upgradeImpact(map, libraryName)  :262-284  # Upgrade-impact walk: lib → importing files → their callers/i
function impactView(map, relFile, depth)  :294-346  # Impact of changing one file, computed from the store's `impo
function architectureView(map)  :352-387  # Architecture rollup from the store: module token table, hub 
function envReaders(map, name)  :390-396  # Readers of one env var: the files that read it, and the comm
function relatedTestsView(map, rels) → Map<string, string[]>  :407-424  # Related tests per file, from the store's `tests` edges (test
function fileNeighbors(map, rel)  :427-448  # Typed neighbors of one file node
```

### src/map/migrations.js
```
module.exports = { analyze, collectMigrations }  :92-92
function walk(dir, cwd, depth, out)  :31-62
function collectMigrations(cwd) → Array<{version: string, n  :68-73  # Structured migration rows (#629), sorted by repo-relative fi
function analyze(files, cwd)  :75-90
```

### src/map/route-table.js
```
module.exports = { analyze, collectRoutes }  :176-176
function shouldSkipFile(rel)  :18-21
function nestControllerPrefixes(content) → Array<{index:number, pref  :30-176  # Byte offsets and prefixes of every `@Controller(
function prefixBefore(controllers, index)  :41-88  # Prefix of the nearest `@Controller` above `index`, or '' whe
function joinRoute(prefix, methodPath) → string  :55-88  # Join a controller prefix and a method path into one route pa
function collectRoutes(files, cwd) → { method:string, path:str  :69-88  # Structured route rows across the supported frameworks — the 
function analyze(files, cwd)  :162-171
```

### src/mcp/handlers.js
```
module.exports = { readContext, searchSignatures, getMap, createCheckpoint, getRouting, explainFile, listModules, queryContext, getMethodImpact, getImpact, getLines, readMemory, getCalleeSignatures, notifyFileCreated, notifySymbolAdded, notifyFileDeleted, getDiffContext, getArchitectureOverview, verifySuggestion, squeezeOutput, getBudget, queryKnowledgeMap }  :1031-1031
function _readContextFiles(cwd)  :10-17
function readContext(args, cwd)  :36-66  # read_context({ module
function searchSignatures(args, cwd)  :74-100  # search_signatures({ query }) → string
function getMap(args, cwd)  :108-131  # get_map({ type }) → string
function createCheckpoint(args, cwd)  :143-215  # create_checkpoint({ note
function getRouting(args, cwd)  :224-261  # get_routing({}) → string
function explainFile(args, cwd)  :269-356  # explain_file({ path }) → string
function listModules(args, cwd)  :364-403  # list_modules({}) → string
function queryContext(args, cwd)  :411-449  # query_context({ query, topK
function getMethodImpact(args, cwd)  :457-471  # get_method_impact({ symbol, direction
function getImpact(args, cwd)  :479-494  # get_impact({ file, depth
function getLines(args, cwd)  :503-551  # get_lines({ file, start, end }) → string
function readMemory(args, cwd)  :559-594  # read_memory({ limit
function getBudget(args, cwd)  :603-629  # get_budget({ session
function getCalleeSignatures(args, cwd)  :638-683  # get_callee_signatures — return the exact defining signature(
function _pkgVersion(cwd)  :690-693
function notifyFileCreated(args, cwd)  :697-719  # notify_file_created — extract a file's signatures and index 
function notifySymbolAdded(args, cwd)  :722-742  # notify_symbol_added — append one signature to a file's live 
function notifyFileDeleted(args, cwd)  :745-759  # notify_file_deleted — drop a file's cache-overlay entry
function _changedFiles(cwd, args)  :765-777  # List the files changed in the working tree, staged area, or 
function getDiffContext(args, cwd)  :786-857  # get_diff_context({ base
function getArchitectureOverview(args, cwd)  :866-902  # get_architecture_overview({}) → string
function verifySuggestion(args, cwd)  :912-947  # verify_suggestion({ code }) → string
function squeezeOutput(args, cwd)  :957-990  # squeeze_output({ content }) → string
function queryKnowledgeMap(args, cwd)  :993-1029
```

### src/mcp/install.js
```
module.exports = { CLIENTS, listClients, installClient, resolveTarget }  :169-169
function resolveTarget(spec, cwd, home, useGlobal)  :40-46  # Resolve the absolute config path for a client, honoring `glo
function listClients(opts = {})  :49-63  # List supported clients with their resolved target paths
function serverArgs(scriptPath)  :65-67
function _installJson(filePath, scriptPath)  :70-82  # Install into a JSON `mcpServers` config (create file/dir if 
function _installVscode(filePath, scriptPath)  :90-107  # Install into VS Code's `
function _installZed(filePath, scriptPath)  :110-122  # Install into Zed's `context_servers` config (create file/dir
function _installYaml(filePath, scriptPath)  :125-143  # Install into Codex CLI YAML (append block; create file if ab
function installClient(client, opts = {}) → client, label, path, stat  :150-167  # Install the sigmap MCP server for a single client
```

### src/mcp/tools.js
```
module.exports = { TOOLS }  :437-437
```

### src/retrieval/bm25.js
```
module.exports = { tokenize, stem, bm25rank, PATH_BOOST, STOP, expandQuery, EXPANSIONS, EXPANSION_WEIGHT, DOC_WEIGHT, MODULE_DOC_RE, stripAnchor }  :269-269
function stem(w) → string  :36-45  # Light suffix stemmer — conservative, tuned for code identifi
function tokenize(text) → string[]  :54-65  # Split on non-alphanumeric characters AND camelCase / snake_c
function stripAnchor(line)  :126-128
function expandQuery(qToks, mined) → Map<string, number>  :166-187  # Expand stemmed query tokens with curated synonyms
function bm25rank(query, candidates, opts) → Array<object & { score: n  :200-267  # BM25 re-rank of candidates against a query
```

### src/retrieval/enrich-from-maps.js
```
module.exports = { enrichWithSurfaces }  :55-55
function enrichWithSurfaces(index, cwd) → number  :25-53  # Enrich a signature index with route pseudo-signatures
```

### src/retrieval/mined-expansions.js
```
module.exports = { mineExpansions, loadOrMine, canonicalJson, SCHEMA_VERSION, MIN_DF, MAX_DF_RATIO, MIN_COOC, TOP_K }  :142-142
function mineExpansions(sigIndex) → { schema: number, files:   :38-98  # Mine per-repo expansion candidates from a signature index
function canonicalJson(mined)  :101-103  # Canonical rendering: stable key order comes from mineExpansi
function loadOrMine(cwd) → { schema: number, files:   :112-140  # Load the mined map from `
```

### src/retrieval/module-doc.js
```
module.exports = { extractModuleDoc, moduleDocSig, MAX_CHARS }  :120-120
function _extOf(filePath)  :33-36
function _cleanLine(line)  :39-120  # Strip comment furniture, JSDoc tags, and markup from one raw
function extractModuleDoc(src, filePath) → string  :55-117  # Extract a module's leading documentation prose
function moduleDocSig(src, filePath)  :115-117  # Render as an index-only pseudo-signature, or '' when there i
```

### src/retrieval/ranker.js
```
module.exports = { rank, buildSigIndex, scoreFile, _queryWants, _isDataHolder, detectIntents, formatRankTable, formatRankJSON, DEFAULT_WEIGHTS, GRAPH_BOOST_AMOUNTS, CENTRALITY_BLEND_WEIGHT, detectIntent }  :800-800
function _queryWants(queryTokens)  :97-105  # Which penalised categories the query is explicitly asking fo
function _isDataHolder(sigs)  :112-118  # True when a file's members are overwhelmingly trivial access
function _computePenalty(filePath, wants, sigs)  :120-139
function _computeHubs(graph)  :142-153
function _graphKeys(p)  :160-164
function _graphGet(map, absPath)  :165-171
function _registerKeys(map, absPath, value)  :172-174
function _isHub(filePath)  :176-180
function scoreFile(filePath, sigs, queryTokens, weights, wants) → { score: number, signals:  :191-252  # Score a single file against a query, returning detailed sign
function rank(query, sigIndex, opts) → { file: string, score: nu  :272-489  # Rank all files in a signature index against a query
function _parseContextFile(contextPath) → Map<string, string[]>  :518-550  # Parse a single context file into a Map<filePath, string[]>
function _mergeSigIndex(target, source)  :553-561  # Merge source index into target; prefer non-empty sig lists
function _buildSigIndexFromCache(cwd) → Map<string, string[]>  :568-588  # Load signatures from
function _enrichSigIndexFromStrategy(cwd, index) → Map<string, string[]>  :596-627  # Hot-cold and per-module strategies store most signatures out
function buildSigIndex(cwd, opts) → Map<string, string[]>  :644-677  # Build a signature index from the generated context file
function formatRankTable(results, query) → string  :686-722  # Format ranked results as a markdown table string
function formatRankJSON(results, query) → object  :731-746  # Format ranked results as a structured JSON-serialisable obje
function detectIntents(query) → string[]  :779-793  # Every intent whose pattern matches, strongest first
function detectIntent(query)  :796-798  # Primary intent
```

### src/retrieval/sig-index-store.js
```
module.exports = { writeFullIndex, readFullIndex, indexPath, SCHEMA, INDEX_FILE }  :95-95
function indexPath(cwd)  :34-36  # Absolute path to the retrieval index artifact
function writeFullIndex(cwd, fileEntries, opts = {}) → { path: string, files: nu  :47-70  # Persist the complete signature index
function readFullIndex(cwd) → Map<string, string[]>  :83-93  # Load the complete signature index, or an empty Map when abse
```

### src/review/pr-evidence.js
```
module.exports = { buildPrEvidence, formatPrEvidenceMarkdown }  :176-176
function buildPrEvidence(changedFiles, cwd, opts = {}) → { scope:string, files:obj  :32-103  # Build the structured PR evidence for a changed-file list
function formatPrEvidenceMarkdown(evidence, opts = {})  :108-174  # Render the branded, deterministic "PR Evidence Report" Markd
```

### src/review/review-pr.js
```
module.exports = { reviewPr, SECURITY_PATTERNS, GOD_NODE_THRESHOLD, SCOPE_DIR_THRESHOLD }  :150-150
function isTestFile(p)  :32-34
function isSource(p)  :35-37
function reviewPr(changedFiles, cwd, opts = {}) → { findings: object[], bla  :48-148  # Audit a changed-file list
```

### src/scip/reader.js
```
module.exports = { parseIndex, fields, readVarint, packedVarints, DEFINITION_ROLE }  :106-106
function readVarint(buf, pos)  :19-28
function packedVarints(buf)  :45-50
function parseIndex(buf) → { tool: string, documents  :60-104  # Parse a SCIP index buffer into a compact per-document struct
```

### src/security/patterns.js
```
module.exports = { PATTERNS }  :62-62
```

### src/security/redact.js
```
module.exports = { redactText }  :56-56
function redactText(text) → { * text: string, redacte  :30-54  # Redact secrets in arbitrary text
```

### src/security/scanner.js
```
module.exports = { scan }  :40-40
function scan(signatures, filePath) → { safe: string[], redacte  :14-38  # Scan an array of signature strings for secrets
```

### src/session/memory-inspect.js
```
module.exports = { inspectMemory, clearMemory, STORES, CLEARABLE }  :86-86
function storePath(cwd, name)  :25-27
function countEntries(kind, filePath)  :29-42
function inspectMemory(cwd) → Array<{store:string, path  :49-64  # Describe every cross-session store
function clearMemory(cwd, store) → string[]  :72-84  # Delete one clearable store (or 'all' clearable stores)
```

### src/skills/skills.js
```
module.exports = { SKILLS, SKILL_CLIENTS, renderSkill, renderAgentsBlock, injectSkillsBlock, installSkills, listSkillClients, clientPresent, START, END }  :206-206
function _footer(version)  :86-89
function renderSkill(client, skillName, version)  :92-109  # Render one skill's client-specific file content
function renderAgentsBlock(version)  :112-119  # Render the combined AGENTS
function injectSkillsBlock(existing, block)  :127-142  # Inject (or replace) the skills block in AGENTS
function _writeIfChanged(filePath, content)  :144-154
function installSkills(client, opts = {}) → { client, label, results:  :161-183  # Install both skills for one client
function clientPresent(client, cwd)  :186-189  # True when the client's parent artifact exists (plain-install
function listSkillClients(opts = {})  :192-204  # List clients with target paths, presence, and installed stat
```

### src/tracking/budget.js
```
module.exports = { sessionKey, budgetStatus, contextMtime, entryInSession }  :113-113
function sessionKey(env)  :30-34  # Session key: SIGMAP_SESSION override, else UTC day bucket
function contextMtime(cwd)  :37-43  # Newest mtime (ms) among generated context files, or 0 if non
function entryInSession(entry, session)  :46-50  # Does a gain-log entry belong to this session
function budgetStatus(cwd, opts = {}) → { * session: string, unit  :70-111  # Session spend status
```

### src/tracking/logger.js
```
module.exports = { logRun, recordUsage, readLog, readGainLog, summarize, isTrackingEnabled, GAIN_FILE }  :199-199
function logRun(entry, cwd)  :30-55  # Append one run entry to the usage log
function readLog(cwd) → object[]  :62-77  # Read and parse all usage log entries
function readGainLog(cwd) → object[]  :84-96  # Read and parse all `gain` dashboard records (oldest first)
function summarize(entries) → object  :103-135  # Compute summary statistics from an array of log records
function isTrackingEnabled(config, argv) → boolean  :147-153  # Whether `gain` savings capture is enabled
function recordUsage(entry, cwd)  :169-197  # Append one operation to the usage log using the extended `ga
```

### src/tracking/pricing.js
```
module.exports = { PRICES, DEFAULT_MODEL, resolvePrice, listModels }  :46-46
function resolvePrice(model) → { model: string, perMtok:  :34-39  # Resolve a price (USD per token) for a model name
function listModels() → string[]  :42-44
```

### src/verify/arity.js
```
module.exports = { parseParams, buildArityIndex, extractCallArgCounts, checkArity, cleanSig, EXACT_PARAM_EXTS }  :202-202
function cleanSig(sig)  :42-44  # Strip the `  :start-end` anchor and `  # hint` tail from a s
function parseParams(paramText) → { min: number, max: numbe  :54-106  # Parse a parameter-list string into an arity range
function buildArityIndex(sigIndex) → Map<string, { min, max, v  :115-144  # Build a per-name arity index from a SigMap signature index
function extractCallArgCounts(code) → { name: string, args: num  :154-188  # Extract call sites with argument counts from answer code
function checkArity(name, argCount, arityIndex) → null | { min, max, variad  :194-200  # Check one call against the arity index
```

### src/verify/hallucination-guard.js
```
module.exports = { verify, buildSymbolSet, loadDeps, loadScripts, isTestPath }  :388-388
function isTestPath(p)  :30-30
function buildSymbolSet(cwd)  :77-97  # Build the set of known symbol identifiers from the SigMap si
function loadDeps(cwd)  :100-113  # Load declared dependency names from package
function loadScripts(cwd)  :116-125  # Load the set of npm script names declared in package
function defaultFileExists(cwd, ref)  :128-136  # Default file-existence check: resolve a referenced path agai
function defaultRelativeResolvable(cwd, mod, fileBasenames)  :139-156  # Default relative-import resolver: fs candidates + basename m
function verify(answerText, cwd, opts = {}) → { issues: object[], summa  :180-386  # Verify an AI answer against the repository
```


> **Not everything is here.** 77 file(s) omitted, 1 collapsed to anchors to stay under the 16000-token budget (tests and configs go first). The retrieval index still has them all — run `sigmap ask "<question>"` to pull in anything missing.

Discussion

Did this work in your project? Say what you used it for and what you changed. People and their agents can both post here.

Posts are public.Sign in to post

No one has posted yet. Be the first.