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,339 @@
#!/usr/bin/env node
// Builds config recipes for upgrade-survivor E2E scenarios.
import { spawnSync } from "node:child_process";
import fs from "node:fs";
import path from "node:path";
import { pathToFileURL } from "node:url";
import { parseReleaseVersion } from "../../../lib/npm-publish-plan.mjs";
import { buildCmdExeCommandLine, resolveWindowsCmdExePath } from "../../../windows-cmd-helpers.mjs";
const args = process.argv.slice(2);
const command = args.shift();
export const CONFIG_COMMAND_TIMEOUT_MS = 120_000;
export const CONFIG_COMMAND_MAX_BUFFER_BYTES = 4 * 1024 * 1024;
function option(name, fallback) {
const index = args.indexOf(name);
if (index === -1) {
return fallback;
}
const value = args[index + 1];
if (!value) {
throw new Error(`missing value for ${name}`);
}
return value;
}
function tail(value, max = 2400) {
const text = String(value || "");
return text.length <= max ? text : text.slice(-max);
}
function writeJson(file, value) {
fs.mkdirSync(path.dirname(file), { recursive: true });
fs.writeFileSync(file, `${JSON.stringify(value, null, 2)}\n`);
}
const configSectionDir = new URL("./config-recipe/", import.meta.url);
function readConfigSection(fileName) {
const fileUrl = new URL(fileName, configSectionDir);
return JSON.stringify(JSON.parse(fs.readFileSync(fileUrl, "utf8")));
}
export function isReleaseBefore(version, minimum) {
const parsed = parseReleaseVersion(String(version ?? ""));
const minimumParsed = parseReleaseFloor(minimum);
if (!parsed || !minimumParsed) {
return false;
}
for (const key of ["year", "month", "patch"]) {
const delta = parsed[key] - minimumParsed[key];
if (delta !== 0) {
return delta < 0;
}
}
return false;
}
function parseReleaseFloor(version) {
const match = /^([0-9]{4})\.([1-9][0-9]?)\.([0-9]+)$/u.exec(String(version ?? ""));
if (!match) {
return null;
}
const [year, month, patch] = match.slice(1).map((part) => Number(part));
if (
!Number.isSafeInteger(year) ||
!Number.isSafeInteger(month) ||
!Number.isSafeInteger(patch) ||
month < 1 ||
month > 12
) {
return null;
}
return { year, month, patch };
}
function configSetJsonFile(id, intent, configPath, fileName) {
return {
id,
intent,
argv: ["config", "set", configPath, readConfigSection(fileName), "--strict-json"],
};
}
const representativeConfigSteps = [
configSetJsonFile("models-openai", "models", "models.providers.openai", "models-openai.json"),
configSetJsonFile("agents", "agents", "agents", "agents.json"),
configSetJsonFile("skills", "skills", "skills", "skills.json"),
configSetJsonFile("plugins", "plugins", "plugins", "plugins.json"),
configSetJsonFile(
"channels-discord",
"discord-channel",
"channels.discord",
"channels-discord.json",
),
configSetJsonFile(
"channels-telegram",
"telegram-channel",
"channels.telegram",
"channels-telegram.json",
),
configSetJsonFile(
"channels-whatsapp",
"whatsapp-channel",
"channels.whatsapp",
"channels-whatsapp.json",
),
];
const scenarioConfigSteps = new Map([
[
"acpx-openclaw-tools-bridge",
[
configSetJsonFile(
"plugins-acpx-openclaw-tools-bridge",
"acpx-openclaw-tools-bridge",
"plugins",
"plugins-acpx-openclaw-tools-bridge.json",
),
],
],
[
"feishu-channel",
[
configSetJsonFile("plugins-feishu", "plugins", "plugins", "plugins-feishu.json"),
configSetJsonFile(
"channels-feishu",
"feishu-channel",
"channels.feishu",
"channels-feishu.json",
),
],
],
[
"tilde-log-path",
[
{
id: "logging-file",
intent: "logging",
argv: ["config", "set", "logging.file", "~/openclaw-upgrade-survivor/gateway.jsonl"],
},
],
],
[
"configured-plugin-installs",
[
configSetJsonFile(
"plugins-configured-installs",
"configured-plugin-installs",
"plugins",
"plugins-configured-installs.json",
),
{
id: "channels-whatsapp-unset",
intent: "configured-plugin-installs",
argv: ["config", "unset", "channels.whatsapp"],
},
configSetJsonFile(
"channels-matrix",
"configured-plugin-installs",
"channels.matrix",
"channels-matrix.json",
),
],
],
]);
const recipe = [
{
id: "update-channel",
intent: "update",
argv: ["config", "set", "update.channel", "stable"],
},
configSetJsonFile("gateway", "gateway", "gateway", "gateway.json"),
...representativeConfigSteps,
{
id: "validate",
intent: "validate",
argv: ["config", "validate"],
},
];
function selectedScenario() {
return process.env.OPENCLAW_UPGRADE_SURVIVOR_SCENARIO || "base";
}
function adaptStepForBaseline(step, baselineVersion, summary) {
if (
step.intent === "acpx-openclaw-tools-bridge" &&
isReleaseBefore(baselineVersion, "2026.4.22")
) {
if (!summary.skippedIntents.includes("acpx-openclaw-tools-bridge")) {
summary.skippedIntents.push("acpx-openclaw-tools-bridge");
}
return null;
}
if (!isReleaseBefore(baselineVersion, "2026.4.0")) {
return step;
}
if (step.id === "plugins-feishu" || step.id === "channels-feishu") {
if (!summary.skippedIntents.includes("feishu-channel")) {
summary.skippedIntents.push("feishu-channel");
}
return null;
}
if (step.id === "agents") {
const agents = JSON.parse(step.argv[3]);
delete agents.defaults?.skills;
for (const agent of agents.list ?? []) {
delete agent.thinkingDefault;
delete agent.fastModeDefault;
delete agent.skills;
}
summary.skippedIntents.push("agent-modern-preferences");
return {
...step,
argv: [...step.argv.slice(0, 3), JSON.stringify(agents), ...step.argv.slice(4)],
};
}
if (step.intent === "plugins") {
const plugins = JSON.parse(step.argv[3]);
plugins.allow = (plugins.allow ?? []).filter((id) => id !== "memory");
delete plugins.entries?.memory;
if (!summary.skippedIntents.includes("memory-plugin-allow")) {
summary.skippedIntents.push("memory-plugin-allow");
}
return {
...step,
argv: [...step.argv.slice(0, 3), JSON.stringify(plugins), ...step.argv.slice(4)],
};
}
return step;
}
export function resolveUpgradeSurvivorOpenClawCommand(argv, params = {}) {
const platform = params.platform ?? process.platform;
if (platform === "win32") {
const comSpec = params.comSpec ?? resolveWindowsCmdExePath(params.env ?? process.env);
return {
command: comSpec,
args: ["/d", "/s", "/c", buildCmdExeCommandLine("openclaw.cmd", argv)],
commandLabel: ["openclaw", ...argv].join(" "),
shell: false,
windowsVerbatimArguments: true,
};
}
return {
command: "openclaw",
args: argv,
commandLabel: ["openclaw", ...argv].join(" "),
shell: false,
};
}
function errorCode(error) {
return error && typeof error === "object" && "code" in error ? String(error.code) : undefined;
}
export function runUpgradeSurvivorOpenClawStep(step, params = {}) {
const invocation = resolveUpgradeSurvivorOpenClawCommand(step.argv);
const run = params.spawnSyncCommand ?? spawnSync;
const timeoutMs = params.timeoutMs ?? CONFIG_COMMAND_TIMEOUT_MS;
const maxBuffer = params.maxBufferBytes ?? CONFIG_COMMAND_MAX_BUFFER_BYTES;
const result = run(invocation.command, invocation.args, {
encoding: "utf8",
env: process.env,
killSignal: "SIGTERM",
maxBuffer,
shell: invocation.shell,
timeout: timeoutMs,
windowsVerbatimArguments: invocation.windowsVerbatimArguments,
});
const code = errorCode(result.error);
return {
id: step.id,
intent: step.intent,
command: invocation.commandLabel,
status: result.status,
signal: result.signal,
ok: result.status === 0 && !result.error,
errorCode: code,
errorMessage: result.error?.message ? tail(result.error.message) : undefined,
stdout: tail(result.stdout),
stderr: tail(result.stderr),
};
}
function applyRecipe() {
const summaryPath = option("--summary");
const baselineVersion = option("--baseline-version", null);
const scenario = selectedScenario();
const scenarioSteps = scenarioConfigSteps.get(scenario) ?? [];
const summary = {
source: "baseline-cli-command-recipe",
recipe: "upgrade-survivor-v1",
baselineVersion,
scenario,
acceptedIntents: [
"update",
"gateway",
"models",
"agents",
"skills",
"plugins",
"discord-channel",
"telegram-channel",
"whatsapp-channel",
...scenarioSteps.map((step) => step.intent),
],
skippedIntents: [],
steps: [],
};
for (const step of [...recipe.slice(0, -1), ...scenarioSteps, recipe.at(-1)]) {
const adaptedStep = adaptStepForBaseline(step, baselineVersion, summary);
if (!adaptedStep) {
continue;
}
const outcome = runUpgradeSurvivorOpenClawStep(adaptedStep);
summary.steps.push(outcome);
writeJson(summaryPath, summary);
if (!outcome.ok) {
const detail = outcome.errorCode ?? outcome.signal ?? outcome.status ?? "unknown";
throw new Error(`baseline config recipe failed at ${step.id}: ${detail}`);
}
}
}
function main() {
if (command === "apply") {
applyRecipe();
} else {
throw new Error(`unknown upgrade-survivor config-recipe command: ${command ?? "<missing>"}`);
}
}
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
main();
}