Decide whether to auto-include an edge in Mermaid output.
(edge: dict)
| 967 | |
| 968 | |
| 969 | def should_include_edge(edge: dict) -> bool: |
| 970 | """Decide whether to auto-include an edge in Mermaid output.""" |
| 971 | conf = str(edge.get("confidence", "EXTRACTED")).upper() |
| 972 | score = to_float(edge.get("confidence_score", 1.0), 1.0) |
| 973 | |
| 974 | if conf == "EXTRACTED": |
| 975 | return True |
| 976 | if conf == "INFERRED" and score >= 0.85: |
| 977 | return True |
| 978 | # Low-confidence INFERRED or AMBIGUOUS: comment out for LLM review |
| 979 | return False |
| 980 | |
| 981 | |
| 982 | # ────────────────────────────────────────────── |
no test coverage detected