# -*- coding: utf-8 -*-
import io, json, os, re, sys
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8", errors="replace")
BASE = r"D:\work buddy\2026-11-05-14-15-52"
html = io.open(os.path.join(BASE, "index_main.html"), encoding="utf-8").read()
i = html.index("const VERIFIED_DETAILS=new Set([")
j = html.index("])", i)
seg = html[i:j]
items = re.findall(r'"([^"]+)"', seg)
B = os.path.join(BASE, "_heartbeat_baseline.json")
b = json.load(io.open(B, encoding="utf-8"))
b["vd"] = len(items)
json.dump(b, io.open(B, "w", encoding="utf-8"), ensure_ascii=False, indent=1)
print("vd", len(items), "unique", len(set(items)))
