diff --git a/docs/pr-review-comments.md b/docs/pr-review-comments.md index 12f7386ff3..f133056e6d 100644 --- a/docs/pr-review-comments.md +++ b/docs/pr-review-comments.md @@ -42,7 +42,8 @@ The body should include the strongest actionable, non-overlapping sections the report has: - `**Summary**` from the typed `changeSummary` field, not from the - merge verdict or maintainer follow-up summary + merge verdict or maintainer follow-up summary; when `reproductionAssessment` + is present, this section also includes a compact `Reproducibility:` line - `**Next step before merge**` for PRs, or `**Next step**` for issues, from the work-candidate reason or next action - `**Security**` from the typed `securityReview` field, so supply-chain, diff --git a/src/clawsweeper.ts b/src/clawsweeper.ts index 4fd207c383..7dc9856fe4 100644 --- a/src/clawsweeper.ts +++ b/src/clawsweeper.ts @@ -4155,6 +4155,22 @@ function appendPublicSection(lines: string[], heading: string, body: string): vo lines.push(`**${heading}**`, body, ""); } +function publicReproducibilityLine(reproductionAssessment: string): string { + const assessmentLine = sentence(reproductionAssessment); + if (!assessmentLine) return ""; + const match = assessmentLine.match(/^(yes|no|unclear|not applicable)\b/i); + if (!match) return `Reproducibility: ${assessmentLine}`; + const status = match[1]?.toLowerCase() ?? ""; + const detail = sentence(assessmentLine.slice(match[0].length).replace(/^[\s,.:;-]+/, "")); + return `Reproducibility: ${status}.${detail ? ` ${detail}` : ""}`; +} + +function publicSummaryBody(summaryLine: string, reproductionAssessment: string): string { + return [summaryLine, publicReproducibilityLine(reproductionAssessment)] + .filter(Boolean) + .join("\n\n"); +} + function appendReviewQuestionDetails( details: string[], reproductionAssessment: string | undefined, @@ -4214,9 +4230,13 @@ function renderKeepOpenCommentFromReport(markdown: string): string { "", ]; if (isPullRequest) { - appendPublicSection(lines, "Summary", changeSummaryLine); + appendPublicSection( + lines, + "Summary", + publicSummaryBody(changeSummaryLine, reproductionAssessment), + ); } else { - appendPublicSection(lines, "Summary", summaryLine); + appendPublicSection(lines, "Summary", publicSummaryBody(summaryLine, reproductionAssessment)); } appendPublicSection(lines, isPullRequest ? "Next step before merge" : "Next step", nextStepLine); appendPublicSection(lines, "Security", publicSecurityReviewLine(securityReview)); diff --git a/test/clawsweeper.test.ts b/test/clawsweeper.test.ts index cf6451d24d..5d9593d9d2 100644 --- a/test/clawsweeper.test.ts +++ b/test/clawsweeper.test.ts @@ -1202,6 +1202,50 @@ Reason: Maintainers should review the tests after the targeted lane is green. assert.match(comment, /