feat: 接通实现核验修复到正向运行采纳

任务书16第二块:角色分派与每调用轻量检查,提交及代码原子记账,按次数核验修复且耗尽不跑,串行正式运行及恢复引用指标,采纳含null统一公开。451项免费测试通过,全新上下文独立审阅未发现问题;真实研究验收仍待进行。
This commit is contained in:
2026-10-04 04:25:00 -04:00
parent 039b7bb3bc
commit bf5b3f2358
13 changed files with 659 additions and 77 deletions
+11 -2
View File
@@ -1,6 +1,7 @@
import { mkdirSync } from "node:fs";
import { resolve } from "node:path";
import type { ResearchConfig } from "../config/index.ts";
import { forwardNotRunEvent } from "../materials/index.ts";
import { Ledger } from "../ledger/index.ts";
import { Runner } from "../runner/index.ts";
import { fullConfig, readFrozen } from "./frozen.ts";
@@ -8,6 +9,7 @@ import { EVENTS, nextStep, type Next } from "./next-step.ts";
import { ledgerFile } from "./paths.ts";
import { recover } from "./recover.ts";
import { baselineRun, saveBaseline } from "./steps/baseline.ts";
import { forwardRun, adoptBatch } from "./steps/forward.ts";
import { dispatchStage } from "./steps/dispatch.ts";
import { dedupe, freezeProtocols, selectBatch } from "./steps/round.ts";
import { assignEntries } from "./steps/round-zero.ts";
@@ -75,8 +77,9 @@ async function doStep(s: Study, next: Exclude<Next, { do: "freezeConfig" }>): Pr
case "saveBaseline":
saveBaseline(s);
return null;
case "baselineRun": {
const ran = await baselineRun(s, next.run);
case "baselineRun":
case "forwardRun": {
const ran = next.do === "baselineRun" ? await baselineRun(s, next.run) : await forwardRun(s, next.round, next.candidate, next.run);
if (ran === "stopped") return USER_STOPPED;
if (ran === "done") return null;
return halt(s.ledger, `运行 ${next.run} 没有启动,名额已退还;本进程不重跑,下次启动时起新编号重跑。Docker 的报错:${ran.notStarted}`, [next.run]);
@@ -104,6 +107,12 @@ async function doStep(s: Study, next: Exclude<Next, { do: "freezeConfig" }>): Pr
case "selectBatch":
selectBatch(s, next.round);
return null;
case "forwardNotRun":
s.ledger.append("event", forwardNotRunEvent(next.candidate, next.reason));
return null;
case "adopt":
adoptBatch(s, next.round);
return null;
case "halt":
return halt(s.ledger, next.reason, next.objects);
}