Skip to content

Commit 11b8a13

Browse files
authored
Merge branch 'main' into fix/followup-104814
2 parents 84db03e + 25f00f9 commit 11b8a13

806 files changed

Lines changed: 63956 additions & 7923 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

‎.agents/skills/openclaw-changelog-update/scripts/verify-release-notes.mjs‎

Lines changed: 80 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -805,6 +805,54 @@ function backportPullRequestOrigins(message) {
805805
].map((match) => Number(match[1]));
806806
}
807807

808+
export function releaseProvenanceMarkers(message) {
809+
const markers = [];
810+
for (const line of message.split("\n")) {
811+
if (!/^Release provenance:/i.test(line)) {
812+
continue;
813+
}
814+
const match = line.match(/^Release provenance: ([0-9a-f]{40}) -> (#\d+(?:,\s*#\d+)*)\.?\s*$/i);
815+
if (!match) {
816+
fail(`invalid release provenance marker: ${line}`);
817+
}
818+
markers.push({
819+
commit: match[1].toLowerCase(),
820+
pullRequests: [...match[2].matchAll(/#(\d+)/g)].map((reference) => Number(reference[1])),
821+
});
822+
}
823+
return markers;
824+
}
825+
826+
export function collectReleaseProvenanceOverrides(activeCommits) {
827+
const activeCommitHashes = new Set(activeCommits.map((commit) => commit.hash));
828+
const overrides = new Map();
829+
for (const commit of activeCommits) {
830+
for (const marker of releaseProvenanceMarkers(commit.body)) {
831+
if (!activeCommitHashes.has(marker.commit)) {
832+
fail(`release provenance marker targets commit outside the active range: ${marker.commit}`);
833+
}
834+
const existing = overrides.get(marker.commit);
835+
if (existing && existing.join(",") !== marker.pullRequests.join(",")) {
836+
fail(`conflicting release provenance markers for ${marker.commit}`);
837+
}
838+
overrides.set(marker.commit, marker.pullRequests);
839+
}
840+
}
841+
return overrides;
842+
}
843+
844+
export function resolvedReleasePullRequests(
845+
currentPullRequests,
846+
mainPullRequests,
847+
hasCanonicalMainCommit,
848+
provenanceOverride,
849+
) {
850+
return (
851+
provenanceOverride ??
852+
canonicalPullRequests(currentPullRequests, mainPullRequests, hasCanonicalMainCommit)
853+
);
854+
}
855+
808856
function changedPathsForCommit(hash) {
809857
return new Set(
810858
git(["diff-tree", "--root", "--no-commit-id", "--name-only", "-r", hash, "--"])
@@ -1080,7 +1128,9 @@ function sourceCommits(base, target, mainRef) {
10801128
activeCommits.map((commit) => commit.hash),
10811129
targetTimestamp,
10821130
);
1131+
const provenanceOverrides = collectReleaseProvenanceOverrides(activeCommits);
10831132
const mainCommits = canonicalMainCommits(base, mainRef);
1133+
const mainCommit = gitCommit(mainRef, true);
10841134
const mainCommitsByHash = new Map(mainCommits.map((commit) => [commit.hash, commit]));
10851135
const mainCommitsBySubject = new Map();
10861136
for (const commit of mainCommits) {
@@ -1183,10 +1233,11 @@ function sourceCommits(base, target, mainRef) {
11831233
(hash) => canonicalMainPullRequests.get(hash) ?? [],
11841234
);
11851235
const matchedMainCommits = canonicalMainCommitsByReleaseCommit.get(commit.hash) ?? [];
1186-
const associatedPullRequests = canonicalPullRequests(
1236+
const associatedPullRequests = resolvedReleasePullRequests(
11871237
currentPullRequests,
11881238
mainPullRequests,
11891239
matchedMainCommits.length > 0,
1240+
provenanceOverrides.get(commit.hash),
11901241
);
11911242
commit.pullRequests = associatedPullRequests;
11921243
const suppressedBackportPullRequests = new Set(
@@ -1249,8 +1300,10 @@ function sourceCommits(base, target, mainRef) {
12491300
return {
12501301
activeCommits,
12511302
coauthorsByReference,
1303+
mainCommit,
12521304
mergeBase,
12531305
pullRequests,
1306+
provenanceOverrides,
12541307
references,
12551308
revertedReferences,
12561309
target: targetCommit,
@@ -1456,7 +1509,9 @@ function resolveReferences(numbers) {
14561509
... on PullRequest {
14571510
number
14581511
title
1512+
baseRefName
14591513
mergedAt
1514+
mergeCommit { oid }
14601515
author { __typename login }
14611516
closingIssuesReferences(first: 100) {
14621517
nodes { number }
@@ -1478,6 +1533,29 @@ function resolveReferences(numbers) {
14781533
return resolveIssueRelationshipPages(nodes);
14791534
}
14801535

1536+
export function validateReleaseProvenanceOverrides(
1537+
provenanceOverrides,
1538+
nodes,
1539+
mainCommit,
1540+
isMainAncestor = gitIsAncestor,
1541+
) {
1542+
for (const [commit, pullRequests] of provenanceOverrides) {
1543+
for (const number of pullRequests) {
1544+
const node = nodes.get(number);
1545+
// Markers may name current-main forward-ports, but never release-only or unmerged PRs.
1546+
if (
1547+
node?.__typename !== "PullRequest" ||
1548+
node.baseRefName !== "main" ||
1549+
!node.mergedAt ||
1550+
!node.mergeCommit?.oid ||
1551+
!isMainAncestor(node.mergeCommit.oid, mainCommit)
1552+
) {
1553+
fail(`release provenance marker for ${commit} references non-main PR #${number}`);
1554+
}
1555+
}
1556+
}
1557+
}
1558+
14811559
function resolveGitHubHandles(handles) {
14821560
const resolved = new Map();
14831561
const uniqueHandles = [...new Set(handles)];
@@ -2248,6 +2326,7 @@ function main() {
22482326
.join(", ")}`,
22492327
);
22502328
}
2329+
validateReleaseProvenanceOverrides(source.provenanceOverrides, nodes, source.mainCommit);
22512330
const provisionalEntries = references
22522331
.map((number) => nodes.get(number))
22532332
.filter((node) => node?.__typename === "PullRequest");

‎.agents/skills/openclaw-live-updater/SKILL.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ Keep `/Users/steipete/openclaw` a read-only-to-the-agent deployment mirror: clea
3232
- A dependency-input change, absent `node_modules`, or missing/invalid build provenance requires `pnpm install --frozen-lockfile`. When a build is required, do not install before acquiring the maintenance suspension and stopping the managed Gateway.
3333
- Before mutating any entrypoint currently executed by the Gateway, invoke an exact trusted source CLI to acquire `gateway.suspend.prepare`, binding both prepare and resume to this checkout's managed LaunchAgent loopback port and service auth even when normal CLI configuration points at a remote Gateway. The LaunchAgent may execute either this checkout's `dist/index.js` or a clean detached canonical snapshot under `~/.openclaw/runtime/gateway-<sha>` whose commit is an ancestor of the checkout; reject every other entrypoint. Never execute snapshot code: capture an exact source control build before the Git fast-forward for its prepare and failure-resume calls, preserve any validated generated service-environment wrapper, and stop the managed LaunchAgent with native launchd bootout. If that control build is missing, first accept native proof that the snapshot job is already booted out with its port free; when the isolated snapshot is still running, build the verified clean source checkout to obtain an exact suspension client, then use only that source client for prepare and failure-resume. Never use this recovery build while launchd targets the source checkout. This atomically pauses cron scheduling, closes new work admission, and refuses while active work remains. A busy result defers further mutation to the next heartbeat; never replace this fence with `cron list` polling. Once ready, stop directly without a source launcher, install frozen dependencies when required, then build unless the exact recovery build already produced the deployment artifact; source launchers can auto-build stale output before dispatching the stop. Resume the suspension if stop fails. If suspension RPC is unavailable on macOS, proceed only when native inspection proves this checkout's managed LaunchAgent is booted out and its configured port has no listener; never accept a loaded KeepAlive job's transient stopped state. On other platforms, require the existing CLI to prove the managed service is stopped with no PID, listener, or RPC. This preserves retry after a post-stop failure without weakening the live-work fence. Preserve `dist/OpenClaw.app` outside `dist` for the build and restore it even when the build fails, because the JS build cleans `dist` regardless of Mac impact classification. Never mutate the live `dist` tree while an old Gateway can dynamically import from it. `pnpm build` must leave both canonical stamp heads and `dist/build-info.json.commit` equal to post-update `afterSha`; any missing/mismatched stamp or required artifact blocks restart.
3434
- Snapshot ownership validation must never invoke Git inside the snapshot. Treat its worktree, local Git configuration, filters, hooks, attributes, and build artifacts as untrusted; prove only that the regular owned LaunchAgent entrypoint is under the canonical detached ancestor snapshot path. Snapshot validation authorizes native bootout and retargeting only. Every CLI path must reject snapshot execution and use the trusted source checkout build instead.
35-
- Only after exact-SHA build proof may it restart the managed Gateway and require `gateway status --deep --require-rpc --json` plus `health --verbose --json`. A validated ancestor snapshot is suspension-only: prove the old launchd job is booted out with its port free, then atomically retarget only the owned LaunchAgent entrypoint to this checkout's exact `dist/index.js`, including on a retry where the build is already current. Preserve all other service arguments and environment unchanged. After restart, prove the loaded launchd PID owns the configured listener.
35+
- Only after exact-SHA build proof may it restart the managed Gateway and require `gateway status --deep --require-rpc --json` plus `health --verbose --json`. A validated ancestor snapshot is suspension-only: prove the old launchd job is booted out with its port free, allowing bounded retries while launchd and the listener finish teardown, then atomically retarget only the owned LaunchAgent entrypoint to this checkout's exact `dist/index.js`, including on a retry where the build is already current. Replace the verified `ProgramArguments` array as one value; never use array-index plist mutation that can insert a duplicate argument. Preserve all other service arguments and environment unchanged. After restart, prove the loaded launchd PID owns the configured listener.
3636
- After every managed restart, query Gateway logs through RPC, restrict the audit to entries emitted since that restart began, report warning summaries, and fail the pass on any error/fatal entry. If RPC verification or log retrieval fails, still inspect the local structured log for that restart window. Never accept supervisor or RPC health without this restart-window log audit.
3737

3838
Treat supervisor state alone as insufficient. If build or proof fails, leave the new mirror head intact and retry the stale/missing build on the next heartbeat; never run the old `dist` against new source.

‎.agents/skills/openclaw-live-updater/scripts/update-main.mjs‎

Lines changed: 67 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,6 +37,8 @@ const DEFAULT_EXPECTED_ORIGIN = "openclaw/openclaw";
3737
const FULL_SHA_RE = /^[0-9a-f]{40}$/u;
3838
const GATEWAY_READINESS_ATTEMPTS = 3;
3939
const GATEWAY_READINESS_RETRY_DELAY_MS = 5_000;
40+
const GATEWAY_STOP_PROOF_ATTEMPTS = 100;
41+
const GATEWAY_STOP_PROOF_RETRY_DELAY_MS = 100;
4042
const GATEWAY_SUSPEND_TIMEOUT_MS = 10_000;
4143
const GENERATED_LAUNCH_AGENT_ENV_WRAPPER = `#!/bin/sh
4244
set -eu
@@ -875,23 +877,43 @@ export function repointManagedGatewayDeployment(
875877
};
876878
}
877879

880+
export function replaceLaunchAgentProgramArgument(programArguments, index, expected, replacement) {
881+
if (!Array.isArray(programArguments) || programArguments[index] !== expected) {
882+
throw new UpdateInvariantError(
883+
"gateway_repoint_failed",
884+
"managed Gateway LaunchAgent changed before its entrypoint could be replaced",
885+
);
886+
}
887+
return programArguments.with(index, replacement);
888+
}
889+
878890
function replaceLaunchAgentEntrypoint(deployment, entrypoint) {
879-
const original = readFileSync(deployment.plistPath);
880891
const temporaryPath = `${deployment.plistPath}.openclaw-live-updater-${randomUUID()}`;
881-
writeFileSync(temporaryPath, original, {
892+
writeFileSync(temporaryPath, readFileSync(deployment.plistPath), {
882893
flag: "wx",
883894
mode: statSync(deployment.plistPath).mode,
884895
});
885896
try {
897+
const plistResult = spawnSync(
898+
"/usr/bin/plutil",
899+
["-convert", "json", "-o", "-", temporaryPath],
900+
{ encoding: "utf8" },
901+
);
902+
if (plistResult.status !== 0) {
903+
throw new UpdateInvariantError(
904+
"gateway_repoint_failed",
905+
`could not read the managed Gateway LaunchAgent: ${String(plistResult.stderr).trim()}`,
906+
);
907+
}
908+
const programArguments = replaceLaunchAgentProgramArgument(
909+
JSON.parse(plistResult.stdout)?.ProgramArguments,
910+
deployment.entrypointIndex,
911+
deployment.entrypoint,
912+
entrypoint,
913+
);
886914
execFileSync(
887915
"/usr/bin/plutil",
888-
[
889-
"-replace",
890-
`ProgramArguments.${deployment.entrypointIndex}`,
891-
"-string",
892-
entrypoint,
893-
temporaryPath,
894-
],
916+
["-replace", "ProgramArguments", "-json", JSON.stringify(programArguments), temporaryPath],
895917
{ stdio: ["ignore", "ignore", "pipe"] },
896918
);
897919
execFileSync("/usr/bin/plutil", ["-lint", temporaryPath], {
@@ -1143,6 +1165,33 @@ function stopManagedGateway(runCommand, checkout, deployment) {
11431165
);
11441166
}
11451167

1168+
function stopManagedGatewayAndProve(runCommand, checkout, deployment, proveGatewayStopped, sleep) {
1169+
let stopError;
1170+
try {
1171+
stopManagedGateway(runCommand, checkout, deployment);
1172+
} catch (error) {
1173+
stopError = error;
1174+
}
1175+
let proofError;
1176+
for (let attempt = 0; attempt < GATEWAY_STOP_PROOF_ATTEMPTS; attempt += 1) {
1177+
try {
1178+
return proveGatewayStopped(checkout);
1179+
} catch (error) {
1180+
proofError = error;
1181+
if (attempt + 1 < GATEWAY_STOP_PROOF_ATTEMPTS) {
1182+
sleep(GATEWAY_STOP_PROOF_RETRY_DELAY_MS);
1183+
}
1184+
}
1185+
}
1186+
if (!stopError) {
1187+
throw proofError;
1188+
}
1189+
throw new AggregateError(
1190+
[stopError, proofError],
1191+
"Gateway stop command failed and native stopped proof did not converge",
1192+
);
1193+
}
1194+
11461195
function isTrustedSourceControlBuild(checkout, buildState, currentHead) {
11471196
if (buildState.current) {
11481197
return true;
@@ -1802,10 +1851,15 @@ export function maintainMain(options, dependencies = {}) {
18021851
// Native bootout prevents launchd from retaining old ProgramArguments
18031852
// and avoids source launchers that can rebuild stale dist before stopping.
18041853
try {
1805-
stopManagedGateway(runCommand, update.checkout, gatewayDeploymentBefore);
1806-
// Retarget only after launchd has discarded the old ProgramArguments.
1807-
// Otherwise a later kickstart can revive its cached snapshot command.
1808-
proveGatewayStopped(update.checkout);
1854+
// launchctl can return before the job and listener have disappeared.
1855+
// Retarget only after bounded native proof prevents cached snapshot revival.
1856+
stopManagedGatewayAndProve(
1857+
runCommand,
1858+
update.checkout,
1859+
gatewayDeploymentBefore,
1860+
proveGatewayStopped,
1861+
sleep,
1862+
);
18091863
} catch (error) {
18101864
try {
18111865
resumeSuspension(

‎.github/workflows/ci.yml‎

Lines changed: 71 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -827,10 +827,6 @@ jobs:
827827
NODE_OPTIONS: --max-old-space-size=8192
828828
run: pnpm build:ci-artifacts
829829

830-
- name: Check Control UI i18n
831-
if: needs.preflight.outputs.run_control_ui_i18n == 'true'
832-
run: pnpm ui:i18n:check
833-
834830
- name: Pack built runtime artifacts
835831
run: tar --posix -cf dist-runtime-build.tar.zst --use-compress-program zstdmt dist dist-runtime packages/*/dist
836832

@@ -1059,12 +1055,35 @@ jobs:
10591055
if [[ "$COMPATIBILITY_TARGET" == "true" ]]; then
10601056
# Frozen targets can contain timing-sensitive tests fixed on current main.
10611057
# Give legacy browser fixtures enough headroom on shared hosted runners.
1058+
# Isolate files because older suites can still leak module mocks between tests.
10621059
# Do not retry whole files: several rely on one-shot mocked browser globals.
1063-
pnpm --dir ui test --testTimeout=30000
1060+
pnpm --dir ui test --testTimeout=30000 --isolate
10641061
else
10651062
pnpm --dir ui test
10661063
fi
10671064
1065+
control-ui-i18n:
1066+
permissions:
1067+
contents: read
1068+
name: control-ui-i18n
1069+
needs: [preflight]
1070+
if: needs.preflight.outputs.run_control_ui_i18n == 'true'
1071+
# Locale refresh runs separately on main and nightly. Keep drift visible on
1072+
# automatic runs without blocking unrelated work; release CI stays strict.
1073+
continue-on-error: ${{ github.event_name != 'workflow_dispatch' }}
1074+
runs-on: ${{ github.event_name == 'workflow_dispatch' && 'ubuntu-24.04' || (github.repository == 'openclaw/openclaw' && 'blacksmith-4vcpu-ubuntu-2404' || 'ubuntu-24.04') }}
1075+
timeout-minutes: 10
1076+
steps:
1077+
- *linux_node_checkout_step
1078+
- name: Setup Node environment
1079+
uses: ./.github/actions/setup-node-env
1080+
with:
1081+
node-version: "24.x"
1082+
install-bun: "false"
1083+
1084+
- name: Check Control UI locale parity
1085+
run: pnpm ui:i18n:check
1086+
10681087
checks-fast-core:
10691088
permissions:
10701089
contents: read
@@ -1179,13 +1198,58 @@ jobs:
11791198
if (typeof smokePlan.createQaSmokeCiPart === "function") {
11801199
runs = smokePlan.createQaSmokeCiPart(partId).runs;
11811200
} else if (typeof smokePlan.createQaSmokeCiMatrix === "function") {
1201+
// Legacy planners select the entire profile and can mix long-lived
1202+
// execution kinds. Reuse the current bounded smoke contract and
1203+
// isolate each kind so frozen targets cannot pin a profile part.
1204+
const compatibilityScenarioIds = new Set([
1205+
"control-ui-chat-flow-playwright",
1206+
"crestodian-ring-zero-setup",
1207+
"dreaming-shadow-trial-report",
1208+
"gateway-smoke",
1209+
"group-visible-reply-tool",
1210+
"long-running-release-audit",
1211+
"luna-thinking-visibility-switch",
1212+
"matrix-restart-resume",
1213+
"personal-task-followthrough-status",
1214+
"plugin-lifecycle-hot-reload",
1215+
"subagent-completion-direct-fallback",
1216+
"telegram-commands-command",
1217+
]);
11821218
const partIndex = partId === "profile-1" ? 0 : partId === "profile-2" ? 1 : -1;
11831219
if (partIndex < 0) {
11841220
throw new Error(`unknown QA smoke CI profile part: ${partId}`);
11851221
}
1186-
runs = smokePlan
1222+
const scenarioCatalog = await import("./extensions/qa-lab/src/scenario-catalog.ts");
1223+
const scenarioKindById = new Map(
1224+
scenarioCatalog
1225+
.readQaScenarioPack()
1226+
.scenarios.map((scenario) => [scenario.id, scenario.execution.kind]),
1227+
);
1228+
const legacyRuns = smokePlan
11871229
.createQaSmokeCiMatrix()
11881230
.include.filter((_, index) => index % 2 === partIndex);
1231+
runs = legacyRuns.flatMap((run) => {
1232+
const scenarioIdsByKind = new Map();
1233+
for (const scenarioId of run.scenario_ids) {
1234+
if (!compatibilityScenarioIds.has(scenarioId)) {
1235+
continue;
1236+
}
1237+
const kind = scenarioKindById.get(scenarioId);
1238+
if (!kind) {
1239+
throw new Error(`legacy QA smoke scenario not found: ${scenarioId}`);
1240+
}
1241+
const scenarioIds = scenarioIdsByKind.get(kind) ?? [];
1242+
scenarioIds.push(scenarioId);
1243+
scenarioIdsByKind.set(kind, scenarioIds);
1244+
}
1245+
return [...scenarioIdsByKind.entries()]
1246+
.toSorted(([left], [right]) => left.localeCompare(right))
1247+
.map(([kind, scenarioIds]) => ({
1248+
...run,
1249+
slug: `${run.slug}-${kind}`,
1250+
scenario_ids: scenarioIds,
1251+
}));
1252+
});
11891253
} else {
11901254
throw new Error("QA smoke plan does not expose a supported CI planner.");
11911255
}
@@ -1677,7 +1741,6 @@ jobs:
16771741
env:
16781742
ADDITIONAL_CHECK_GROUP: ${{ matrix.group }}
16791743
OPENCLAW_ADDITIONAL_BOUNDARY_SHARD: ${{ matrix.boundary_shard || '' }}
1680-
RUN_CONTROL_UI_I18N: ${{ needs.preflight.outputs.run_control_ui_i18n }}
16811744
OPENCLAW_ADDITIONAL_BOUNDARY_CONCURRENCY: 4
16821745
OPENCLAW_EXTENSION_BOUNDARY_CONCURRENCY: 6
16831746
shell: bash
@@ -2461,6 +2524,7 @@ jobs:
24612524
- pnpm-store-warmup
24622525
- build-artifacts
24632526
- checks-ui
2527+
- control-ui-i18n
24642528
- checks-fast-core
24652529
- checks-fast-plugin-contracts-shard
24662530
- checks-fast-channel-contracts-shard

0 commit comments

Comments
 (0)