Commit cb27a7e
authored
feat: 14-language AST support with heritage, call resolution, and dead code improvements (#78)
* feat: improve PreToolUse hook relevance with multi-signal search
Replace FTS-only file retrieval with a 3-signal ranking system:
- Symbol name match (weight 2.0) — most precise
- File path match (weight 1.5) — catches path-based searches
- FTS on wiki content (weight 1.0) — broadest, lowest priority
Files ranked by signal score then PageRank, top 3 returned.
Remove git signals (HOTSPOT, bus-factor, owner) from enrichment —
that info belongs in get_risk, not every search. Remove Bash command
interception (fragile regex on grep/rg commands).
Keep: symbols (3), importers (3), dependencies (2) per file.
* feat: centralize language config into LanguageRegistry (Phase 1)
Create a single LanguageRegistry with 42 LanguageSpec entries as the
source of truth for all language identity data. Migrate 14 consumer
files to derive their constants from the registry, eliminating
widespread duplication. Delete stale packages/core/queries/ directory.
* feat: modularize extractors and resolvers out of parser.py and graph.py (Phase 2)
Extract per-language logic into dedicated packages:
- extractors/ — visibility, signatures, docstrings, bindings, heritage
- resolvers/ — Python, TS/JS, Go, Rust, C/C++, generic stem fallback
- framework_edges.py — Django, FastAPI, Flask, pytest conftest detection
parser.py drops from 1,806 to 796 lines (pure orchestration).
graph.py drops from 1,286 to 646 lines. Delete dead parsers/ stubs.
* docs: update language support doc and add Phase 3 handoff
Update Adding a New Language guide to reflect modular architecture
(extractors/, resolvers/ instead of inline in parser.py/graph.py).
Add architecture section and updated roadmap.
Create Phase 3 handoff doc covering remaining language work:
hardening C++/C, wiring Kotlin/Ruby/C#, adding Swift/Scala/PHP.
* feat: add AST support for 6 new languages and harden C/C++ (Phase 3)
Complete language pipeline for Kotlin, Ruby, C#, Swift, Scala, and PHP
with tree-sitter grammars, .scm queries, LanguageConfig entries,
per-language extractors (bindings, docstrings, visibility, heritage),
and dedicated import resolvers. Harden C++ with binding extraction and
Doxygen docstrings, add call captures to C. Brings total AST-supported
languages to 14 (7 Full + 7 Good tier).
- Add 6 grammar dependencies (tree-sitter-kotlin/ruby/c-sharp/swift/scala/php)
- Create .scm query files for C#, Swift, Scala, PHP; extend Kotlin, Ruby, C
- Add LanguageConfig entries for all 8 languages in parser.py
- Add per-language visibility functions (kotlin, csharp, swift, scala, php)
- Add binding extractors for all 8 languages
- Add docstring extractors (KDoc, RDoc, XML doc, Swift doc, ScalaDoc, PHPDoc, Doxygen)
- Add heritage extractors for Swift, Scala, PHP
- Create dedicated resolvers for Kotlin, Ruby, C#, Swift, Scala, PHP
- Add 37 new parser tests with fixtures for all 6 languages
- Update registry specs with grammar_package and heritage_node_types
- Update README.md and LANGUAGE_SUPPORT.md documentation
* fix: P0 bugs — dead code symbols lookup, PHP method visibility, Kotlin interfaces
- Fix _detect_unused_exports to read symbol nodes via DEFINES edges
instead of non-existent 'symbols' attribute on file nodes
- Add fallback PHP method_declaration pattern without visibility_modifier
so methods defaulting to public are captured
- Add refine_kotlin_class_kind() to distinguish interface/enum from
regular class in Kotlin class_declaration nodes
- Update test helper _build_graph to create proper symbol nodes
* feat: heritage support for Ruby mixins, Rust derive, Swift extensions, PHP traits
- Ruby: extract include/extend/prepend from class body as mixin relations
- Rust: extract #[derive(Trait)] from struct/enum attribute items
- Swift: add extension conformance capture (user_type pattern in .scm)
- PHP: extract use TraitName; from class declaration_list
- Add struct_item/enum_item to Rust heritage_node_types
- Add 'derive' to valid heritage kinds in integration tests
* feat: P1 fixes — PHP imports, multi-lang dynamic detection, unused internals, module-level calls
- Add PHP require/require_once/include/include_once as import captures
- Extend dynamic import detection to JS/TS/Java/Kotlin/Ruby/PHP/Go
- Implement _detect_unused_internals for private symbols with no callers
- Add synthetic __module__ symbol per file for module-level call resolution
- Update call_resolver to assign orphan calls to __module__ symbol
* docs: update language support docs for 14-language coverage, remove obsolete planning docs
Update README, LANGUAGE_SUPPORT.md, ARCHITECTURE.md, and website docs to
reflect 14 AST-supported languages (7 Full + 7 Good tier) with heritage
extraction improvements. Remove obsolete planning and handoff docs.1 parent 4677a19 commit cb27a7e
92 files changed
Lines changed: 6412 additions & 3699 deletions
File tree
- docs
- architecture
- internals
- packages
- cli/src/repowise/cli
- core
- queries
- src/repowise/core
- analysis
- generation
- ingestion
- dynamic_hints
- extractors
- languages
- parsers
- queries
- resolvers
- workspace/extractors
- server/src/repowise/server/mcp_server
- tests
- fixtures/sample_repo
- csharp_pkg
- kotlin_pkg
- php_pkg
- ruby_pkg
- scala_pkg
- swift_pkg
- integration
- unit
- ingestion
- website
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
65 | 65 | | |
66 | 66 | | |
67 | 67 | | |
68 | | - | |
| 68 | + | |
69 | 69 | | |
70 | 70 | | |
71 | 71 | | |
| |||
543 | 543 | | |
544 | 544 | | |
545 | 545 | | |
546 | | - | |
547 | | - | |
548 | | - | |
549 | | - | |
550 | | - | |
| 546 | + | |
| 547 | + | |
551 | 548 | | |
552 | 549 | | |
553 | | - | |
| 550 | + | |
554 | 551 | | |
555 | 552 | | |
556 | 553 | | |
| |||
| 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 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
| 68 | + | |
| 69 | + | |
| 70 | + | |
| 71 | + | |
| 72 | + | |
| 73 | + | |
| 74 | + | |
| 75 | + | |
| 76 | + | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
| 82 | + | |
| 83 | + | |
| 84 | + | |
| 85 | + | |
| 86 | + | |
| 87 | + | |
| 88 | + | |
| 89 | + | |
| 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 | + | |
| 117 | + | |
| 118 | + | |
| 119 | + | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
| 134 | + | |
| 135 | + | |
| 136 | + | |
| 137 | + | |
| 138 | + | |
| 139 | + | |
| 140 | + | |
| 141 | + | |
| 142 | + | |
| 143 | + | |
| 144 | + | |
| 145 | + | |
| 146 | + | |
| 147 | + | |
| 148 | + | |
| 149 | + | |
| 150 | + | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| 185 | + | |
| 186 | + | |
| 187 | + | |
| 188 | + | |
| 189 | + | |
| 190 | + | |
| 191 | + | |
| 192 | + | |
| 193 | + | |
| 194 | + | |
| 195 | + | |
| 196 | + | |
| 197 | + | |
| 198 | + | |
| 199 | + | |
| 200 | + | |
| 201 | + | |
| 202 | + | |
| 203 | + | |
| 204 | + | |
| 205 | + | |
| 206 | + | |
| 207 | + | |
| 208 | + | |
| 209 | + | |
| 210 | + | |
| 211 | + | |
| 212 | + | |
| 213 | + | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 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 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
| 263 | + | |
| 264 | + | |
| 265 | + | |
| 266 | + | |
| 267 | + | |
| 268 | + | |
| 269 | + | |
| 270 | + | |
| 271 | + | |
| 272 | + | |
| 273 | + | |
| 274 | + | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
| 278 | + | |
| 279 | + | |
| 280 | + | |
| 281 | + | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
| 308 | + | |
| 309 | + | |
| 310 | + | |
| 311 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
163 | 163 | | |
164 | 164 | | |
165 | 165 | | |
166 | | - | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
167 | 171 | | |
168 | 172 | | |
169 | 173 | | |
| |||
506 | 510 | | |
507 | 511 | | |
508 | 512 | | |
509 | | - | |
510 | | - | |
| 513 | + | |
| 514 | + | |
511 | 515 | | |
512 | 516 | | |
513 | 517 | | |
| |||
1547 | 1551 | | |
1548 | 1552 | | |
1549 | 1553 | | |
1550 | | - | |
| 1554 | + | |
1551 | 1555 | | |
1552 | | - | |
1553 | | - | |
1554 | | - | |
| 1556 | + | |
| 1557 | + | |
1555 | 1558 | | |
1556 | | - | |
| 1559 | + | |
| 1560 | + | |
| 1561 | + | |
| 1562 | + | |
| 1563 | + | |
| 1564 | + | |
| 1565 | + | |
1557 | 1566 | | |
1558 | 1567 | | |
1559 | 1568 | | |
1560 | | - | |
| 1569 | + | |
| 1570 | + | |
| 1571 | + | |
| 1572 | + | |
1561 | 1573 | | |
1562 | | - | |
| 1574 | + | |
1563 | 1575 | | |
1564 | 1576 | | |
1565 | 1577 | | |
| |||
0 commit comments