chore(工作区): 纳入版本控制基线(回收 411 MB 过程产物)

回收 411 MB(470 M → 58.8 M),全部经回收站,可恢复:
- 待清理/(146.2 M,含 relay 分片 128 M 与 42 项过程目录)
- tmp/(32.4 M,按接续棒命名的过程临时区)
- .workbuddy/tmp/(39.5 M)
- 4 份 workbuddy.db 冗余副本(101 M,09-23 事故的坏副本 / 抢救产物)
- tmp/im16/gw/centrifugo 二进制(63.9 M,可重下)+ 缓存残留

入库范围:常驻规则(CODEBUDDY.md / README.md / state.py)、在途接续入口与
接续包、docs/、交付物/、交接单/、归档/、scripts/、.codebuddy/、
.workbuddy/memory/;共 398 件,其中 >60 KB 的 26 件全为文档。

排除(.gitignore):tmp/、待清理/、运行态日志与缓存、*.db 与 DB 备份整目录、
打包二进制(*.tar.gz / *.tgz)、记忆修复前备份。
This commit is contained in:
admin committed 2026-09-24 07:51:03 +08:00
commit ce8e6ceed9
396 files changed
+66045

No files matched your search

+47
View File
@@ -0,0 +1,47 @@
# -*- coding: utf-8 -*-
"""逐会话从转录 rawUsage 汇总真实积分(递归找 rawUsage.credit)。"""
import io, json, glob
HOME = "E:/ProgramData/.workbuddy"
SIDS = {
"3814f5fb": "覆盖网络线·归档接续(自动 @10:20)",
"e265f0cd": "覆盖网络线·接续优化版(自动 @10:45)",
"478eef8c": "决策方法-2(自动 @11:10)",
"d48a9be8": "覆盖网络线·S1 落地(自动 @14:32)",
"b08b1c35": "确认覆盖网络任务待办事项(手动新会话,基线)",
}
def walk(o, hits, path=""):
if isinstance(o, dict):
for k, v in o.items():
if k == "rawUsage" and isinstance(v, dict):
hits.append(v)
else:
walk(v, hits, path + "/" + str(k))
elif isinstance(o, list):
for x in o:
walk(x, hits, path)
print("%-38s %6s %8s %8s" % ("会话", "计费次", "积分合计", "均值"))
for short, label in SIDS.items():
hits = glob.glob(HOME + "/projects/*/" + short + "*.jsonl")
if not hits:
print(short, "无转录")
continue
ru = []
with io.open(hits[0], "r", encoding="utf-8", errors="replace", newline="") as f:
for line in f:
line = line.strip()
if not line:
continue
try:
d = json.loads(line)
except Exception:
continue
walk(d, ru)
cr = [r.get("credit") for r in ru if isinstance(r.get("credit"), (int, float))]
tot = sum(cr)
print("%-38s %6d %8.2f %8s" % (label[:36], len(cr), tot, ("%.3f" % (tot / len(cr))) if cr else "-"))
if cr:
s = sorted(cr)
print(" min=%.2f 中位=%.2f max=%.2f | 首=%.2f 末=%.2f" % (s[0], s[len(s)//2], s[-1], cr[0], cr[-1]))