feat: 沉淀 Workbench Kafka 隔离重放探针

This commit is contained in:
Codex
2026-07-10 13:51:05 +02:00
parent ea7bc0f444
commit 93abd9ba88
18 changed files with 490 additions and 10 deletions
@@ -68,3 +68,39 @@ test("observe status keeps exact command not-found structured", async () => {
valuesRedacted: true,
});
});
test("observe status preserves bounded Workbench Kafka debug replay evidence", async () => {
const stateDir = await mkdtemp(join(tmpdir(), "unidesk-web-observe-debug-replay-status-"));
const commandId = "cmd-debug-replay";
await mkdir(join(stateDir, "commands", "done"), { recursive: true });
await writeFile(join(stateDir, "commands", "done", `${commandId}.json`), JSON.stringify({
ok: true,
commandId,
type: "validateWorkbenchKafkaDebugReplay",
completedAt: "2026-07-10T12:00:00.000Z",
result: {
ok: true,
status: "passed",
sessionId: "ses_fixture",
traceId: "trc_fixture",
topic: "hwlab.event.debug.v1",
groupId: "hwlab-v03-workbench-isolated-debug-123-fixture",
groupPrefix: "hwlab-v03-workbench-isolated-debug",
receivedCount: 35,
appliedCount: 35,
terminalStatus: "completed",
reportPath: "/tmp/report.json",
reportSha256: "sha256:report",
screenshot: { path: "/tmp/replay.png", sha256: "sha256:image" },
},
}) + "\n");
const status = await runStatusScript(stateDir, commandId);
assert.equal(status.exactCommand.type, "validateWorkbenchKafkaDebugReplay");
assert.equal(status.exactCommand.result.traceId, "trc_fixture");
assert.equal(status.exactCommand.result.topic, "hwlab.event.debug.v1");
assert.equal(status.exactCommand.result.groupPrefix, "hwlab-v03-workbench-isolated-debug");
assert.equal(status.exactCommand.result.receivedCount, 35);
assert.equal(status.exactCommand.result.appliedCount, 35);
assert.equal(status.exactCommand.result.screenshot.sha256, "sha256:image");
});