Skip to content

Commit 95cd2b7

Browse files
Merge branch 'main' into fix-image-branch
2 parents 019e3fe + cab8040 commit 95cd2b7

199 files changed

Lines changed: 6842 additions & 1963 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: 90 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
import { execFileSync } from "node:child_process";
44
import { readFileSync, writeFileSync } from "node:fs";
5+
import { pathToFileURL } from "node:url";
56

67
const repo = "openclaw/openclaw";
78
const commitAssociationQueryBatchSize = 20;
@@ -221,6 +222,42 @@ function referencesIn(text) {
221222
return references;
222223
}
223224

225+
function referenceLabelsIn(text) {
226+
const labels = [];
227+
for (const match of text.matchAll(
228+
/(?<![A-Za-z0-9_.&-])(?:(?<owner>[A-Za-z0-9_.-]+)\/(?<name>[A-Za-z0-9_.-]+))?#(?<number>\d+)/g,
229+
)) {
230+
const qualifiedRepository = match.groups?.owner
231+
? `${match.groups.owner}/${match.groups.name}`
232+
: undefined;
233+
labels.push(
234+
!qualifiedRepository || qualifiedRepository.toLowerCase() === repo
235+
? `#${match.groups?.number}`
236+
: `${qualifiedRepository}#${match.groups?.number}`,
237+
);
238+
}
239+
return labels;
240+
}
241+
242+
export function renderContributionRecordEntry(entry) {
243+
const references = [];
244+
appendUnique(references, referenceLabelsIn(entry.title));
245+
appendUnique(
246+
references,
247+
(entry.priorReferences ?? []).map((number) => `#${number}`),
248+
);
249+
appendUnique(references, entry.externalReferences ?? []);
250+
for (const issue of entry.linkedIssues) {
251+
appendUnique(references, [`#${issue.number}`]);
252+
}
253+
const related = references.length > 0 ? ` Related ${references.join(", ")}.` : "";
254+
const attribution =
255+
entry.thanks.length > 0
256+
? ` Thanks ${entry.thanks.map((handle) => `@${handle}`).join(" and ")}.`
257+
: "";
258+
return `- **PR #${entry.number}**${related}${attribution}`;
259+
}
260+
224261
function closingReferencesIn(text) {
225262
const references = [];
226263
for (const match of text.matchAll(
@@ -255,26 +292,38 @@ function handlesIn(text) {
255292
);
256293
}
257294

258-
function relatedReferencesIn(line) {
259-
const related = line.match(/\bRelated ((?:#\d+)(?:, #\d+)*)\./);
260-
return related ? referencesIn(related[1]) : [];
295+
function externalReferencesIn(text) {
296+
return referenceLabelsIn(text).filter((reference) => !reference.startsWith("#"));
297+
}
298+
299+
function appendUnique(values, additions) {
300+
const seen = new Set(values.map((value) => value.toLowerCase()));
301+
for (const value of additions) {
302+
const key = value.toLowerCase();
303+
if (!seen.has(key)) {
304+
values.push(value);
305+
seen.add(key);
306+
}
307+
}
261308
}
262309

263310
function addContributionRecordEntry(entries, key, entry) {
264311
const existing = entries.get(key);
265312
if (!existing) {
266313
entries.set(key, {
267314
...entry,
315+
externalReferences: [...(entry.externalReferences ?? [])],
268316
references: [...entry.references],
269317
thanks: [...entry.thanks],
270318
});
271319
return;
272320
}
321+
appendUnique(existing.externalReferences, entry.externalReferences ?? []);
273322
appendReferences(existing.references, entry.references);
274323
addHandles(existing.thanks, entry.thanks);
275324
}
276325

277-
function contributionRecordFor(section) {
326+
export function contributionRecordFor(section) {
278327
const result = { legacyIssues: new Map(), pullRequests: new Map() };
279328
const recordStart = section.source.search(/\n### Complete contribution (?:ledger|record)\r?$/m);
280329
if (recordStart < 0) {
@@ -301,8 +350,10 @@ function contributionRecordFor(section) {
301350
const number = explicitRecord?.[1] ?? legacyRecord?.[1];
302351
if (number) {
303352
const value = Number(number);
353+
const metadata = explicitRecord ? line.slice(explicitRecord[0].length) : line;
304354
addContributionRecordEntry(result.pullRequests, value, {
305-
references: relatedReferencesIn(line),
355+
externalReferences: externalReferencesIn(metadata),
356+
references: referencesIn(metadata).filter((reference) => reference !== value),
306357
thanks: handlesIn(line),
307358
});
308359
}
@@ -345,6 +396,7 @@ function withoutRevertedContributionRecords(record, revertedReferences) {
345396
}
346397
addContributionRecordEntry(filtered.pullRequests, number, {
347398
...entry,
399+
externalReferences: entry.externalReferences,
348400
references: entry.references.filter((reference) => !revertedReferences.has(reference)),
349401
});
350402
}
@@ -1153,7 +1205,7 @@ function mergeIssues(...groups) {
11531205
return [...entries.values()];
11541206
}
11551207

1156-
function ledgerFor(
1208+
export function ledgerFor(
11571209
base,
11581210
target,
11591211
references,
@@ -1203,6 +1255,8 @@ function ledgerFor(
12031255
const issues = entries.filter((entry) => entry.type === "Issue");
12041256
const legacyIssues = legacyIssuesByPullRequest(priorRecord, nodes);
12051257
const records = pullRequests.map((entry) => {
1258+
const priorEntry = priorRecord.pullRequests.get(entry.number);
1259+
const priorReferences = priorEntry?.references ?? [];
12061260
const titleIssues = issueEntries(referencesIn(entry.title), nodes);
12071261
const closingIssues = issueEntries(
12081262
entry.closingIssuesReferences?.nodes.map((issue) => issue.number) ?? [],
@@ -1212,41 +1266,31 @@ function ledgerFor(
12121266
titleIssues,
12131267
closingIssues,
12141268
relationships.issuesByPullRequest.get(entry.number) ?? [],
1269+
issueEntries(priorReferences, nodes),
12151270
issueEntries(legacyIssues.get(entry.number) ?? [], nodes, priorRecord.legacyIssues),
12161271
);
1217-
const titleIssueNumbers = new Set(titleIssues.map((issue) => issue.number));
1218-
const relatedIssues = linkedIssues.filter((issue) => !titleIssueNumbers.has(issue.number));
12191272
const thanks = [...entry.thanks];
1273+
addHandles(thanks, priorEntry?.thanks ?? []);
12201274
for (const issue of linkedIssues) {
12211275
addHandles(thanks, issue.thanks);
12221276
}
12231277
return {
12241278
...entry,
12251279
...editorialClassification(entry.title),
1280+
externalReferences: priorEntry?.externalReferences ?? [],
12261281
linkedIssues,
1227-
relatedIssues,
1282+
priorReferences,
12281283
thanks,
12291284
};
12301285
});
1231-
const renderEntry = (entry) => {
1232-
const attribution =
1233-
entry.thanks.length > 0
1234-
? ` Thanks ${entry.thanks.map((handle) => `@${handle}`).join(" and ")}.`
1235-
: "";
1236-
const relatedIssues =
1237-
entry.relatedIssues.length > 0
1238-
? ` Related ${entry.relatedIssues.map((issue) => `#${issue.number}`).join(", ")}.`
1239-
: "";
1240-
return `- **PR #${entry.number}** ${withSentenceEnding(entry.title)}${relatedIssues}${attribution}`;
1241-
};
12421286
const ledger = [
12431287
"### Complete contribution record",
12441288
"",
12451289
`This audited record covers the complete ${base}..${target} history: ${records.length} merged PRs. The generation manifest also supplies direct commits as editorial input; the grouped notes above prioritize user impact.`,
12461290
"",
12471291
"#### Pull requests",
12481292
"",
1249-
...records.map((entry) => renderEntry(entry)),
1293+
...records.map((entry) => renderContributionRecordEntry(entry)),
12501294
].join("\n");
12511295
return {
12521296
entries,
@@ -1267,7 +1311,7 @@ function replaceLedger(changelog, section, ledger, pullRequests, directCommits)
12671311
return `${changelog.slice(0, section.start)}${replacement}${changelog.slice(section.end)}`;
12681312
}
12691313

1270-
function ledgerChecks(section, pullRequests, nodes, directCommits) {
1314+
export function ledgerChecks(section, pullRequests, nodes, directCommits) {
12711315
const errors = [];
12721316
if (/@undefined\b/i.test(section.source)) {
12731317
errors.push("release section contains invalid @undefined contributor credit");
@@ -1311,6 +1355,25 @@ function ledgerChecks(section, pullRequests, nodes, directCommits) {
13111355
errors.push(`missing Thanks @${handle} for #${entry.number}`);
13121356
}
13131357
}
1358+
const expectedReferences = [];
1359+
appendUnique(expectedReferences, referenceLabelsIn(entry.title));
1360+
appendUnique(
1361+
expectedReferences,
1362+
entry.priorReferences.map((number) => `#${number}`),
1363+
);
1364+
appendUnique(expectedReferences, entry.externalReferences);
1365+
appendUnique(
1366+
expectedReferences,
1367+
entry.linkedIssues.map((issue) => `#${issue.number}`),
1368+
);
1369+
const actualReferences = new Set(
1370+
referenceLabelsIn(line).map((reference) => reference.toLowerCase()),
1371+
);
1372+
for (const reference of expectedReferences) {
1373+
if (!actualReferences.has(reference.toLowerCase())) {
1374+
errors.push(`missing ${reference} on contribution record for PR #${entry.number}`);
1375+
}
1376+
}
13141377
}
13151378
const editorialProse = section.source.slice(0, ledgerStart);
13161379
for (const entry of pullRequests) {
@@ -1402,6 +1465,8 @@ function manifestFor(options, source, ledger, directCommitRecords) {
14021465
type: entry.type,
14031466
editorialEligible: entry.editorialEligible,
14041467
thanks: entry.thanks,
1468+
externalReferences: entry.externalReferences,
1469+
relatedReferences: [...new Set([...entry.priorReferences, ...referencesIn(entry.title)])],
14051470
linkedIssues: entry.linkedIssues.map((issue) => ({
14061471
number: issue.number,
14071472
title: issue.title,
@@ -1620,4 +1685,6 @@ function main() {
16201685
}
16211686
}
16221687

1623-
main();
1688+
if (process.argv[1] && import.meta.url === pathToFileURL(process.argv[1]).href) {
1689+
main();
1690+
}

‎.github/workflows/ci.yml‎

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1170,6 +1170,10 @@ jobs:
11701170
go-version-file: scripts/docs-i18n/go.mod
11711171
cache-dependency-path: scripts/docs-i18n/go.sum
11721172

1173+
- name: Verify docs i18n Go toolchain
1174+
if: matrix.requires_go == true
1175+
run: test "$(go env GOVERSION)" = "go1.25.12"
1176+
11731177
- name: Configure Node test resources
11741178
run: echo "OPENCLAW_VITEST_MAX_WORKERS=2" >> "$GITHUB_ENV"
11751179

‎.github/workflows/openclaw-performance.yml‎

Lines changed: 43 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ on:
4545
kova_ref:
4646
description: openclaw/Kova Git ref to install
4747
required: false
48-
default: a18f4c018151f5885d980804d863643bc78933b3
48+
default: 6a1c20bf818f71f93d6d4cad7dabac74a2996bc0
4949
type: string
5050
dispatch_id:
5151
description: Optional parent workflow dispatch identifier
@@ -148,7 +148,7 @@ jobs:
148148
include_filters: "scenario:agent-cold-warm-message"
149149
expected_release_entries: "agent-cold-warm-message:mock-openai-provider"
150150
env:
151-
KOVA_REF: ${{ inputs.kova_ref || 'a18f4c018151f5885d980804d863643bc78933b3' }}
151+
KOVA_REF: ${{ inputs.kova_ref || '6a1c20bf818f71f93d6d4cad7dabac74a2996bc0' }}
152152
KOVA_HOME: ${{ github.workspace }}/.artifacts/kova/home/${{ matrix.lane }}
153153
PERFORMANCE_HELPER_DIR: ${{ github.workspace }}/.artifacts/performance-workflow
154154
REPORT_DIR: ${{ github.workspace }}/.artifacts/kova/reports/${{ matrix.lane }}
@@ -1045,6 +1045,22 @@ jobs:
10451045
push_report() {
10461046
GIT_TERMINAL_PROMPT=0 GIT_CONFIG_COUNT=2 GIT_CONFIG_KEY_0=core.hooksPath GIT_CONFIG_VALUE_0=/dev/null GIT_CONFIG_KEY_1=http.https://github.com/.extraheader GIT_CONFIG_VALUE_1="AUTHORIZATION: basic ${auth_header}" timeout 120s git -C "$reports_root" push origin HEAD:main
10471047
}
1048+
write_publish_success() {
1049+
{
1050+
echo "### Clawgrit report published"
1051+
echo
1052+
echo "- Published report: ${REPORT_URL}"
1053+
} >> "$GITHUB_STEP_SUMMARY"
1054+
}
1055+
write_publish_failure() {
1056+
{
1057+
echo "### Clawgrit report publish failed"
1058+
echo
1059+
echo "Kova artifacts were uploaded, but publishing the clawgrit report failed after $1 attempts."
1060+
echo "Check the ClawSweeper GitHub App installation and contents permission for openclaw/clawgrit-reports."
1061+
} >> "$GITHUB_STEP_SUMMARY"
1062+
echo "::${annotation}::Kova artifacts uploaded, but clawgrit report publish failed after $1 attempts."
1063+
}
10481064
10491065
if [[ "$(git_local config --local --get core.hooksPath)" != "/dev/null" || "$(git_local remote get-url origin)" != "https://github.com/openclaw/clawgrit-reports.git" ]]; then
10501066
echo "::${annotation}::Prepared reports checkout failed integrity validation."
@@ -1055,42 +1071,36 @@ jobs:
10551071
10561072
for attempt in 1 2 3 4 5; do
10571073
if push_report; then
1058-
{
1059-
echo "### Clawgrit report published"
1060-
echo
1061-
echo "- Published report: ${REPORT_URL}"
1062-
} >> "$GITHUB_STEP_SUMMARY"
1074+
write_publish_success
10631075
exit 0
10641076
fi
1065-
if [[ "$attempt" == "5" ]]; then
1066-
{
1067-
echo "### Clawgrit report publish failed"
1068-
echo
1069-
echo "Kova artifacts were uploaded, but publishing the clawgrit report failed after ${attempt} attempts."
1070-
echo "Check the ClawSweeper GitHub App installation and contents permission for openclaw/clawgrit-reports."
1071-
} >> "$GITHUB_STEP_SUMMARY"
1072-
echo "::${annotation}::Kova artifacts uploaded, but clawgrit report publish failed after ${attempt} attempts."
1073-
exit 1
1074-
fi
10751077
10761078
sleep $((attempt * 2))
10771079
if ! timeout 120s git -C "$reports_root" -c core.hooksPath=/dev/null fetch --depth=1 origin main; then
1078-
echo "::warning::Unable to refresh openclaw/clawgrit-reports after publish attempt ${attempt}; retrying."
1079-
continue
1080-
fi
1081-
if git_local cat-file -e "FETCH_HEAD:${DEST_REL}/report.json" 2>/dev/null; then
1082-
# A timed-out push may have succeeded. Preserve any newer latest pointer.
1083-
git_local checkout --detach FETCH_HEAD
1084-
continue
1080+
if [[ "$attempt" != "5" ]]; then
1081+
echo "::warning::Unable to refresh openclaw/clawgrit-reports after publish attempt ${attempt}; retrying."
1082+
continue
1083+
fi
1084+
else
1085+
if git_local cat-file -e "FETCH_HEAD:${DEST_REL}/report.json" 2>/dev/null; then
1086+
# A timed-out push may have succeeded; verify its unique report before failing.
1087+
write_publish_success
1088+
exit 0
1089+
fi
1090+
if [[ "$attempt" != "5" ]]; then
1091+
git_local checkout --detach FETCH_HEAD
1092+
# The run path is unique; only the shared latest pointer can conflict.
1093+
# Replaying with the current commit wins that pointer deterministically.
1094+
if ! git_local cherry-pick -X theirs "$report_commit"; then
1095+
git_local cherry-pick --abort || true
1096+
echo "::${annotation}::Unable to replay the clawgrit report after a concurrent publish."
1097+
exit 1
1098+
fi
1099+
report_commit="$(git_local rev-parse HEAD)"
1100+
continue
1101+
fi
10851102
fi
10861103
1087-
git_local checkout --detach FETCH_HEAD
1088-
# The run path is unique; only the shared latest pointer can conflict.
1089-
# Replaying with the current commit wins that pointer deterministically.
1090-
if ! git_local cherry-pick -X theirs "$report_commit"; then
1091-
git_local cherry-pick --abort || true
1092-
echo "::${annotation}::Unable to replay the clawgrit report after a concurrent publish."
1093-
exit 1
1094-
fi
1095-
report_commit="$(git_local rev-parse HEAD)"
1104+
write_publish_failure "$attempt"
1105+
exit 1
10961106
done

0 commit comments

Comments
 (0)