In this section
- 04 Touch Harness interaction · neural-link-between-agents / FIXES/NL-009/round1/04-touch-harness.cjs lines 1–189
- 07 Perf Edition Min storage · neural-link-between-agents / FIXES/NL-009/round1/07-perf-edition_min.py lines 1–43
- File Touch C4 render · neural-link-between-agents / FIXES/NL-010/evidence/controller-4/touch-pixel7/file-touch-c4.cjs lines 1–60
- See Through C5 render · neural-link-between-agents / FIXES/NL-010/evidence/controller-5/see-through-c5.cjs lines 1–75
- Render Pixel7 render · neural-link-between-agents / FIXES/NL-010/team-11/render-pixel7.cjs lines 1–38
- Crun automation · neural-link-between-agents / FIXES/NL-010/tools/controller/crun.sh lines 1–16
- Crun6 automation · neural-link-between-agents / FIXES/NL-010/tools/controller/crun6.sh lines 1–11
- Drift Probe render · neural-link-between-agents / FIXES/NL-010/tools/controller/drift-probe.cjs lines 1–15
04 Touch Harness
A JavaScript module in Neural Link Between Agents that works with dt last (`dtLast`) and calculates planar distances.
interactionneural-link-between-agents / FIXES/NL-009/round1/04-touch-harness.cjs · lines 1–189 of 189 · Not reached from any entry point (candidate for review) · pattern touch (shared by 11 files)
- What it does
- It loads data. Defines 9 functions or classes, including sleep, touch, touchT, seq, rec. Uses libraries playwright, fs. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'agents'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: command-line arguments.
- What it achieves
- It is built from the touch t helper (`touchT`), the seq step (`seq`) and the rec step (`rec`). Defines `sleep`, `touch`, `touchT` and 4 more. It responds to pointercancel, contextmenu and pointerup events.
- Why it matters
- No other file in the estate was found to import it.
- Application
- neural-link-between-agents · FIXES/NL-009/round1 · JavaScript module
- Uses
- playwright, fs
- Used by
- none found
- Produces
- sleep, touch, touchT, seq, rec, G, settle, VV, dtLast
- Defines here
- sleep, touch, touchT, seq, rec, G, settle, VV, dtLast
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- neural-link-between-agents@598eff3f59afe11738d64cb14cb8befe5e37cdc2 FIXES/NL-009/round1/04-touch-harness.cjs:1-189 · blob 82fa11d24cd85967b45833fce1d982d72a205756 · GitHub at these lines
- State
- achieves: name · context: auto · stage: output · effects: dom, filesystem, process · domain stage: agent_infra · users: ai_agent · canonical: unreached_review
// FABLE-04 touch harness. node touch.cjs <before|after> [device]
const { chromium, devices } = require('playwright');
const fs = require('fs');
const S = __dirname;
const mode = process.argv[2] || 'before', devName = process.argv[3] || 'Pixel 7';
const htmlPath = mode === 'before' ? S + '/index.orig.html' : S + '/index.html';
const HOOK = `
window.__k = { get:()=>({cx,cy,zoom,moved,openPanel,card:card.style.display,cardOpen:card.classList.contains('open'),pts:pts.size,edSel,edN:edPlaced.length,drag:!!drag,pinch:!!pinch,W:innerWidth,H:innerHeight}),
set:(o)=>{ if ('cx' in o) cx=o.cx; if ('cy' in o) cy=o.cy; if ('zoom' in o) zoom=o.zoom; tween=null; atHome=false; dirty=true; draw(); },
spark:(i)=>({x:edPlaced[i].x,y:edPlaced[i].y,s:edScreen(edPlaced[i])}), toWorld, key:(k)=>dispatchEvent(new KeyboardEvent('keydown',{key:k})), draw:()=>{dirty=true;draw();} };
window.edCard = (i)=>edCard(i); Object.defineProperty(window,'edSel',{set:v=>{edSel=v;},get:()=>edSel}); Object.defineProperty(window,'litRepo',{set:v=>{litRepo=v;},get:()=>litRepo});
window.__ev = { cancel:0, ctx:0, ctxPrevented:0, ups:[], clicks:[] };
addEventListener('pointercancel', ()=>__ev.cancel++, true);
addEventListener('contextmenu', e=>{ __ev.ctx++; setTimeout(()=>{ if (e.defaultPrevented) __ev.ctxPrevented++; },0); }, true);
addEventListener('pointerup', e=>__ev.ups.push([performance.now(), e.target.id||e.target.tagName]), true);
addEventListener('click', e=>__ev.clicks.push([performance.now(), e.target.id||e.target.tagName]), true);
requestAnimationFrame(frame);
</script>`;
const sleep = ms => new Promise(r => setTimeout(r, ms));
(async () => {
const html = fs.readFileSync(htmlPath, 'utf8').replace('requestAnimationFrame(frame);\n</script>', HOOK);
if (!html.includes('window.__k')) throw new Error('hook not injected');
const browser = await chromium.launch({ args:['--use-gl=angle','--use-angle=swiftshader','--enable-unsafe-swiftshader','--ignore-gpu-blocklist'] });
const ctx = await browser.newContext({ ...devices[devName] });
const page = await ctx.newPage();
const errors = []; page.on('console', m => { if (m.type() === 'error') errors.push(m.text()); }); page.on('pageerror', e => errors.push(String(e)));
await page.route('**/editions/202611012027/', r => r.fulfill({ status:200, contentType:'text/html', body:html }));
const cdp = await ctx.newCDPSession(page);
const touch = (type, pts) => cdp.send('Input.dispatchTouchEvent', { type, touchPoints: pts.map((p, i) => ({ x:p[0], y:p[1], id:i, radiusX:8, radiusY:8 })) });
const touchT = (type, pts, t) => cdp.send('Input.dispatchTouchEvent', { type, timestamp:t, touchPoints: pts.map((p, i) => ({ x:p[0], y:p[1], id:i, radiusX:8, radiusY:8 })) });
const seq = async (steps) => { const t0 = Date.now()/1000; for (const [type, pts, dt] of steps) await touchT(type, pts, t0 + dt/1000); };
const R = { mode, device:devName, results:{} };
const rec = (k, v) => { R.results[k] = v; console.log(k, JSON.stringify(v)); };
await page.goto('about:blank'); await page.goto('http://127.0.0.1:8104/editions/202611012027/');
await page.waitForFunction(() => window.__k && window.__k.get().edN > 0, null, { timeout:60000 }); await sleep(7000);
const G = () => page.evaluate(() => window.__k.get());
const settle = async () => { const fr = () => page.evaluate(() => new Promise(r => requestAnimationFrame(t0 => requestAnimationFrame(t1 => r(t1 - t0)))));
for (let i = 0; i < 60; i++) { if (await fr() < 120 && await fr() < 120) return i; } return -1; };
const VV = () => page.evaluate(() => ({ scale:visualViewport.scale, pageTop:visualViewport.pageTop, offsetTop:visualViewport.offsetTop, scrollY:scrollY, scrollX:scrollX }));
const st = await G(); const W = st.W, H = st.H;
rec('viewport', { W, H, meta: await page.evaluate(() => document.querySelector('meta[name=viewport]').content) });
rec('touch_action', await page.evaluate(() => { const g = s => { const el = document.querySelector(s); return el ? getComputedStyle(el).touchAction + ' | user-select=' + getComputedStyle(el).userSelect : 'n/a'; };
return { canvas:g('#c'), overlay:g('#o'), bar:g('#bar'), barBtn:g('#bar .gm-title'), lines:g('#lines'), top:g('#top'), card:g('#card'), html:g('html') }; }));
// ---- T1 one finger drag
{ const a = await G(), v0 = await VV(); const x0 = Math.round(W*0.5), y0 = Math.round(H*0.55);
await touch('touchStart', [[x0, y0]]); for (let i = 1; i <= 10; i++) { await touch('touchMove', [[x0 + 10*i, y0 + 6*i]]); await sleep(16); } await touch('touchEnd', []); await sleep(300);
const b = await G(), v1 = await VV();
rec('T1_drag', { dcx_px: +((a.cx - b.cx)*a.zoom).toFixed(2), dcy_px: +((b.cy - a.cy)*a.zoom).toFixed(2), expected:[100, 60], cancel: await page.evaluate(() => __ev.cancel), vv_before:v0, vv_after:v1, card_after:b.card, pts:b.pts }); }
// ---- T2 pinch on canvas
{ const a = await G(); const cxs = Math.round(W*0.5), cys = Math.round(H*0.55); const w0 = await page.evaluate(([x,y]) => window.__k.toWorld(x,y), [cxs, cys]);
await touch('touchStart', [[cxs-50, cys]]); await touch('touchStart', [[cxs-50, cys],[cxs+50, cys]]);
for (let i = 1; i <= 10; i++) { await touch('touchMove', [[cxs-50-5*i, cys],[cxs+50+5*i, cys]]); await sleep(16); }
await touch('touchEnd', [[cxs+100, cys]]); await touch('touchEnd', []); await sleep(300);
const b = await G(); const w1 = await page.evaluate(([x,y]) => window.__k.toWorld(x,y), [cxs, cys]);
rec('T2_pinch_canvas', { zoom_ratio:+(b.zoom/a.zoom).toFixed(3), expected:2, centre_world_drift:+Math.hypot(w1[0]-w0[0], w1[1]-w0[1]).toFixed(6), vv: await VV(), pts:b.pts, pinch:b.pinch }); }
// ---- T2b pinch on the bar and on an open panel (page zoom?)
{ const br = await page.$eval('#bar', e => { const r = e.getBoundingClientRect(); return [r.left, r.top, r.width, r.height]; });
const y = Math.round(br[1] + br[3]/2), x = Math.round(W*0.5);
await touch('touchStart', [[x-40, y]]); await touch('touchStart', [[x-40, y],[x+40, y]]);
for (let i = 1; i <= 10; i++) { await touch('touchMove', [[x-40-8*i, y],[x+40+8*i, y]]); await sleep(16); }
await touch('touchEnd', []); await sleep(400);
rec('T2b_pinch_bar', { vv: await VV(), state:(await G()).zoom });
await page.evaluate(() => { if (visualViewport.scale !== 1) {} });
await page.evaluate(() => window.__k.key('Escape'));
await page.$eval('#bar [data-panel=lines]', b => b.click()); await sleep(300);
const lr = await page.$eval('#lines', e => { const r = e.getBoundingClientRect(); return [r.left, r.top, r.width, r.height]; });
const py = Math.round(lr[1] + Math.min(lr[3]/2, 200)), px = Math.round(W*0.5);
await touch('touchStart', [[px-40, py]]); await touch('touchStart', [[px-40, py],[px+40, py]]);
for (let i = 1; i <= 10; i++) { await touch('touchMove', [[px-40-8*i, py],[px+40+8*i, py]]); await sleep(16); }
await touch('touchEnd', []); await sleep(400);
rec('T2c_pinch_lines_panel', { lines_rect:lr.map(Math.round), vv: await VV(), openPanel:(await G()).openPanel });
await page.screenshot({ path:S + '/img/' + mode + '-T2c.png', scale:'css', timeout:180000 });
await cdp.send('Emulation.setPageScaleFactor', { pageScaleFactor:1 }).catch(()=>{});
await page.evaluate(() => window.__k.key('Escape')); }
// ---- T3 tap discrimination
{ const clear = async () => { await page.evaluate(() => { card.style.display = 'none'; __k.key('Backspace'); }); await sleep(1500); await settle(); };
await page.evaluate(() => { __ev.t = []; addEventListener('pointerdown', e => __ev.t.push(['d', e.timeStamp]), true); addEventListener('pointerup', e => __ev.t.push(['u', e.timeStamp]), true); });
const dtLast = () => page.evaluate(() => { const t = __ev.t; const u = t.filter(v => v[0] === 'u').pop(), d = t.filter(v => v[0] === 'd').pop(); return u && d ? +(u[1] - d[1]).toFixed(1) : null; });
await clear();
const x = Math.round(W*0.5), y = Math.round(H*0.5);
await seq([['touchStart', [[x, y]], 0], ['touchEnd', [], 60]]); await sleep(200);
const clean = (await G()).card, cleanDt = await dtLast();
await clear();
await seq([['touchStart', [[x, y]], 0], ['touchEnd', [], 900]]); await sleep(200);
const held = (await G()).card, heldDt = await dtLast();
await clear();
await seq([['touchStart', [[x, y]], 0], ['touchMove', [[x+3, y+2]], 20], ['touchMove', [[x+5, y+5]], 40], ['touchMove', [[x+6, y+6]], 60], ['touchEnd', [], 80]]); await sleep(200);
const jitter = await G(); const jitterDt = await dtLast();
await clear();
await seq([['touchStart', [[x, y]], 0], ...[1,2,3,4,5,6].map(i => ['touchMove', [[x+5*i, y]], 16*i]), ['touchEnd', [], 120]]); await sleep(200);
const drag30 = await G();
rec('T3_tap_vs_drag', { clean_tap_opens_card: clean === 'block', clean_down_to_up_ms:cleanDt, held_900ms_opens_card: held === 'block', held_down_to_up_ms:heldDt, jittered_tap_6px_opens_card: jitter.card === 'block', jitter_moved:+jitter.moved.toFixed(2), jitter_down_to_up_ms:jitterDt, drag_30px_opens_card: drag30.card === 'block', drag_moved:+drag30.moved.toFixed(2) }); }
// ---- T4 double tap: page zoom and click delay
{ await page.evaluate(() => { card.style.display = 'none'; }); const x = Math.round(W*0.5), y = Math.round(H*0.6);
await touch('touchStart', [[x, y]]); await sleep(50); await touch('touchEnd', []); await sleep(120); await touch('touchStart', [[x, y]]); await sleep(50); await touch('touchEnd', []); await sleep(600);
const vvc = await VV();
await page.$eval('#bar [data-panel=top]', b => b.click()); await sleep(200);
const tr = await page.$eval('#top', e => { const r = e.getBoundingClientRect(); return [r.left + r.width/2, r.top + Math.min(r.height/2, 80)]; });
await touch('touchStart', [[tr[0], tr[1]]]); await sleep(50); await touch('touchEnd', []); await sleep(120); await touch('touchStart', [[tr[0], tr[1]]]); await sleep(50); await touch('touchEnd', []); await sleep(600);
const vvp = await VV();
await cdp.send('Emulation.setPageScaleFactor', { pageScaleFactor:1 }).catch(()=>{});
await page.evaluate(() => { __ev.ups = []; __ev.clicks = []; });
const b = await page.$('#bar [data-panel=hud]'); const bb = await b.boundingBox();
await page.touchscreen.tap(bb.x + bb.width/2, bb.y + bb.height/2); await sleep(500);
const lat = await page.evaluate(() => ({ ups:__ev.ups, clicks:__ev.clicks, delay_ms: __ev.clicks.length && __ev.ups.length ? +(__ev.clicks[0][0] - __ev.ups[0][0]).toFixed(1) : null }));
rec('T4_double_tap', { vv_after_double_tap_canvas:vvc, vv_after_double_tap_panel:vvp, pointerup_to_click_ms:lat.delay_ms, targets:{ up:lat.ups[0], click:lat.clicks[0] }, openPanel:(await G()).openPanel });
await page.evaluate(() => window.__k.key('Escape')); }
// ---- T5 a tap on the bar / the card's x / the wafer-with-panel-open reaching the canvas
{ const put = async (i, sx, sy) => page.evaluate(([i, sx, sy]) => { const b = __k.spark(i), g = __k.get(); __k.set({ zoom:14, cx: b.x - (sx - g.W/2)/14, cy: b.y + (sy - g.H/2)/14 }); return __k.spark(i).s; }, [i, sx, sy]);
await page.evaluate(() => { card.style.display = 'none'; edSel = -1; });
const bb = await (await page.$('#bar [data-panel=lines]')).boundingBox(); const bx = bb.x + bb.width/2, by = bb.y + bb.height/2;
const s = await put(5, bx, by); await sleep(300); await settle();
await page.touchscreen.tap(bx, by); await sleep(1500);
const g1 = await G();
rec('T5a_tap_bar_button_over_spark', { spark_screen:s.map(v => +v.toFixed(1)), button_centre:[+bx.toFixed(1), +by.toFixed(1)], panel_opened:g1.openPanel, card_opened_by_spark: g1.card === 'block', edSel:g1.edSel, verdict: g1.edSel === 5 ? 'BUG: bar tap reached the canvas' : 'ok' });
await page.screenshot({ path:S + '/img/' + mode + '-T5a.png', scale:'css', timeout:180000 });
if (g1.openPanel) await page.evaluate(() => window.__k.key('Escape'));
// the card's x
await page.evaluate(() => { card.style.display = 'none'; edSel = -1; }); await page.evaluate(() => { edCard(3); }); await sleep(300);
const xb = await (await page.$('#card .cx')).boundingBox(); const xx = xb.x + xb.width/2, xy = xb.y + xb.height/2;
const s2 = await put(7, xx, xy); await sleep(300); await settle();
await page.touchscreen.tap(xx, xy); await sleep(1500);
const g2 = await G();
rec('T5b_tap_card_close_over_spark', { spark_screen:s2.map(v => +v.toFixed(1)), x_centre:[+xx.toFixed(1), +xy.toFixed(1)], card_after:g2.card, edSel_after:g2.edSel, verdict: g2.card === 'block' ? 'BUG: x close reopened another line' : 'ok' });
await page.screenshot({ path:S + '/img/' + mode + '-T5b.png', scale:'css', timeout:180000 });
// details toggle on the card: does the card survive?
await page.evaluate(() => { card.style.display = 'none'; edSel = -1; edCard(9); }); await sleep(300);
const db = await (await page.$('#card .ct')).boundingBox(); await page.touchscreen.tap(db.x + db.width/2, db.y + db.height/2); await sleep(400);
const g3 = await G();
rec('T5c_tap_details', { card_after:g3.card, details_open:g3.cardOpen, verdict: g3.card === 'block' && g3.cardOpen ? 'ok' : 'BUG: details tap closed the card' });
// tap on the card body
await page.evaluate(() => { card.style.display = 'none'; edSel = -1; edCard(9); }); await sleep(300);
const cb = await (await page.$('#card .cq')).boundingBox(); await page.touchscreen.tap(cb.x + 20, cb.y + 8); await sleep(400);
rec('T5d_tap_card_body', { card_after:(await G()).card });
// tap on the card's own padding (target is #card itself)
await page.evaluate(() => { card.style.display = 'none'; edSel = -1; edCard(9); }); await sleep(300);
const cr = await (await page.$('#card')).boundingBox(); await page.touchscreen.tap(cr.x + cr.width - 12, cr.y + cr.height - 6); await sleep(400);
rec('T5f_tap_card_padding', { card_after:(await G()).card, verdict:(await G()).card === 'block' ? 'ok' : 'BUG: tap on the card padding closed the card' });
// wafer tap with a panel open: closes the panel; does it also act on the wafer?
await page.evaluate(() => { card.style.display = 'none'; edSel = -1; litRepo = -1; }); await page.$eval('#bar [data-panel=hud]', b => b.click()); await sleep(300);
await page.touchscreen.tap(Math.round(W*0.5), Math.round(H*0.75)); await sleep(500);
const g5 = await G();
rec('T5e_tap_wafer_with_panel_open', { panel_after:g5.openPanel, card_after:g5.card, verdict: g5.openPanel ? 'BUG: panel stayed open' : (g5.card === 'block' ? 'tap also acted on the wafer (card opened)' : 'ok: dismiss only') }); }
// ---- T6 back gesture and Escape
{ await page.evaluate(() => { card.style.display = 'none'; }); const len0 = await page.evaluate(() => history.length);
await page.$eval('#bar [data-panel=lines]', b => b.click()); await sleep(300);
const len1 = await page.evaluate(() => history.length);
await page.goBack({ waitUntil:'commit' }).catch(e => rec('T6_goback_error', String(e))); await sleep(800);
const url = page.url(); const alive = await page.evaluate(() => !!window.__k).catch(() => false);
const after = alive ? await G() : null;
rec('T6a_back_with_panel_open', { history_before:len0, history_after_open:len1, url_after_back:url, page_alive:alive, openPanel_after:after && after.openPanel, verdict: alive && !after.openPanel ? 'ok: back closed the panel' : 'BUG: back left the page' });
if (!alive) { await page.goForward({ waitUntil:'commit' }).catch(()=>{}); await page.waitForFunction(() => window.__k && window.__k.get().edN > 0, null, { timeout:60000 }); await sleep(6000); }
// back with the card open
await page.evaluate(() => { edCard(2); }); await sleep(200); await page.goBack({ waitUntil:'commit' }).catch(()=>{}); await sleep(800);
const alive2 = await page.evaluate(() => !!window.__k).catch(() => false); const g6 = alive2 ? await G() : null;
rec('T6b_back_with_card_open', { page_alive:alive2, card_after:g6 && g6.card, verdict: alive2 && g6.card !== 'block' ? 'ok' : 'BUG' });
if (!alive2) { await page.goForward({ waitUntil:'commit' }).catch(()=>{}); await page.waitForFunction(() => window.__k && window.__k.get().edN > 0, null, { timeout:60000 }); await sleep(6000); }
// back with nothing open leaves the page (must still work)
const g6c0 = await G(); await page.goBack({ waitUntil:'commit' }).catch(()=>{}); await sleep(800); const alive3 = await page.evaluate(() => !!window.__k).catch(() => false);
rec('T6c_back_with_nothing_open', { openPanel:g6c0.openPanel, card:g6c0.card, page_left:!alive3, verdict: !alive3 ? 'ok: back leaves the page' : 'BUG: back trapped' });
if (!alive3) { await page.goForward({ waitUntil:'commit' }).catch(()=>{}); await page.waitForFunction(() => window.__k && window.__k.get().edN > 0, null, { timeout:60000 }); await sleep(6000); }
await page.evaluate(() => { edCard(4); }); await sleep(200); await page.keyboard.press('Escape'); await sleep(200);
const g7 = await G(); rec('T6d_escape_with_card_open', { card_after:g7.card, verdict: g7.card === 'block' ? 'BUG: Escape does not close the card' : 'ok' });
await page.evaluate(() => { card.style.display = 'none'; }); await page.$eval('#bar [data-panel=foot]', b => b.click()); await sleep(200); await page.keyboard.press('Escape'); await sleep(200);
rec('T6e_escape_with_panel_open', { openPanel_after:(await G()).openPanel });
// the race: close a layer and open another before the popstate from history.back() arrives
await page.$eval('#bar [data-panel=lines]', b => b.click()); await sleep(300);
await page.evaluate(() => { __k.key('Escape'); edCard(6); }); await sleep(1500);
const g8 = await G(); rec('T6f_close_then_open_at_once', { openPanel:g8.openPanel, card_after:g8.card, edSel:g8.edSel, state_kuiper: await page.evaluate(() => !!(history.state && history.state.kuiper)), verdict: g8.card === 'block' ? 'ok: the new card survived our own back()' : 'BUG: our own popstate closed the new card' });
await page.goBack({ waitUntil:'commit' }).catch(()=>{}); await sleep(800);
const alive8 = await page.evaluate(() => !!window.__k).catch(() => false); const g9 = alive8 ? await G() : null;
rec('T6g_back_after_race', { page_alive:alive8, card_after:g9 && g9.card, verdict: alive8 && g9.card !== 'block' ? 'ok' : 'BUG' });
if (!alive8) { await page.goForward({ waitUntil:'commit' }).catch(()=>{}); await page.waitForFunction(() => window.__k && window.__k.get().edN > 0, null, { timeout:60000 }); await sleep(6000); } }
// ---- T7 long press
{ await page.evaluate(() => { card.style.display = 'none'; __ev.ctx = 0; __ev.ctxPrevented = 0; }); await settle();
const x = Math.round(W*0.5), y = Math.round(H*0.65);
await touch('touchStart', [[x, y]]); await sleep(900); await touch('touchEnd', []); await sleep(300);
const c1 = await page.evaluate(() => ({ ctx:__ev.ctx, prevented:__ev.ctxPrevented, sel:getSelection().toString().length, card:__k.get().card }));
const bb = await (await page.$('#bar [data-panel=top]')).boundingBox(); await page.evaluate(() => { __ev.ctx = 0; __ev.ctxPrevented = 0; });
await touch('touchStart', [[bb.x + bb.width/2, bb.y + bb.height/2]]); await sleep(900); await touch('touchEnd', []); await sleep(300);
const c2 = await page.evaluate(() => ({ ctx:__ev.ctx, prevented:__ev.ctxPrevented, sel:getSelection().toString().length, openPanel:__k.get().openPanel }));
const synth = await page.evaluate(() => { const ev = new MouseEvent('contextmenu', { bubbles:true, cancelable:true, clientX:200, clientY:500 }); return { canvas_contextmenu_prevented: !document.getElementById('c').dispatchEvent(ev),
bar_contextmenu_prevented: !document.querySelector('#bar .gm-title').dispatchEvent(new MouseEvent('contextmenu', { bubbles:true, cancelable:true })) }; });
rec('T7_long_press', { canvas:c1, bar_button:c2, synthetic:synth }); }
rec('console_errors', errors);
await page.evaluate(() => { card.style.display = 'none'; if (__k.get().openPanel) __k.key('Escape'); });
fs.writeFileSync(S + '/results-' + mode + '-' + devName.replace(/\s+/g, '_') + '.json', JSON.stringify(R, null, 1));
await browser.close();
})().catch(e => { console.error('HARNESS ERROR', e); process.exit(1); });07 Perf Edition Min
A Python command-line tool in Neural Link Between Agents that uses SHA-256. It is built from the build step (`build`) and the text step (`text`).
storageneural-link-between-agents / FIXES/NL-009/round1/07-perf-edition_min.py · lines 1–43 of 43 · Entry point
- What it does
- It loads data. Defines build, text, main. Uses libraries hashlib, json, os, sys. Side effects: reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'agents'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: JSON file keys.json; JSON file keys-min.json; command-line arguments.
- Downstream impact
- It is itself an entry point (Python CLI); no other file was found loading it.
- What it achieves
- Only the fields the edition page draws, taken from `keys.json`, which stays as the evidence.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- neural-link-between-agents · FIXES/NL-009/round1 · Python CLI
- Uses
- hashlib, json, os, sys
- Used by
- none found
- Produces
- build, text, main
- Defines here
- build, text, main
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- neural-link-between-agents@598eff3f59afe11738d64cb14cb8befe5e37cdc2 FIXES/NL-009/round1/07-perf-edition_min.py:1-43 · blob 248116884467546cf51c4765cfecb87f9dd96db5 · GitHub at these lines
- State
- achieves: comment · context: auto · stage: output · effects: filesystem, process · domain stage: agent_infra · users: ai_agent · canonical: supporting_data
#!/usr/bin/env python3
"""keys-min.json: only the fields the edition page draws, taken from keys.json, which stays as the evidence.
keys.json (1.7 MB) carries 36 fields per record and one record whose line_text is a 1.24 MB one-line file;
the page reads 14 fields. This writes them, in a fixed order, minified, LF-terminated, with the sha256 of
the keys.json it came from, so the proof can tie the two together.
usage: python3 tools/edition_min.py editions/<stamp> writes editions/<stamp>/keys-min.json
python3 tools/edition_min.py editions/<stamp> --check verifies an existing keys-min.json against keys.json
"""
import hashlib, json, os, sys
FIELDS = ('id', 'key', 'on_wafer', 'verified', 'class', 'title', 'repo', 'path', 'line',
'quote', 'destination', 'commit', 'pattern', 'worker', 'finding')
def build(folder):
raw = open(os.path.join(folder, 'keys.json'), 'rb').read()
j = json.loads(raw)
summary = dict(j.get('summary') or {})
summary.update(source='keys.json', source_sha256=hashlib.sha256(raw).hexdigest(), fields=list(FIELDS))
bodies = [{k: b[k] for k in FIELDS if k in b} for b in j['bodies']]
return {'summary': summary, 'bodies': bodies}
def text(obj):
return json.dumps(obj, separators=(',', ':'), ensure_ascii=False) + '\n'
def main(argv):
folder = argv[1]
dst = os.path.join(folder, 'keys-min.json')
want = text(build(folder))
if '--check' in argv:
have = open(dst, 'rb').read().decode('utf-8')
ok = have == want
print('keys-min.json %s (%d bytes)' % ('matches keys.json' if ok else 'DIFFERS from keys.json', len(have.encode())))
return 0 if ok else 1
with open(dst, 'w', encoding='utf-8', newline='\n') as f:
f.write(want)
print('wrote %s: %d records, %d fields each, %d bytes (keys.json %d bytes)' % (
dst, len(json.loads(want)['bodies']), len(FIELDS), len(want.encode()), os.path.getsize(os.path.join(folder, 'keys.json'))))
return 0
if __name__ == '__main__':
sys.exit(main(sys.argv))File Touch C4
A JavaScript module in the evidence folder of Neural Link Between Agents that works with tap sel (`tapSel`).
renderneural-link-between-agents / FIXES/NL-010/evidence/controller-4/touch-pixel7/file-touch-c4.cjs · lines 1–60 of 60 · Entry point · pattern tapSel (shared by 6 files)
- What it does
- It draws its content. Defines step, shot, tapSel, card. Uses libraries playwright, fs, path. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'agents'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: command-line arguments. Out: JSON file touch.json.
- Downstream impact
- It is itself an entry point (JavaScript module); no other file was found loading it.
- What it achieves
- It is built from the tap sel helper (`tapSel`) and the card step (`card`). Defines `step`, `shot`, `tapSel` and 1 more.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- neural-link-between-agents · FIXES/NL-010/evidence/controller-4/touch-pixel7 · JavaScript module
- Uses
- playwright, fs, path
- Used by
- none found
- Produces
- step, shot, tapSel, card
- Defines here
- step, shot, tapSel, card
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- neural-link-between-agents@598eff3f59afe11738d64cb14cb8befe5e37cdc2 FIXES/NL-010/evidence/controller-4/touch-pixel7/file-touch-c4.cjs:1-60 · blob a718aaa5f97dddd1194729dc8a668622f65204e6 · GitHub at these lines
- State
- achieves: name · context: auto · stage: output · effects: dom, filesystem, process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/usr/bin/env node
// file-touch-c4.cjs <url> <outdir> [--device "Pixel 7"] (OPUS-CONTROLLER-4, 2026-11-02): the controller's own touch check of
// FILE on a frozen snapshot: real taps only (page.touchscreen.tap), SwiftShader flags as journey-6.cjs. Measures:
// T1 FILE opens from the bar title (data-open=file, #ky-file visible);
// T2 every visible tap target in #ky-file (button, a, input) is >= 44 px tall;
// T3 Open a key <KEY0> + GO opens the line card (line-card inspect().open, #card shown, header = that line);
// T4 Open a line <LINE0> + GO opens the line card on that line (the openIndex / #lyFind path for engine-owned lines).
// Page errors are counted. Report JSON to stdout and <outdir>/touch.json; screenshots <outdir>/NN-*.png.
'use strict';
const { chromium, devices } = require('playwright');
const fs = require('fs'), path = require('path');
const argv = process.argv.slice(2), pos = argv.filter(a => !a.startsWith('--'));
const di = argv.indexOf('--device'), DEV = di >= 0 ? argv[di + 1] : 'Pixel 7';
const URL0 = pos[0], OUT = path.resolve(pos[1]); fs.mkdirSync(OUT, { recursive: true });
const KEY0 = 36064705400, LINE0 = process.env.LINE1; // LINE1: a different placed line than KEY0's, so T4 changes the card
(async () => {
const R = { device: DEV, url: URL0, start: new Date().toISOString(), steps: [], pageerrors: [], console_errors: [] };
const step = (id, pass, m) => { R.steps.push({ id, pass: !!pass, m }); console.error('[' + DEV + '] ' + (pass ? 'PASS' : 'FAIL') + ' ' + id + ' ' + JSON.stringify(m)); };
const browser = await chromium.launch({ args: ['--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'] });
const ctx = await browser.newContext({ ...devices[DEV] });
await ctx.route(u => !u.href.startsWith('http://127.0.0.1:8590/'), r => r.abort());
const p = await ctx.newPage();
p.on('pageerror', e => R.pageerrors.push(String(e && e.message || e)));
p.on('console', m => { if (m.type() === 'error') R.console_errors.push(m.text()); });
const shot = n => p.screenshot({ path: path.join(OUT, n + '.png'), timeout: 120000 }).catch(e => (R.shot_errors = R.shot_errors || []).push(n + ': ' + e.message.split('\n')[0]));
const tapSel = async sel => { const el = p.locator(sel).first(); await el.scrollIntoViewIfNeeded(); const b = await el.boundingBox(); if (!b) throw new Error('no box ' + sel); await p.touchscreen.tap(b.x + b.width / 2, b.y + Math.min(b.height / 2, 22)); return b; };
const card = () => p.evaluate(() => { const lc = KY.modules['line-card'].api.inspect(); const h = document.querySelector('#card .lc-h code'); const c = document.getElementById('card');
return { open: lc.open, index: lc.index, header: h ? h.textContent : null, display: c ? getComputedStyle(c).display : null, hash: location.hash }; });
try {
await p.goto(URL0, { timeout: 180000 });
await p.waitForFunction(() => { try { return window.__KUIPER_EDITION__ && __KUIPER_EDITION__.admitted.some(a => a.id === 'file') && KY.modules.layers.api.get('lines').status === 'OK' && document.getElementById('ky-file'); } catch (e) { return false; } }, null, { timeout: 300000, polling: 500 });
await p.waitForTimeout(6500);
R.admitted = await p.evaluate(() => ({ admitted: __KUIPER_EDITION__.admitted.map(a => a.id), refused: __KUIPER_EDITION__.refused }));
const bodies = JSON.parse(fs.readFileSync(process.env.KEYS, 'utf8')).bodies;
const b0 = bodies.find(b => b.key === KEY0), bl = bodies.find(b => b.id === LINE0 || (b.blob + ':' + b.line) === LINE0);
R.expect = { key: b0 && { id: b0.id, line_text: b0.line_text }, line: bl && { id: bl.id, key: bl.key, line_text: bl.line_text } };
// T1
await tapSel('#kuiper-menu-bar .gm-menu[data-menu="file"] > .gm-title'); await p.waitForTimeout(1200);
const t1 = await p.evaluate(() => { const b = document.getElementById('kuiper-menu-bar'), f = document.getElementById('ky-file'), r = f && f.getBoundingClientRect(); return { open: b.getAttribute('data-open'), w: r && Math.round(r.width), h: r && Math.round(r.height) }; });
step('T1 FILE opens by touch', t1.open === 'file' && t1.w > 0 && t1.h > 0, t1); await shot('01-file-open');
// T2
const t2 = await p.evaluate(() => [...document.querySelectorAll('#ky-file button, #ky-file a, #ky-file input')].filter(e => { const r = e.getBoundingClientRect(), s = getComputedStyle(e); return r.width > 0 && r.height > 0 && s.visibility !== 'hidden' && s.display !== 'none'; })
.map(e => ({ t: ((e.querySelector && e.querySelector('.ky-file-label')) || e).textContent.trim().slice(0, 40) || e.id || e.tagName, tag: e.tagName, h: Math.round(e.getBoundingClientRect().height * 10) / 10 })));
const minH = Math.min(...t2.map(x => x.h)); R.rows = t2;
step('T2 every visible FILE target >= 44 px', t2.length > 0 && minH >= 44, { targets: t2.length, min_h: minH, below: t2.filter(x => x.h < 44) });
// T3
await tapSel('#ky-file-key-in'); await p.keyboard.type(String(KEY0)); await tapSel('#ky-file-key .ky-go'); await p.waitForTimeout(9000);
const t3 = await card(); await shot('02-open-key');
step('T3 Open a key opens the line card', t3.open && t3.display !== 'none' && b0 && t3.header === b0.line_text, t3);
// T4
const open = await p.evaluate(() => document.getElementById('kuiper-menu-bar').getAttribute('data-open'));
if (open !== 'file') { await tapSel('#kuiper-menu-bar .gm-menu[data-menu="file"] > .gm-title'); await p.waitForTimeout(1200); }
await p.locator('#ky-file-line-in').fill(''); await tapSel('#ky-file-line-in'); await p.keyboard.type(LINE0); await tapSel('#ky-file-line .ky-go'); await p.waitForTimeout(9000);
const t4 = await card(); await shot('03-open-line');
step('T4 Open a line opens the line card on that line', t4.open && t4.display !== 'none' && bl && t4.header === bl.line_text, t4);
} catch (e) { R.harness_error = String(e && e.stack || e); console.error('HARNESS ' + R.harness_error); }
R.end = new Date().toISOString(); R.pass = !R.harness_error && R.steps.length === 4 && R.steps.every(s => s.pass) && R.pageerrors.length === 0;
fs.writeFileSync(path.join(OUT, 'touch.json'), JSON.stringify(R, null, 1)); console.log(JSON.stringify(R, null, 1));
await browser.close(); process.exit(R.pass ? 0 : 1);
})();See Through C5
A JavaScript module in the evidence folder of Neural Link Between Agents that draws on a canvas, using SHA-256.
renderneural-link-between-agents / FIXES/NL-010/evidence/controller-5/see-through-c5.cjs · lines 1–75 of 75 · Entry point · pattern count (shared by 27 files)
- What it does
- It draws its content. Defines step, shot, count. Uses libraries playwright, fs, path. Side effects: changes the web page (DOM); reads or writes files; makes network requests; starts processes.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'agents'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: JSON file modules.json; JSON file see-through.json; command-line arguments. Out: JSON file check.json; canvas drawing.
- Downstream impact
- It is itself an entry point (JavaScript module); no other file was found loading it.
- What it achieves
- Defines `step`, `shot` and `count`. It reads `modules.json`.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- neural-link-between-agents · FIXES/NL-010/evidence/controller-5 · JavaScript module
- Uses
- playwright, fs, path
- Used by
- none found
- Produces
- step, shot, count
- Defines here
- step, shot, count
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- neural-link-between-agents@598eff3f59afe11738d64cb14cb8befe5e37cdc2 FIXES/NL-010/evidence/controller-5/see-through-c5.cjs:1-75 · blob d454e5c8039b9f74e34a47122e84ed0121607be8 · GitHub at these lines
- State
- achieves: name · context: auto · stage: output · effects: dom, filesystem, network, process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/usr/bin/env node
// see-through-c5.cjs <url> <outdir> [--device "Pixel 7"] (OPUS-CONTROLLER-5, 2026-11-02): the controller's own check of the
// see-through module on a frozen snapshot, SwiftShader flags as journey-6.cjs. Measures:
// S1 loader: every modules.json order entry admitted, none refused, see-through among them;
// S2 the layers row "See Through stars" reads OK (label.ky-ly[data-id=see-through] .st, layers.api.get('see-through'));
// S3 stars keyed to real data: data/see-through.json fetched in the page; every feature key == floor((j+0.5)*SPACE/20000)
// (BigInt), every key < SPACE, features == placed == total, and the bytes' sha256, size and count == the modules.json record (data.files[0]);
// S4 the layer draws: switched on through its original input, the overlay gains pixels of the layer's colour;
// S5 nothing goes off-origin at load: every request URL starts with the snapshot origin (off-origin ones are aborted and listed);
// S6 the shell's See Through entry: exactly one a[data-star=see-through] (kuiper-shell defaultStar), to ../../see-through/ on this origin, same tab.
// Page errors and console errors are counted. Report JSON to stdout and <outdir>/check.json; screenshots <outdir>/NN-*.png.
'use strict';
const { chromium, devices } = require('playwright');
const fs = require('fs'), path = require('path');
const argv = process.argv.slice(2), pos = argv.filter(a => !a.startsWith('--'));
const di = argv.indexOf('--device'), DEV = di >= 0 ? argv[di + 1] : 'Pixel 7';
const URL0 = pos[0], OUT = path.resolve(pos[1]); fs.mkdirSync(OUT, { recursive: true });
const ORIGIN = new URL(URL0).origin + '/';
(async () => {
const R = { device: DEV, url: URL0, start: new Date().toISOString(), steps: [], pageerrors: [], console_errors: [], off_origin: [], requests: 0 };
const step = (id, pass, m) => { R.steps.push({ id, pass: !!pass, m }); console.error('[' + DEV + '] ' + (pass ? 'PASS' : 'FAIL') + ' ' + id + ' ' + JSON.stringify(m).slice(0, 600)); };
const browser = await chromium.launch({ args: ['--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'] });
const ctx = await browser.newContext({ ...devices[DEV] });
await ctx.route(u => !u.href.startsWith(ORIGIN), r => { R.off_origin.push(r.request().url().slice(0, 200)); return r.abort(); });
const p = await ctx.newPage();
p.on('request', () => R.requests++);
p.on('pageerror', e => R.pageerrors.push(String(e && e.message || e)));
p.on('console', m => { if (m.type() === 'error') R.console_errors.push(m.text().slice(0, 300)); });
const shot = n => p.screenshot({ path: path.join(OUT, n + '.png'), timeout: 120000 }).catch(e => (R.shot_errors = R.shot_errors || []).push(n + ': ' + e.message.split('\n')[0]));
try {
await p.goto(URL0, { timeout: 180000 });
await p.waitForFunction(() => { try { const E = window.__KUIPER_EDITION__; const L = KY.modules.layers.api; const g = L.get('see-through');
return E && E.admitted.some(a => a.id === 'see-through') && g && g.status !== 'WAIT' && g.status !== 'LOAD' && L.get('lines').status === 'OK'; } catch (e) { return false; } }, null, { timeout: 300000, polling: 500 });
await p.waitForTimeout(6500);
const offAtLoad = R.off_origin.slice();
// S1
const s1 = await p.evaluate(async () => { const E = __KUIPER_EDITION__; const mj = await (await fetch('modules.json', { cache: 'no-store' })).json();
return { order: mj.order, admitted: E.admitted.map(a => a.id), refused: E.refused.map(r => r.id || r), loader_admitted_in_order: JSON.stringify(mj.order) === JSON.stringify(E.admitted.map(a => a.id)) }; });
step('S1 loader: every order entry admitted, none refused, see-through among them', s1.loader_admitted_in_order && s1.refused.length === 0 && s1.admitted.includes('see-through'), s1);
// S2
const s2 = await p.evaluate(() => { const L = KY.modules.layers.api, g = L.get('see-through'); const lab = document.querySelector('#layers label.ky-ly[data-id="see-through"]'); const st = lab && lab.querySelector('.st');
return { status: g.status, why: g.why, tag: g.tag, placed: g.placed, total: g.total, loaded_sha256: g.loaded_sha256, label: g.label, rec_module: g.module, record_source: g.source, history: g.history,
row_text: lab ? lab.textContent.trim().replace(/\s+/g, ' ') : null, st_text: st ? st.textContent : null, st_data_s: st && st.getAttribute('data-s'), aria: lab && lab.getAttribute('aria-label'), input_disabled: !!(lab && lab.querySelector('input').disabled),
st_inspect: KY.modules['see-through'] && KY.modules['see-through'].api.inspect() }; });
step('S2 layers row "See Through stars" reads OK', s2.status === 'OK' && s2.st_data_s === 'OK' && /^OK · /.test(s2.st_text || '') && s2.label === 'See Through stars' && s2.placed > 0 && s2.placed === s2.total, s2);
await shot('01-wafer-panel-closed');
// S3
const s3 = await p.evaluate(async () => { const H = KY.hooks, SPACE = BigInt(H.SPACE); const g = KY.modules.layers.api.get('see-through');
const mj = await (await fetch('modules.json', { cache: 'no-store' })).json(); const mrec = mj.modules.find(m => m.id === 'see-through'); const drec = (mrec && mrec.data && mrec.data.files && mrec.data.files[0]) || {};
const res = await fetch('data/see-through.json', { cache: 'no-store' }); const buf = await res.arrayBuffer();
const hex = [...new Uint8Array(await crypto.subtle.digest('SHA-256', buf))].map(b => (b < 16 ? '0' : '') + b.toString(16)).join('');
const j = JSON.parse(new TextDecoder().decode(buf)); const fs = j.features || []; let badKey = 0, beyond = 0, notPoint = 0, named = 0; const js = new Set();
for (const f of fs) { const gm = f.geometry || {}; if (gm.type !== 'Point') { notPoint++; continue; } const jj = f.properties && (f.properties.j ?? f.properties.star_j ?? f.properties.sub); if (jj == null) { badKey++; continue; } js.add(jj);
const want = ((BigInt(jj) * 2n + 1n) * SPACE) / 40000n; if (BigInt(gm.key) !== want) badKey++; if (BigInt(gm.key) >= SPACE) beyond++; if (f.properties && f.properties.name) named++; }
return { bytes: buf.byteLength, sha256: hex, record_sha256: drec.sha256, record_bytes: drec.bytes, record_features: drec.features, record_from: 'modules.json see-through data.files[0]', layers_json_source: g.source, features: fs.length, distinct_j: js.size, bad_key: badKey, beyond_space: beyond, not_point: notPoint, named, space: String(SPACE), data_space: j.space || (j.properties && j.prope … [line shortened here: 489 characters; full line on GitHub]
step('S3 stars keyed to real data (key_j = floor((j+0.5)*SPACE/20000), sha256 = record)', s3.features > 0 && s3.bad_key === 0 && s3.beyond_space === 0 && s3.not_point === 0 && s3.distinct_j === s3.features && s3.features === s3.placed && s3.placed === s3.total && s3.sha256 === s3.record_sha256 && s3.bytes === s3.record_bytes && s3.features === s3.record_features, s3);
// S4: switch the layer on through its original and count pixels of its colour on the overlay
const s4 = await p.evaluate(async () => { const L = KY.modules.layers.api; const g = L.get('see-through'); const col = g.colour; const before = count(); L.set('see-through', true); await new Promise(r => setTimeout(r, 1500)); KY.redraw && KY.redraw(); await new Promise(r => setTimeout(r, 1500));
const after = count(); return { colour: col, on: L.get('see-through').on, before, after };
function count() { const o = document.getElementById('o'); if (!o || !o.width) return -1; const d = o.getContext('2d').getImageData(0, 0, o.width, o.height).data; let n = 0; const rc = parseInt(col.slice(1, 3), 16), gc = parseInt(col.slice(3, 5), 16), bc = parseInt(col.slice(5, 7), 16);
for (let i = 0; i < d.length; i += 4) { if (d[i + 3] > 60 && Math.abs(d[i] - rc) < 40 && Math.abs(d[i + 1] - gc) < 40 && Math.abs(d[i + 2] - bc) < 40) n++; } return n; } });
step('S4 the layer draws when switched on (overlay pixels of its colour)', s4.on === true && s4.after > s4.before && s4.after > 100, s4);
await shot('02-layer-on');
// S5
step('S5 nothing off-origin at load', offAtLoad.length === 0, { origin: ORIGIN, requests: R.requests, off_origin_at_load: offAtLoad });
// S6
const s6 = await p.evaluate(() => { const els = [...document.querySelectorAll('a[data-star="see-through"], #kuiper-star')]; const a = els[0]; const r = a && a.getBoundingClientRect(); const cs = a && getComputedStyle(a);
return { count: els.length, tag: a && a.tagName, href: a && a.getAttribute('href'), resolved: a && new URL(a.getAttribute('href'), location.href).href, same_origin: a && new URL(a.getAttribute('href'), location.href).origin === location.origin, target: a && a.getAttribute('target'), text: a && a.textContent.trim(), aria: a && (a.getAttribute('aria-label') || a.getAttribute('title')), parent: … [line shortened here: 659 characters; full line on GitHub]
step('S6 shell See Through entry: one a[data-star=see-through] to ../../see-through/, same origin, same tab, visible', s6.count === 1 && s6.tag === 'A' && s6.href === '../../see-through/' && s6.same_origin && !s6.target && s6.visible, s6);
await shot('03-entry');
} catch (e) { R.harness_error = String(e && e.stack || e); console.error('HARNESS ' + R.harness_error); }
R.end = new Date().toISOString(); R.pass = !R.harness_error && R.steps.length === 6 && R.steps.every(s => s.pass) && R.pageerrors.length === 0;
fs.writeFileSync(path.join(OUT, 'check.json'), JSON.stringify(R, null, 1)); console.log(JSON.stringify(R, null, 1));
await browser.close(); process.exit(R.pass ? 0 : 1);
})();Render Pixel7
A JavaScript module in Neural Link Between Agents.
renderneural-link-between-agents / FIXES/NL-010/team-11/render-pixel7.cjs · lines 1–38 of 38 · Not reached from any entry point (candidate for review)
- What it does
- It draws its content. Uses libraries playwright, node:http, node:fs, node:path. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'agents'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: command-line arguments.
- What it achieves
- Its name says it renders Pixel7.
- Why it matters
- No other file in the estate was found to import it.
- Application
- neural-link-between-agents · FIXES/NL-010/team-11 · JavaScript module
- Uses
- playwright, node:http, node:fs, node:path
- Used by
- none found
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- neural-link-between-agents@598eff3f59afe11738d64cb14cb8befe5e37cdc2 FIXES/NL-010/team-11/render-pixel7.cjs:1-38 · blob f6563c3eed35e654f9ffd4afe29c9fff5b2c3336 · GitHub at these lines
- State
- achieves: name · context: auto · stage: output · effects: dom, filesystem, process · domain stage: agent_infra · users: ai_agent · canonical: unreached_review
const {chromium,devices}=require('playwright');
const http=require('node:http'),fs=require('node:fs'),path=require('node:path');
const root=process.argv[2], out=process.argv[3];
const server=http.createServer((req,res)=>{let p=new URL(req.url,'http://x').pathname;const f=path.resolve(root,'.'+(p.endsWith('/')?p+'index.html':p));if(!f.startsWith(root)||!fs.existsSync(f)||!fs.statSync(f).isFile()){res.writeHead(404).end();return;}res.setHeader('Content-Type',({'.html':'text/html; charset=utf-8','.js':'text/javascript','.css':'text/css','.json':'application/json'})[path.extn … [line shortened here: 473 characters; full line on GitHub]
(async()=>{await new Promise(r=>server.listen(0,'127.0.0.1',r));const base='http://127.0.0.1:'+server.address().port+'/';
const browser=await chromium.launch();const ctx=await browser.newContext({...devices['Pixel 7']});const page=await ctx.newPage();
const errors=[];page.on('pageerror',e=>errors.push('pageerror '+e.message));page.on('console',m=>{if(m.type()==='error')errors.push('console '+m.text());});
// external requests (fonts, active pages etc) are blocked: local render only
await page.route(/^https?:\/\/(?!127\.0\.0\.1)/,r=>r.abort());
await page.goto(base);await page.waitForSelector('#searchControls:not([hidden])',{state:'attached',timeout:20000}).catch(()=>{});
await page.waitForTimeout(1500);
const r={device:'Pixel 7',viewport:page.viewportSize()};
await page.locator('#kuiper > summary').tap();await page.waitForTimeout(400);
const card=page.locator('#kuiper-editions');
r.card_count=await card.count();
r.card_visible=await card.isVisible();
r.card_title=(await card.locator(':scope > summary').innerText()).replace(/\s+/g,' ');
await card.locator(':scope > summary').tap();await page.waitForTimeout(400);
r.card_open=await card.evaluate(e=>e.open);
r.launch_href=await card.locator(':scope > .inside > .launch').getAttribute('href');
r.launch_text=await card.locator(':scope > .inside > .launch').innerText();
r.description=await card.locator(':scope > .inside > p').first().innerText();
r.see_through_href=await page.locator('#see-through > .inside > .launch').getAttribute('href');
r.kuiper_children=await page.locator('#kuiper > .inside > details').evaluateAll(es=>es.map(e=>e.id));
r.doc_overflow_px=await page.evaluate(()=>document.documentElement.scrollWidth-document.documentElement.clientWidth);
const bb=await card.boundingBox();r.card_box=bb;
await card.scrollIntoViewIfNeeded();await page.waitForTimeout(200);
await page.screenshot({path:out+'/pixel7-kuiper-editions-card.png',timeout:180000});
await page.locator('#catalogueArchive').evaluate(e=>{e.open=true;});
const search=page.locator('#catalogueSearch, input[type=search]').first();
if(await search.count()){await search.fill('kuiper editions');await page.waitForTimeout(400);r.search_rows=await page.locator('#catalogueRows tr:visible').evaluateAll(rs=>rs.map(x=>x.dataset.entityId));
const row=page.locator('#catalogueRows tr[data-entity-id="kuiper-editions"]');if(await row.count()){await row.scrollIntoViewIfNeeded();await page.screenshot({path:out+'/pixel7-catalogue-row.png',timeout:180000});r.row_versions=await row.locator('.table-versions > summary').innerText();}}
r.errors=errors;
// no-JS fallback
const nojs=await browser.newContext({...devices['Pixel 7'],javaScriptEnabled:false});const p2=await nojs.newPage();await p2.route(/^https?:\/\/(?!127\.0\.0\.1)/,x=>x.abort());await p2.goto(base);
r.nojs_launch=await p2.locator('#kuiper-editions > .inside > .launch').getAttribute('href');
r.nojs_row=await p2.locator('#catalogueRows tr[data-entity-id="kuiper-editions"]').count();
console.log(JSON.stringify(r,null,2));await browser.close();server.close();})().catch(e=>{console.error(e);process.exit(1);});Crun
A shell script in the controller folder of Neural Link Between Agents that uses SHA-256.
automationneural-link-between-agents / FIXES/NL-010/tools/controller/crun.sh · lines 1–16 of 16 · Entry point
- What it does
- Side effects: starts processes.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'agents'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Downstream impact
- It is itself an entry point (shell script); no other file was found loading it.
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- neural-link-between-agents · FIXES/NL-010/tools/controller · shell script
- Uses
- none found
- Used by
- none found
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- neural-link-between-agents@598eff3f59afe11738d64cb14cb8befe5e37cdc2 FIXES/NL-010/tools/controller/crun.sh:1-16 · blob 3945573f535b47a6280402b6cb2a0a0e7f3385fb · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# crun.sh <snap> <device> [index.html] [modules.json]: OPUS-CONTROLLER. Freeze a snapshot (snap.sh), optionally overlay a
# candidate page and manifest into the snapshot only, then run journey-5.cjs (team 10 lead's admission script) on one
# device on port 8590 (serves scratchpad/snap). Output journey/<snap>-<dev>.{log,json,sum,load}
set -u
S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad; N=$1; D=$2
s=$(echo "$D" | tr ' A-Z' '-a-z'); E=$S/snap/$N/editions/202611012135
if [ ! -d "$E" ]; then $S/snap.sh $N >/dev/null || exit 3
[ -n "${3:-}" ] && cp "$3" $E/index.html
[ -n "${4:-}" ] && cp "$4" $E/modules.json
(cd $E && find . -type f ! -path './proof/*' | sort | xargs sha256sum) > $S/snap/$N.sha256
fi
cd $S/journey; uptime > $N-$s.load; date -u +%H:%M >> $N-$s.load
NODE_PATH=$(npm root -g) timeout 3000 node ${JS:-/tmp/nl010-opus/team-10/lead/journey/journey-5.cjs} http://127.0.0.1:8590/$N/editions/202611012135/ $S/journey/out-$N-$s --device "$D" > $N-$s.json 2> $N-$s.log
echo "exit $?" >> $N-$s.log; uptime >> $N-$s.load; date -u +%H:%M >> $N-$s.load
grep -hE "\] (PASS|FAIL)" $N-$s.log > $N-$s.sum; echo DONE $N $DCrun6
A shell script in the controller folder of Neural Link Between Agents.
automationneural-link-between-agents / FIXES/NL-010/tools/controller/crun6.sh · lines 1–11 of 11 · Entry point
- What it does
- Side effects: starts processes.
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'agents'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Downstream impact
- It is itself an entry point (shell script); no other file was found loading it.
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name. Described from its file name only (a candidate, not yet checked against the code).
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- neural-link-between-agents · FIXES/NL-010/tools/controller · shell script
- Uses
- none found
- Used by
- none found
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- neural-link-between-agents@598eff3f59afe11738d64cb14cb8befe5e37cdc2 FIXES/NL-010/tools/controller/crun6.sh:1-11 · blob 6d69115c68816d440fe166633a0af24e1a2d7227 · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# crun6.sh <snap> <device>: OPUS-CONTROLLER-2. Run journey-6.cjs on one device against an existing snap6.sh snapshot,
# served by the scratchpad/snap http.server on port 8590. Chromium flags come from the script (SwiftShader / ANGLE).
# Output scratchpad/journey/<snap>-<dev>.{log,json,sum,load}
set -u
S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad; N=$1; D=$2; ED=${ED:-202611020326}
s=$(echo "$D" | tr ' A-Z' '-a-z'); mkdir -p $S/journey; cd $S/journey
{ uptime; date -u +%H:%M:%S; } > $N-$s.load
NODE_PATH=$(npm root -g) timeout 3300 node ${JS:-/home/user/neural-link-between-agents/FIXES/NL-010/tools/controller/journey-6.cjs} http://127.0.0.1:8590/$N/editions/$ED/ $S/journey/out-$N-$s --device "$D" > $N-$s.json 2> $N-$s.log
echo "exit $?" >> $N-$s.log; { uptime; date -u +%H:%M:%S; } >> $N-$s.load
grep -hE "\] (PASS|FAIL)" $N-$s.log > $N-$s.sum; echo DONE $N $DDrift Probe
A JavaScript module in the controller folder of Neural Link Between Agents.
renderneural-link-between-agents / FIXES/NL-010/tools/controller/drift-probe.cjs · lines 1–15 of 15 · Not reached from any entry point (candidate for review)
- What it does
- It lists and searches its content. Uses libraries playwright. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage agent_infra (repository name word 'agents'): AI-agent memory, coordination and code audit (the multi-agent journey named in Ventus Ltd's brief).
- Inputs & outputs
- In: command-line arguments.
- What it achieves
- Pixel 7, SwiftShader flags. After load, report what the drift module shows: the #ky-drift section text (first 300 chars), any refusal text in #refuse, and the HUD's DRIFT line.
- Why it matters
- No other file in the estate was found to import it.
- Application
- neural-link-between-agents · FIXES/NL-010/tools/controller · JavaScript module
- Uses
- playwright
- Used by
- none found
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- neural-link-between-agents@598eff3f59afe11738d64cb14cb8befe5e37cdc2 FIXES/NL-010/tools/controller/drift-probe.cjs:1-15 · blob 69c64eb054c1f692dff8709f81526bd877de0c8a · GitHub at these lines
- State
- achieves: comment · context: auto · stage: output · effects: dom · domain stage: agent_infra · users: ai_agent · canonical: unreached_review
// drift-probe.cjs <url>: OPUS-CONTROLLER-2. Pixel 7, SwiftShader flags. After load, report what the drift module shows:
// the #ky-drift section text (first 300 chars), any refusal text in #refuse, and the HUD's DRIFT line.
const { chromium, devices } = require('playwright');
(async () => {
const b = await chromium.launch({ args: ['--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'] });
const p = await (await b.newContext({ ...devices['Pixel 7'] })).newPage();
await p.goto(process.argv[2], { waitUntil: 'load' }); await p.waitForTimeout(15000);
const r = await p.evaluate(() => ({
admitted: (window.KY && KY.state && KY.state.admitted || []).map(m => m.id || m),
drift: (document.querySelector('#ky-drift') || {}).textContent ? document.querySelector('#ky-drift').textContent.replace(/\s+/g, ' ').slice(0, 300) : null,
refuse: (document.querySelector('#refuse') || {}).textContent || null,
hudDrift: ((document.querySelector('#hud') || {}).textContent || '').split('\n').filter(l => /DRIFT/i.test(l)).slice(0, 2),
}));
console.log(JSON.stringify(r)); await b.close();
})();