Build equivalence evidence only from exact unconditional in-corpus includes.
(resolution_nodes: list[dict], edges: list[dict], root: Path)
| 4588 | |
| 4589 | |
| 4590 | def _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 | |
| 4608 | def _cpp_include_path(includes: dict[str, set[str]], start: str, target: str) -> list[str]: |
no test coverage detected