Conversation
Add Python import-edge resolution to the graph and a new `graft cycles` command (plus a `graft_find_import_cycles` MCP tool) that reports every resolved file-to-file import cycle. Python imports: - Resolve absolute and relative (dotted) module specifiers to in-repo file nodes, honoring package `__init__` modules and disambiguating ambiguous suffixes by source root. - Flag lazy edges: imports inside functions/classes or under `if TYPE_CHECKING:` are marked `lazy` and carry their import line, so cycle reports can distinguish breakable edges from eager ones. - Edges gain optional `lazy`/`line` metadata; eager occurrences win over lazy ones on dedup. Cycles: - `findImportCycles` / `formatImportCycles` detect and render file-level import cycles across all languages, marking lazy edges and import lines. - Exposed as the `graft cycles` CLI command (workspace-aware) and the `graft_find_import_cycles` MCP tool, added to the MCP instructions within the existing <1000-char budget by trimming the prose. - `cycles` added to the tracked telemetry commands. Tests cover Python import extraction and resolution, cycle detection, the CLI command, the MCP tool/advertising, and the telemetry contract.
🌱 graft blast radius4 areas changed → 5 areas can be affected. 17 dependent symbols, depth 2. flowchart TB
A0(("Session Metrics<br/>7 symbols"))
A1(("Graph Building<br/>5 symbols"))
A2(("Graph Operations<br/>2 symbols"))
A3(("Telemetry Tracking<br/>2 symbols"))
A4(("Pull Request Review<br/>1 symbol"))
classDef reached fill:#D9EDF3,stroke:#3AA7C9,stroke-width:1.5px,color:#0E313C;
class A0,A1,A2,A3,A4 reached;
Who knows this code — 6 people across 9 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 17 dependent symbols, grouped by areaSession Metrics — 7 symbols in 7 files
Graph Building — 5 symbols in 5 files
Graph Operations — 2 symbols in 1 file
Telemetry Tracking — 2 symbols in 2 files
Pull Request Review — 1 symbol in 1 file
Test signal per changed area — 1 ✓ · 1 ✗ · 2 –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.
47 test suites also reference this code56 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 the code that changed, and the line that reaches it. |
Add Python import-edge resolution to the graph and a new
graft cyclescommand (plus agraft_find_import_cyclesMCP tool) that reports every resolved file-to-file import cycle.Python imports:
__init__modules and disambiguating ambiguous suffixes by source root.if TYPE_CHECKING:are markedlazyand carry their import line, so cycle reports can distinguish breakable edges from eager ones.lazy/linemetadata; eager occurrences win over lazy ones on dedup.Cycles:
findImportCycles/formatImportCyclesdetect and render file-level import cycles across all languages, marking lazy edges and import lines.graft cyclesCLI command (workspace-aware) and thegraft_find_import_cyclesMCP tool, added to the MCP instructions within the existing <1000-char budget by trimming the prose.cyclesadded to the tracked telemetry commands.Tests cover Python import extraction and resolution, cycle detection, the CLI command, the MCP tool/advertising, and the telemetry contract.