build / build-and-scan (push) Waiting to run
文档库:目录改为编号制(01-规范/02-架构设计/03-数据库/04-调整方案/
05-交接单/06-ops/07-scripts/08-skills/09-archive),顶层散文件归入 01-规范/;
INDEX.md 与 docs-manifest.json 重刷(档案 146 篇);旧目录名引用全量对齐。
IM 线:src/im/**(SDK / hub / store / presence / ws / gateway-token)、
src/web/routes/im.ts、src/db/plugin-data/**、src/supervisor/plugin-assembly.ts
及对应 test/**。
插件线:poc/{im-agent-bridge,im-connection-gateway,im-conversation-tabs,
business-plugins-im,carbon-mcp-probe}、src/web/routes/{sessions,overlay-device}.ts、
src/net/relay/{device-grant,instance-credential}.ts。
仓库卫生:清出 40 个历史误入库 / 已改名文件(34 个交接单归档 + 6 个旧结构,
本地均有副本);dsh-server-docs/.gitignore 补 tmp/;交接单不入库(政策)。
69 lines
2.9 KiB
Python
69 lines
2.9 KiB
Python
#!/usr/bin/env python3
|
||
# -*- coding: utf-8 -*-
|
||
"""handoff-status.py — 一条命令看清 05-交接单 里哪些单子【待执行】/【已完成】/【无状态】。
|
||
|
||
为什么需要它:`05-交接单/交接单-已完成/` 那层目录摊平后,**"目录位置"不再表达状态**。
|
||
状态改由**机读字段**承载(与布局解耦,摊平/搬家都不失效):
|
||
① 单子头部 `- 状态:…` 行(模板已有)→ ② 回退取 `05-交接单/README.md` 台账表的「状态」列
|
||
|
||
用法:python 07-scripts/handoff-status.py
|
||
"""
|
||
import os
|
||
import re
|
||
|
||
ROOT = os.path.dirname(os.path.dirname(os.path.abspath(__file__)))
|
||
D = os.path.join(ROOT, "05-交接单")
|
||
README = os.path.join(D, "README.md")
|
||
|
||
HEAD_STATUS = re.compile(r"^[\s>*\-|#]*\*{0,2}状态\*{0,2}\s*[::]\s*(.+?)\s*$", re.M)
|
||
DONE_KW = ("已完成", "已落地", "已归档", "已收口", "已闭合", "已实施", "已上线",
|
||
"已修复", "已释放", "已结束", "已通过", "全部完成", "全绿", "✅")
|
||
WAIT_KW = ("待执行", "待开工", "进行中", "在途", "待验证", "待跑", "规划中", "未开工",
|
||
"部分执行", "受阻", "未做", "设计定稿", "🔄", "⏳", "⏸", "🟡")
|
||
|
||
table = {}
|
||
if os.path.exists(README):
|
||
with open(README, encoding="utf-8") as fh:
|
||
for line in fh:
|
||
if not line.startswith("|"):
|
||
continue
|
||
cells = [c.strip() for c in line.strip().strip("|").split("|")]
|
||
if len(cells) < 2 or ".md" not in cells[0]:
|
||
continue
|
||
table[cells[0].strip("`").split("/")[-1].strip()] = cells[1]
|
||
|
||
groups = {"待执行": [], "已完成": [], "无状态": []}
|
||
targets = []
|
||
for root2, dirs2, _f in os.walk(D):
|
||
dirs2[:] = [x for x in dirs2 if not x.startswith(".")]
|
||
for f2 in _f:
|
||
if f2.endswith(".md") and f2 != "README.md" and not f2.startswith("."):
|
||
rel = os.path.relpath(os.path.join(root2, f2), D).replace("\\", "/")
|
||
targets.append((rel, os.path.join(root2, f2)))
|
||
for n, path in sorted(targets):
|
||
base = n.split("/")[-1]
|
||
with open(path, encoding="utf-8", errors="ignore") as fh:
|
||
head = "".join(fh.readlines()[:30])
|
||
m = HEAD_STATUS.search(head)
|
||
if m:
|
||
s, src = m.group(1)[:44], "头部"
|
||
elif base in table:
|
||
s, src = table[base][:44], "台账表"
|
||
else:
|
||
s, src = "", ""
|
||
if not s:
|
||
groups["无状态"].append((n, "—"))
|
||
elif any(k in s for k in DONE_KW):
|
||
groups["已完成"].append((n, "%s ·%s" % (s, src)))
|
||
elif any(k in s for k in WAIT_KW):
|
||
groups["待执行"].append((n, "%s ·%s" % (s, src)))
|
||
else:
|
||
groups["无状态"].append((n, "%s ·%s未识别" % (s, src)))
|
||
|
||
for g in ("待执行", "已完成", "无状态"):
|
||
print("【%s】%d 个" % (g, len(groups[g])))
|
||
for n, s in groups[g]:
|
||
print(" %-44s %s" % (n[:44], s))
|
||
print()
|
||
print("合计 %d 个单子(不含 README.md)" % sum(len(v) for v in groups.values()))
|