* (Re)build the query/extraction/graph layers over the current `this.queries` * (which wraps `this.db`). Factored out of the constructor so `reopenIfReplaced` * can rebuild them against a fresh connection without duplicating the wiring. * The path-based `fileLock` is independent of the DB h
()
| 179 | * The path-based `fileLock` is independent of the DB handle, so it stays put. |
| 180 | */ |
| 181 | private wireLayers(): void { |
| 182 | // Down-weight the project name as a query term in search ranking — it names |
| 183 | // the whole repo, not a symbol, so it has no discriminative value (#720). |
| 184 | try { |
| 185 | this.queries.setProjectNameTokens(deriveProjectNameTokens(this.projectRoot)); |
| 186 | } catch { |
| 187 | // Best-effort: ranking still works without it. |
| 188 | } |
| 189 | this.orchestrator = new ExtractionOrchestrator(this.projectRoot, this.queries); |
| 190 | this.resolver = createResolver(this.projectRoot, this.queries); |
| 191 | this.graphManager = new GraphQueryManager(this.queries); |
| 192 | this.traverser = new GraphTraverser(this.queries); |
| 193 | this.contextBuilder = createContextBuilder( |
| 194 | this.projectRoot, |
| 195 | this.queries, |
| 196 | this.traverser |
| 197 | ); |
| 198 | } |
| 199 | |
| 200 | /** |
| 201 | * Heal a stale database handle in place. If `.codegraph/` was removed and |
no test coverage detected