@@ -162,7 +162,23 @@ describe("checkSubmissionFreshness (#3007)", () => {
162162 expect ( result ) . toEqual ( { fresh : false , reason : "already_addressed" } ) ;
163163 } ) ;
164164
165- it ( "a referencing PR with a non-string authorLogin is ignored rather than crashing or false-flagging" , async ( ) => {
165+ it ( "REGRESSION: a merged referencing PR with a missing authorLogin counts as already-addressed (fail-closed)" , async ( ) => {
166+ const { claimLedger } = stubClaimLedger ( [ activeClaim ] ) ;
167+ const { eventLedger } = stubEventLedger ( ) ;
168+ const fetchLiveIssueSnapshot = vi . fn ( async ( ) => ( {
169+ state : "open" as const ,
170+ referencingPrs : [ { number : 99 , state : "merged" as const , authorLogin : null as unknown as string , createdAt : null } ] ,
171+ } ) ) ;
172+
173+ const result = await checkSubmissionFreshness (
174+ { repoFullName : "acme/widgets" , issueNumber : 42 , minerLogin : "miner-bot" } ,
175+ { claimLedger, fetchLiveIssueSnapshot, eventLedger } ,
176+ ) ;
177+
178+ expect ( result ) . toEqual ( { fresh : false , reason : "already_addressed" } ) ;
179+ } ) ;
180+
181+ it ( "a referencing PR with a non-string authorLogin counts as already-addressed instead of being ignored" , async ( ) => {
166182 const { claimLedger } = stubClaimLedger ( [ activeClaim ] ) ;
167183 const { eventLedger } = stubEventLedger ( ) ;
168184 const fetchLiveIssueSnapshot = vi . fn ( async ( ) => ( {
@@ -175,7 +191,7 @@ describe("checkSubmissionFreshness (#3007)", () => {
175191 { claimLedger, fetchLiveIssueSnapshot, eventLedger } ,
176192 ) ;
177193
178- expect ( result ) . toEqual ( { fresh : true } ) ;
194+ expect ( result ) . toEqual ( { fresh : false , reason : "already_addressed" } ) ;
179195 } ) ;
180196
181197 it ( "a CLOSED (not merged) referencing PR from another author does not count as already-addressed" , async ( ) => {
0 commit comments