Skip to content

Commit f4c375e

Browse files
fix(ci): authenticate proof verdict markers
1 parent 265b126 commit f4c375e

4 files changed

Lines changed: 37 additions & 6 deletions

File tree

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -46,6 +46,7 @@ Docs: https://docs.openclaw.ai
4646

4747
### Fixes
4848

49+
- CI: require real-behavior-proof verdict markers to come from the ClawSweeper GitHub App before accepting exact-head proof. (#83692)
4950
- Agents/image generation: allow distinct `image_generate` prompts to start separate session-backed background tasks while same-prompt retries still return the active task status. (#83614) Thanks @Elarwei001.
5051
- Control UI: stop the chat reading indicator from sticking after an assistant response finishes. (#83515) Thanks @njuboy11.
5152
- Skills: reject empty or whitespace-only skill names and descriptions during quick validation. (#27061)

scripts/github/real-behavior-proof-policy.mjs

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -243,11 +243,10 @@ function extractMarkerField(marker, name) {
243243
}
244244

245245
function isTrustedClawSweeperComment(comment) {
246-
const user = comment?.user ?? comment?.author ?? {};
247-
const login = String(user?.login ?? "").toLowerCase();
248-
const type = String(user?.type ?? "").toLowerCase();
249-
const appSlug = String(comment?.performed_via_github_app?.slug ?? "").toLowerCase();
250-
return appSlug === "clawsweeper" || (login === "clawsweeper[bot]" && type === "bot");
246+
const appSlug = String(
247+
comment?.performed_via_github_app?.slug ?? comment?.performedViaGithubApp?.slug ?? "",
248+
).toLowerCase();
249+
return appSlug === "clawsweeper";
251250
}
252251

253252
export function hasClawSweeperExactHeadProof({ pullRequest, comments = [] } = {}) {

test/scripts/barnacle-auto-response.test.ts

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@ function barnacleGithub(
135135
maintainerLogins?: string[];
136136
removeLabelNotFound?: string[];
137137
repositoryRoles?: Record<string, string>;
138-
comments?: Array<{ body: string; user?: { login: string; type: string } }>;
138+
comments?: Array<{
139+
body: string;
140+
performed_via_github_app?: { slug: string };
141+
user?: { login: string; type: string };
142+
}>;
139143
} = {},
140144
) {
141145
const maintainerLogins = new Set(
@@ -797,6 +801,9 @@ describe("barnacle-auto-response", () => {
797801
login: "clawsweeper[bot]",
798802
type: "Bot",
799803
},
804+
performed_via_github_app: {
805+
slug: "clawsweeper",
806+
},
800807
body: `<!-- clawsweeper-verdict:pass item=123 sha=${headSha} confidence=high -->`,
801808
},
802809
],

test/scripts/real-behavior-proof-policy.test.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,9 @@ describe("real-behavior-proof-policy", () => {
190190
login: "clawsweeper[bot]",
191191
type: "Bot",
192192
},
193+
performed_via_github_app: {
194+
slug: "clawsweeper",
195+
},
193196
body: [
194197
"Codex review: passed.",
195198
"<!-- clawsweeper-verdict:pass item=83581 sha=06ee95df6608d29a395c52ba8ab53fdd93a9dc4f confidence=high -->",
@@ -230,6 +233,27 @@ describe("real-behavior-proof-policy", () => {
230233
expect(hasClawSweeperExactHeadProof({ pullRequest, comments })).toBe(false);
231234
expect(evaluateClawSweeperExactHeadProof({ pullRequest, comments }).passed).toBe(false);
232235
});
236+
237+
it("rejects bot-shaped ClawSweeper pass verdict markers without the GitHub App source", () => {
238+
const pullRequest = {
239+
number: 83581,
240+
head: {
241+
sha: "06ee95df6608d29a395c52ba8ab53fdd93a9dc4f",
242+
},
243+
};
244+
const comments = [
245+
{
246+
user: {
247+
login: "clawsweeper[bot]",
248+
type: "Bot",
249+
},
250+
body: "<!-- clawsweeper-verdict:pass item=83581 sha=06ee95df6608d29a395c52ba8ab53fdd93a9dc4f confidence=high -->",
251+
},
252+
];
253+
254+
expect(hasClawSweeperExactHeadProof({ pullRequest, comments })).toBe(false);
255+
expect(evaluateClawSweeperExactHeadProof({ pullRequest, comments }).passed).toBe(false);
256+
});
233257
});
234258

235259
describe("isMaintainerTeamMember", () => {

0 commit comments

Comments
 (0)