Vendor OpenClaw source as Adolf fork baseline
Some checks failed
ClawSweeper Dispatch / dispatch (push) Has been cancelled
CodeQL / Security High (actions) (push) Has been cancelled
CodeQL / Security High (channel-runtime-boundary) (push) Has been cancelled
CodeQL / Security High (core-auth-secrets) (push) Has been cancelled
CodeQL / Security High (mcp-process-tool-boundary) (push) Has been cancelled
CodeQL / Security High (network-ssrf-boundary) (push) Has been cancelled
CodeQL / Security High (plugin-trust-boundary) (push) Has been cancelled
CodeQL / Security High (process-exec-boundary) (push) Has been cancelled
Docs Sync Publish Repo / sync-publish-repo (push) Has been cancelled
Docs / docs (push) Has been cancelled
OpenClaw Stable Main Closeout / Resolve stable release closeout inputs (push) Has been cancelled
OpenClaw Stable Main Closeout / Verify stable main closeout (push) Has been cancelled
Workflow Sanity / no-tabs (push) Has been cancelled
Workflow Sanity / actionlint (push) Has been cancelled
Workflow Sanity / generated-doc-baselines (push) Has been cancelled
CI / runner-admission (push) Has been cancelled
CI / preflight (push) Has been cancelled
CI / security-fast (push) Has been cancelled
CI / pnpm-store-warmup (push) Has been cancelled
CI / build-artifacts (push) Has been cancelled
CI / native-i18n (push) Has been cancelled
CI / ${{ matrix.check_name }} (push) Has been cancelled
CI / ${{ matrix.checkName }} (push) Has been cancelled
CI / checks-node-compat-node22 (push) Has been cancelled
CI / check-bundled-channel-config-metadata (push) Has been cancelled
CI / check-dependencies (push) Has been cancelled
CI / check-guards (push) Has been cancelled
CI / check-lint (push) Has been cancelled
CI / check-prod-types (push) Has been cancelled
CI / check-shrinkwrap (push) Has been cancelled
CI / check-test-types (push) Has been cancelled
CI / check-additional-boundaries-a (push) Has been cancelled
CI / check-additional-boundaries-bcd (push) Has been cancelled
CI / check-additional-extension-bundled (push) Has been cancelled
CI / check-additional-extension-channels (push) Has been cancelled
CI / check-additional-extension-package-boundary (push) Has been cancelled
CI / check-additional-runtime-topology-architecture (push) Has been cancelled
CI / check-session-accessor-boundary (push) Has been cancelled
CI / check-session-transcript-reader-boundary (push) Has been cancelled
CI / check-docs (push) Has been cancelled
CI / skills-python (push) Has been cancelled
CI / macos-swift (push) Has been cancelled
CI / ios-build (push) Has been cancelled
CI / ci-timings-summary (push) Has been cancelled
Native App Locale Refresh / Refresh native fa (push) Has been cancelled
Native App Locale Refresh / Refresh native fr (push) Has been cancelled
Native App Locale Refresh / Refresh native hi (push) Has been cancelled
Native App Locale Refresh / Refresh native id (push) Has been cancelled
Native App Locale Refresh / Refresh native it (push) Has been cancelled
Native App Locale Refresh / Refresh native ja-JP (push) Has been cancelled
Control UI Locale Refresh / plan (push) Has been cancelled
Control UI Locale Refresh / Refresh ${{ matrix.locale }} (push) Has been cancelled
Control UI Locale Refresh / Commit control UI locale refresh (push) Has been cancelled
Live Media Runner Image / Build live media runner image (push) Has been cancelled
Native App Locale Refresh / Refresh native ar (push) Has been cancelled
Native App Locale Refresh / Refresh native de (push) Has been cancelled
Native App Locale Refresh / Refresh native es (push) Has been cancelled
Native App Locale Refresh / Refresh native ko (push) Has been cancelled
Native App Locale Refresh / Refresh native nl (push) Has been cancelled
Native App Locale Refresh / Refresh native pl (push) Has been cancelled
Native App Locale Refresh / Refresh native pt-BR (push) Has been cancelled
Native App Locale Refresh / Refresh native ru (push) Has been cancelled
Native App Locale Refresh / Refresh native sv (push) Has been cancelled
Native App Locale Refresh / Refresh native th (push) Has been cancelled
Native App Locale Refresh / Refresh native tr (push) Has been cancelled
Native App Locale Refresh / Refresh native uk (push) Has been cancelled
Native App Locale Refresh / Refresh native vi (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-CN (push) Has been cancelled
Native App Locale Refresh / Refresh native zh-TW (push) Has been cancelled
Native App Locale Refresh / Commit native locale refresh (push) Has been cancelled
Plugin Init Scaffold Validation / Validate provider scaffold (push) Has been cancelled
Plugin NPM Release / preview_plugins_npm (push) Has been cancelled
Plugin NPM Release / Validate release publish approval (push) Has been cancelled
Plugin NPM Release / preview_plugin_pack (push) Has been cancelled
Plugin NPM Release / publish_plugins_npm (push) Has been cancelled
Sandbox Common Smoke / sandbox-common-smoke (push) Has been cancelled
Website Installer Sync / static (push) Has been cancelled
Website Installer Sync / linux-docker (push) Has been cancelled
Website Installer Sync / macos-installer (push) Has been cancelled
Website Installer Sync / windows-installer (push) Has been cancelled
Website Installer Sync / sync-website (push) Has been cancelled

Adolf is a fork/vendored clone of github.com/openclaw/openclaw (v2026.6.11),
free to diverge. Tree copied sans upstream .git; upstream remote added for
future syncs. Node pinned to 24 (.nvmrc); engines already require >=22.19.
Preserves docs/ARCHITECTURE.md.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01LeqyaxJF2nbRXJtae2kNB2
This commit is contained in:
2026-07-05 09:36:54 +00:00
parent 3216769225
commit bedb527145
21108 changed files with 6010766 additions and 0 deletions

View File

@@ -0,0 +1,358 @@
// Mantis Publish Pr Evidence tests cover mantis publish pr evidence script behavior.
import { mkdirSync, mkdtempSync, rmSync, writeFileSync } from "node:fs";
import { tmpdir } from "node:os";
import path from "node:path";
import { afterEach, describe, expect, it } from "vitest";
import {
loadEvidenceManifest,
publishArtifactFiles,
renderEvidenceComment,
shouldPublishPrComment,
} from "../../scripts/mantis/publish-pr-evidence.mjs";
const tempDirs: string[] = [];
afterEach(() => {
for (const dir of tempDirs.splice(0)) {
rmSync(dir, { recursive: true, force: true });
}
});
function writeFixtureManifest() {
const dir = mkdtempSync(path.join(tmpdir(), "mantis-evidence-test-"));
tempDirs.push(dir);
mkdirSync(path.join(dir, "baseline"), { recursive: true });
mkdirSync(path.join(dir, "candidate"), { recursive: true });
writeFileSync(path.join(dir, "baseline", "timeline.png"), "baseline timeline");
writeFileSync(path.join(dir, "candidate", "timeline.png"), "candidate timeline");
writeFileSync(path.join(dir, "baseline", "change.mp4"), "baseline clip");
const manifestPath = path.join(dir, "mantis-evidence.json");
writeFileSync(
manifestPath,
JSON.stringify({
schemaVersion: 1,
id: "discord-status-reactions",
title: "Mantis Discord Status Reactions QA",
summary: "Mantis reran the scenario.",
scenario: "discord-status-reactions-tool-only",
comparison: {
baseline: {
expected: "queued-only",
sha: "aaa",
status: "fail",
},
candidate: {
expected: "queued -> thinking -> done",
sha: "bbb",
status: "pass",
},
pass: true,
},
artifacts: [
{
alt: "Baseline timeline",
kind: "timeline",
label: "Baseline queued-only",
lane: "baseline",
path: "baseline/timeline.png",
targetPath: "baseline.png",
},
{
alt: "Candidate timeline",
kind: "timeline",
label: "Candidate queued -> thinking -> done",
lane: "candidate",
path: "candidate/timeline.png",
targetPath: "candidate.png",
},
{
kind: "motionClip",
label: "Baseline change MP4",
lane: "baseline",
path: "baseline/change.mp4",
targetPath: "baseline-change.mp4",
},
],
}),
);
return manifestPath;
}
describe("scripts/mantis/publish-pr-evidence", () => {
it("renders a manifest-driven PR comment with inline screenshots and video links", () => {
const manifest = loadEvidenceManifest(writeFixtureManifest());
const body = renderEvidenceComment({
artifactUrl: "https://github.com/openclaw/openclaw/actions/runs/1/artifacts/2",
manifest,
marker: "<!-- mantis-discord-status-reactions -->",
rawBase: "https://qa.openclaw.ai/mantis/discord/pr-1/run-1",
requestSource: "workflow_dispatch",
runUrl: "https://github.com/openclaw/openclaw/actions/runs/1",
treeUrl: "https://qa.openclaw.ai/mantis/discord/pr-1/run-1",
});
expect(body).toContain("<!-- mantis-discord-status-reactions -->");
expect(body).toContain("Summary: Mantis reran the scenario.");
expect(body).toContain('<table width="100%">');
expect(body).toContain('<th width="50%">Baseline queued-only</th>');
expect(body).toContain('<th width="50%">Candidate queued -> thinking -> done</th>');
expect(body).toContain(
'<td width="50%" align="center"><img src="https://qa.openclaw.ai/mantis/discord/pr-1/run-1/baseline.png" width="100%"',
);
expect(body).toContain(
"[Baseline change MP4](https://qa.openclaw.ai/mantis/discord/pr-1/run-1/baseline-change.mp4)",
);
expect(body).not.toContain("raw.githubusercontent.com");
expect(body).toContain("- Overall: `true`");
});
it("uploads manifest artifacts to R2-compatible object storage", async () => {
const manifest = loadEvidenceManifest(writeFixtureManifest());
const requests: Array<{ body: Buffer; headers: HeadersInit; method: string; url: string }> = [];
const fetchImpl = async (
url: URL,
init: { body: Buffer; headers: HeadersInit; method: string },
) => {
requests.push({
body: init.body,
headers: init.headers,
method: init.method,
url: url.toString(),
});
return new Response("", { status: 200 });
};
const published = await publishArtifactFiles({
artifactRoot: "mantis/discord/pr-1/run-1",
fetchImpl,
manifest,
storageConfig: {
accessKeyId: "access",
bucket: "qa-artifacts",
endpoint: "https://example.r2.cloudflarestorage.com",
publicBaseUrl: "https://qa.openclaw.ai",
region: "auto",
secretAccessKey: "secret",
},
});
expect(published).toEqual({
artifactRoot: "mantis/discord/pr-1/run-1",
rawBase: "https://qa.openclaw.ai/mantis/discord/pr-1/run-1",
treeUrl: "https://qa.openclaw.ai/mantis/discord/pr-1/run-1/index.json",
});
expect(requests.map((request) => request.method)).toEqual(["PUT", "PUT", "PUT", "PUT", "PUT"]);
expect(requests.map((request) => request.url)).toEqual([
"https://example.r2.cloudflarestorage.com/qa-artifacts/mantis/discord/pr-1/run-1/baseline.png",
"https://example.r2.cloudflarestorage.com/qa-artifacts/mantis/discord/pr-1/run-1/candidate.png",
"https://example.r2.cloudflarestorage.com/qa-artifacts/mantis/discord/pr-1/run-1/baseline-change.mp4",
"https://example.r2.cloudflarestorage.com/qa-artifacts/mantis/discord/pr-1/run-1/mantis-evidence.json",
"https://example.r2.cloudflarestorage.com/qa-artifacts/mantis/discord/pr-1/run-1/index.json",
]);
expect(requests[0]?.headers).toMatchObject({
"content-type": "image/png",
"x-amz-date": expect.any(String),
});
expect((requests[0].headers as Record<string, string>).authorization).toContain(
"Credential=access/",
);
expect(String(requests[4]?.body)).toContain(
'"url": "https://qa.openclaw.ai/mantis/discord/pr-1/run-1/baseline.png"',
);
});
it("allows failure manifests to omit optional visual artifacts", () => {
const dir = mkdtempSync(path.join(tmpdir(), "mantis-evidence-test-"));
tempDirs.push(dir);
writeFileSync(path.join(dir, "summary.json"), JSON.stringify({ status: "fail" }));
writeFileSync(path.join(dir, "report.md"), "bootstrap failed before screenshot");
const manifestPath = path.join(dir, "mantis-evidence.json");
writeFileSync(
manifestPath,
JSON.stringify({
schemaVersion: 1,
id: "slack-desktop-smoke",
title: "Mantis Slack Desktop Smoke QA",
summary: "Mantis could not finish VM setup.",
scenario: "slack-openclaw-desktop-smoke",
comparison: {
candidate: {
expected: "Slack QA and VM gateway setup pass",
sha: "bbb",
status: "fail",
},
pass: false,
},
artifacts: [
{
alt: "Slack Web desktop screenshot from the Mantis VM",
inline: true,
kind: "desktopScreenshot",
label: "Slack desktop/VNC browser",
lane: "candidate",
path: "slack-desktop-smoke.png",
required: false,
targetPath: "slack-desktop.png",
},
{
kind: "metadata",
label: "Slack desktop summary",
lane: "run",
path: "summary.json",
targetPath: "summary.json",
},
{
kind: "report",
label: "Slack desktop report",
lane: "run",
path: "report.md",
targetPath: "report.md",
},
],
}),
);
const manifest = loadEvidenceManifest(manifestPath);
expect(manifest.artifacts.map((artifact) => artifact.targetPath)).toEqual([
"summary.json",
"report.md",
"mantis-evidence.json",
]);
const body = renderEvidenceComment({
artifactUrl: "https://github.com/openclaw/openclaw/actions/runs/1/artifacts/2",
manifest,
marker: "<!-- mantis-slack-desktop-smoke -->",
rawBase: "https://qa.openclaw.ai/mantis/slack/pr-1/run-1",
requestSource: "workflow_dispatch",
runUrl: "https://github.com/openclaw/openclaw/actions/runs/1",
treeUrl: "https://qa.openclaw.ai/mantis/slack/pr-1/run-1",
});
expect(body).toContain("Summary: Mantis could not finish VM setup.");
expect(body).toContain("- Overall: `false`");
expect(body).not.toContain("<img ");
});
it("renders a successful no-visual-proof manifest without media tables", () => {
const dir = mkdtempSync(path.join(tmpdir(), "mantis-evidence-test-"));
tempDirs.push(dir);
const manifestPath = path.join(dir, "mantis-evidence.json");
writeFileSync(
manifestPath,
JSON.stringify({
artifacts: [],
comparison: {
baseline: {
expected: "no visible Telegram Desktop delta",
status: "skipped",
},
candidate: {
expected: "no visible Telegram Desktop delta",
status: "skipped",
},
pass: true,
},
id: "telegram-desktop-proof",
scenario: "telegram-desktop-proof",
schemaVersion: 1,
summary:
"Mantis did not generate before/after GIFs because this PR changes CI wiring only.",
title: "Mantis Telegram Desktop Proof",
}),
);
const manifest = loadEvidenceManifest(manifestPath);
const body = renderEvidenceComment({
artifactRoot: "mantis/telegram-desktop/pr-1/run-1",
manifest,
marker: "<!-- mantis-telegram-desktop-proof -->",
rawBase:
"https://raw.githubusercontent.com/openclaw/openclaw/qa-artifacts/mantis/telegram-desktop/pr-1/run-1",
requestSource: "issue_comment",
runUrl: "https://github.com/openclaw/openclaw/actions/runs/1",
treeUrl:
"https://github.com/openclaw/openclaw/tree/qa-artifacts/mantis/telegram-desktop/pr-1/run-1",
});
expect(manifest.artifacts.map((artifact) => artifact.targetPath)).toEqual([
"mantis-evidence.json",
]);
expect(body).toContain(
"Summary: Mantis did not generate before/after GIFs because this PR changes CI wiring only.",
);
expect(body).toContain("- Overall: `true`");
expect(body).not.toContain("<table");
expect(body).not.toContain("<img ");
expect(shouldPublishPrComment(manifest, { requestSource: "issue_comment" })).toBe(true);
expect(shouldPublishPrComment(manifest, { requestSource: "pull_request_target" })).toBe(false);
});
it("does not publish PR comments for Telegram capture infrastructure failures", () => {
const dir = mkdtempSync(path.join(tmpdir(), "mantis-evidence-test-"));
tempDirs.push(dir);
const manifestPath = path.join(dir, "mantis-evidence.json");
writeFileSync(
manifestPath,
JSON.stringify({
artifacts: [],
comparison: {
baseline: {
expected: "no acceptable native Telegram Desktop visual artifact",
status: "skipped",
},
candidate: {
expected: "no acceptable native Telegram Desktop visual artifact",
status: "skipped",
},
pass: false,
},
id: "telegram-desktop-proof",
scenario: "telegram-desktop-proof",
schemaVersion: 1,
summary:
"Mantis could not capture Telegram Desktop proof because native Telegram Desktop opened to the logged-out welcome screen.",
title: "Mantis Telegram Desktop Proof",
}),
);
const manifest = loadEvidenceManifest(manifestPath);
const body = renderEvidenceComment({
manifest,
marker: "<!-- mantis-telegram-desktop-proof -->",
rawBase: "https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-1/run-1",
requestSource: "pull_request_target",
runUrl: "https://github.com/openclaw/openclaw/actions/runs/1",
treeUrl: "https://artifacts.openclaw.ai/mantis/telegram-desktop/pr-1/run-1/index.json",
});
expect(body).toContain(
"Summary: Mantis could not capture Telegram Desktop proof because native Telegram Desktop opened to the logged-out welcome screen.",
);
expect(body).toContain("- Overall: `false`");
expect(shouldPublishPrComment(manifest, { requestSource: "issue_comment" })).toBe(false);
expect(shouldPublishPrComment(manifest, { requestSource: "pull_request_target" })).toBe(false);
});
it("rejects artifact paths that escape the manifest directory", () => {
const dir = mkdtempSync(path.join(tmpdir(), "mantis-evidence-test-"));
tempDirs.push(dir);
const manifestPath = path.join(dir, "mantis-evidence.json");
writeFileSync(
manifestPath,
JSON.stringify({
artifacts: [
{
kind: "metadata",
path: "../outside.json",
},
],
id: "bad",
scenario: "bad",
schemaVersion: 1,
title: "Bad",
}),
);
expect(() => loadEvidenceManifest(manifestPath)).toThrow(/escapes manifest directory/u);
});
});