From d4b49af0d49574631a5e309cb53ff7780937e637 Mon Sep 17 00:00:00 2001 From: iomgaa Date: Mon, 5 Oct 2026 22:24:21 -0400 Subject: [PATCH] =?UTF-8?q?fix:=20=E8=AF=8A=E6=96=AD=E8=BF=90=E8=A1=8C?= =?UTF-8?q?=E8=84=9A=E6=9C=AC=E6=9D=80=E8=BF=87=E4=B8=80=E6=AC=A1=E5=90=8E?= =?UTF-8?q?=E7=BB=AD=E8=B7=91=E4=B8=8D=E5=86=8D=E9=87=8D=E6=9D=80=EF=BC=8C?= =?UTF-8?q?=E4=B8=89=E6=9D=A1=E6=A3=80=E6=9F=A5=E6=8C=89=20kill.json=20?= =?UTF-8?q?=E5=92=8C=E6=9D=80=E6=97=B6=E8=B4=A6=E6=9C=AC=E5=81=9A=EF=BC=88?= =?UTF-8?q?=E4=BB=BB=E5=8A=A1=E4=B9=A6=2018=20=E7=AC=AC=E4=B8=89=E5=9D=97?= =?UTF-8?q?=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Sonnet 5.5 --- eval/diagnosis/run.ts | 27 +++++++++++---------------- 1 file changed, 11 insertions(+), 16 deletions(-) diff --git a/eval/diagnosis/run.ts b/eval/diagnosis/run.ts index 0a98a37..80fc3d4 100644 --- a/eval/diagnosis/run.ts +++ b/eval/diagnosis/run.ts @@ -122,12 +122,8 @@ function start(path: string | null) { const sampler = setInterval(sample, 5000); sampler.unref(); let active = start(config); -let killEvidence: { - run: string; - cell: string; - round: number; - killSeq: number; -} | null = null; +// 杀过一次以后(kill.json 已写),模型服务出错等停下再续跑时不再杀;最后的三条检查照 kill.json 和杀时账本做。 +const killPending = kill && !existsSync(join(out, "kill.json")); try { await waitForLedger(studyDir, active.child); let watching = watchTimeline( @@ -135,7 +131,7 @@ try { active.child, join(out, "timeline.jsonl"), ); - if (kill) { + if (killPending) { // 盯住账本:第一个用途为 diagnosis 的运行确认启动之后、结果落账之前杀控制进程(照 eval/forward/run.ts 的 kill 做法)。 let hit = false; while (active.child.exitCode === null && active.child.signalCode === null) { @@ -189,12 +185,6 @@ try { join(out, "container-before-resume.json"), inspect(container), ); - killEvidence = { - run, - cell: plan.content.object!, - round: plan.content.round, - killSeq: atKill.at(-1)!.seq, - }; active = start(null); watching = watchTimeline( studyDir, @@ -262,7 +252,12 @@ try { jsonFile(join(out, "accounts.json"), accounts); // 杀进程的三条检查(任务书 17 第 3.1 节):①恢复按容器名接着等同一个容器、没有重跑;②只扣一次;③结果照常写入、结算和后续步骤走完。 - if (killEvidence !== null) { + if (existsSync(join(out, "kill.json"))) { + const killSeq = ( + JSON.parse( + readFileSync(join(out, "ledger-at-kill.json"), "utf8"), + ) as Array<{ seq: number }> + ).at(-1)!.seq; const evidence = JSON.parse( readFileSync(join(out, "kill.json"), "utf8"), ) as { run: string; cell: string; round: number; container: string }; @@ -305,7 +300,7 @@ try { ); const report = { evidence, - killSeq: killEvidence.killSeq, + killSeq, snapshotMeaning: "杀前、杀后、恢复启动前;没有把快照当成恢复完成的证据", lifecycleChecks, checks: { @@ -316,7 +311,7 @@ try { chargedOnce: target.starts.length === 1, resultSettledAndFinished: target.results.length === 1 && - target.results[0]!.seq > killEvidence.killSeq && + target.results[0]!.seq > killSeq && settlement !== undefined && settlement.run === evidence.run && perExperimentRecorded &&