Repository navigation
Conversation
…q#438) 'graft ask "..."' without the repo-root positional anchored the freshness check on cwd, so the pre-query rebuild re-rooted the graph on an unrelated directory and wrote 0 nodes over a valid graph — behind surviving per-file cards, exit 0, the worst failure mode there is. - buildGraph now records its source root on the graph (meta.root). - ensureFreshGraph refuses to rebuild when the query's root is not the recorded root: it answers from the graph as-is and says what root built it. Same directory is judged by realpath, so a symlinked entry (hub/entry -> ../repo) and the repo's own path are one root. - The freshly seeded worktree copy is the deliberate exception — its repair rebuild to THIS checkout is the point of seeding — and graphs without a recorded root keep the old behavior exactly, so an upgrade changes nothing for them.
🌱 graft blast radius1 area changed → 4 areas can be affected. 12 dependent symbols, depth 2. flowchart TB
A0(("Pull Request Review<br/>4 symbols"))
A1(("Graph Refresh CLI<br/>3 symbols"))
A2(("CLI Engine Integration<br/>3 symbols"))
A3(("MCP Server Tools<br/>2 symbols"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0,A1,A2,A3 reached;
Who knows this code — 3 people across 5 areas
Ownership is git history over each area's own files, weighted towards recent work (120-day half-life). Merge commits and bots are dropped, and you are dropped from your own PR. A name with no All 12 dependent symbols, grouped by areaPull Request Review — 4 symbols in 4 files
Graph Refresh CLI — 3 symbols in 2 files
CLI Engine Integration — 3 symbols in 2 files
MCP Server Tools — 2 symbols in 2 files
Test signal per changed area — 1 ✓Reached = a node under a test path has a resolved edge into the changed symbol. It undercounts anything called indirectly — through a CLI, a spawned process or a dynamic import — so read a low ratio as “look here”, never as a coverage gate.
53 test suites also reference this code65 symbols, kept out of the diagram and the table so they cannot crowd out the areas a reviewer has to look at.
Open the interactive graph → — click an area to see its dependent symbols at file:line. |
Fixes #438.
Root cause
The pre-query freshness check anchored on the query's root. With no positional,
queryRootfalls back to cwd, the fingerprint probe compares cwd's file set against the graph, everything "changed", and the rebuild re-rooted the graph on an unrelated directory — 0 nodes written over a valid graph, cards intact, exit 0.Fix
buildGraphrecords its absolute source root on the graph (meta.root).ensureFreshGraphrefuses to rebuild when the query root is not the recorded root: it answers from the graph as-is and printsgraph was built for <root>; pass it as the argument, or use --no-refresh to answer as-is.<entry>symlinks into sibling repos) passes no matter which path spelling arrives.meta.rootkeep the old behavior byte-for-byte, so an upgrade changes nothing.Tests (test/graph-refresh.test.ts)
Stranger-root query →
refreshed:false, note names the recorded root, node set untouched · symlink alias of the true root → clean, no note · true root with a real edit → refreshes as before · old graph without the field → old (re-rooting) behavior asserted honestly as unchanged.