* Distinct file paths that DEPEND ON `filePath`: every file containing a * symbol with a cross-file edge (any kind except `contains`) into a symbol * of this file. This is the file-level projection of the symbol dependency * graph and the basis for blast-radius / `affected` test selection.
(filePath: string)
| 1793 | * it. One indexed query (idx_nodes_file_path + idx_edges_target_kind). |
| 1794 | */ |
| 1795 | getDependentFilePaths(filePath: string): string[] { |
| 1796 | const sql = `SELECT DISTINCT src.file_path AS fp |
| 1797 | FROM edges e |
| 1798 | JOIN nodes tgt ON tgt.id = e.target |
| 1799 | JOIN nodes src ON src.id = e.source |
| 1800 | WHERE tgt.file_path = ? |
| 1801 | AND e.kind != 'contains' |
| 1802 | AND src.file_path != ?`; |
| 1803 | const rows = this.db.prepare(sql).all(filePath, filePath) as Array<{ fp: string }>; |
| 1804 | return rows.map((r) => r.fp); |
| 1805 | } |
| 1806 | |
| 1807 | /** |
| 1808 | * Distinct file paths that `filePath` DEPENDS ON — the inverse of |
no test coverage detected