Skip to content

Commit fc057e8

Browse files
committed
fix(review): align required proof comments and status labels
Use the shared host proof projection for review comments and status labels while preserving recorded reviewer assessments and the existing proof merge gate.
1 parent 74b0f85 commit fc057e8

16 files changed

Lines changed: 971 additions & 178 deletions

‎CHANGELOG.md‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,7 @@ checkpoint, and status-only commits are intentionally omitted.
6464

6565
### Fixed
6666

67+
- Aligned PR proof comments and status labels with the existing host requirement when a reviewer records proof as not applicable, while preserving recorded assessments and merge gates.
6768
- Classified the explicitly approved autoreview fixture only by its exact full-URI digest and canonical or vendored source path, enforcing the same digest/path/mode policy at every scanned endpoint for all reviewed fixtures while preserving scanner gates and value-free audits.
6869
- Stopped treating pane-local runtime state as stored data while retaining warnings for explicit persistence changes and incomplete storage patches.
6970
- Corrected retained terminal-proof cleanup for independent process-exit and PTY-close events, preserving the original wrapper failure and draining dead-pane capture only after verified cleanup.

‎docs/pr-review-comments.md‎

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,6 +107,23 @@ review metrics, stored-data warnings, root-cause clusters, proof suggestions,
107107
merge-risk options, full review comments, labels, evidence, optional rank-up
108108
moves, the rank legend, workflow notes, and review history.
109109

110+
The recorded reviewer proof assessment and the host's existing proof requirement
111+
are separate. An applicable external PR assessed as `not_applicable` still needs
112+
proof: the verdict, readiness, verification, checklist, and status label explain
113+
that the assessment does not satisfy current policy. Put relevant after-change
114+
evidence in the main PR body, then request a fresh review. This includes root
115+
`README.md` changes; the existing docs exemption requires a complete, nonempty
116+
file list entirely under `docs/`. Recorded proof fields, summaries, ratings, and
117+
rating labels remain unchanged; the comment identifies reviewer context without
118+
presenting it as a host exemption.
119+
120+
Failed or malformed historical verification receipts remain separate,
121+
maintainer-owned blockers. They do not erase independently sufficient contributor
122+
proof or turn an exempt change into a contributor proof request. These projections
123+
do not change merge, repair, or close eligibility. OpenClaw Bay needs no code or
124+
schema change because its observer projection does not consume this assessment
125+
or checklist.
126+
110127
For OpenClaw PRs, stored-data warnings flag possible persistence changes in
111128
production source or documented storage contracts, not setup in test, fixture,
112129
or example source paths. Markdown beside source is still documentation: ordinary

‎src/clawsweeper-label-policy.ts‎

