"""临时包装脚本：确保从项目根目录运行 analyze_dataflow.py"""
import os
import sys
import traceback

# 切换到项目根目录
root = os.path.abspath(os.path.join(os.path.dirname(__file__), "..", ".."))
os.chdir(root)
print(f"[wrapper] cwd = {os.getcwd()}", flush=True)

# 将 scripts/ops 加入 sys.path
scripts_ops = os.path.join(root, "scripts", "ops")
if scripts_ops not in sys.path:
    sys.path.insert(0, scripts_ops)

try:
    from analyze_dataflow import main
    main()
except Exception as e:
    traceback.print_exc()
    sys.exit(1)
