mirror of
https://github.com/Graphify-Labs/graphify.git
synced 2026-09-14 19:34:09 +08:00
be80ee82d5
`graphify extract <root> --out <dir>` reduced every node's `source_file` to a bare filename, so a graph.json could no longer be resolved back to files on disk by joining source_file onto the scan root. --out passes the output dir as cache_root to relocate the cache, but that value also anchored relativization. Every scanned file then failed relative_to(root), fell through to the #1899 out-of-root fallback, tripped its `updepth > 3` walk-up guard -- written for a stray ProjectReference, not a whole corpus -- and collapsed to a basename. On Windows an --out on another drive hit the cross-drive branch and basenamed unconditionally, which is what the reporter saw: 0 of ~120k source_files kept a separator. The directory survived only in the node id slug, lossily (`.`, `/`, `\`, `-`, spaces all map to `_`), and no other field carried it -- origin_file is stripped (#1516) and the export has no file table -- so 0% of nodes resolved. extract() now takes an explicit `root` anchor for source_file/ids/symbol resolution, which the CLI pins to the scan root independent of where the cache lives. This completes the cache/anchor decoupling #1774 started and matches build(root=target), which already anchored on the scan root -- extract was the lone component keying off --out. cache_root keeps its fallback-anchor role, so callers that pass the scan root as cache_root (watch, the no---out CLI path, tests) are unchanged, as are cache location and out-of-root portability (#1899).