@@ -5376,6 +5376,57 @@ test("triage writes and reprojects aggregate-only fresh cache bodies", async ()
53765376 }
53775377} ) ;
53785378
5379+ test ( "PR proof triage keeps legacy Telegram labels visible during migration" , async ( ) => {
5380+ const originalFetch = globalThis . fetch ;
5381+ const originalCaches = globalThis . caches ;
5382+ const queries : string [ ] = [ ] ;
5383+ Object . defineProperty ( globalThis , "caches" , {
5384+ configurable : true ,
5385+ value : { default : new MemoryCache ( ) } ,
5386+ } ) ;
5387+ globalThis . fetch = async ( input ) => {
5388+ const url = new URL ( String ( input ) ) ;
5389+ if ( url . pathname . endsWith ( "/labels" ) ) {
5390+ return jsonResponse ( [
5391+ { name : "mantis: telegram-visible-proof" , color : "57606A" } ,
5392+ { name : "proof: telegram-e2e" , color : "57606A" } ,
5393+ ] ) ;
5394+ }
5395+ if ( url . pathname === "/search/issues" ) {
5396+ const query = url . searchParams . get ( "q" ) ?? "" ;
5397+ queries . push ( query ) ;
5398+ return jsonResponse ( {
5399+ total_count :
5400+ query . includes ( "mantis: telegram-visible-proof" ) && query . includes ( "proof: telegram-e2e" )
5401+ ? 1
5402+ : 0 ,
5403+ items : [ ] ,
5404+ } ) ;
5405+ }
5406+ throw new Error ( `unexpected synthetic request: ${ url . pathname } ` ) ;
5407+ } ;
5408+
5409+ try {
5410+ const response = await worker . fetch (
5411+ new Request ( "https://clawsweeper.openclaw.ai/api/pr-proof-triage" ) ,
5412+ { TARGET_REPOS : "synthetic/target" , TRIAGE_CACHE_TTL_SECONDS : "0" } ,
5413+ { waitUntil : ( ) => undefined } ,
5414+ ) ;
5415+ const snapshot = await response . json ( ) ;
5416+ assert . equal ( response . status , 200 ) ;
5417+ assert . equal ( snapshot . counts [ "telegram-proof" ] , 1 ) ;
5418+ assert . ok (
5419+ queries . some (
5420+ ( query ) =>
5421+ query . includes ( "mantis: telegram-visible-proof" ) && query . includes ( "proof: telegram-e2e" ) ,
5422+ ) ,
5423+ ) ;
5424+ } finally {
5425+ globalThis . fetch = originalFetch ;
5426+ Object . defineProperty ( globalThis , "caches" , { configurable : true , value : originalCaches } ) ;
5427+ }
5428+ } ) ;
5429+
53795430test ( "triage routes reproject raw legacy fresh caches" , async ( ) => {
53805431 const originalFetch = globalThis . fetch ;
53815432 const originalCaches = globalThis . caches ;
0 commit comments