Skip to content

World's first open-source enterprise world model.

The typed-graph bench runs twice more on deepseek-flash, and its judge retries a rate limit (#1029)

WaylandYang209bccec094a
diff --git a/docs/decisions/0044-the-ontology-is-a-view-over-what-documents-say.md b/docs/decisions/0044-the-ontology-is-a-view-over-what-documents-say.md
index a46377ff..c6f8a279 100644
--- a/docs/decisions/0044-the-ontology-is-a-view-over-what-documents-say.md
+++ b/docs/decisions/0044-the-ontology-is-a-view-over-what-documents-say.md
@@ -1,6 +1,6 @@
# 0044 · The ontology is a view over what documents say
-- **Status**: In progress · accepted 2026-09-17 · cut 1 built (#731), cut 2 mostly built (#751, #876, #878, #882), cut 5 is 0061, cut 6 built (#885) · open: the parity and errata bench runs, cut 4
+- **Status**: In progress · accepted 2026-09-17 · cut 1 built (#731), cut 2 mostly built (#751, #876, #878, #882), cut 5 is 0061, cut 6 built (#885) · cut 2 and cut 6 measured twice on 100 Re-DocRED documents, two groups each (bench README, the fourth run on gemini-3.5-flash 2026-09-25 and the ninth on deepseek-flash 2026-09-30): judged precision passes on both (80–89%), same-sentence recall passes on gemini (17.8% / 17.1%) and fails on deepseek-flash (12.3% / 13.2%, the extractor finds a third fewer entity pairs), tokens per document fail on both (31k–48k against the 6k threshold; alignment is charged per signature, and a fresh 100-document base is its dearest shape); the errata agent adds without retracting (0–2 retractions, none wrong) · open: the tokens-per-document threshold (restate it per signature, or accept the miss), cut 4
- **Written**: 2026-09-16 (conventions in the [README](README.md))
- **Related**: [0022](0022-an-unknown-date-is-not-an-open-one.md) put a document's date in `attested_at` beside the world and record axes; [0025](0025-governance-reads-the-ledger-before-it-decides.md) and [0027](0027-an-automatic-merge-is-gated-by-what-it-can-undo.md) put agent decisions through a gate that weighs what they can undo; [0041](0041-a-name-is-a-claim-about-an-entity.md) made names facts and identity a matter of evidence; [0043](0043-every-review-queue-is-governed.md) sent every review queue through the governor; #714 found upload time used as the document date in extraction.
diff --git a/scripts/bench/README.md b/scripts/bench/README.md
index 45d1afd3..093f1db9 100644
--- a/scripts/bench/README.md
+++ b/scripts/bench/README.md
@@ -965,3 +965,66 @@ bound / none / undecided。0044 的门槛:裁判精度不低于完整原型的
相同的 166 与 160 个,新旧之间 157 到 164 个,分不出来。
- 正确率差一个实体上下(错 4、5 对 6、6),在这个量上也分不出来;本体只有六个类,候选多、定义长的
本体省得更多,也更该在那样的库上再量一次。
+
+### 第九次真跑:#906 之后的 100 篇,两组,换一个模型(2026-09-30,dev @ 798fb24,deepseek-flash 经 DeepSeek 官方接口,bge-m3 经 OpenRouter,裁判 gemini-3.5-flash 经 OpenRouter)
+
+第四次真跑的重复:同一份语料、同一个裁判模型、两组各一个新库、`--judge 200 --errata`,抽取模型换成
+`deepseek-flash`。目的有两个:0044 cut 2 的三条门槛要"两轮各报一次",第四次之后 dev 又改了七刀
+(#906 之后到 #1013),在当前的 dev 上再量一次;另一个是看门槛过不过取决于模型还是管线。
+
+三处与第四次不同,读数时要记着:
+- **抽取的推理强度是 `none`,不是 `minimal`。** deepseek-flash 默认思考,`minimal` 关不掉(试探请求仍有
+ 思考 token),只有 `none` 能关;设置接口和库的 CHECK 只认 minimal / low / medium / high,这一轮在
+ 测量库上去掉了那条 CHECK 直接写 `none`。对齐与提规则在代码里固定用 `low`,deepseek 在 `low` 下每次
+ 调用输出七八千 token 的思考,gemini 只有几百——每篇 token 因此不能和第四次直接比,下面按调用拆开。
+- **嵌入走 OpenRouter 的 bge-m3**(SiliconFlow 的余额用完了)。同一个模型,向量与库里 SiliconFlow 算的
+ 余弦 0.9999,本体向量不用重建。
+- **裁判从台子直连,Node 自己的 `fetch` 不读代理变量**:直连出口被 OpenRouter 按地区拒掉 gemini(403),
+ 要 `NODE_USE_ENV_PROXY=1`。裁判四篇并行又撞上新账号的每分钟限速(429),两组各丢了一半样本;
+ `typed.mjs` 的裁判调用从这一轮起对 429 和 5xx 退避重试,两个库用它重新打分,200 条各判满。
+
+| | 组 1 | 组 2 |
+|---|---|---|
+| 开放陈述 / 实体 | 1495 / 2100 | 1519 / 2113 |
+| 签名 bound / none / undecided | 277 / 692 / 33 | 283 / 677 / 54 |
+| 类型化 勘误前 → 后 | 406 → 642 | 444 → 676 |
+| gold recall 勘误前(同句 / 跨句) | 5.1%(7.1% / 3.4%) | 6.4%(8.4% / 4.8%) |
+| 勘误:看 / 撤 / 改 / 加 / 留人 / 拒 | 100 篇 407 条:0 / 1 / 246 / 52 / 9 | 100 篇 445 条:0 / 0 / 260 / 50 / 6 |
+| gold recall 勘误后(同句 / 跨句) | 8.4%(12.3% / 5.1%) | 9.6%(13.2% / 6.6%) |
+| 裁判精度 勘误后(200 条判满,重新打分) | 86.5%(stated 173 / misworded 22 / not_stated 5) | 89.0%(178 / 18 / 4) |
+| entity-pair recall(开放层) | 10.7% | 10.8% |
+| 用时 | 105 分 | 114 分 |
+
+**token 按阶段拆**(服务端日志,按时间窗;裁判不在里面):
+
+| 阶段 | 组 1 调用 / token / 每篇 | 组 2 调用 / token / 每篇 |
+|---|---|---|
+| 抽取 | 220 / 67 万 / 0.7 万 | 229 / 69 万 / 0.7 万 |
+| 对齐 + 提规则 | 344 / 332 万 / 3.3 万 | 339 / 355 万 / 3.6 万 |
+| 勘误 | 129 / 34 万 / 0.3 万 | 141 / 43 万 / 0.4 万 |
+| 合计每篇 | 4.4 万 | 4.8 万 |
+
+按调用(两组相近,取组 2):短语对齐 142 次、每篇 1.7 万;类别词对齐 76 次、0.9 万;提规则 38 次、
+0.6 万;抽取 126 次、0.4 万;本体代理 26 次、0.4 万;实体裁决 102 次、0.3 万;勘误 110 次、0.2 万;
+时间解释 85 次、0.1 万。对齐三项合计 3.2 万,其中输出 token 占四分之三——那是 `low` 下的思考。
+
+按 0044 的门槛读,两轮各报一次:
+
+- **裁判精度 ≥ 75.3%**:过(86.5% / 89.0%)。与第四次的 83.0% / 80.5% 同一水平;misworded 占错的大半,
+ 与第四次一样。
+- **同句召回不低于完整原型(15.3%)**:**不过**,勘误后 12.3% / 13.2%。第四次 gemini 是 17.8% / 17.1%。
+ 差在抽取那一层:实体对召回 10.7% / 10.8% 对 17.4% / 16.7%,绑上的签名 277 / 283 对 426 / 442——
+ deepseek-flash 在开放抽取上比 gemini-3.5-flash 少抽三分之一的实体对,后面每一步按比例缩小。
+ 这条门槛过不过取决于抽取模型,不是管线:同一份代码在 gemini 上过、在 deepseek-flash 上不过。
+- **每篇 token 不到原型的五分之一(约 6 千)**:不过,4.4 万 / 4.8 万。第四次 3.1 万 / 3.4 万。两次真跑
+ 的管线相同,多出来的一万三是 deepseek 在对齐上的思考(对齐输出 243 万 / 268 万 token,第四次的
+ 对齐整个才 222 万 / 232 万)。四次 100 篇真跑没有一次接近这条门槛:gemini 五倍,deepseek 八倍。
+ 它按文档摊对齐的成本,而对齐按签名收费,一个新库 100 篇是最贵的形态(第四次已指出)。要么按
+ 签名重定,要么记下"不过"接受——这是 0044 的决定,台子只给数。
+
+两组之间很一致:同句召回差 0.9 个点,实体对差 0.1 个点,每篇 token 差 4 千。运行间的波动小于
+两个模型之间的差。勘误这一刀两组都只加不撤(撤 0 / 0,改 1 / 0),加的 246 / 260 条把同句召回
+抬了五个点,判满之后精度 86.5% / 89.0%。
+
+费用:deepseek-flash 两组加 20 篇试跑共 ¥28.7(输入 $0.15 / 百万、输出 $0.60 / 百万,思考 token 按输出计);
+裁判约 600 次调用、每次 $0.0045(gemini 没关思考,每次三四百个思考 token),合计 $3 上下。
diff --git a/scripts/bench/typed.mjs b/scripts/bench/typed.mjs
index 95c1bdc3..48db0781 100644
--- a/scripts/bench/typed.mjs
+++ b/scripts/bench/typed.mjs
@@ -410,14 +410,26 @@ function judgeEndpoint(KB) {
log("裁判与抽取是同一个模型,数字要打折看(judge_open.mjs 同一条提醒)");
return { base, key, model };
}
+// 限流(429)和端点出错(5xx)退避后重试:裁判四篇并行,网关按分钟限速时一轮里能丢掉一半样本
+//(2026-09-30 的一组 200 条只判了 58 条),而丢掉的样本不是随机的——判不了的那篇文档整篇没判
async function chat(ep, messages) {
- const r = await fetch(`${ep.base.replace(/\/$/, "")}/chat/completions`, {
- method: "POST", headers: { "content-type": "application/json", ...(ep.key ? { authorization: `Bearer ${ep.key}` } : {}) },
- body: JSON.stringify({ model: ep.model, temperature: 0, messages }),
- });
- if (!r.ok) throw new Error(`judge -> ${r.status} ${(await r.text()).slice(0, 200)}`);
- const j = await r.json();
- return j.choices?.[0]?.message?.content ?? "";
+ for (let attempt = 1; ; attempt++) {
+ const r = await fetch(`${ep.base.replace(/\/$/, "")}/chat/completions`, {
+ method: "POST", headers: { "content-type": "application/json", ...(ep.key ? { authorization: `Bearer ${ep.key}` } : {}) },
+ body: JSON.stringify({ model: ep.model, temperature: 0, messages }),
+ });
+ if (r.ok) {
+ const j = await r.json();
+ return j.choices?.[0]?.message?.content ?? "";
+ }
+ const body = (await r.text()).slice(0, 200);
+ if ((r.status === 429 || r.status >= 500) && attempt < 6) {
+ const wait = Number(r.headers.get("retry-after")) * 1000 || 15000 * attempt;
+ await sleep(wait);
+ continue;
+ }
+ throw new Error(`judge -> ${r.status} ${body}`);
+ }
}
const JUDGE = `You check facts extracted from a document. Each numbered fact says that a subject stands in a named relation to an object (a thing or a value). Judge only from the document text given.
- "stated": the document states this, or a careful reader takes it directly from the document, and the relation is the right one;