gitoria

gitoria

All repositories: gitoria

ReadmeCodePull requestsReleasesTicketsSettings
Commit477d7bdc477d7bdcMerge branch 'p50'mre477d7bdc/tests/cleanup-browser.mjs

23.5 KB

  1. // W60: one own plain tab in the existing Chrome, real clicks and keys, own test storage.
  2. // Usage: TMPDIR=<scratch>/tmp HL_CDP_URL=http://127.0.0.1:9223 node tests/cleanup-browser.mjs <old app> <output root>
  3. import { spawn, execFileSync } from 'node:child_process';
  4. import { createServer } from 'node:http';
  5. import { mkdirSync, writeFileSync, readFileSync, existsSync } from 'node:fs';
  6. import { resolve, join } from 'node:path';
  7. import { launchBrowser } from './cdp.mjs';
  8. import { startIdent } from './identkit.mjs';
  9. const CLIENT = process.argv[2] === '--client';
  10. const OUT = resolve(process.argv[3]), CURRENT = resolve('.'), OLD = CLIENT ? null : resolve(process.argv[2]);
  11. const CONFIG = CLIENT ? JSON.parse(readFileSync(join(OUT,'client-config.json'),'utf8')) : null;
  12. const PORT = 8731, IPORT = 8732, TPORT = 8733;
  13. const J = JSON.stringify, sleep = ms => new Promise(r => setTimeout(r, ms));
  14. let passed = 0, failed = 0, browser, page, ident, server, fixture;
  15. const pids = [], shots = [];
  16. function check(name, ok) { console.log(`${ok ? 'ok' : 'FAIL'} ${name}`); ok ? passed++ : failed++; }
  17. function track(name, p) { pids.push({name,pid:p.pid}); console.log('PROCESS', name, p.pid); return p; }
  18. async function stop(p) { if (!p || p.exitCode !== null || p.signalCode !== null) return; p.kill('SIGTERM'); await Promise.race([new Promise(r=>p.once('exit',r)),sleep(3000)]); }
  19. async function up(url) { for (const end = Date.now()+240000; Date.now()<end;) { try { if ((await fetch(url)).ok) return; } catch {} await sleep(250); } throw new Error('server did not start '+url); }
  20. async function go(url, ready) { await page.goto(url); await page.waitForSelector(ready,{timeout:30000}); await page.waitFor('!!window.__hl && window.__hl.socket && window.__hl.socket.readyState === 1',{timeout:30000}); }
  21. async function shot(tag,name,width) {
  22. console.log('SHOT',tag,name,width);
  23. const sels={repositories:'#createform',org:'#orgform',tokens:'#tokenform',keys:'#keyform',settings:'#memberform',app:'#appform',tickets:'#newticketform',pr:'#commentform',drafts:'#threadlist form'};
  24. const sel=sels[name];await page.evaluate(`document.activeElement?.blur();${sel?`document.querySelector(${J(sel)}).scrollIntoView({block:'center'});`:''}window.scrollX`);await sleep(150);
  25. const path=join(OUT,`${tag}-${name}-${width}.png`);let data;const errors=[];for(const attempt of [1,2]){try{({data}=await page.send('Page.captureScreenshot',{format:'png',captureBeyondViewport:false,fromSurface:false}));break;}catch(e){errors.push(e.message);console.log('SCREENSHOT TIMEOUT',tag,name,width,'attempt',attempt);if(attempt===1){console.log('RETRY SCREENSHOT ONCE',tag,name,width);await sleep(250);}}}if(errors.length)writeFileSync(path.replace('.png','-capture-attempts.json'),J({name,width,errors,succeeded:!!data}));if(!data){failed++;console.log('FAIL screenshot after one retry',tag,name,width);return;}writeFileSync(path,Buffer.from(data,'base64'));shots.push(path);
  26. const timeRects=await page.evaluate(`(()=>{const out=[];const walk=document.createTreeWalker(document.body,NodeFilter.SHOW_TEXT);while(walk.nextNode()){const n=walk.currentNode;if(!/20[0-9]{2}-[0-9]{2}-[0-9]{2}/.test(n.textContent)||n.parentElement.closest('script,style'))continue;const range=document.createRange();range.selectNode(n);const r=range.getBoundingClientRect();if(r.width&&r.height)out.push({x:r.x,y:r.y,width:r.width,height:r.height,text:n.textContent})}for(const sel of ['#tokensecret','#shownkey','#shownsecret']){const e=document.querySelector(sel);if(!e)continue;const r=e.getBoundingClientRect();if(r.width&&r.height)out.push({x:r.x,y:r.y,width:r.width,height:r.height,kind:'one-time test credential'})}return out})()`);writeFileSync(path.replace('.png','-time-rects.json'),J(timeRects));
  27. if(sel){const clip=await page.evaluate(`(()=>{const b=document.querySelector(${J(sel)}).getBoundingClientRect();return {x:b.x,y:b.y,width:b.width,height:b.height}})()`);writeFileSync(path.replace('.png','-control-rect.json'),J(clip));}
  28. }
  29. const val = sel => page.evaluate(`document.querySelector(${J(sel)}).value`);
  30. async function clear(sel) { await page.focus(sel); await page.send('Input.dispatchKeyEvent',{type:'keyDown',key:'a',code:'KeyA',modifiers:2,windowsVirtualKeyCode:65});await page.send('Input.dispatchKeyEvent',{type:'keyUp',key:'a',code:'KeyA',modifiers:2,windowsVirtualKeyCode:65});await page.send('Input.dispatchKeyEvent',{type:'keyDown',key:'Backspace',code:'Backspace',windowsVirtualKeyCode:8});await page.send('Input.dispatchKeyEvent',{type:'keyUp',key:'Backspace',code:'Backspace',windowsVirtualKeyCode:8}); }
  31. async function shClick(selector) { const b=await page.waitFor(`(()=>{const e=document.querySelector('#selector')?.shadowRoot?.querySelector(${J(selector)});if(!e)return null;e.scrollIntoView({block:'center'});const b=e.getBoundingClientRect();return b.width?{x:b.left+b.width/2,y:b.top+b.height/2}:null})()`,{timeout:30000});for(const [type,buttons]of[['mouseMoved',0],['mousePressed',1],['mouseReleased',0]])await page.send('Input.dispatchMouseEvent',{...b,type,buttons,button:'left',clickCount:1}); }
  32. async function httpFace(base,cookie,event,payload) { const r=await fetch(base+'/__hl/emit',{method:'POST',headers:{cookie,'content-type':'application/json'},body:J({t:'emit',i:Date.now(),event,payload})});const j=await r.json();return j.value; }
  33. if (!CLIENT) {
  34. try {
  35. mkdirSync(OUT,{recursive:true});
  36. // A dedicated HTTP fixture for the external tickets service. Every write stays in this process.
  37. let tickets=[];
  38. fixture=createServer(async(req,res)=>{ const u=new URL(req.url,`http://127.0.0.1:${TPORT}`);let b='';for await(const c of req)b+=c;
  39. if(u.pathname==='/connect'){res.writeHead(302,{location:u.searchParams.get('return')+'?code=w60&state='+encodeURIComponent(u.searchParams.get('state'))});res.end();return;}
  40. res.setHeader('content-type','application/json');
  41. if(u.pathname==='/api/connect/exchange'){res.end(J({key:'tktc_w60',project:'w60',title:'W60 test tickets',api:`http://127.0.0.1:${TPORT}/api/projects/w60`}));return;}
  42. if(u.pathname==='/api/projects/w60/tickets'&&req.method==='POST'){const j=JSON.parse(b);const t={number:tickets.length+1,subject:j.subject,state:'Open',stateSlug:'open',created:'2026-11-06',updated:'2026-11-06',href:'/projects/w60/'+(tickets.length+1)};tickets.unshift(t);res.writeHead(201);res.end(J({ticket:t}));return;}
  43. if(u.pathname==='/api/projects/w60/tickets'){res.end(J({tickets}));return;}res.end('{}');
  44. });await new Promise(r=>fixture.listen(TPORT,'127.0.0.1',r));
  45. ident=await startIdent({identDir:'/media/STORAGE/projects/WorldAPI/ident.worldapi.org',workDir:join(OUT,'ident'),port:IPORT});track('ident',ident.proc);
  46. const alice=await ident.signIn('[email protected]'), bob=await ident.signIn('[email protected]');
  47. if(!existsSync(join(OUT,'test-key.pub')))execFileSync('ssh-keygen',['-q','-t','ed25519','-N','','-f',join(OUT,'test-key')]);
  48. for(const[tag,appDir]of(process.env.W60_AFTER_ONLY==='1'?[['after',CURRENT]]:process.env.W60_BEFORE_ONLY==='1'?[['before',OLD]]:[['before',OLD],['after',CURRENT]])){
  49. tickets=[];const base=`http://w60v3-${tag}.localhost:${PORT}`, repo=`http://alpha.w60v3-${tag}.localhost:${PORT}`;
  50. const store=join(OUT,tag);mkdirSync(store,{recursive:true});
  51. const app=await ident.registerApp(alice,'W60 '+tag,[base,`http://*.w60v3-${tag}.localhost:${PORT}`]);
  52. server=track('gitoria-'+tag,spawn(join(appDir,'bin/hybriel'),['project.hl'],{cwd:appDir,env:{...process.env,GITORIA_PORT:String(PORT),GITORIA_STORAGE:join(store,'mpackdb'),GITORIA_GIT:join(store,'git'),GITORIA_SESSIONS:join(store,'sessions')+'/',GITORIA_WATCH:'0',GITORIA_PUBLIC_URL:base,GITORIA_SSH_SECRET:'w60-fixture',GITORIA_APP_HOSTS:`http://127.0.0.1:${TPORT}`,GITORIA_TICKETS_URL:`http://127.0.0.1:${TPORT}`,IDENT_URL:`http://ident.w60v3-${tag}.localhost:${IPORT}`,IDENT_EXCHANGE_URL:ident.base,IDENT_API_KEY:app.key,IDENT_API_SECRET:app.secret},stdio:['ignore','pipe','pipe']}));
  53. const log=[];server.stdout.on('data',x=>log.push(x));server.stderr.on('data',x=>log.push(x));await up(`http://127.0.0.1:${PORT}/api/repos`);
  54. // Seed Bob's name in this test store so Alice can add him through the member form.
  55. const cb=await fetch(`http://127.0.0.1:${PORT}/login/callback?ident_code=`+await ident.selectorCode(bob,app,base),{redirect:'manual'});const bobCookie=cb.headers.get('set-cookie').split(';')[0];await httpFace(`http://127.0.0.1:${PORT}`,bobCookie,'gitoriaSaveName',['Bob']);
  56. const cfg={tag,base,repo,store,alice,app,bobCookie,key:readFileSync(join(OUT,'test-key.pub'),'utf8').trim()};
  57. writeFileSync(join(OUT,'client-config.json'),J(cfg));
  58. const child=spawn('flock',['/media/STORAGE/claude-scratch/atlas/lisbeth.lock',process.execPath,resolve('tests/cleanup-browser.mjs'),'--client',OUT],{cwd:CURRENT,env:process.env,stdio:'inherit'});track('chrome-client-'+tag,child);
  59. const status=await new Promise(r=>child.once('exit',r));check(tag+' Chrome client completes',status===0);
  60. await stop(server);writeFileSync(join(OUT,tag+'-server.log'),Buffer.concat(log));server=null;
  61. }
  62. } catch(e){failed++;console.log('FAIL walk',e.stack);if(page)console.log('CONSOLE',page.dumpConsole().slice(-2500));}
  63. finally{
  64. try{if(page){await page.setOffline(false);await page.close();}}catch{}
  65. try{if(browser)browser.disconnect();}catch{}
  66. await stop(server);if(ident)await ident.stop();if(fixture)await new Promise(r=>fixture.close(r));
  67. writeFileSync(join(OUT,'processes.json'),J(pids,null,2));writeFileSync(join(OUT,'screenshots.json'),J(shots,null,2));
  68. try{const final=await(await fetch('http://127.0.0.1:9223/json/list')).json();writeFileSync(join(OUT,'targets-after.json'),J(final,null,2));}catch{}
  69. console.log(`${passed} passed, ${failed} failed`);
  70. }
  71. process.exitCode=failed?1:0;
  72. } else {
  73. try {
  74. const {tag,base,repo,store,alice,app,bobCookie,key}=CONFIG;
  75. const initial=await(await fetch('http://127.0.0.1:9223/json/list')).json();writeFileSync(join(OUT,tag+'-targets-before.json'),J(initial,null,2));
  76. browser=await launchBrowser();browser.disconnect=()=>browser.conn.close();page=await browser.newPage();writeFileSync(join(OUT,tag+'-owned-target.txt'),page.targetId);await browser.conn.send('Target.activateTarget',{targetId:page.targetId});
  77. // Log in through the actual ident selector, including its hidden bound code bridge.
  78. const[n,v]=alice.cookie.split('=');await page.send('Network.setCookie',{name:n,value:v,url:`http://ident.w60v3-${tag}.localhost:${IPORT}/`,httpOnly:true});
  79. await page.send('Emulation.setDeviceMetricsOverride',{width:390,height:844,deviceScaleFactor:1,mobile:true});
  80. await go(base+'/','#heading');await page.evaluate(`window.__w60Login=0;window.__w60Marker=1;document.querySelector('#identcode').addEventListener('change',()=>window.__w60Login++)`);await shClick('#choose');await shClick('[part~="identity"]');
  81. await page.waitForSelector('#nameform',{timeout:30000});await page.type('#displayname','Alice');await page.click('#namesave');await page.waitForSelector('#createform',{timeout:30000});check(`${tag}: hidden identcode login without reload`,await page.evaluate(`window.__w60Login===1&&window.__w60Marker===1&&document.querySelector('#identcode').value===''`));
  82. let prSeeded=false;
  83. for(const width of [390,1280]){
  84. await page.send('Emulation.setDeviceMetricsOverride',{width,height:width===390?844:900,deviceScaleFactor:1,mobile:width<600});
  85. await go(base+'/','#createform');await shot(tag,'repositories',width);
  86. const slug=width===390?'alpha':'beta';await page.type('#slug',slug);await page.type('#description','W60 test repository');await page.click('#createsave');await page.waitFor(`document.querySelector('#created')?.textContent.includes(${J(slug)})`,{timeout:30000});
  87. check(`${tag} ${width}: repo fields clear and row appears once`,await val('#slug')===''&&await val('#description')===''&&await page.evaluate(`[...document.querySelectorAll('#repos li .repo-slug')].filter(e=>e.textContent===${J(slug)}).length===1`));
  88. // A refusal preserves the existing draft, just as on the starting tree.
  89. await page.type('#slug',slug);await page.type('#description','keep failed draft');await page.click('#createsave');await page.waitFor(`document.querySelector('#createerror').textContent.length>0`);check(`${tag} ${width}: failed repo keeps draft`,await val('#description')==='keep failed draft');await clear('#slug');await clear('#description');
  90. await shot(tag,'tokens',width);await page.type('#tokenname','Laptop '+width);await page.click('#tokensave');await page.waitFor(`document.querySelector('#tokenlist').textContent.includes('Laptop ${width}')`,{timeout:30000});check(`${tag} ${width}: token clears and appears once`,await val('#tokenname')===''&&await page.evaluate(`document.querySelectorAll('#tokenlist li').length===1`));await page.click('#tokenlist button');await page.waitFor(`document.querySelectorAll('#tokenlist li').length===0`);
  91. await shot(tag,'keys',width);await page.type('#keyname','Laptop '+width);await page.type('#keytext',key);await page.click('#keysave');await page.waitFor(`document.querySelector('#keylist').textContent.includes('Laptop ${width}')`,{timeout:30000});console.log('KEY MEASURE',tag,width,J({name:await val('#keyname'),text:await val('#keytext'),rows:await page.evaluate(`document.querySelectorAll('#keylist li').length`)}));check(`${tag} ${width}: key clears and appears once`,await val('#keyname')===''&&await val('#keytext')===''&&await page.evaluate(`document.querySelectorAll('#keylist li').length===1`));await go(base+'/','#keyform');check(`${tag} ${width}: second visit retains exactly one key`,await page.evaluate(`document.querySelectorAll('#keylist li').length===1`));await page.click('#keylist button');await page.waitFor(`document.querySelectorAll('#keylist li').length===0`);
  92. await go(base+'/','#createform');check(`${tag} ${width}: second visit has one repo and no removed credentials`,await page.evaluate(`[...document.querySelectorAll('#repos .repo-slug')].filter(e=>e.textContent===${J(slug)}).length===1&&document.querySelectorAll('#keylist li,#tokenlist li').length===0`));
  93. await shot(tag,'org',width);await page.type('#orgslug','team-'+width);await page.click('#orgsave');await page.waitFor(`document.querySelector('#orgs').textContent.includes('team-${width}')`,{timeout:30000});console.log('ORG MEASURE',tag,width,J({slug:await val('#orgslug'),rows:await page.evaluate(`[...document.querySelectorAll('#orgs .slug')].filter(e=>e.textContent==='team-${width}').length`)}));check(`${tag} ${width}: organization clears and appears once`,await val('#orgslug')===''&&await page.evaluate(`[...document.querySelectorAll('#orgs .slug')].filter(e=>e.textContent==='team-${width}').length===1`));await go(base+'/','#createform');check(`${tag} ${width}: second visit retains exactly one organization`,await page.evaluate(`[...document.querySelectorAll('#orgs .slug')].filter(e=>e.textContent==='team-${width}').length===1`));
  94. await go(repo+'/settings','#memberform');await shot(tag,'settings',width);await page.type('#membername','Bob');await page.click('#memberadd');await page.waitFor(`document.querySelector('#members').textContent.includes('Bob')`,{timeout:30000});check(`${tag} ${width}: member clears and appears once`,await val('#membername')===''&&await page.evaluate(`document.querySelectorAll('#members li').length===1`));
  95. await go(repo+'/settings','#memberform');check(`${tag} ${width}: second visit retains member`,await page.evaluate(`document.querySelectorAll('#members li').length===1`));await page.click('#members button');await page.waitFor(`document.querySelectorAll('#members li').length===0`);
  96. await shot(tag,'app',width);await page.type('#appname','Review '+width);await page.type('#apphook',`http://127.0.0.1:${TPORT}/receiver`);await page.click('#appadd');await page.waitFor(`document.querySelector('#applist').textContent.includes('Review ${width}')`,{timeout:30000});check(`${tag} ${width}: app fields clear`,await val('#appname')===''&&await val('#apphook')==='');
  97. await page.type('#requiredcontext','build');await page.click('#requiredadd');await page.waitFor(`document.querySelector('#requiredlist').textContent.includes('build')`,{timeout:30000});check(`${tag} ${width}: required context clears`,await val('#requiredcontext')==='');await page.click('#requiredlist button');await page.waitFor(`document.querySelectorAll('#requiredlist li').length===0`);
  98. await page.click('#connecttickets');await page.waitFor(`document.querySelector('#connectedto')?.textContent.includes('W60 test tickets')`,{timeout:30000});
  99. await go(repo+'/tickets','#newticket');await page.click('#newticket > summary');await shot(tag,'tickets',width);const subject='Ticket '+width;await page.type('#ticketsubject',subject);await page.type('#ticketsummary','A test ticket');await page.click('#ticketsave');await page.waitFor(`document.querySelector('#ticketlist')?.textContent.includes(${J(subject)})`,{timeout:30000});check(`${tag} ${width}: ticket fields clear and row appears once`,await val('#ticketsubject')===''&&await val('#ticketsummary')===''&&await page.evaluate(`[...document.querySelectorAll('#ticketlist .ticket-subject')].filter(e=>e.textContent===${J(subject)}).length===1`));
  100. await go(repo+'/tickets','#ticketlist');check(`${tag} ${width}: second visit retains ticket once`,await page.evaluate(`[...document.querySelectorAll('#ticketlist .ticket-subject')].filter(e=>e.textContent===${J(subject)}).length===1`));
  101. if(!prSeeded){
  102. const W=join(store,'pr-work');mkdirSync(W,{recursive:true});const env={...process.env,GIT_AUTHOR_NAME:'Alice',GIT_AUTHOR_EMAIL:'[email protected]',GIT_COMMITTER_NAME:'Alice',GIT_COMMITTER_EMAIL:'[email protected]',GIT_AUTHOR_DATE:'2020-01-01T12:00:00Z',GIT_COMMITTER_DATE:'2020-01-01T12:00:00Z'};
  103. const git=(...args)=>execFileSync('git',args,{cwd:W,env,encoding:'utf8',stdio:['ignore','pipe','pipe']}).trim();git('init','-q','-b','main');writeFileSync(join(W,'base.txt'),'base\n');git('add','.');git('commit','-q','-m','base');git('push','-q',join(store,'git','alpha.git'),'main');git('checkout','-q','-b','feat');writeFileSync(join(W,'f.txt'),'one\ntwo\nthree\n');git('add','.');git('commit','-q','-m','|||PR Review this change');const head=git('rev-parse','HEAD');git('push','-q',join(store,'git','alpha.git'),'feat');
  104. const api=async(method,path,obj,token)=>page.evaluate(`fetch(${J('/api'+path)},{method:${J(method)},headers:{'content-type':'application/json',...((${J(token||'')})?{authorization:'Bearer '+${J(token||'')}}:{})},body:${obj===undefined?'undefined':J(J(obj))}}).then(async r=>({status:r.status,json:await r.json()}))`);
  105. await go(repo+'/pulls','repo-pulls');await go(repo+'/settings','#appform');const secret=await page.evaluate(`document.querySelector('#shownkey')?.textContent||''`);
  106. // The one-time UI key is kept by the test before leaving Settings.
  107. let appKey=secret;if(!appKey){const cookies=(await page.cookies([base])).find(x=>x.name==='gitoriasid');const added=await httpFace(`http://127.0.0.1:${PORT}`,cookies.name+'='+cookies.value,'gitoriaAppAdd',['alpha','Thread fixture',`http://127.0.0.1:${TPORT}/receiver`]);appKey=added.key;}
  108. const issued=await api('POST','/apps/token',undefined,appKey);if(issued.status!==200)throw new Error('app token setup '+J(issued));const review=await api('POST','/pulls/1/reviews',{head,verdict:'comment',body:'Two thread fixture',comments:[{path:'f.txt',line:1,body:'First thread'},{path:'f.txt',line:2,body:'Second thread'}]},issued.json.token);if(review.status!==201)throw new Error('review setup '+J(review));prSeeded=true;
  109. }
  110. await go(repo+'/pulls/1','#commentform');await shot(tag,'pr',width);const comment='Comment '+width;await page.type('#commentbody',comment);await page.click('#commentsave');await page.waitFor(`document.querySelector('#conversation').textContent.includes(${J(comment)})`,{timeout:30000});check(`${tag} ${width}: PR comment clears and appears once`,await val('#commentbody')===''&&await page.evaluate(`[...document.querySelectorAll('#conversation li')].filter(e=>e.textContent.includes(${J(comment)})).length===1`));
  111. const markThreads=()=>page.evaluate(`for(const li of document.querySelectorAll('#threadlist > li')){const where=li.querySelector('code.where').textContent;li.setAttribute('data-w60-thread',where)}`);await markThreads();const firstThread='#threadlist > li[data-w60-thread="f.txt:1"]',secondThread='#threadlist > li[data-w60-thread="f.txt:2"]';const one=firstThread+' form textarea',two=secondThread+' form textarea',saveOne=firstThread+' form button[type=submit]',saveTwo=secondThread+' form button[type=submit]';
  112. await shot(tag,'drafts',width);await page.type(one,'First draft '+width);await page.type(two,'Second draft '+width);console.log('DRAFT MEASURE',tag,width,J({first:await val(one),second:await val(two)}));check(`${tag} ${width}: two simultaneous reply drafts stay separate`,await val(one)==='First draft '+width&&await val(two)==='Second draft '+width);
  113. // A whitespace body reaches the server and is refused; HTML required does not reject it.
  114. await clear(one);await page.type(one,' ');await page.click(saveOne);await page.waitFor(`document.querySelector('#pullerror').textContent.length>0`,{timeout:30000});check(`${tag} ${width}: failed reply retains both drafts`,await val(one)===' '&&await val(two)==='Second draft '+width);
  115. await clear(one);await page.type(one,'First draft '+width);await page.click(saveOne);await page.waitFor(`[...document.querySelectorAll('#threadlist > li')].some(li=>li.querySelector('code.where').textContent==='f.txt:1'&&li.textContent.includes('First draft ${width}'))`,{timeout:30000});await markThreads();check(`${tag} ${width}: only successful reply clears`,await val(one)===''&&await val(two)==='Second draft '+width);
  116. if(await val(two)!=='Second draft '+width){await clear(two);await page.type(two,'Second draft '+width);}await page.click(saveTwo);await page.waitFor(`[...document.querySelectorAll('#threadlist > li')].some(li=>li.querySelector('code.where').textContent==='f.txt:2'&&li.textContent.includes('Second draft ${width}'))`,{timeout:30000});await markThreads();check(`${tag} ${width}: second reply clears on its success`,await val(two)==='');await go(repo+'/pulls/1','#commentform');check(`${tag} ${width}: second visit retains comment and both replies`,await page.evaluate(`document.querySelector('#conversation').textContent.includes(${J(comment)})&&document.querySelector('#threadlist').textContent.includes('First draft ${width}')&&document.querySelector('#threadlist').textContent.includes('Second draft ${width}')`));
  117. await page.setOffline(true);let offlineVisible=false;try{await page.waitFor(`!!document.querySelector('#offline')`,{timeout:15000});offlineVisible=true;}catch{}check(`${tag} ${width}: Chrome offline shows exact note`,offlineVisible&&await page.evaluate(`document.querySelector('#offline')?.textContent==='You are offline. Repositories and code need the network.'`));if(!offlineVisible)console.log('OFFLINE MEASURE',JSON.stringify(await page.evaluate(`({online:navigator.onLine,visibility:document.visibilityState,animation:getComputedStyle(document.querySelector('net-probe')).animation,reduce:matchMedia('(prefers-reduced-motion: reduce)').matches})`)));await shot(tag,'offline',width);await page.setOffline(false);let hidden=false;try{await page.waitFor(`!document.querySelector('#offline')`,{timeout:15000});hidden=true;}catch{}check(`${tag} ${width}: Chrome online hides note`,hidden);
  118. }
  119. } catch(e){failed++;console.log('FAIL client',e.stack);if(page)console.log('CONSOLE',page.dumpConsole().slice(-2000));}
  120. finally{try{if(page){await page.setOffline(false);await page.close();}}catch{}try{if(browser)browser.disconnect();}catch{}const tag=CONFIG.tag;writeFileSync(join(OUT,tag+'-screenshots.json'),J(shots));writeFileSync(join(OUT,tag+'-result.json'),J({passed,failed}));try{writeFileSync(join(OUT,tag+'-targets-after.json'),J(await(await fetch('http://127.0.0.1:9223/json/list')).json(),null,2));}catch{}console.log(tag,`${passed} passed, ${failed} failed`);}
  121. process.exitCode=failed?1:0;
  122. }

