# -*- coding: utf-8 -*-
import io, sys, os, re, json, glob
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding="utf-8")
os.chdir(r"D:\work buddy\2026-11-05-14-15-52")

def prog_n(path):
    t=open(path,encoding="utf-8").read()
    seg=t[t.find("const PROGRAMS="):t.find("const CATD=")]
    return len(re.findall(r'\{id:"',seg))

for f in sorted(glob.glob("index_main.backup-before-round*.html")):
    print(f, prog_n(f))
print("current", prog_n("index_main.html"))

b=json.load(open("_heartbeat_baseline.json",encoding="utf-8"))
print("\n=== note ===")
print(b.get("note",""))
print("\n=== blocked_notes 条数 ===", len(b["blocked_notes"]))
for n in b["blocked_notes"]:
    print("-", n[:70])
