## Problem - `build_graph()` writes `graph_image.png` to disk before returning the compiled graph. - `graph.py` calls `faq_graph = build_graph()` at module top level. - Every import of `graph` regenerates the PNG. ## Impact - Adds latency to every run (including unit tests). - A failure in `draw_mermaid_png()` would prevent the module from importing at all. ## Required Fix - [ ] Move the PNG render to a separate function or to `if __name__ == "__main__":`. - [ ] Don't run side-effecting I/O inside a constructor function named `build_graph`.
Problem
build_graph()writesgraph_image.pngto disk before returning the compiled graph.graph.pycallsfaq_graph = build_graph()at module top level.graphregenerates the PNG.Impact
draw_mermaid_png()would prevent the module from importing at all.Required Fix
if __name__ == "__main__":.build_graph.