From 720e295cff18f2fa10659295c4cdc9fc9040a5c3 Mon Sep 17 00:00:00 2001 From: Vincent Koc Date: Tue, 23 Jun 2026 15:08:57 +0200 Subject: [PATCH] fix(qa): require Telegram proof report before publish --- scripts/e2e/telegram-user-crabbox-proof.ts | 5 +++++ test/scripts/telegram-user-crabbox-proof.test.ts | 15 +++++++++++++++ 2 files changed, 20 insertions(+) diff --git a/scripts/e2e/telegram-user-crabbox-proof.ts b/scripts/e2e/telegram-user-crabbox-proof.ts index 296226e5404e..d99acf9421fb 100644 --- a/scripts/e2e/telegram-user-crabbox-proof.ts +++ b/scripts/e2e/telegram-user-crabbox-proof.ts @@ -1997,6 +1997,7 @@ const FULL_ARTIFACT_JSON_NAMES = new Set([ "telegram-user-crabbox-session-summary.json", ]); const FULL_ARTIFACT_FILE_EXTENSIONS = new Set([".gif", ".log", ".md", ".mp4", ".png"]); +const FULL_ARTIFACT_PROOF_REPORT = "telegram-user-crabbox-proof.md"; const TIMESTAMPED_PROBE_ARTIFACT_JSON = /^probe-\d{4}-\d{2}-\d{2}T\d{2}-\d{2}-\d{2}-\d{3}Z\.json$/u; function isFullArtifactJsonName(name: string) { @@ -2004,6 +2005,10 @@ function isFullArtifactJsonName(name: string) { } export function stageFullSessionArtifacts(outputDir: string) { + if (!fs.existsSync(path.join(outputDir, FULL_ARTIFACT_PROOF_REPORT))) { + throw new Error(`Missing proof report. Run finish first: ${FULL_ARTIFACT_PROOF_REPORT}`); + } + const publishDir = path.join(outputDir, "publish-full-artifacts"); fs.rmSync(publishDir, { force: true, recursive: true }); fs.mkdirSync(publishDir, { recursive: true }); diff --git a/test/scripts/telegram-user-crabbox-proof.test.ts b/test/scripts/telegram-user-crabbox-proof.test.ts index d337469bd501..add26736f9e3 100644 --- a/test/scripts/telegram-user-crabbox-proof.test.ts +++ b/test/scripts/telegram-user-crabbox-proof.test.ts @@ -291,6 +291,21 @@ describe("telegram user Crabbox proof log polling", () => { expect(fs.existsSync(path.join(stagedDir, "stale.txt"))).toBe(false); }); + it("requires finish to write the proof report before full artifact publishing", () => { + const outputDir = makeTempDir(); + fs.writeFileSync( + path.join(outputDir, "session.json"), + '{"sshKey":"/private/tmp/openclaw/key"}', + ); + fs.writeFileSync(path.join(outputDir, "status.json"), '{"ok":true}'); + fs.writeFileSync(path.join(outputDir, "telegram-desktop.log"), "log"); + + expect(() => stageFullSessionArtifacts(outputDir)).toThrow( + "Missing proof report. Run finish first: telegram-user-crabbox-proof.md", + ); + expect(fs.existsSync(path.join(outputDir, "publish-full-artifacts"))).toBe(false); + }); + posixIt("does not expand generated remote probe arguments in the shell", () => { const root = makeTempDir(); const fakePython = path.join(root, "python3");