Lines changed: 21 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,14 @@ import {
55
OVERALL_CORRECTNESS_VALUES,
66
PR_STATUS_LABEL_NAMES,
77
PR_STATUS_LABELS,
8-
REAL_BEHAVIOR_PROOF_STATUSES,
98
SECURITY_REVIEW_STATUSES,
109
} from "./clawsweeper-policy.js";
1110
import {
1211
AUTOMERGE_LABEL,
1312
HUMAN_REVIEW_LABEL,
1413
MANUAL_ONLY_LABEL,
1514
} from "./repair/exact-review-guard-labels.js";
16-
import type { AttachedLiveVerification } from "./live-proof/verification.js";
15+
import type { RealBehaviorProofPolicy } from "./clawsweeper-proof-policy.js";
1716
import type {
1817
FeatureShowcase,
1918
FeatureShowcaseStatus,
@@ -22,8 +21,6 @@ import type {
2221
MergeRiskOptionCategory,
2322
OverallCorrectness,
2423
PrStatusLabelKind,
25-
RealBehaviorProof,
26-
RealBehaviorProofStatus,
2724
ReviewFinding,
2825
SecurityReview,
2926
SecurityReviewStatus,
@@ -34,9 +31,8 @@ interface LabelPolicyDependencies {
3431
frontMatterValue: (markdown: string, key: string) => string | undefined;
3532
isAutomationReportAuthor: (author: string | undefined) => boolean;
3633
mergeRiskOptionsFromReport: (markdown: string) => MergeRiskOption[];
37-
reportAttachedLiveVerification: (markdown: string) => AttachedLiveVerification;
3834
reportOverallCorrectness: (markdown: string) => OverallCorrectness;
39-
reportRealBehaviorProof: (markdown: string) => RealBehaviorProof;
35+
reportRealBehaviorProofPolicy: (markdown: string) => RealBehaviorProofPolicy;
4036
reportReviewFindings: (markdown: string) => ReviewFinding[];
4137
reportSecurityReview: (markdown: string) => SecurityReview;
4238
stringOrUndefined: (value: unknown) => string | undefined;
@@ -48,9 +44,8 @@ export function createLabelPolicy({
4844
frontMatterValue,
4945
isAutomationReportAuthor,
5046
mergeRiskOptionsFromReport,
51-
reportAttachedLiveVerification,
5247
reportOverallCorrectness,
53-
reportRealBehaviorProof,
48+
reportRealBehaviorProofPolicy,
5449
reportReviewFindings,
5550
reportSecurityReview,
5651
stringOrUndefined,
@@ -127,18 +122,6 @@ export function createLabelPolicy({
127122
});
128123
}
129124

130-
function proofIsUnresolved(proof: Pick<RealBehaviorProof, "status">): boolean {
131-
return (
132-
proof.status === "missing" || proof.status === "mock_only" || proof.status === "insufficient"
133-
);
134-
}
135-
136-
function proofNeedsContributorAction(
137-
proof: Pick<RealBehaviorProof, "status" | "needsContributorAction">,
138-
): boolean {
139-
return proofIsUnresolved(proof) && proof.needsContributorAction;
140-
}
141-
142125
function hasBlockingReviewFindings(
143126
findings: readonly Pick<ReviewFinding, "priority">[],
144127
): boolean {
@@ -160,22 +143,22 @@ export function createLabelPolicy({
160143
}
161144

162145
function hasUnresolvedContributorWork(options: {
163-
realBehaviorProof: Pick<RealBehaviorProof, "status" | "needsContributorAction">;
146+
proofPolicy: Pick<RealBehaviorProofPolicy, "blocksMerge" | "needsContributorAction">;
164147
reviewFindings: readonly Pick<ReviewFinding, "priority">[];
165148
securityReview: Pick<SecurityReview, "status">;
166149
mergeRiskOptions: readonly Pick<MergeRiskOption, "category" | "recommended">[];
167150
overallCorrectness: OverallCorrectness;
168151
}): boolean {
169152
return (
170-
proofNeedsContributorAction(options.realBehaviorProof) ||
153+
options.proofPolicy.needsContributorAction ||
171154
hasBlockingReviewFindings(options.reviewFindings) ||
172155
securityReviewNeedsContributorWork(options) ||
173156
options.overallCorrectness === "patch is incorrect"
174157
);
175158
}
176159

177160
function isReadyForMaintainerLook(options: {
178-
realBehaviorProof: Pick<RealBehaviorProof, "status" | "needsContributorAction">;
161+
proofPolicy: Pick<RealBehaviorProofPolicy, "blocksMerge" | "needsContributorAction">;
179162
reviewFindings: readonly Pick<ReviewFinding, "priority">[];
180163
securityReview: Pick<SecurityReview, "status">;
181164
mergeRiskOptions: readonly Pick<MergeRiskOption, "category" | "recommended">[];
@@ -184,15 +167,14 @@ export function createLabelPolicy({
184167
return (
185168
!hasBlockingReviewFindings(options.reviewFindings) &&
186169
!securityReviewNeedsContributorWork(options) &&
187-
(options.realBehaviorProof.status === "sufficient" ||
188-
options.realBehaviorProof.status === "override" ||
189-
options.realBehaviorProof.status === "not_applicable") &&
170+
!options.proofPolicy.blocksMerge &&
190171
options.overallCorrectness === "patch is correct"
191172
);
192173
}
193174

194175
function prStatusLabelKind(options: {
195-
realBehaviorProof: Pick<RealBehaviorProof, "status" | "needsContributorAction">;
176+
reviewFailed: boolean;
177+
proofPolicy: Pick<RealBehaviorProofPolicy, "blocksMerge" | "needsContributorAction">;
196178
reviewFindings: readonly Pick<ReviewFinding, "priority">[];
197179
securityReview: Pick<SecurityReview, "status">;
198180
mergeRiskOptions: readonly Pick<MergeRiskOption, "category" | "recommended">[];
@@ -206,8 +188,9 @@ export function createLabelPolicy({
206188
if (options.hasRepairLoopPauseLabel) return null;
207189
if (options.hasRecentReReviewRequest) return "re_review_loop";
208190
if (options.hasRecentAuthorActivity && unresolvedWork) return "actively_grinding";
209-
if (proofNeedsContributorAction(options.realBehaviorProof)) return "needs_proof";
210-
if (proofIsUnresolved(options.realBehaviorProof)) return "needs_maintainer_proof_decision";
191+
if (options.proofPolicy.needsContributorAction) return "needs_proof";
192+
if (options.proofPolicy.blocksMerge) return "needs_maintainer_proof_decision";
193+
if (options.reviewFailed) return null;
211194
if (unresolvedWork) return "waiting_on_author";
212195
if (options.hasAutomergeLabel) return "automerge_armed";
213196
if (isReadyForMaintainerLook(options)) return "ready_for_maintainer_look";
@@ -308,15 +291,9 @@ export function createLabelPolicy({
308291
currentLabels: readonly string[],
309292
): PrStatusLabelKind | null {
310293
if (frontMatterValue(markdown, "type") !== "pull_request") return null;
311-
const proof = reportRealBehaviorProof(markdown);
312-
const attached = reportAttachedLiveVerification(markdown);
313-
const statusProof =
314-
(attached.status === "failed" || attached.status === "malformed") &&
315-
!proofNeedsContributorAction(proof)
316-
? { status: "insufficient" as const, needsContributorAction: false }
317-
: proof;
318294
return prStatusLabelKind({
319-
realBehaviorProof: statusProof,
295+
reviewFailed: frontMatterValue(markdown, "review_status") === "failed",
296+
proofPolicy: reportRealBehaviorProofPolicy(markdown),
320297
reviewFindings: reportReviewFindings(markdown),
321298
securityReview: reportSecurityReview(markdown),
322299
mergeRiskOptions: mergeRiskOptionsFromReport(markdown),
@@ -364,14 +341,14 @@ export function createLabelPolicy({
364341
{ comments: [...(options.comments ?? [])] },
365342
options.reviewedAt ?? "2026-01-01T00:00:00Z",
366343
);
344+
const unresolvedProof = ["missing", "mock_only", "insufficient"].includes(
345+
options.proofStatus ?? "",
346+
);
367347
const statusKind = prStatusLabelKind({
368-
realBehaviorProof: {
369-
status: REAL_BEHAVIOR_PROOF_STATUSES.has(options.proofStatus as RealBehaviorProofStatus)
370-
? (options.proofStatus as RealBehaviorProofStatus)
371-
: "not_applicable",
372-
needsContributorAction:
373-
options.needsContributorAction ??
374-
["missing", "mock_only", "insufficient"].includes(options.proofStatus ?? ""),
348+
reviewFailed: false,
349+
proofPolicy: {
350+
blocksMerge: unresolvedProof,
351+
needsContributorAction: unresolvedProof && (options.needsContributorAction ?? true),
375352
},
376353
reviewFindings: (options.findingPriorities ?? [])
377354
.filter((priority): priority is 0 | 1 | 2 | 3 => [0, 1, 2, 3].includes(priority))

‎src/clawsweeper-label-presentation.ts‎

Lines changed: 10 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,11 +52,13 @@ export function createReportLabelPresentation(
5252
nextTelegramVisibleProofLabels,
5353
prStatusLabelForKind,
5454
prStatusLabelKindFromReportLabels,
55+
publicHistoricalVerificationBlockerLine,
5556
publicRealBehaviorProofLine,
5657
reportFeatureShowcase,
5758
reportOverallCorrectness,
5859
reportPrRating,
5960
reportRealBehaviorProof,
61+
reportRealBehaviorProofPolicy,
6062
reportSecurityReview,
6163
reportTelegramVisibleProof,
6264
sentence,
@@ -320,6 +322,7 @@ export function createReportLabelPresentation(
320322
const isPullRequest = frontMatterValue(markdown, "type") === "pull_request";
321323
const realBehaviorProof = reportRealBehaviorProof(markdown);
322324
if (isPullRequest && frontMatterValue(markdown, "review_status") !== "failed") {
325+
const proofPolicy = reportRealBehaviorProofPolicy(markdown);
323326
const rating = reportPrRating(markdown);
324327
const ratingLabel = ratingLabelForTier(rating.overallTier).name;
325328
const previousRatingLabel = frontMatterStringArray(markdown, "labels").find(
@@ -328,11 +331,15 @@ export function createReportLabelPresentation(
328331
const changed = previousRatingLabel
329332
? ` Replaced prior ${inlineCode(previousRatingLabel)}.`
330333
: "";
334+
const requiredProofContext =
335+
proofPolicy.proofBlocksMerge && proofPolicy.assessment.status === "not_applicable"
336+
? " This is the recorded reviewer rating; real behavior proof remains required by host policy."
337+
: "";
331338
add(
332339
ratingLabel,
333340
`Overall readiness is ${themedRatingName(rating.overallTier)}; proof is ${themedRatingName(
334341
rating.proofTier,
335-
)} and patch quality is ${themedRatingName(rating.patchTier)}.${changed}`,
342+
)} and patch quality is ${themedRatingName(rating.patchTier)}.${changed}${requiredProofContext}`,
336343
);
337344
const featureShowcase = reportFeatureShowcase(markdown);
338345
if (
@@ -355,8 +362,8 @@ export function createReportLabelPresentation(
355362
add(
356363
prStatusLabelForKind(statusKind).name,
357364
`${prStatusLabelForKind(statusKind).description} ${publicRealBehaviorProofLine(
358-
realBehaviorProof,
359-
)}`,
365+
proofPolicy,
366+
)}${proofPolicy.verificationBlocksMerge ? ` ${publicHistoricalVerificationBlockerLine()}` : ""}`,
360367
);
361368
}
362369
if (realBehaviorProof.status === "sufficient") {

‎src/clawsweeper-orchestration-foundation.ts‎

Lines changed: 2 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import { hasDataModelUpgradeProof } from "./clawsweeper-change-detection.js";
22
import { createLabelSynchronization } from "./clawsweeper-label-sync.js";
3-
import { AUTHORITY_CHAIN_PROOF_MARKER, PROOF_OVERRIDE_LABEL } from "./clawsweeper-policy.js";
43
import type {
54
CloseReason,
65
Evidence,
@@ -35,8 +34,6 @@ export function createReportOrchestrationFoundation(
3534
isBulkFilerExemptAuthorAssociation,
3635
isBulkFilerExemptRepositoryPermission,
3736
isDigitsOnly,
38-
isDocsOnlyPullRequestReport,
39-
isExternalPullRequestReport,
4037
labelPolicy,
4138
markdownLink,
4239
markdownRepository,
@@ -45,8 +42,7 @@ export function createReportOrchestrationFoundation(
4542
publicReviewTextDiffers,
4643
publicTableCell,
4744
repoUrlFor,
48-
reportAttachedLiveVerification,
49-
reportRealBehaviorProof,
45+
reportRealBehaviorProofPolicy,
5046
reportSecurityReview,
5147
reviewSectionValue,
5248
sentence,
@@ -461,25 +457,7 @@ export function createReportOrchestrationFoundation(
461457
} = labelSynchronization;
462458

463459
function realBehaviorProofBlocksMerge(markdown: string): boolean {
464-
const attached = reportAttachedLiveVerification(markdown);
465-
if (attached.status === "failed" || attached.status === "malformed") return true;
466-
if (frontMatterValue(markdown, "review_status") === "failed") return false;
467-
if (frontMatterStringArray(markdown, "labels").includes(PROOF_OVERRIDE_LABEL)) return false;
468-
if (isDocsOnlyPullRequestReport(markdown)) return false;
469-
const proof = reportRealBehaviorProof(markdown);
470-
const authorityChainProofRequired = reviewSectionValue(markdown, "realBehaviorProof")
471-
.split("\n")
472-
.some((line) => line.trimStart().startsWith(`Summary: ${AUTHORITY_CHAIN_PROOF_MARKER}`));
473-
if (!isExternalPullRequestReport(markdown) && !authorityChainProofRequired) {
474-
return false;
475-
}
476-
return (
477-
proof.needsContributorAction ||
478-
proof.status === "missing" ||
479-
proof.status === "mock_only" ||
480-
proof.status === "insufficient" ||
481-
(proof.status !== "sufficient" && proof.status !== "override")
482-
);
460+
return reportRealBehaviorProofPolicy(markdown).blocksMerge;
483461
}
484462

485463
function normalizedLabelSet(labels: readonly string[]): Set<string> {

‎src/clawsweeper-proof-policy.ts‎

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
import { AUTHORITY_CHAIN_PROOF_MARKER, PROOF_OVERRIDE_LABEL } from "./clawsweeper-policy.js";
2+
import type { RealBehaviorProof } from "./clawsweeper-types.js";
3+
import type { AttachedLiveVerification } from "./live-proof/verification.js";
4+
5+
export interface RealBehaviorProofPolicy {
6+
readonly assessment: RealBehaviorProof;
7+
readonly required: boolean;
8+
readonly proofBlocksMerge: boolean;
9+
readonly verificationBlocksMerge: boolean;
10+
readonly needsContributorAction: boolean;
11+
readonly blocksMerge: boolean;
12+
}
13+
14+
interface ProofPolicyDependencies {
15+
frontMatterValue: (markdown: string, key: string) => string | undefined;
16+
frontMatterStringArray: (markdown: string, key: string) => string[];
17+
isDocsOnlyPullRequestReport: (markdown: string) => boolean;
18+
isExternalPullRequestReport: (markdown: string) => boolean;
19+
reportAttachedLiveVerification: (markdown: string) => AttachedLiveVerification;
20+
reportRealBehaviorProof: (markdown: string) => RealBehaviorProof;
21+
reviewSectionValue: (markdown: string, key: "realBehaviorProof") => string;
22+
}
23+
24+
export function createRealBehaviorProofPolicy(dependencies: ProofPolicyDependencies) {
25+
const {
26+
frontMatterValue,
27+
frontMatterStringArray,
28+
isDocsOnlyPullRequestReport,
29+
isExternalPullRequestReport,
30+
reportAttachedLiveVerification,
31+
reportRealBehaviorProof,
32+
reviewSectionValue,
33+
} = dependencies;
34+
35+
return function reportRealBehaviorProofPolicy(markdown: string): RealBehaviorProofPolicy {
36+
const assessment = reportRealBehaviorProof(markdown);
37+
const attached = reportAttachedLiveVerification(markdown);
38+
const verificationBlocksMerge = attached.status === "failed" || attached.status === "malformed";
39+
const authorityChainProofRequired = reviewSectionValue(markdown, "realBehaviorProof")
40+
.split("\n")
41+
.some((line) => line.trimStart().startsWith(`Summary: ${AUTHORITY_CHAIN_PROOF_MARKER}`));
42+
const required =
43+
frontMatterValue(markdown, "review_status") !== "failed" &&
44+
!frontMatterStringArray(markdown, "labels").includes(PROOF_OVERRIDE_LABEL) &&
45+
!isDocsOnlyPullRequestReport(markdown) &&
46+
(isExternalPullRequestReport(markdown) || authorityChainProofRequired);
47+
const proofBlocksMerge =
48+
required &&
49+
(assessment.needsContributorAction ||
50+
(assessment.status !== "sufficient" && assessment.status !== "override"));
51+
return {
52+
assessment,
53+
required,
54+
proofBlocksMerge,
55+
verificationBlocksMerge,
56+
// N/A cannot exempt applicable PRs. Receipt failures remain maintainer-owned.
57+
needsContributorAction:
58+
proofBlocksMerge &&
59+
(assessment.needsContributorAction || assessment.status === "not_applicable"),
60+
blocksMerge: proofBlocksMerge || verificationBlocksMerge,
61+
};
62+
};
63+
}

0 commit comments

Comments
 (0)