# -*- coding: utf-8 -*-
import json, io, sys, os, re
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")
todo = json.load(open("todo_upgrade.json", encoding="utf-8"))
idx = open("index_main.html", encoding="utf-8").read()
prog_seg = idx[idx.find("const PROGRAMS="):idx.find("const CATD=")]
existing_dets = set(re.findall(r'url:"(details/[^"]+)"', prog_seg))
# UT 未入库
ut_todo = [t for t in todo if t["s"]=="ut" and t["det"] not in existing_dets]
print("UT 未入库 todo 数:", len(ut_todo))
for t in ut_todo[:40]:
    print(t["deg"], "|", t["en"], "|", t["det"])
