Files
pbz-progress-roadmap/roadmap.py
T

577 lines
24 KiB
Python
Raw Permalink Blame History

This file contains invisible Unicode characters
This file contains invisible Unicode characters that are indistinguishable to humans but may be processed differently by a computer. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
"""影之刃零 进度时间线 —— 按实际推进顺序排列,不按章节分组。
用法:
python roadmap.py # 生成 roadmap.md / roadmap.html
python render_png.py # 生成 roadmap.png(阶段概览)
python render_detail.py # 生成 roadmap-detail.png(逐节点时间线)
python refresh.py # 先从游戏存档重新解密,再跑上面三步
判据(关键):
BranchCompleted 已完成
BranchActivating 进行中
BranchLocked 已锁死/失败 ← 只有这个算真错过
BranchType::None 尚未解锁 ← 正常,不是失败
"""
from __future__ import annotations
import json
import sys
from pathlib import Path
ROOT = Path(__file__).resolve().parent
SNAP = ROOT / "save_snapshot"
MAIN_SLOT = "AutoSave0"
COMPLETED = "BranchCompleted"
ACTIVATING = "BranchActivating"
LOCKED = "BranchLocked"
class Save:
def __init__(self, slot: str = MAIN_SLOT):
path = SNAP / f"{slot}.json"
if not path.is_file():
raise SystemExit(
f"缺少存档快照:{path}\n\n"
"先在项目目录下运行:\n"
" python fetch_codec.py # 取 Oodle 解码器(只需一次)\n"
" python refresh.py # 读游戏存档,生成 save_snapshot/*.json\n"
)
self.d = json.loads(path.read_text("utf8"))
ach = json.loads((SNAP / "__Achievements__.json").read_text("utf8"))
self.unlocked = set(ach["UnlockedIds"])
self.counters = ach.get("Counters", {})
self.killed = {
k for k, v in self.d.get("BossRecord", {}).items()
if any(r.get("KillCount", 0) > 0 for r in v.get("Records", {}).values())
}
self.tags = set(self.d["EventPipeline"]["GlobalTags"])
self.quests = {}
for q in self.d["Narrative"]["NarrativeSavedQuests"]:
name = q["QuestClass"].split("/")[-1].split(".")[0]
branches, tasks, times = {}, {}, {}
for b in q.get("QuestBranches", []):
branches[b["BranchID"]] = b["BranchType"].rsplit("::", 1)[-1]
tasks[b["BranchID"]] = b.get("TasksProgress") or []
times[b["BranchID"]] = b.get("DirtyTime", "")
self.quests[name] = {
"status": q["QuestCompletion"].rsplit("::", 1)[-1],
"branches": branches,
"tasks": tasks,
"times": times,
}
self.g = self.d["PBZGameSystem"]
def tasks(self, quest, bid):
return self.q(quest)["tasks"].get(bid, [])
def date(self, quest, bid=None):
"""取该分支的完成时间(MM-DD);无则空。"""
q = self.q(quest)
if bid:
t = q["times"].get(bid, "")
return self._md(t)
# 无指定分支:取所有已完成分支里最晚的一个
best = ""
for b, st in q["branches"].items():
if st == COMPLETED:
t = q["times"].get(b, "")
if t > best:
best = t
return self._md(best)
@staticmethod
def _md(t):
# "2026.11.24-22.56.56" -> "11-24"
if not t or t.startswith("0001"):
return ""
parts = t.split("-")
if len(parts) < 2:
return ""
md = parts[0].split(".")
if len(md) < 3:
return ""
return f"{md[1]}-{md[2]}"
def q(self, name):
return self.quests.get(name, {"status": "Missing", "branches": {}})
def branch(self, quest, bid):
return self.q(quest)["branches"].get(bid, "Missing")
def done(self, quest):
return self.q(quest)["status"] == "QC_Succeded"
def started(self, quest):
return self.q(quest)["status"] == "QC_Started"
def failed(self, quest):
q = self.q(quest)
if q["status"] == "QC_Failed":
return True
return any(v == LOCKED for v in q["branches"].values())
def has(self, tag):
return tag in self.tags
from timeline_data import TIMELINE # noqa: E402
KIND_LABEL = {"main": "主线", "purple": "紫色", "side": "支线",
"boss": "首领", "ach": "结局", "gate": "闸口", "item": "道具"}
def status_of(save: Save, node: dict) -> tuple[str, str]:
# 道具节点默认不判定(存档里多数没有对应字段),只按位置提示;
# 若该道具带了 tag,就让它走下面的 tag 判定。
if node.get("kind") == "item" and not node.get("tag"):
return "item", "道具 · 按位置取"
if node.get("ach") and node["ach"] in save.unlocked:
return "done", f"成就 {node['ach']} 已解锁"
for bk in node.get("boss", []):
if bk in save.killed:
return "done", f"BOSS 已击杀({bk})"
if node.get("tag") and save.has(node["tag"]):
return "done", f"节点已达成({node['tag']})"
# 人工标注:分步任务的某一步做完了,但整条线还在跑(分支仍 Activating),
# 自动判定会显示成「进行中」让人误以为没做完。manual 直接给结论。
if node.get("manual"):
return node["manual"], node.get("manual_note") or "人工标注"
if node.get("lost_if") and save.has(node["lost_if"]):
return "locked", f"已错过(存档无任务记录,且存在 {node['lost_if']})"
if node.get("tp"):
bid, idx = node["tp"]
prog = save.tasks(node["quest"], bid)
if idx < len(prog):
ok = prog[idx] == 1
return ("done" if ok else "todo"), f"第 {idx + 1} 处 {'已完成' if ok else '未完成'}"
return "todo", "无进度数据"
q = node.get("quest")
if q:
if save.failed(q):
return "locked", "任务失败 / 分支锁死"
if save.done(q):
return "done", f"{q} 已完成"
bid = node.get("branch")
if bid:
st = save.branch(q, bid)
if st == COMPLETED:
return "done", f"分支 {bid} 已完成"
if st == ACTIVATING:
return "active", f"分支 {bid} 进行中"
if st == LOCKED:
return "locked", f"分支 {bid} 已锁死"
return "todo", f"分支 {bid} 未解锁"
if save.started(q):
br = save.q(q)["branches"]
act = [k for k, v in br.items() if v == ACTIVATING]
done = [k for k, v in br.items() if v == COMPLETED]
if not act:
# 没有进行中的分支:这一段已经没得做了,别让人以为还欠着
if done:
return "done", f"本段已完成 · {len(done)} 支"
return "todo", f"{q} 未开始"
return "active", f"{len(done)} 支已完成 · 进行 {','.join(act)}"
return "todo", f"{q} 未开始"
return "todo", "未到达"
def build(save: Save):
"""展开时间线:stage 行原样保留,节点行带状态与序号。"""
rows = []
seq = 0
for item in TIMELINE:
if "stage" in item:
rows.append({"type": "stage", "name": item["stage"],
"sub": item.get("sub", "")})
continue
code, ev = status_of(save, item)
seq += 1
rows.append({"type": "node", "seq": seq, "code": code,
"evidence": ev, **item})
# 顺序推定:有些跨区任务的存档分支号与攻略步骤对不上
# (昆仑三杰 S1/S2/S3 全激活、1~5 全空;泣声何来 4 步之后无分支号)。
# 规则:任务已完成 → 全 done;否则找到该任务第一个未完成的步骤,
# 若它是推定节点就标 active(该推进这步),其后的推定节点一律 todo。
for who in {r.get("who") for r in rows if r["type"] == "node" and r.get("infer")}:
nodes = [r for r in rows if r["type"] == "node" and r.get("who") == who]
if not nodes:
continue
q = nodes[0].get("quest")
if q and save.done(q):
for n in nodes:
n["code"], n["evidence"] = "done", "任务已完成"
continue
first_open_seen = False
for n in nodes:
if n["code"] == "done":
continue
if not first_open_seen:
first_open_seen = True
if n.get("infer"):
n["code"] = "active"
n["evidence"] = "进行中 · 该推进这一步"
continue
if n.get("infer"):
n["code"] = "todo"
n["evidence"] = "未到达"
# 当前阶段:用「最近交互铃铛」的时间戳判定,不能靠「第一个 active」——
# 已通过区域里仍挂着跨区任务(赤红庄园、四凶斧等),会误判。
MAP_TO_STAGE = {"XiGu": "悲泣溪谷", "FuJiZhiLin": "血色森林",
"LuJiaCun": "陆家村", "Zhengdaodaying": "正道大营"}
times = save.d["BellManager"].get("RecentlyInteractedAtByMap", {})
cur_stage = None
if times:
cur_stage = MAP_TO_STAGE.get(max(times, key=times.get))
if cur_stage is None:
cur = None
for r in rows:
if r["type"] == "stage":
cur = r["name"]
elif r["code"] == "todo" and cur_stage is None:
cur_stage = cur
for r in rows:
r["current_stage"] = (r["type"] == "stage" and r["name"] == cur_stage)
# 给每个节点补上日期与地图标签(地图只作标签,不是分组)
stage = ""
for r in rows:
if r["type"] == "stage":
stage = r["name"]
continue
r["map"] = r.get("map") or stage
if r.get("date"):
continue
if r["code"] != "done":
r["date"] = ""
continue
q = r.get("quest")
if q:
bid = None
if r.get("tp"):
bid = r["tp"][0]
elif r.get("branch"):
bid = r["branch"]
r["date"] = save.date(q, bid)
else:
r["date"] = ""
return rows
def stage_stats(rows):
"""每个阶段的完成数,用于概览图。"""
out, cur = [], None
for r in rows:
if r["type"] == "stage":
cur = {"name": r["name"], "sub": r["sub"], "done": 0, "active": 0,
"todo": 0, "locked": 0, "item": 0, "total": 0,
"current": r["current_stage"], "pending": []}
out.append(cur)
elif cur is not None:
cur[r["code"]] += 1
cur["total"] += 1
if r["code"] in ("active", "todo"):
cur["pending"].append(r["name"])
return out
def summary(save: Save, rows):
counts = {"done": 0, "active": 0, "locked": 0, "todo": 0, "item": 0}
for r in rows:
if r["type"] == "node":
counts[r["code"]] += 1
return {
"hours": round(save.g["HasGameTime"] / 3600, 1),
"date": save.g["DateTimeString"],
"cycle": save.g["CycleCount"],
"days_left": save.d["Player"]["RemainingDays"],
"deaths": save.d["PBZDeathMeta"]["DiedTimes"],
"ach": len(save.unlocked),
"counts": counts,
"gen": __import__("datetime").datetime.now().strftime("%Y-%m-%d %H:%M"),
"total": sum(counts.values()),
}
def next_actions(rows):
"""当前阶段的未完成节点;没有则取最近一个还有未完成的阶段。"""
cur_stage, cur_list = None, []
stages = []
for r in rows:
if r["type"] == "stage":
cur_stage, cur_list = r["name"], []
stages.append((r["name"], cur_list, r["current_stage"]))
elif r["code"] in ("active", "todo"):
cur_list.append(r)
for name, lst, is_cur in stages:
if is_cur:
return lst, name
for name, lst, _ in stages:
if lst:
return lst, name
return [], None
# ---------------------------------------------------------------- Markdown
MARK = {"done": "✅", "active": "▶️", "locked": "❌", "todo": "⬜", "item": "🎒"}
def cross_region_lines(rows):
"""按 who 分组的跨区任务线;单节点的线不算(会显示成 1/1 完成,误导)。"""
order, groups = [], {}
for r in rows:
if r["type"] != "node" or not r.get("who"):
continue
w = r["who"]
if w not in groups:
order.append(w)
groups[w] = []
groups[w].append(r)
return [(w, groups[w]) for w in order if len(groups[w]) >= 2]
def render_lines_html(rows) -> str:
"""跨区任务线的动态视图:每一环带地图和状态,断在第几环一目了然。"""
lines = cross_region_lines(rows)
if not lines:
return ""
cards = []
for who, steps in lines:
done = sum(1 for s in steps if s["code"] == "done")
brk = next((i for i, s in enumerate(steps) if s["code"] != "done"), None)
if brk is None:
state, tone = "全部完成", "done"
elif steps[brk]["code"] == "locked":
state, tone = f"断在第 {brk + 1} 环(已错过)", "locked"
elif steps[brk]["code"] == "active":
state, tone = f"进行到第 {brk + 1} 环", "active"
else:
state, tone = f"下一步:第 {brk + 1} 环", "todo"
seg = "".join(
f'<li class="{s["code"]}"><i>{s.get("map") or "—"}</i>{s["name"]}</li>'
for s in steps)
cards.append(
f'<div class="line">'
f'<div class="lh"><b>{who}</b>'
f'<span class="prog">{done}/{len(steps)} · <em class="{tone}">{state}</em></span></div>'
f'<ol class="steps">{seg}</ol></div>')
return (
'<section class="lines-wrap">'
'<h2>跨区任务线</h2>'
f'<p class="cap">{len(lines)} 条跨地图的线,每一环挂在地图上;'
'断在第几环、下一步该去哪,跟着存档实时算。</p>'
f'<div class="lines">{"".join(cards)}</div></section>')
def render_md(rows, s) -> str:
todo, cur = next_actions(rows)
out = ["# 影之刃零 · 进度时间线", "",
f"存档 `{MAIN_SLOT}` · **{s['hours']} 小时** · {s['date']} · 难度 3 · "
f"第 {s['cycle']+1} 轮 · 剩余 {s['days_left']} 天 · 死亡 {s['deaths']} 次 · "
f"**成就 {s['ach']}/66**", "",
f"完成 {s['counts']['done']} · 进行中 {s['counts']['active']} · "
f"未到达 {s['counts']['todo']} · 已错过 {s['counts']['locked']} · "
f"道具 {s['counts']['item']}", ""]
if cur:
out += [f"> **现在在:{cur}**", ">",
"> " + " · ".join(f"{MARK[t['code']]}{t['name']}" for t in todo), ""]
for r in rows:
if r["type"] == "stage":
mark = " ◀ 现在这里" if r["current_stage"] else ""
out.append(f"\n### {r['name']}{mark}")
if r["sub"]:
out.append(f"_{r['sub']}_")
continue
typ = KIND_LABEL.get(r["kind"], "")
span = f" `{r['span']}`" if r.get("span") else ""
note = f" — {r['note']}" if r.get("note") else ""
out.append(f"{MARK[r['code']]} **{r['name']}** · {typ}{span}{note}")
out.append(f"  <sub>{r['evidence']}</sub>")
return "\n".join(out)
# ---------------------------------------------------------------- HTML
COLORS = {"done": ("#2ec27e", "#141c17"), "active": ("#f5a623", "#1f1a12"),
"locked": ("#e5484d", "#1e1414"), "todo": ("#7a756e", "#1a1714"),
"item": ("#4a9eff", "#101a26")}
def render_html(rows, s) -> str:
"""时间轴表格:序号 / 日期 / 地图 / 节点 / 状态。地图只是标签。"""
todo, cur = next_actions(rows)
c = s["counts"]
body = []
for r in rows:
if r["type"] == "stage":
is_cur = r["current_stage"]
cls = "mapsplit cur" if is_cur else "mapsplit"
here = '<b class="here">← 现在这里</b>' if is_cur else ""
body.append(
f'<div class="{cls}"><span class="tri"></span>'
f'<span class="mname">进入 {r["name"]}</span>'
f'<span class="msub">{r.get("sub", "")}</span>{here}</div>')
continue
who = (f'<span class="who">跨区·{r["who"]}</span>' if r.get("who") else "")
note = f'<small>{r["note"]}</small>' if r.get("note") else ""
date = r.get("date") or ""
body.append(f"""
<div class="tl {r['code']}">
<div class="c-seq">{r['seq']:02d}</div>
<div class="c-date">{date}</div>
<div class="c-map"><i>{r.get('map', '')}</i></div>
<div class="c-name">{r['name']}<span class="k k-{r['kind']}">{KIND_LABEL.get(r['kind'], '')}</span>{who}{note}</div>
<div class="c-ev">{r['evidence']}</div>
</div>""")
chips = "".join(f'<li class="{t["code"]}">{MARK[t["code"]]} {t["name"]}</li>' for t in todo)
lines_html = render_lines_html(rows)
return f"""<!DOCTYPE html>
<html lang="zh-CN"><head><meta charset="utf-8">
<meta name="viewport" content="width=device-width,initial-scale=1">
<title>影之刃零 · 推进时间轴</title>
<style>
:root{{--bg:#12100e;--fg:#e8e2d8;--dim:#8b8479;--line:#2c2822;--mapbg:#26211b;--mapfg:#c4ac7e}}
*{{box-sizing:border-box}}
body{{margin:0;background:var(--bg);color:var(--fg);
font-family:"Segoe UI","Microsoft YaHei",system-ui,sans-serif;line-height:1.5;font-size:14px}}
header{{padding:26px 30px 18px;border-bottom:1px solid var(--line);
background:radial-gradient(ellipse at 12% 0%,#241d16,#12100e 72%)}}
h1{{margin:0 0 4px;font-size:23px;letter-spacing:.04em}}
h1 small{{color:var(--dim);font-size:12px;font-weight:400;margin-left:8px}}
.stats{{display:flex;gap:18px;flex-wrap:wrap;margin-top:10px;font-size:12px;color:var(--dim)}}
.stats b{{color:var(--fg);font-size:15px;margin-right:2px}}
.legend{{display:flex;gap:14px;margin-top:9px;font-size:11px;color:var(--dim);flex-wrap:wrap}}
.legend i{{display:inline-block;width:8px;height:8px;border-radius:2px;margin-right:4px}}
.action{{margin-top:12px;padding:10px 13px;background:#1f1a12;border:1px solid #3a2f1e;border-radius:4px}}
.action-title{{font-size:11px;letter-spacing:.1em;color:#c9a05a;margin-bottom:6px}}
.chips{{list-style:none;display:flex;flex-wrap:wrap;gap:6px;margin:0;padding:0}}
.chips li{{font-size:12px;padding:2px 8px;border-radius:3px;background:#2a2419;border:1px solid #3d3423}}
.chips li.active{{border-color:#f5a623;color:#f5c06a}}
.lines-wrap{{max-width:1180px;margin:0 auto;padding:20px 22px 2px}}
.lines-wrap h2{{margin:0 0 3px;font-size:15px;letter-spacing:.04em;color:#c9b177;font-weight:600}}
.lines-wrap .cap{{margin:0 0 10px;font-size:11px;color:#6d665c}}
.lines{{display:grid;gap:9px;grid-template-columns:repeat(auto-fit,minmax(500px,1fr))}}
.line{{background:#171411;border:1px solid var(--line);border-radius:5px;padding:9px 11px}}
.lh{{display:flex;justify-content:space-between;align-items:baseline;gap:10px;margin-bottom:7px}}
.lh b{{font-size:13px;letter-spacing:.02em}}
.prog{{font-size:10.5px;color:#6d665c;font-variant-numeric:tabular-nums;white-space:nowrap}}
.prog em{{font-style:normal}}
.prog em.done{{color:#4e8a68}} .prog em.active{{color:#c98a34}}
.prog em.locked{{color:#c96a6d}} .prog em.todo{{color:#8b8479}}
.steps{{list-style:none;display:flex;gap:5px;flex-wrap:wrap;margin:0;padding:0}}
.steps li{{font-size:11px;padding:3px 7px 4px;border-radius:3px;
border:1px solid #2e2a24;background:#1d1a16;color:#9a938a;line-height:1.35}}
.steps li i{{display:block;font-style:normal;font-size:9px;opacity:.65;margin-bottom:1px}}
.steps li.done{{border-color:#2f5743;background:#152119;color:#a8cbb8}}
.steps li.active{{border-color:#6b4f22;background:#241c11;color:#e0b070}}
.steps li.locked{{border-color:#5e2c2f;background:#221515;color:#d08286}}
.steps li.item{{border-color:#2b4a6b;background:#131b24;color:#8fb6dd}}
.table{{max-width:1180px;margin:0 auto;padding:0 22px 70px}}
.head,.tl{{display:grid;grid-template-columns:44px 52px 84px minmax(220px,1fr) minmax(160px,240px);
align-items:start;column-gap:8px}}
.head{{position:sticky;top:0;z-index:9;background:#15120f;padding:9px 0 8px;
border-bottom:1px solid var(--line);font-size:11px;color:#6d665c;letter-spacing:.06em}}
.tl{{padding:7px 0;border-bottom:1px solid #1e1b17;position:relative}}
.tl:hover{{background:#171411}}
.c-seq{{font-size:10px;color:#5d564c;padding-top:4px;font-variant-numeric:tabular-nums}}
.c-date{{font-size:11px;color:#84796a;padding-top:3px;font-variant-numeric:tabular-nums}}
.c-map i{{display:inline-block;font-style:normal;font-size:10px;padding:1px 6px;margin-top:2px;
border-radius:2px;background:var(--mapbg);color:var(--mapfg);white-space:nowrap}}
.c-name{{font-size:14px;font-weight:600;padding-top:1px}}
.c-name small{{display:block;font-size:11px;font-weight:400;color:#7b746a;margin-top:2px;line-height:1.45}}
.k{{font-size:10px;font-weight:400;padding:0 5px;border-radius:2px;margin-left:6px;vertical-align:1px}}
.k-main{{background:#2a3a4d;color:#8fb8de}} .k-purple{{background:#3a2a4d;color:#c4a0e8}}
.k-side{{background:#2d302c;color:#a8b0a4}} .k-boss{{background:#4d2f2a;color:#e8a08f}}
.k-ach{{background:#4d4429;color:#e8d48f}} .k-gate{{background:#4d2a2a;color:#f0a0a0}}
.who{{font-size:10px;font-weight:400;padding:0 6px;margin-left:6px;border-radius:2px;
background:#332d22;color:#c9b177;border:1px solid #4a4029}}
.c-ev{{font-size:11px;text-align:right;padding-top:3px;color:#6a645a;
line-height:1.45;word-break:break-word}}
.tl.done .c-name{{color:#cfe3d6}} .tl.done .c-ev{{color:#4e7360}}
.tl.active{{background:linear-gradient(90deg,#1f1a12,transparent 65%)}}
.tl.active .c-ev{{color:#b58a44}}
.tl.todo .c-name{{color:#b6b0a6}} .tl.todo .c-ev{{color:#5c574f}}
.tl.locked .c-name{{color:#f08a8d}} .tl.locked .c-ev{{color:#c96a6d}}
.mapsplit{{max-width:1180px;margin:0 auto;padding:14px 22px 6px;position:relative;
font-size:13px;color:var(--mapfg);border-top:1px dashed #2a2621}}
.mapsplit .tri{{display:inline-block;width:0;height:0;border:5px solid transparent;
border-left-color:#6b6154;margin-right:8px;vertical-align:1px}}
.mapsplit .mname{{font-weight:600;letter-spacing:.02em}}
.mapsplit .msub{{font-size:11px;color:#6d665c;margin-left:10px}}
.mapsplit.cur{{color:#ffd98a}}
.mapsplit.cur .tri{{border-left-color:#f5a623}}
.mapsplit .here{{font-size:11px;color:#7fc4e8;font-weight:400;margin-left:10px}}
footer{{text-align:center;color:#544e46;font-size:11px;padding:22px}}
@media (max-width:720px){{
.head,.tl{{grid-template-columns:38px 74px 1fr}}
.c-date,.head .h-date{{display:none}}
.c-ev{{grid-column:2 / 4;text-align:left;padding-top:2px}}
}}
</style></head>
<body>
<header>
<h1>影之刃零 · 推进时间轴 <small>{s['hours']}h / 第 {s['cycle']+1} 轮</small></h1>
<div class="stats">
<span><b>{s['ach']}</b>成就 /66</span>
<span><b>{c['done']}</b>已完成</span>
<span><b>{c['active']}</b>进行中</span>
<span><b>{c['todo']}</b>未到达</span>
<span><b>{c['locked']}</b>已错过</span>
<span>剩 <b>{s['days_left']}</b>天</span>
<span>死亡 <b>{s['deaths']}</b>次</span>
</div>
<div class="legend">
<span><i style="background:#2ec27e"></i>已完成</span>
<span><i style="background:#f5a623"></i>进行中</span>
<span><i style="background:#7a756e"></i>未到达</span>
<span><i style="background:#e5484d"></i>已错过</span>
<span style="color:#4e483f">存档 {s['date']}</span>
</div>
<div class="action">
<div class="action-title">现在该做({cur or '—'})</div>
<ul class="chips">{chips}</ul>
</div>
</header>
{lines_html}
<div class="table">
<div class="head">
<div>#</div><div class="h-date">日期</div><div>地图</div><div>节点</div><div style="text-align:right">状态</div>
</div>
{''.join(body)}
</div>
<footer>按推进时间排序,地图为标签 · 跨区任务拆成步骤节点 · 仅 BranchLocked / QC_Failed 记为已错过<br>
<span style="color:#8a8278">生成 {s['gen']} · {s['total']} 个节点 · 存档 {s['date']}</span></footer>
</body></html>"""
def main():
slot = MAIN_SLOT
if "--slot" in sys.argv:
slot = sys.argv[sys.argv.index("--slot") + 1]
save = Save(slot)
rows = build(save)
s = summary(save, rows)
(ROOT / "roadmap.md").write_text(render_md(rows, s), encoding="utf8")
(ROOT / "roadmap.html").write_text(render_html(rows, s), encoding="utf8")
c = s["counts"]
print(f"{slot}: {s['hours']}h done={c['done']} active={c['active']} "
f"todo={c['todo']} locked={c['locked']} ach={s['ach']}/66")
if __name__ == "__main__":
main()