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

Function _cpp_exact_includes

graphify/extractors/resolution.py:4590–4605  ·  view source on GitHub ↗

Build equivalence evidence only from exact unconditional in-corpus includes.

(resolution_nodes: list[dict], edges: list[dict], root: Path)

Source from the content-addressed store, hash-verified

4588
4589
4590def _cpp_exact_includes(resolution_nodes: list[dict], edges: list[dict], root: Path) -> dict[str, set[str]]:
4591 """Build equivalence evidence only from exact unconditional in-corpus includes."""
4592 by_id = {n["id"]: n for n in resolution_nodes}
4593 includes: dict[str, set[str]] = {}
4594 for edge in edges:
4595 if (edge.get("relation") != "imports" or not edge.get("_cpp_include_proof")
4596 or (edge.get("metadata") or {}).get("cpp_conditions")):
4597 continue
4598 source = _cpp_source_key(edge.get("source_file", ""), root)
4599 target_file = edge.get("target_file") or by_id.get(edge.get("target"), {}).get("source_file")
4600 if source and target_file:
4601 target = _cpp_source_key(target_file, root)
4602 if target:
4603 includes.setdefault(source, set()).add(target)
4604
4605 return includes
4606
4607
4608def _cpp_include_path(includes: dict[str, set[str]], start: str, target: str) -> list[str]:

Callers 3

extractFunction · 0.90

Calls 2

_cpp_source_keyFunction · 0.85
getMethod · 0.45

Tested by

no test coverage detected