import io, json, re
BASE = r"D:\work buddy\2026-11-05-14-15-52"
h = io.open(BASE + r"\index_main.html", encoding="utf-8").read()
seg = h[h.index("const CATD=["):h.index("const VERIFIED_DETAILS=")]
n = len(re.findall(r'\n\["', seg))
print("catd items", n)
b = json.load(io.open(BASE + r"\_heartbeat_baseline.json", encoding="utf-8"))
b["catd"] = n
json.dump(b, io.open(BASE + r"\_heartbeat_baseline.json", "w", encoding="utf-8"), ensure_ascii=False, indent=1)
print("fixed", b["catd"], b["round"], b["programs"], b["vd"], b["phd"], b["master"], b["density_grade"])
