@@ -833,6 +833,15 @@ function shouldRemoveProofSufficientLabel(
833833 return true ;
834834}
835835
836+ const negativeProofLabels = new Set ( [ NEEDS_REAL_BEHAVIOR_PROOF_LABEL , MOCK_ONLY_PROOF_LABEL ] ) ;
837+
838+ function shouldPreserveClawSweeperProofJudgment ( context , labelSet ) {
839+ return (
840+ labelSet . has ( PROOF_SUFFICIENT_LABEL ) &&
841+ ! [ "edited" , "synchronize" ] . includes ( context . payload . action )
842+ ) ;
843+ }
844+
836845async function applyPullRequestCandidateLabels ( github , context , core , pullRequest , labelSet ) {
837846 const files = await listPullRequestFiles ( github , context , pullRequest ) ;
838847 const hasExactHeadClawSweeperProof =
@@ -854,8 +863,11 @@ async function applyPullRequestCandidateLabels(github, context, core, pullReques
854863 } ,
855864 files ,
856865 ) ;
866+ const candidateLabelsToApply = shouldPreserveClawSweeperProofJudgment ( context , labelSet )
867+ ? classifiedLabels . filter ( ( label ) => ! negativeProofLabels . has ( label ) )
868+ : classifiedLabels ;
857869 const staleProofLabels = structuralProofLabelValues . filter (
858- ( label ) => labelSet . has ( label ) && ! classifiedLabels . includes ( label ) ,
870+ ( label ) => labelSet . has ( label ) && ! candidateLabelsToApply . includes ( label ) ,
859871 ) ;
860872 if (
861873 labelSet . has ( PROOF_SUFFICIENT_LABEL ) &&
@@ -870,7 +882,14 @@ async function applyPullRequestCandidateLabels(github, context, core, pullReques
870882 staleProofLabels . push ( PROOF_SUFFICIENT_LABEL ) ;
871883 }
872884 await removeLabels ( github , context , pullRequest . number , staleProofLabels , labelSet ) ;
873- await addMissingLabels ( github , context , core , pullRequest . number , classifiedLabels , labelSet ) ;
885+ await addMissingLabels (
886+ github ,
887+ context ,
888+ core ,
889+ pullRequest . number ,
890+ candidateLabelsToApply ,
891+ labelSet ,
892+ ) ;
874893}
875894
876895function isAutomationUser ( user , fallbackLogin = "" ) {
0 commit comments