Commit 53b2c52
authored
feat: richer symbol metadata — signatures, JSDoc, type members, call graph (#19)
* feat: richer symbol metadata — generics, return types, enum members
Signatures now include generic type parameters (`<T extends Base>`),
return type annotations (`: Promise<void>`), and class/interface
heritage (`extends`, `implements`). Enum members are extracted into a
new `members TEXT` column as JSON.
Benchmarked on a 1,653-file React/TS codebase: 973 functions gain
return types, 873 symbols gain generics, 291 enum member values
captured across 50 enums. Index time +7% (negligible), DB size
unchanged.
* feat: JSDoc extraction and type_members table
Add doc_comment column to symbols (3,084 documented symbols on benchmark
repo) and new type_members table for interface/type-alias properties
(12,052 members extracted). Agents can now query type shapes and symbol
documentation without reading files.
SCHEMA_VERSION bumped to 2.
* feat: extract const literal values into symbols.value
Captures string, number, boolean, null, negative numbers, `as const`,
and simple template literals. 615 values extracted on benchmark repo.
* feat: symbol nesting via parent_name + class member extraction
Adds parent_name column to symbols for scope tracking. A visitor stack
assigns parent context to nested functions/consts (10,202 nested symbols
on benchmark). Class methods, properties, and getters/setters are now
extracted as individual symbols with parent_name pointing to the class.
* feat: call graph extraction — function-scoped, deduped per file
New `calls` table tracks which functions call which. Edges are deduped
per file and limited to function-scoped calls (module-level excluded).
Benchmark (merchant-dashboard-v2): 13,804 edges, 2,700 callers,
5,310 callees. Index time unchanged, DB +5MB (23→28MB).
* chore: add changeset for richer symbol metadata
* fix: call graph improvements — qualified scope, this.method(), multi-declarator scope fix
- Add caller_scope column to calls table (dot-joined scope path, e.g.
UserService.run) so same-named methods across classes are no longer
conflated. Dedup key now uses full scope path.
- Handle this.foo() calls in CallExpression (emitted as this.methodName).
- Fix multi-declarator scope corruption: VariableDeclaration:exit now
iterates in reverse so const a = () => {}, b = () => {} correctly
pops both scopes.
- Document new class-member kind values (method, property, getter,
setter) in architecture.md.
- Sync template SKILL.md with authoring skill query examples.
* perf: reduce allocations and redundant I/O in parser and index engine
- Cache scopeStack.join(".") via scopePush/scopePop helpers
- Hoist hot-path regex literals (RE_COMPONENT, RE_HOOK) to module scope
- Replace findJsDoc gap regex with charCodeAt loop (no .slice())
- Cache getProjectRoot() in getChangedFiles, insertParsedResults, indexFiles
- Eliminate redundant getAllFileHashes call in incremental path
- Batch DELETE for deleted files (single IN() vs N separate DELETEs)
- Hoist fileURLToPath and getProjectRoot() in worker-pool spawn loop
- Increase BATCH_SIZE 100→500 for fewer INSERT round-trips
- Zero-alloc isPathExcluded via charCodeAt segment scan
- Update docs: schema version 1→2, batch size references
* docs: fix stale schema comment, add caller_scope index, expand parser checklist
- Update SCHEMA_VERSION comment to reflect current bump-on-change policy
- Add idx_calls_scope covering index for caller_scope queries
- Expand parser extraction checklist in architecture.md with JSDoc,
const values, type members, call graph, and symbol nesting1 parent 630c0b4 commit 53b2c52
16 files changed
Lines changed: 1272 additions & 61 deletions
File tree
- .agents
- rules
- skills/codemap
- .changeset
- docs
- src
- adapters
- application
- templates/agents/skills/codemap
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
56 | 56 | | |
57 | 57 | | |
58 | 58 | | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
59 | 62 | | |
60 | 63 | | |
61 | 64 | | |
| |||
93 | 96 | | |
94 | 97 | | |
95 | 98 | | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
96 | 108 | | |
97 | 109 | | |
98 | 110 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
85 | 85 | | |
86 | 86 | | |
87 | 87 | | |
88 | | - | |
| 88 | + | |
89 | 89 | | |
90 | 90 | | |
| 91 | + | |
| 92 | + | |
| 93 | + | |
| 94 | + | |
| 95 | + | |
| 96 | + | |
| 97 | + | |
| 98 | + | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
| 106 | + | |
| 107 | + | |
| 108 | + | |
| 109 | + | |
| 110 | + | |
| 111 | + | |
| 112 | + | |
| 113 | + | |
| 114 | + | |
| 115 | + | |
| 116 | + | |
91 | 117 | | |
92 | 118 | | |
93 | 119 | | |
| |||
190 | 216 | | |
191 | 217 | | |
192 | 218 | | |
| 219 | + | |
| 220 | + | |
| 221 | + | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
193 | 259 | | |
194 | 260 | | |
195 | 261 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
0 commit comments