# -*- coding: utf-8 -*-
import sys, io, json, os, datetime
sys.stdout = io.TextIOWrapper(sys.stdout.buffer, encoding='utf-8', errors='replace')
BASE = r"D:\work buddy\2026-11-05-14-15-52"
bp = os.path.join(BASE, "_heartbeat_baseline.json")
b = json.load(open(bp, encoding="utf-8"))
b["round"] = 340
b["timestamp"] = datetime.datetime.now().strftime("%Y-%m-%d %H:%M:%S")
b["main_file_mtime"] = "2026-12-02 12:22:27"
b["main_file_bytes"] = 1958764
b["schools"] = 36; b["programs"] = 1440; b["catd"] = 2817; b["vd"] = 1547
b["dead_links"] = 0; b["exclude_residue"] = 0; b["details_on_disk"] = 3776
b["master"] = 941; b["phd"] = 499
b["http"] = "200 @ http://127.0.0.1:8000/index_main.html"

notes = [
 "r340 UCSD 官方 2026-27 研究生注册费表已重新实抓复核（https://students.ucsd.edu/finances/fees/registration/2026-27/graduate.html，Last Updated 2026-09-20）：学费 $4,574/季、学生服务费 $448/季、学生健保 $2,220/季、NRST $5,034/季、一次性注册服务费 $115、国际新生签证管理费 $200；年度合计 居民 $22,985.17 / 非居民 $38,087.17。",
 "r340 UCSD self-supporting 另表已实抓（https://students.ucsd.edu/finances/fees/registration/2026-27/self-supporting.html）：按学分计费 —— MS Computational Social Science $1,056/学分、MAS Convergent Systems Engineering $925/学分、MAS Data Science and Engineering $1,135/学分、MPH $1,149/学分、MAS Clinical Research $976/学分、MAS Climate Science & Policy $848/学分、MAS Marine Biodiversity $888/学分、MDSO $815/学分、MSDDPM $998/学分、MAS Precision Medicine Therapeutics $1,130/学分、MAS PA Education $19,762.11/季；该类项目校园费年度合计 $9,263.17（不含学分学费）。",
 "待复核：库内 ucsd-dse-ms 录为 MS，官网 self-supporting 表只有 MAS in Data Science and Engineering（$1,135/学分），学位类型口径待核；ucsd-cse-cpss-ms 录为 MS，官网表列为 MAS Convergent Systems Engineering（$925/学分），亦待核学位名。",
 "待复核：ucsd-css 与 ucsd-css-ms 为同项目重复占位（MS Computational Social Science，self-supporting $1,056/学分）；ucsd-bioe-med-ms 与 ucsd-bioe-ms-med 为同项目重复占位（Bioengineering MS Medical 方向），待合并去重。",
]
for n in notes:
    if n not in b["blocked_notes"]:
        b["blocked_notes"].append(n)

b["actions_this_round"] = [
 "r340 只读巡检：终检四脚本全绿，计数与 r339 完全一致（36/1440/2817/1547/死链0），主文件 mtime 11:32:33 未变（无外部改动）。",
 "r340 实抓 UCSD 官方两页（研究生注册费 2026-27 + self-supporting 项目表），建立 UCSD 双口径费率基线，可成组复用。",
 "r340 回填 8 条 UCSD 州资助学术型项目学费（$22,985.17/年居民 · $38,087.17/年非居民，2026-27）：ucsd-cse-ms、ucsd-mae-ms、ucsd-se-ms、ucsd-math-app-ms、ucsd-bioe-med-ms、ucsd-es-bb-ms、ucsd-es-pe-ms、ucsd-es-cm-ms。",
 "r340 同步 8 个详情页：cse-ms 新增“学费（2026-27）”卡；mae-ms/se-ms 补 Tuition 行；math-app-ms/bioe-med-ms/es-bb-ms/es-pe-ms/es-cm-ms 补“学费”行；5 页半核验说明同步改为“学费已回填”，并统一加页脚数据说明。",
 "r340 校验：node exit 0；final_check 计数不变、死链0、残留0；_vd_check 全绿；`}{` 缺逗号 0；HTTP 200。主文件 1,958,764 字节，mtime 12:22:27。",
]
json.dump(b, open(bp, "w", encoding="utf-8"), ensure_ascii=False, indent=2)
print("baseline r340", b["timestamp"], os.path.getsize(bp))
