fix: 用容器生命周期核实恢复并单列三份总体验收

审阅发现spawn后快照早于恢复实际执行,不能证明没有重启;改用杀前至目标结果落账的Docker历史事件,保留缓存完整性限制。逐份stats不再冒称任务书总体通过;独立验收要求三份不同研究、成功杀进程及不重叠区间。两项缺陷附回归,7项定向测试与check通过,独立复审无新问题;真实B尚待启动。
This commit is contained in:
2026-10-04 04:52:13 -04:00
parent b7be524cdc
commit de8e13b031
5 changed files with 473 additions and 25 deletions
+37 -13
View File
@@ -12,6 +12,12 @@ import {
jsonFile,
scoreBand,
} from "../lib/forward.ts";
import {
sameContainerThroughResult,
type ContainerEvent,
type ContainerSnapshot,
type LifecycleWindow,
} from "../lib/forward-evidence.ts";
import { finalSubmissions, ofKind, readLedger } from "../lib/ledger.ts";
import { lightCheckUsage } from "../lib/light-checks.ts";
import { referenceScores } from "../lib/reference-scores.ts";
@@ -117,16 +123,32 @@ const summaries = dirs.map((dir) => {
if (existsSync(join(dir, "kill.json"))) {
const evidence = JSON.parse(
readFileSync(join(dir, "kill.json"), "utf8"),
) as { run: string; candidate: string; beforeKillSeq: number };
type Container = {
Id: string;
State: { StartedAt: string; Running: boolean };
) as {
run: string;
candidate: string;
beforeKillSeq: number;
container: string;
};
const snapshots = ["before", "after-kill", "after-resume"].map(
const snapshots = ["before", "after-kill", "before-resume"].map(
(part) =>
JSON.parse(
readFileSync(join(dir, `container-${part}.json`), "utf8"),
) as Container,
) as ContainerSnapshot,
);
const lifecycleWindow = JSON.parse(
readFileSync(join(dir, "container-events-window.json"), "utf8"),
) as LifecycleWindow;
const lifecycleEvents = readFileSync(
join(dir, "container-events.jsonl"),
"utf8",
)
.split("\n")
.filter(Boolean)
.map((line) => JSON.parse(line) as ContainerEvent);
const lifecycleChecks = sameContainerThroughResult(
snapshots,
lifecycleEvents,
evidence.container,
);
const target = accounts.runs.find(
(r) => r.plan.content.run === evidence.run,
@@ -144,16 +166,18 @@ const summaries = dirs.map((dir) => {
evidence,
killSeq,
snapshots,
snapshotMeaning: "杀前、杀后、恢复启动前;没有把快照当成恢复完成的证据",
lifecycleWindow,
lifecycleChecks,
lifecycleEvents,
charged: target.starts.length,
resultSeq: target.results[0]?.seq ?? null,
checks: {
sameContainer:
snapshots[0]!.State.Running &&
snapshots.every(
(c) =>
c.Id === snapshots[0]!.Id &&
c.State.StartedAt === snapshots[0]!.State.StartedAt,
),
Object.values(lifecycleChecks).every(Boolean) &&
lifecycleWindow.run === evidence.run &&
lifecycleWindow.resultSeq === target.results[0]?.seq &&
Date.parse(lifecycleWindow.since) < Date.parse(lifecycleWindow.until),
chargedOnceNoRerun:
target.starts.length === 1 && candidatePlans.length === 1,
resultAndContinued:
@@ -211,6 +235,6 @@ jsonFile(join(output, "manual-review.json"), {
"核对各目录launches.jsonl、machine.jsonl和父会话观察;上一份全部结束后才起下一份;不宣称快照排除任意外部进程",
});
console.log(
`统计:${output};程序检查${summaries.every((s) => s.pass) ? "通过" : "未通过"};质量判断仍待独立阅读。`,
`统计:${output};所给 ${summaries.length} 份研究的逐研究检查${summaries.every((s) => s.pass) ? "通过" : "未通过"},不是任务书16总体验收;总体程序验收另运行 node eval/forward/acceptance.ts ${output};质量判断仍待独立阅读。`,
);
if (!summaries.every((s) => s.pass)) process.exitCode = 1;