MCPcopy Create free account
hub / github.com/Graphify-Labs/graphify / _write_ambiguous_graph

Function _write_ambiguous_graph

tests/test_explain_cli.py:268–289  ·  view source on GitHub ↗

Two DIFFERENT symbols that happen to share a label, in different files. This is the monorepo shape: each workspace defines its own `MetricsPort`. Both land in `_find_node`'s `exact` tier, separated only by iteration order.

(tmp_path, *, reverse: bool = False)

Source from the content-addressed store, hash-verified

266
267
268def _write_ambiguous_graph(tmp_path, *, reverse: bool = False):
269 """Two DIFFERENT symbols that happen to share a label, in different files.
270
271 This is the monorepo shape: each workspace defines its own `MetricsPort`.
272 Both land in `_find_node`'s `exact` tier, separated only by iteration order.
273 """
274 nodes = [
275 {"id": "chat_metrics_port", "label": "MetricsPort",
276 "source_file": "services/chat/src/application/ports/metrics.port.ts",
277 "community": 0},
278 {"id": "scraping_metrics_port", "label": "MetricsPort",
279 "source_file": "services/scraping/src/application/ports/metrics.port.ts",
280 "community": 0},
281 ]
282 graph_data = {
283 "directed": False, "multigraph": False, "graph": {},
284 "nodes": list(reversed(nodes)) if reverse else nodes,
285 "links": [],
286 }
287 p = tmp_path / ("graph_rev.json" if reverse else "graph.json")
288 p.write_text(json.dumps(graph_data))
289 return p
290
291
292def _run_expect_exit(monkeypatch, graph_path, label, capsys):

Calls

no outgoing calls

Tested by

no test coverage detected