track: 新增 OpenWork / Orca / Maka 三项目,样本达到 4 个
样本 - openwork (different-ai/openwork) 23.2k★ 能力分发层,DCO + evals + worlds - orca (stablyai/orca) 58.8k★ 并行编排外壳,5000 issue 实为团队自开任务板 - maka (apache/maka) 4.4k★ 执行记录层,Apache 孵化但无正式 release 档案 - 三份五维档案填完,risk.claim_vs_reality 均已核实到证据 - ipollowork 象限坐标从占位 9/9/9/9 校准为 8/7/7/7(与新样本同一标尺) 文章 - 新增横评文《四个 Agent 工作台的路线分野:把「多引擎中立」拆开看》(emlog id=99) - 总纲文回填四项目矩阵 + 双视图象限图 (emlog id=98) 镜像 - gitinbox/maka 已推送(public,source-only 快照 12 MB) - openwork(291MB) / orca(671MB) 受 50KB/s 带宽约束,档案标 mode: pending 规则 - license-tiers.yaml 新增「目录切分许可」降级流程(OpenWork 判例: 排除 ee/ 后为纯 MIT → public,完整镜像 → private) - registry.yaml openwork 可见性改 public + mirror_excludes: ["ee/"] 脚本修复 - _common.py 新增 upsert_block:手工整块覆盖 ecosystem 删掉 metrics 时能自愈 - mirror_sync.sh:SOURCE_ONLY 未初始化(set -u 下偶发炸); 浅仓推送被服务端拒绝 → 自动 --unshallow,失败降级快照; 量体积前先 repack(此前新 commit 全是 loose object,恒打印 0 MB) - build_matrix.py:成熟度长文本移出表格(新增 maturity_level 短标签); 象限图标签靠右时翻转到左侧防溢出;SVG 加 max-width 防窄屏溢出; 文章索引改为自动生成(原先手抄,横评文发了索引里却没有) - publish_emlog.py:ID 回写按「有无同名档案」分流, 00-* 跨项目文章落到 articles/<id>.meta.yaml(此前 ID 无处可写)
This commit is contained in:
+33
-24
@@ -9,13 +9,20 @@
|
||||
|
||||
两个关键设计
|
||||
------------
|
||||
1. **update 前必须先 detail 取回全文**。
|
||||
emlog 的 article_update 接口在 content 为空时会把正文清空 —— 这是接口行为,
|
||||
不是 bug。总纲文每次回填都要更新,所以这条保护是刚需。
|
||||
1. **防空保护点放在"本地正文非空",不是"先 detail 取回线上全文"**。
|
||||
emlog 的 article_update 在 content 为空时会把正文清空,所以必须有保护。
|
||||
但保护不能建立在 detail 上,原因有二:
|
||||
a) 本脚本的 content 永远来自本地 Markdown 源文,不存在"忘了传"的情况;
|
||||
b) detail 接口**查不到草稿**(实测:草稿 id 返回 400 Article not found,
|
||||
已发布文章正常)。若以 detail 为门槛,草稿将永远无法转正。
|
||||
因此 detail 降级为可选的健全性检查:取得到就对比长度,取不到不阻断。
|
||||
2. **文章 ID 回写**。
|
||||
项目文回写到 data/projects/<id>.yaml 的 article 块;
|
||||
总纲文回写到 articles/00-overview.meta.yaml。
|
||||
有同名项目档案(data/projects/<id>.yaml)→ 回写到档案的 article 块;
|
||||
没有(总纲文 00-overview、横评文 00-comparison 这类跨项目文章)
|
||||
→ 回写到 articles/<id>.meta.yaml。
|
||||
有了 ID 才能做"更新"而不是每次都发一篇新的。
|
||||
判断顺序不能反:先按"是不是项目文"分流,再决定落哪里,
|
||||
否则新增一篇横评类文章时 ID 会无处可写,下次发布就变成重复发一篇。
|
||||
"""
|
||||
|
||||
from __future__ import annotations
|
||||
@@ -33,8 +40,6 @@ from _common import ARTICLES, PROJECTS, today, update_block # noqa: E402
|
||||
import publish_article as emlog # noqa: E402
|
||||
|
||||
DEFAULT_SORT_ID = 17 # 可巴蒂
|
||||
OVERVIEW_ID = "00-overview"
|
||||
META_PATH = ARTICLES / f"{OVERVIEW_ID}.meta.yaml"
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- 转换
|
||||
@@ -69,34 +74,38 @@ def to_excerpt(md: str, limit: int = 110) -> str:
|
||||
|
||||
|
||||
# ---------------------------------------------------------------- ID 读写
|
||||
def meta_path(aid: str) -> Path:
|
||||
return ARTICLES / f"{aid}.meta.yaml"
|
||||
|
||||
|
||||
def read_emlog_id(aid: str) -> int | None:
|
||||
if aid == OVERVIEW_ID:
|
||||
if not META_PATH.exists():
|
||||
return None
|
||||
return (yaml.safe_load(META_PATH.read_text(encoding="utf-8")) or {}).get("emlog_id")
|
||||
p = PROJECTS / f"{aid}.yaml"
|
||||
if not p.exists():
|
||||
return None
|
||||
d = yaml.safe_load(p.read_text(encoding="utf-8")) or {}
|
||||
v = (d.get("article") or {}).get("emlog_id")
|
||||
return int(v) if v else None
|
||||
if p.exists():
|
||||
d = yaml.safe_load(p.read_text(encoding="utf-8")) or {}
|
||||
v = (d.get("article") or {}).get("emlog_id")
|
||||
return int(v) if v else None
|
||||
mp = meta_path(aid)
|
||||
if mp.exists():
|
||||
return (yaml.safe_load(mp.read_text(encoding="utf-8")) or {}).get("emlog_id")
|
||||
return None
|
||||
|
||||
|
||||
def write_emlog_id(aid: str, emlog_id: int) -> None:
|
||||
url = f"{emlog.BLOG_URL}/?post={emlog_id}"
|
||||
if aid == OVERVIEW_ID:
|
||||
META_PATH.write_text(
|
||||
f"# 总纲文发布元数据(由 scripts/publish_emlog.py 维护)\n"
|
||||
p = PROJECTS / f"{aid}.yaml"
|
||||
|
||||
if not p.exists():
|
||||
# 跨项目文章(总纲 / 横评 / 专题):没有档案可挂,单独存 meta。
|
||||
mp = meta_path(aid)
|
||||
mp.write_text(
|
||||
f"# 发布元数据(由 scripts/publish_emlog.py 维护)\n"
|
||||
f"# 本文不属于单个项目,ID 不落在 data/projects/ 下\n"
|
||||
f"emlog_id: {emlog_id}\nurl: \"{url}\"\nlast_published: \"{today()}\"\n",
|
||||
encoding="utf-8",
|
||||
)
|
||||
print(f" 已写入 {META_PATH.name}")
|
||||
print(f" 已写入 {mp.name}")
|
||||
return
|
||||
|
||||
p = PROJECTS / f"{aid}.yaml"
|
||||
if not p.exists():
|
||||
print(f" [warn] 档案不存在,未回写 ID: {p}")
|
||||
return
|
||||
text = p.read_text(encoding="utf-8")
|
||||
try:
|
||||
text = update_block(text, "article", {
|
||||
|
||||
Reference in New Issue
Block a user