Branches

Latest commits

  • 477d7bdcMerge branch 'p50'mre
  • 00efc06fP50 reportmre
  • e3f85afblog: commit mention slipmre
  • 4d1a4cf4log: #25 numbersmre
  • 1af0a60ddocs: H25 run() correctionmre
  • eefa2dbcRepo setting: refuse direct pushes to the main branch (pre-receive over HTTPS and ssh)mre
  • 8c8ba2f1log: PR flow announcedmre
  • fa00cd35log: Kunibert pings provenmre
  • 3a68cfaclog: components decisionmre
  • 87de8e31log: Kunibert connected to 9 app reposmre
  • c22aff69log: PR-only rollout startedmre
  • 25309981log: STOP and paused workers 2026-11-08mre
  • 5286803alog: worker briefs and reports of 2026-11-08mre
  • 85c86605log: 2026-11-08 Arachne on list shapemre
  • cb634512log: 2026-11-08 keyed lists livemre
  • 07c98d4aLists: keyed rows with @id, remove(id) and one whole-list assignment instead of hand-rebuilt loopsmre
  • 0db0d81elog: 2026-11-08 day52 live, W30 startedmre
  • b05f6d92tests/status: the gate's 3 s app token expired during the restart; it lives 60 s like status-keyedmre
  • 1e8f4f0avendor: Hybriel set-day52 (fault-path leak fix #335, keyed rows #331)mre
  • f5f0fb7blog: 2026-11-08 day50/#29 live, H25 correction, V52 startedmre