In this section
- E6 Cand Layers Index render · neural-link-between-agents / FIXES/NL-010/tools/controller/e6-cand-layers.index.html lines 701–812
- Frame other · neural-link-between-agents / FIXES/NL-010/tools/controller/frame.py lines 1–18
- Journey 6 render · neural-link-between-agents / FIXES/NL-010/tools/controller/journey-6.cjs lines 1–395
- Jrun T10 automation · neural-link-between-agents / FIXES/NL-010/tools/controller/jrun-t10.sh lines 1–7
- Jrun automation · neural-link-between-agents / FIXES/NL-010/tools/controller/jrun.sh lines 1–9
- K1 ingest · neural-link-between-agents / FIXES/NL-010/tools/controller/k1.py lines 1–5
- Poll automation · neural-link-between-agents / FIXES/NL-010/tools/controller/poll.sh lines 1–6
- Poll6 automation · neural-link-between-agents / FIXES/NL-010/tools/controller/poll6.sh lines 1–6
- Snap automation · neural-link-between-agents / FIXES/NL-010/tools/controller/snap.sh lines 1–10
- Snap6 automation · neural-link-between-agents / FIXES/NL-010/tools/controller/snap6.sh lines 1–18
- State automation · neural-link-between-agents / FIXES/NL-010/tools/controller/state.sh lines 1–12
- State6 automation · neural-link-between-agents / FIXES/NL-010/tools/controller/state6.sh lines 1–14
- Measure render · neural-link-between-agents / FIXES/NL-010/tools/evidence/nl009/01/measure.cjs lines 1–59
E6 Cand Layers Index
A web page in the controller folder of Neural Link Between Agents that converts to world (`toWorld`), steps anim (`stepAnim`), places panels (`placePanels`) and calculates planar distances, using SHA-256.
renderneural-link-between-agents / FIXES/NL-010/tools/controller/e6-cand-layers.index.html · lines 701–812 of 812 (continued from section 1628) · Entry point · pattern placePanels (shared by 2 files)
- What it does
- It draws its content. Defines 51 functions or classes, including fmt, words, refuse, prog, U. Side effects: changes the web page (DOM); makes network requests.
- 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; form fields (user input). Out: web page; WebGL/WebGPU drawing.
- Downstream impact
- It is itself an entry point (page); no other file was found loading it.
- What it achieves
- It shows new (`showNew`), places panels (`placePanels`) and sets panel (`setPanel`). Its `lightTime` function gives commit period summary or null from year, optional month and optional day (VEDIC: period). It reads `modules.json`. It responds to webglcontextlost, resize and pointerdown events.
- 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 · page
- VEDIC
- PERIOD (GG2050-VEDIC-000042): Kuiper / Code navigation · Computer science / Interactive visualisation. year, month_optional, day_optional, ordered_commits → commit_period_summary_or_null
- Uses
- none found
- Used by
- none found
- Produces
- fmt, words, refuse, prog, U, tsv, narrow, resize, flyTo, layout, safeBox, homeCamera
- Defines here
- kyLine, kyRefuse, kyHex, kyInject, se, kyAdmit
- 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/e6-cand-layers.index.html:701-812 · blob 5b21d06c0446faad750fd0206d65cbf52d3dcb07 · GitHub at these lines
- State
- achieves: code · context: auto · stage: output · effects: dom, network · domain stage: agent_infra · users: ai_agent · canonical: unknown
function kyLine(t){ kyLines.push(t); if (!N) hud.textContent += '\n' + t; dirty = true; }
// the one wrap of draw: module painters run after the engine's and the edition's overlay, in ascending order;
// a painter that throws is taken out and named, the frame goes on
{ const _draw = draw; draw = function(){ _draw();
if (kyLines.length) hud.textContent += '\nMODULES · ' + kyLines.join('\n');
for (const d of kyDraw.slice()) { try { d.fn(o2, KY); }
catch (e) { kyDraw.splice(kyDraw.indexOf(d), 1); kyLine(d.id + ' draw threw ' + (e && e.message || e) + ' · painter removed'); } } }; }
const KY_STATE = { schema: 'kuiper.modules.v1', edition: KY_EDITION, hooks: 'kuiper.hooks.v1', order: [], admitted: [],
refused: [], failures: [], done: false, timings: { loader_start_ms: Math.round(performance.now()) } };
const KY_MODULES = {};
const KY = Object.freeze({
schema: 'kuiper.hooks.v1', edition: KY_EDITION,
hooks: Object.freeze({
keyPlace, address, describe, findBy, flyTo, home, homeCamera, safeBox, lightTime, showNew, goKey, fmt, words, esc,
cv, ov, o2, hud, big, sub, card, gbox, gin,
get SPACE(){ return SPACE; }, get N(){ return N; }, get repos(){ return repos; }, get commits(){ return commits; },
wafer: kyWafer }),
cam: Object.freeze({ get x(){ return cx; }, get y(){ return cy; }, get zoom(){ return zoom; }, get atHome(){ return atHome; }, set atHome(v){ atHome = !!v; } }),
lit: Object.freeze({ get repo(){ return litRepo; }, set repo(v){ litRepo = v; dirty = true; },
get K(){ return litK; }, get Ci(){ return litCi; },
set period(p){ if (p == null) { litK = [-1, -1]; litCi = null; dirty = true; } else lightTime(+p.y, +p.m || 0, +p.d || 0); } }),
sel: Object.freeze({ get target(){ return target; }, set target(t){ target = t; dirty = true; } }),
redraw(){ dirty = true; },
draw: Object.freeze({ add(fn, order){ if (typeof fn !== 'function') throw new TypeError('KY.draw.add needs a function');
kyDraw.push({ fn, order: +order || 0, id: kyInstalling || 'module' }); kyDraw.sort((a, b) => a.order - b.order); dirty = true; } }),
// once the shell (team 1, id kuiper-shell) is admitted the bar and its panels are its own: add() forwards into the
// shell's panel of that name (handoff/01-shell/REQUESTS.md item 2); a name the shell does not have falls back here
panels: Object.freeze({ add(name, el, title){ const sh = KY_MODULES['kuiper-shell'], sp = sh && sh.api && typeof sh.api.panel === 'function' ? sh.api.panel(name) : null;
if (sp) { sp.appendChild(el); KY.redraw(); return el; }
if (PANELS[name]) throw new Error('panel ' + name + ' exists');
el.classList.add('gm-panel'); el.setAttribute('role', 'region'); el.setAttribute('aria-label', String(title || name));
if (!el.isConnected) document.body.appendChild(el); PANELS[name] = el; placePanels(); return el; },
set: setPanel, place: placePanels }),
refuse(text, slot){ if (typeof slot !== 'string' || !/^[a-z0-9-]+$/.test(slot) || slot === 'engine' || slot === 'modules')
throw new TypeError('KY.refuse(text, slot): slot is the module id; engine and modules are the page\'s'); refuse(String(text || ''), slot); },
names: KY_NAMES,
register(m){ if (!kyAdmitting) { kyLine('a registration outside admission ignored: ' + (m && m.id)); return false; }
if (kyAdmitting.reg) { kyAdmitting.twice = true; return false; } kyAdmitting.reg = m; return true; },
modules: KY_MODULES,
inspect(){ return JSON.parse(JSON.stringify(KY_STATE)); } });
window.KY = KY; window.__KUIPER_MODULES__ = KY_MODULES; window.__KUIPER_EDITION__ = KY_STATE;
// one strip, role=alert, for refused modules; the engine's own refusals keep their slot in the same strip
function kyRefuse(t){ refuse(t, 'modules'); }
const kyHex = b => [...new Uint8Array(b)].map(x => x.toString(16).padStart(2, '0')).join('');
function kyInject(id, buf){ return new Promise(ok => { const s = document.createElement('script'), u = URL.createObjectURL(new Blob([buf], { type: 'text/javascript' })), st = { loaded: false, error: null };
const se = e => { if (e.filename === u) { st.error = st.error || String(e.message || 'error').replace(/^Uncaught /, ''); e.preventDefault(); } }, fin = l => { removeEventListener('error', se, true); URL.revokeObjectURL(u); st.loaded = l; ok(st); };
addEventListener('error', se, true); s.dataset.kyModule = id; s.src = u; s.onload = () => fin(true); s.onerror = () => fin(false); document.head.appendChild(s); }); } // a module's own script error is its refusal, not the page's error
async function kyAdmit(id, rec, provided){
if (!rec) return 'in order but not in modules';
const path = String(rec.path || ''), file = path.split('/').pop();
if (!/^modules\/[a-z0-9][a-z0-9.-]*\.js$/.test(path) || path.includes('..')) return 'bad path ' + path;
if (!/^\d{12}$/.test(rec.generation || '')) return 'generation ' + rec.generation + ' is not twelve digits';
const fd = file.match(/^(\d{12})-/); if (fd && fd[1] !== rec.generation) return 'stamp mismatch: generation ' + rec.generation + ', file name ' + fd[1];
if (!/^[0-9a-f]{64}$/.test(rec.sha256 || '')) return 'sha256 is not 64 hex';
if (!String(rec.licence || '').trim()) return 'no licence'; for (const f of ['requires', 'provides']) if (rec[f] != null && !Array.isArray(rec[f])) return f + ' is not a list';
for (const r of rec.requires || []) if (!provided.has(r)) return 'missing hook ' + r;
let res; try { res = await fetch(path, { cache: 'no-store' }); } catch (e) { return 'fetch failed ' + (e && e.message || e); }
if (!res.ok) return 'HTTP ' + res.status;
const buf = await res.arrayBuffer(), sha = kyHex(await crypto.subtle.digest('SHA-256', buf));
if (sha !== rec.sha256) return 'sha256 mismatch';
if (buf.byteLength !== rec.bytes) return 'bytes ' + buf.byteLength + ' ≠ manifest ' + rec.bytes;
if (rec.byte_budget && buf.byteLength > rec.byte_budget) return 'over byte_budget ' + buf.byteLength + ' > ' + rec.byte_budget;
const head = new TextDecoder().decode(buf.slice(0, 200)).split('\n')[0].match(/^\/\* kuiper module ([a-z0-9-]+), generation (\d{12}) \(UTC\),/);
if (!head) return 'no header line'; if (head[1] !== id) return 'header names ' + head[1] + ' ≠ ' + id;
if (head[2] !== rec.generation) return 'stamp mismatch: generation ' + rec.generation + ', header ' + head[2];
kyAdmitting = { id }; let reg, twice;
let inj; try { inj = await kyInject(id, buf); } finally { reg = kyAdmitting.reg; twice = kyAdmitting.twice; kyAdmitting = null; } if (!inj.loaded) return 'script did not load'; if (inj.error) return 'script error: ' + inj.error;
if (!reg) return 'no registration';
if (twice) return 'registered twice';
if (reg.schema !== 'kuiper.module.v1') return 'schema ' + reg.schema;
if (reg.id !== id) return 'id ' + reg.id + ' ≠ ' + id; for (const f of ['requires', 'provides']) if (reg[f] != null && !Array.isArray(reg[f])) return 'registration ' + f + ' is not a list';
if (reg.generation !== rec.generation) return 'stamp mismatch: generation ' + rec.generation + ', registration ' + reg.generation;
for (const r of reg.requires || []) { if (!(rec.requires || []).includes(r)) return 'requires ' + r + ' not in the manifest'; if (!provided.has(r)) return 'missing hook ' + r; }
if (typeof reg.install !== 'function') return 'no install';
let api; kyInstalling = id;
try { api = reg.install(KY); } catch (e) { return 'install threw ' + (e && e.message || e); } finally { kyInstalling = null; }
const ready = Promise.resolve(api);
ready.catch(e => { KY_STATE.failures.push({ id, why: 'install rejected ' + (e && e.message || e) }); kyLine(id + ' install rejected: ' + (e && e.message || e)); });
Object.defineProperty(KY_MODULES, id, { enumerable: true, value: Object.freeze({ id, generation: rec.generation, sha256: sha,
api: (api && typeof api.then === 'function') ? undefined : api, ready, inspect: typeof reg.inspect === 'function' ? reg.inspect : () => ({}) }) });
for (const p of [id, ...(reg.provides || []), ...(rec.provides || [])]) provided.add(p);
return null;
}
(async function kyLoad(){
let m;
try { const r = await fetch('modules.json', { cache: 'no-store' }); if (!r.ok) throw new Error('modules.json HTTP ' + r.status); m = await r.json(); if (!m || typeof m !== 'object') throw new Error('modules.json is not an object'); }
catch (e) { m = { error: e && e.message || String(e) }; }
const shape = m.error ? m.error : m.schema !== 'kuiper.modules.v1' ? 'schema ' + m.schema : m.hooks !== 'kuiper.hooks.v1' ? 'hooks ' + m.hooks
: m.edition !== KY_EDITION ? 'edition ' + m.edition + ' ≠ page ' + KY_EDITION : !Array.isArray(m.order) || !Array.isArray(m.modules) ? 'order and modules must be lists'
: !crypto.subtle ? 'no crypto.subtle (not a secure context)' : null;
if (shape) { KY_STATE.whole = shape; KY_STATE.done = true; kyRefuse('MODULES NOT ADMITTED: ' + shape + ' · the wafer is unchanged'); kyLine('modules not admitted: ' + shape); return; }
KY_STATE.order = m.order.slice();
const provided = new Set(KY_NAMES), seen = new Set();
for (const id of m.order) {
let why; try { why = seen.has(id) ? 'in order twice' : await kyAdmit(id, m.modules.find(x => x && x.id === id), provided); } catch (e) { kyAdmitting = kyInstalling = null; why = 'loader error ' + (e && e.message || e); }
const t = Math.round(performance.now()); seen.add(id);
if (why) { KY_STATE.refused.push({ id, why, t_ms: t }); kyLine(id + ' refused: ' + why); }
else { KY_STATE.admitted.push({ id, sha256: KY_MODULES[id].sha256, t_ms: t }); kyLine(id + ' admitted · ' + KY_MODULES[id].sha256.slice(0, 12)); }
}
KY_STATE.timings.last_admitted_ms = KY_STATE.admitted.length ? KY_STATE.admitted[KY_STATE.admitted.length - 1].t_ms : null;
KY_STATE.timings.loader_end_ms = Math.round(performance.now());
KY_STATE.bytes = m.modules.filter(x => x && KY_MODULES[x.id]).reduce((a, x) => a + (x.bytes || 0), 0);
KY_STATE.byte_budget = m.modules.filter(x => x && KY_MODULES[x.id]).reduce((a, x) => a + (x.byte_budget || 0), 0);
KY_STATE.done = true; for (const k of ['order', 'admitted', 'refused', 'timings']) Object.freeze(KY_STATE[k]); // KY.modules stays open: the shell publishes .menuBar there (01-shell REQUESTS 2)
if (KY_STATE.refused.length) kyRefuse(KY_STATE.refused.length + ' module' + (KY_STATE.refused.length > 1 ? 's' : '') + ' refused: '
+ KY_STATE.refused.map(x => x.id + ' (' + x.why + ')').join('; ') + ' · the wafer, the bar and every admitted module keep working');
})();
// ======================================== KUIPER HOOK TABLE AND LOADER kuiper.hooks.v1 · end
requestAnimationFrame(frame);
</script>
</body>
</html>Frame
A Python module in the controller folder of Neural Link Between Agents.
otherneural-link-between-agents / FIXES/NL-010/tools/controller/frame.py · lines 1–18 of 18 · Not reached from any entry point (candidate for review)
- What it does
- Uses libraries sys, PIL.
- 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
- 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.
- Application
- neural-link-between-agents · FIXES/NL-010/tools/controller · Python module
- Uses
- sys, PIL
- 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/frame.py:1-18 · blob e0e3ab6b898a875b706f0fec3118d4d08e90c1fa · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: none found · domain stage: agent_infra · users: ai_agent · canonical: unreached_review
# frame.py <png> <W> <H> <barBottom>: the journey's wafer rule (lum > 34 under the bar) on a saved step frame
import sys
from PIL import Image
p, W, H, yb = sys.argv[1], int(sys.argv[2]), int(sys.argv[3]), float(sys.argv[4])
# optional mask x0,y0,x1,y1 (the SEE THROUGH strip, chrome not wafer, as the script masks #kuiper-star-strip)
M = [int(v) for v in sys.argv[5].split(',')] if len(sys.argv) > 5 else None
im = Image.open(p).convert('RGB'); print('png', im.size)
im = im.resize((W, H), Image.BILINEAR); d = im.load()
lit = tot = 0; minx = miny = 10**9; maxx = maxy = -1
for y in range(max(0, int(yb)), H):
for x in range(W):
if M and M[0] <= x <= M[2] and M[1] <= y <= M[3]: continue
r, g, b = d[x, y]; tot += 1
if 0.299*r + 0.587*g + 0.114*b > 34:
lit += 1; minx = min(minx, x); miny = min(miny, y); maxx = max(maxx, x); maxy = max(maxy, y)
bw, bh = maxx-minx+1, maxy-miny+1
whole = bw > 0.4*min(W, H-yb) and abs(bw/bh-1) < 0.25 and miny >= yb-1 and maxy <= H
print({'bbox': [minx, miny, maxx, maxy], 'bboxW': bw, 'bboxH': bh, 'ratio': round(min(bw, bh)/max(bw, bh), 3), 'litFraction': round(lit/tot, 4), 'whole_by_script_rule': whole})Journey 6
A JavaScript module in the controller folder of Neural Link Between Agents that runs device (`runDevice`), converts to screen (`toScreen`), calculates planar distances and draws on a canvas.
renderneural-link-between-agents / FIXES/NL-010/tools/controller/journey-6.cjs · lines 1–395 of 395 · Entry point · pattern shotPng (shared by 3 files)
- What it does
- It draws its content. Defines 29 functions or classes, including flag, slug, sleep, probeFn, R. 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 keys.json; command-line arguments. Out: JSON file report.json; canvas drawing.
- Downstream impact
- It is itself an entry point (JavaScript module); no other file was found loading it.
- What it achieves
- It runs device (`runDevice`) and is built from the probe fn helper (`probeFn`) and the vis step (`vis`). Defines `flag`, `slug`, `sleep` and 24 more. It reads `keys.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/tools/controller · JavaScript module
- Uses
- playwright, fs, path
- Used by
- none found
- Produces
- flag, slug, sleep, probeFn, R, vis, q, panelEl, hitAt, waferFromPng, masked, keyPlace
- Defines here
- flag, slug, sleep, probeFn, R, vis, q, panelEl, hitAt, waferFromPng, masked, keyPlace, runDevice, probe, shot, shotPng, record, tapAt, tapRect, touch, settle, framesPass, clearSpace, cardCapPx, cardUnderCap, titleRect, solve, toScreen, pinchAt
- 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/journey-6.cjs:1-395 · blob 59f868ef7b2e547a56f6f3bfd2d45cd7a4edf413 · GitHub at these lines
- State
- achieves: name · context: auto · stage: output · effects: dom, filesystem, network, process · domain stage: agent_infra · users: ai_agent · canonical: duplicate_candidate
#!/usr/bin/env node
// journey-6.cjs (OPUS-CONTROLLER, 2026-11-02): journey-5.cjs plus one selector change, no threshold changed: on a page
// without the shell where Edition 4's #lines was cut by Opus 3 (delete-moved.py), the LINES title's panel is #layers,
// the element layers.js:285 registers for that title through KY.panels.add('lines', panel, 'WAFER').
// journey-5.cjs — FIXES/NL-009/android-journey.cjs adapted by the Edition 5 integrator (Opus team 10, NL-010 step 10).
// Same steps, same measurements, same pass rules. Changes, all in the probe and the selectors, none in a threshold:
// (1) the bar is #kuiper-menu-bar (Opus 1's shell) when it is shown, else Edition 4's #bar; a title's logical panel is
// its data-panel (Edition 4) or, in the shell, ABOUT=top (the edition text), WAFER=lines, VIEW=foot and hud; a
// panel is the element its title's aria-controls names; open = gm-on or aria-expanded=true;
// (2) the card's controls are Edition 4's (.cx .ct .cd, class open) or line-card's (.lc-x .lc-t .lc-d, class lc-open);
// (3) WHOLE WAFER is the visible [data-k=Backspace] wherever the shell moved it; SEE THROUGH is searched in the bar,
// #kuiper-star and #kuiper-star-strip;
// (5) the wafer-disc measurement masks the star strip (#kuiper-star-strip / #kuiper-star below the bar): chrome, not wafer;
// (4) one new step, 'modules': every modules.json order entry admitted, refused empty (ROADMAP 9.4 'every module
// admitted'); on a page without the loader it records PASS with the note 'no loader on this page'.
// Original header follows.
// android-journey.cjs — the Android end-to-end journey of a Kuiper edition, measured, not eyeballed.
//
// node android-journey.cjs <url> <outdir> [--device "Pixel 7"] [--all] [--devices "Pixel 7,Galaxy S24"]
//
// Runs on Pixel 7 by default; --all adds Galaxy S24 and Pixel 7 landscape. Real touch only
// (page.touchscreen.tap for taps, CDP Input.dispatchTouchEvent for pinch, drag and in-panel scroll;
// the keyboard is used only for the three presses of "e" and for typing the filter). Every step
// takes a screenshot into <outdir>/<device>/NN-<step>.png and records a measured assertion. The JSON
// report goes to stdout and to <outdir>/report.json. Exit code 0 when every step of every device
// passed, 1 otherwise, 2 on a harness error.
//
// Element ids and texts the script relies on (keep them in later editions or update this list):
// #bar with .gm-title buttons carrying data-panel="top" (text EDITION), "hud" (READOUT), "lines" (LINES),
// "foot" (COMMANDS); a SEE THROUGH control is any <button> or <a> in #bar whose text matches /see ?through/i
// or whose href contains "see-through"; the open title carries class gm-on
// panels: #top (EDITION, with #big and #sub inside), #hud, #lines, #foot; an open panel carries class gm-open
// #lines: #lyFind (filter input), #lineslist with rows .ln[data-i]
// #foot: #keys button[data-k="Backspace"] (text WHOLE WAFER)
// #card: shown with style display:block; title line "<b>title</b> <span>n of N</span>"; .ct toggles details
// (class open on #card, .cd becomes visible); .cx closes
// canvases: #c (WebGL wafer), #o (2d overlay where the sparks are drawn: green rgba(34,238,119), the selected
// spark magenta rgba(255,43,214) with a 14 px ring); #o.width === innerWidth (1 canvas px = 1 CSS px)
// keys.json next to the page: bodies[] with key, on_wafer, verified, in the order the page uses (edPlaced)
// #big text contains "verified lines lit" once keys.json has loaded
'use strict';
const { chromium, devices } = require('playwright');
const fs = require('fs'), path = require('path');
const argv = process.argv.slice(2);
const positional = argv.filter(a => !a.startsWith('--'));
const flag = (n) => { const i = argv.indexOf(n); return i >= 0 ? (argv[i + 1] || true) : null; };
if (positional.length < 2) { console.error('usage: node android-journey.cjs <url> <outdir> [--device NAME] [--all] [--devices A,B]'); process.exit(2); }
const URL0 = positional[0], OUT = path.resolve(positional[1]);
let DEVICES = ['Pixel 7'];
if (flag('--all')) DEVICES = ['Pixel 7', 'Galaxy S24', 'Pixel 7 landscape'];
if (flag('--device')) DEVICES = [String(flag('--device'))];
if (flag('--devices')) DEVICES = String(flag('--devices')).split(',').map(s => s.trim()).filter(Boolean);
const SETTLE_MAX = 90000, APPEAR_MAX = 90000, FIXED_WAIT = 6500, MARGIN = 10; // px margin for "clear space"
const slug = s => s.toLowerCase().replace(/[^a-z0-9]+/g, '-').replace(/^-|-$/g, '');
const sleep = ms => new Promise(r => setTimeout(r, ms));
// ------------------------------------------------------------------ in-page probes (self-contained)
function probeFn() {
const R = el => { if (!el) return null; const r = el.getBoundingClientRect(); return { left: +r.left.toFixed(1), top: +r.top.toFixed(1), right: +r.right.toFixed(1), bottom: +r.bottom.toFixed(1), width: +r.width.toFixed(1), height: +r.height.toFixed(1) }; };
const vis = el => !!el && getComputedStyle(el).display !== 'none' && el.getBoundingClientRect().height > 0;
const q = s => document.querySelector(s);
const kmb = q('#kuiper-menu-bar'), shell = !!kmb && vis(kmb), bar = shell ? kmb : q('#bar'), card = q('#card');
const SHELLMAP = { ABOUT: 'top', WAFER: 'lines', VIEW: 'foot' };
const titleEls = bar ? [...bar.querySelectorAll('.gm-title')] : [];
const titles = titleEls.map(b => ({ text: b.textContent.trim(), panel: shell ? (SHELLMAP[b.textContent.trim().toUpperCase()] || b.textContent.trim().toLowerCase()) : b.dataset.panel, on: b.classList.contains('gm-on') || b.getAttribute('aria-expanded') === 'true', rect: R(b) }));
const panelEl = id => { if (!shell) return q('#' + id) || (id === 'lines' ? q('#layers') : null); const t = titleEls.find(b => (SHELLMAP[b.textContent.trim().toUpperCase()] || '') === (id === 'hud' ? 'foot' : id)); return t && t.getAttribute('aria-controls') ? document.getElementById(t.getAttribute('aria-controls')) : null; };
const barname = shell ? bar.querySelector('.gm-brand-slot') : q('#barname');
// the overlay canvas: magenta = selected spark, green = sparks
let magenta = null, greens = [], overlayOk = false;
const ov = q('#o');
if (ov && ov.width > 0) {
try {
const ctx = ov.getContext('2d'); const W = ov.width, H = ov.height; const d = ctx.getImageData(0, 0, W, H).data;
let sx = 0, sy = 0, n = 0, minx = 1e9, miny = 1e9, maxx = -1, maxy = -1; const gp = [];
for (let y = 0; y < H; y++) for (let x = 0; x < W; x++) { const i = (y * W + x) * 4, r = d[i], g = d[i + 1], b = d[i + 2], a = d[i + 3];
if (a < 60) continue;
if (r > 180 && g < 110 && b > 140) { sx += x; sy += y; n++; if (x < minx) minx = x; if (y < miny) miny = y; if (x > maxx) maxx = x; if (y > maxy) maxy = y; }
else if (g > 150 && r < 120 && b < 170 && a > 120) gp.push([x, y]); }
overlayOk = true;
if (n > 0) magenta = { x: +(sx / n).toFixed(1), y: +(sy / n).toFixed(1), px: n, bbox: [minx, miny, maxx, maxy] };
// greedy clustering of green pixels into sparks
const cl = [];
for (const [x, y] of gp) { let hit = null; for (const c of cl) { if (Math.abs(c.cx - x) <= 7 && Math.abs(c.cy - y) <= 7) { hit = c; break; } }
if (hit) { hit.sx += x; hit.sy += y; hit.n++; hit.cx = hit.sx / hit.n; hit.cy = hit.sy / hit.n; } else cl.push({ sx: x, sy: y, n: 1, cx: x, cy: y }); }
greens = cl.filter(c => c.n >= 6).map(c => ({ x: +c.cx.toFixed(1), y: +c.cy.toFixed(1), px: c.n }));
} catch (e) { overlayOk = false; }
}
const cardOpen = vis(card);
let cardIndex = null, cardTotal = null;
if (cardOpen) { const m = card.textContent.match(/(\d[\d,]*)\s+of\s+(\d[\d,]*)/); if (m) { cardIndex = +m[1].replace(/,/g, ''); cardTotal = +m[2].replace(/,/g, ''); } }
const cs = cardOpen ? getComputedStyle(card) : null;
const hitAt = (x, y) => { const el = document.elementFromPoint(x, y); return el ? (el.id ? '#' + el.id : el.tagName.toLowerCase() + (el.className ? '.' + String(el.className).split(' ')[0] : '')) : null; };
return {
viewport: { w: innerWidth, h: innerHeight, dpr: devicePixelRatio, scrollX: scrollX, scrollY: scrollY, vvScale: visualViewport ? visualViewport.scale : null, vvOffset: visualViewport ? [visualViewport.offsetLeft, visualViewport.offsetTop] : null },
bar: R(bar), barScroll: bar ? { scrollWidth: bar.scrollWidth, clientWidth: bar.clientWidth } : null, barname: barname ? { text: barname.textContent.trim(), rect: R(barname) } : null, titles,
shell, panels: Object.fromEntries(['top', 'hud', 'lines', 'foot'].map(id => { const el = panelEl(id); return [id, el ? { visible: vis(el), open: el.classList.contains('gm-open'), rect: R(el), overflowY: getComputedStyle(el).overflowY, scrollHeight: el.scrollHeight, clientHeight: el.clientHeight, scrollTop: el.scrollTop } : null]; })),
sub: q('#sub') ? { scrollHeight: q('#sub').scrollHeight, clientHeight: q('#sub').clientHeight, scrollTop: q('#sub').scrollTop, overflowY: getComputedStyle(q('#sub')).overflowY } : null,
card: { open: cardOpen, rect: cardOpen ? R(card) : null, maxHeight: cs ? cs.maxHeight : null, height: cardOpen ? card.getBoundingClientRect().height : 0, scrollHeight: card.scrollHeight, detailsOpen: card.classList.contains('open') || card.classList.contains('lc-open'), index: cardIndex, total: cardTotal, title: cardOpen ? (card.querySelector('.lc-title, b') ? card.querySelector('.lc-title, b' … [line shortened here: 703 characters; full line on GitHub]
lines: { rows: document.querySelectorAll('#lineslist .ln[data-i]').length, firstRow: R(q('#lineslist .ln[data-i]')), firstRowText: q('#lineslist .ln[data-i]') ? q('#lineslist .ln[data-i]').textContent.trim().slice(0, 120) : null, allRowsMatch: null, find: R(q('#lyFind')), findValue: q('#lyFind') ? q('#lyFind').value : null },
big: q('#big') ? q('#big').textContent : null,
overlayOk, magenta, greens, greensCount: greens.length,
hitAtMagenta: magenta ? hitAt(magenta.x, magenta.y) : null,
seeThrough: (() => { const els = [...document.querySelectorAll('#kuiper-star, #kuiper-star-strip a, #kuiper-star-strip button, ' + (bar && bar.id ? '#' + bar.id : '#bar') + ' button, ' + (bar && bar.id ? '#' + bar.id : '#bar') + ' a')].filter(vis); const el = els.find(e => /see\s*-?\s*through/i.test(e.textContent) || /see-through/i.test(e.getAttribute('href') || '')); return el ? { text: el.te … [line shortened here: 542 characters; full line on GitHub]
activeElement: document.activeElement ? (document.activeElement.id || document.activeElement.tagName) : null,
frames: window.__fr || 0,
};
}
// screenshot analysis: paint the PNG onto a canvas sized like the viewport and measure the lit pixels under the bar
async function waferFromPng(page, b64, yFrom) {
return page.evaluate(async ({ b64, yFrom }) => {
const img = new Image(); img.src = 'data:image/png;base64,' + b64; await img.decode();
const W = innerWidth, H = innerHeight, c = document.createElement('canvas'); c.width = W; c.height = H;
const g = c.getContext('2d'); g.drawImage(img, 0, 0, W, H); const d = g.getImageData(0, 0, W, H).data;
let lit = 0, tot = 0, minx = 1e9, miny = 1e9, maxx = -1, maxy = -1;
// Edition 5: the star entry's bottom-left strip (Opus 1/5, GridAtlas's phone chip) is chrome, not wafer: masked
const mask = [...document.querySelectorAll('#kuiper-star-strip, #kuiper-star')].map(e => e.getBoundingClientRect()).filter(r => r.height > 0 && r.top > yFrom);
const masked = (x, y) => mask.some(r => x >= r.left - 2 && x <= r.right + 2 && y >= r.top - 2 && y <= r.bottom + 2);
for (let y = Math.max(0, Math.floor(yFrom)); y < H; y++) for (let x = 0; x < W; x++) { const i = (y * W + x) * 4; if (masked(x, y)) continue; tot++;
const lum = 0.299 * d[i] + 0.587 * d[i + 1] + 0.114 * d[i + 2];
if (lum > 34) { lit++; if (x < minx) minx = x; if (y < miny) miny = y; if (x > maxx) maxx = x; if (y > maxy) maxy = y; } }
return { litFraction: +(lit / Math.max(1, tot)).toFixed(4), litPx: lit, bbox: lit ? [minx, miny, maxx, maxy] : null, bboxW: lit ? maxx - minx + 1 : 0, bboxH: lit ? maxy - miny + 1 : 0 };
}, { b64, yFrom });
}
// the placement law, the same arithmetic as the page: used only to predict which spark is nearest to a tap
const G32 = 2654435769;
function keyPlace(k) { const m = Math.imul((k % 4294967296) >>> 0, G32) >>> 0, th = 2 * Math.PI * m / 4294967296, r = Math.sqrt(k + 0.5); return [r * Math.cos(th), r * Math.sin(th)]; }
// ------------------------------------------------------------------ one device run
async function runDevice(browser, deviceName) {
const dev = devices[deviceName];
if (!dev) throw new Error('unknown Playwright device: ' + deviceName);
const dir = path.join(OUT, slug(deviceName)); fs.mkdirSync(dir, { recursive: true });
const context = await browser.newContext({ ...dev, locale: 'en-GB' });
const page = await context.newPage(); page.setDefaultTimeout(180000);
await page.addInitScript(() => { let n = 0; const f = () => { n++; window.__fr = n; requestAnimationFrame(f); }; requestAnimationFrame(f); }); // counts drawn frames, so "settled" means unchanged across frames, not across wall time
const errors = [];
page.on('console', m => { if (m.type() === 'error') errors.push({ kind: 'console', text: m.text().slice(0, 300) }); });
page.on('pageerror', e => errors.push({ kind: 'pageerror', text: String(e.message || e).slice(0, 300) }));
page.on('requestfailed', r => { const f = r.failure(); if (f && !/aborted|ERR_ABORTED/i.test(f.errorText)) errors.push({ kind: 'request', text: r.url().slice(0, 200) + ' ' + f.errorText }); });
const cdp = await context.newCDPSession(page);
const steps = []; let n = 0, stepT0 = Date.now();
const probe = () => page.evaluate(probeFn);
const shot = async (id) => { // a screenshot waits for a frame, and a frame at zoom 14 under SwiftShader on a loaded machine can take minutes: never let it abort the journey
const f = path.join(dir, String(++n).padStart(2, '0') + '-' + id + '.png');
for (let attempt = 0; attempt < 2; attempt++) { try { await page.screenshot({ path: f, scale: 'css', timeout: 180000 }); return path.relative(OUT, f); } catch (e) { if (attempt) return 'FAILED: ' + String(e.message || e).split('\n')[0]; } }
};
const shotPng = async () => { try { return await page.screenshot({ type: 'png', scale: 'css', timeout: 180000 }); } catch (e) { return null; } };
const record = (id, name, pass, measured, note) => { const s = { id, name, pass: !!pass, ms: Date.now() - stepT0, measured, note: note || '' }; stepT0 = Date.now(); steps.push(s); process.stderr.write(`[${deviceName}] ${pass ? 'PASS' : 'FAIL'} ${id}${note ? ' — ' + note : ''}\n`); return s; };
const tapAt = (x, y) => page.touchscreen.tap(Math.round(x), Math.round(y));
const tapRect = async (r) => { if (!r) throw new Error('no rect to tap'); await tapAt((r.left + r.right) / 2, (r.top + r.bottom) / 2); };
const touch = async (type, points) => cdp.send('Input.dispatchTouchEvent', { type, touchPoints: points.map((p, i) => ({ x: p[0], y: p[1], id: i + 1, radiusX: 4, radiusY: 4, force: 1 })) });
const settle = async (opts = {}) => {
// Under SwiftShader on a loaded machine a frame can take seconds, and a position that is unchanged for a second of wall
// time may be one stale frame from the middle of a fly. So "settled" is: the selected spark is drawn, and its position is
// unchanged across at least two further frames (the rAF counter advanced by 2). The measurement is the final position.
const t0 = Date.now(); let last = null, seen = 0, f0 = -1;
while (true) { await sleep(300); const p = await probe(); const t = Date.now() - t0;
if (!p.magenta) { if (opts.noSpark) { if (f0 < 0) f0 = p.frames; if (t >= FIXED_WAIT && p.frames - f0 >= 2) return p; if (t >= SETTLE_MAX) return p; continue; }
if (t >= APPEAR_MAX) return p; continue; }
if (!seen) seen = Date.now();
if (last && Math.hypot(p.magenta.x - last.x, p.magenta.y - last.y) < 0.6) { if (p.frames - last.frames >= 2) return p; }
else last = { x: p.magenta.x, y: p.magenta.y, frames: p.frames };
if (Date.now() - seen >= SETTLE_MAX) return p; }
};
const framesPass = async (k, max = 60000) => { const f0 = await page.evaluate(() => window.__fr || 0), t0 = Date.now(); while (Date.now() - t0 < max) { await sleep(250); if ((await page.evaluate(() => window.__fr || 0)) - f0 >= k) return true; } return false; };
const clearSpace = (p) => { // the spark must sit between the bar and the card, with margins, and the hit test must land on the wafer
if (!p.magenta) return { ok: false, why: 'no selected spark drawn on #o' };
const top = p.bar.bottom + MARGIN, bot = (p.card.open ? p.card.rect.top : p.viewport.h) - MARGIN;
const okY = p.magenta.y >= top && p.magenta.y <= bot, okX = p.magenta.x >= MARGIN && p.magenta.x <= p.viewport.w - MARGIN;
const okHit = p.hitAtMagenta === '#c' || p.hitAtMagenta === '#o' || p.hitAtMagenta === 'canvas';
return { ok: okY && okX && okHit, sparkY: p.magenta.y, sparkX: p.magenta.x, barBottom: p.bar.bottom, cardTop: p.card.open ? p.card.rect.top : null, windowY: [top, bot], hitTest: p.hitAtMagenta, why: okY && okX ? (okHit ? '' : 'spark covered by ' + p.hitAtMagenta) : 'spark at y=' + p.magenta.y + ' outside [' + top + ',' + bot + ']' };
};
const cardCapPx = (p) => { const mh = p.card.maxHeight || ''; const m = mh.match(/([\d.]+)(vh|px)/); if (!m) return null; return m[2] === 'vh' ? +m[1] / 100 * p.viewport.h : +m[1]; };
const cardUnderCap = (p) => { const cap = cardCapPx(p); return { cap: cap && +cap.toFixed(1), height: p.card.height, ok: !p.card.open || (cap == null ? p.card.rect.bottom <= p.viewport.h + 1 : p.card.height <= cap + 1 && p.card.rect.bottom <= p.viewport.h + 1) }; };
let bodies = [], placed = []; // keys.json, for the nearest-spark prediction
const report = { device: deviceName, viewport: dev.viewport, dpr: dev.deviceScaleFactor, url: URL0, startedAt: new Date().toISOString(), steps, consoleErrors: errors, pass: false };
try {
// 1 load
const t0 = Date.now();
await page.goto(URL0, { waitUntil: 'load', timeout: 120000 });
await page.waitForFunction(() => /verified lines lit/.test((document.getElementById('big') || {}).textContent || ''), null, { timeout: 60000 }).catch(() => {});
await sleep(FIXED_WAIT);
const frames = await page.evaluate(() => new Promise(res => { const t = []; let last = performance.now(); const f = () => { const now = performance.now(); t.push(now - last); last = now; if (t.length < 12) requestAnimationFrame(f); else res(t); }; requestAnimationFrame(f); setTimeout(() => res(t), 6000); }));
let p = await probe();
// the first frames under SwiftShader can take long: the wafer check is retried across drawn frames before it counts as absent
let png = null, wafer = null, waferOk = false, waferTries = 0;
for (; waferTries < 4 && !waferOk; waferTries++) {
if (waferTries) await framesPass(2, 40000);
p = await probe(); png = await shotPng();
wafer = png ? await waferFromPng(page, png.toString('base64'), p.bar ? p.bar.bottom : 0) : { error: 'screenshot timed out', litFraction: 0, bbox: null };
const clearMin = Math.min(p.viewport.w, p.viewport.h - (p.bar ? p.bar.bottom : 0));
waferOk = wafer.litFraction > 0.03 && !!wafer.bbox && wafer.bboxW > 0.4 * clearMin && Math.abs(wafer.bboxW / wafer.bboxH - 1) < 0.25;
}
const tops = p.titles.map(t => t.rect.top); // the buttons' tops: one row means they all share one, the bar is under two button heights, and nothing is clipped off the right
const nameInRow = !p.barname || !p.barname.rect || (p.barname.rect.bottom <= Math.max(...p.titles.map(t => t.rect.bottom)) + 4 && p.barname.rect.top >= Math.min(...tops) - 4);
const oneRow = p.bar && tops.length && Math.max(...tops) - Math.min(...tops) < 4 && nameInRow && p.bar.height < 2 * Math.min(...p.titles.map(t => t.rect.height)) && p.barScroll.scrollWidth <= p.barScroll.clientWidth + 1;
const fr = frames.slice(1).sort((a, b) => a - b);
record('load', 'load: zero console errors, wafer drawn, bar one row', errors.length === 0 && waferOk && oneRow,
{ loadMs: Date.now() - t0, consoleErrors: errors.slice(), big: p.big, wafer, waferTries, bar: p.bar, barTitles: p.titles.map(t => t.text), titleTops: tops, barScroll: p.barScroll, oneRow: !!oneRow, sparksVisible: p.greensCount, frameMs: fr.length ? { median: +fr[fr.length >> 1].toFixed(0), max: +fr[fr.length - 1].toFixed(0) } : null, screenshot: await shot('load') },
[errors.length ? errors.length + ' console error(s)' : '', waferOk ? '' : 'wafer not detected as a disc under the bar', oneRow ? '' : 'bar is not one row (button tops ' + tops.join('/') + ', bar height ' + (p.bar && p.bar.height) + ', scrollWidth ' + p.barScroll.scrollWidth + '/' + p.barScroll.clientWidth + ')'].filter(Boolean).join('; '));
{ const t1 = Date.now(); let ms = null; while (Date.now() - t1 < 60000) { ms = await page.evaluate(() => { const s = window.__KUIPER_EDITION__; return s ? { done: !!s.done, order: s.order, admitted: (s.admitted || []).map(a => a.id), refused: s.refused, failures: s.failures, whole: s.whole || null, timings: s.timings, bytes: s.bytes, byte_budget: s.byte_budget } : null; }); if (!ms || ms.done) … [line shortened here: 427 characters; full line on GitHub]
const okM = !ms || (ms.done && !ms.whole && ms.refused.length === 0 && (ms.failures || []).length === 0 && JSON.stringify(ms.admitted) === JSON.stringify(ms.order));
record('modules', 'every modules.json order entry admitted in order, none refused', okM, { modules: ms, consoleErrorsSoFar: errors.length },
!ms ? 'no loader on this page' : (okM ? ms.admitted.length + ' admitted: ' + ms.admitted.join(', ') : 'admitted ' + JSON.stringify(ms.admitted) + ' of ' + JSON.stringify(ms.order) + '; refused ' + JSON.stringify(ms.refused) + (ms.whole ? '; whole set refused: ' + ms.whole : '') + ((ms.failures || []).length ? '; failures ' + JSON.stringify(ms.failures) : ''))); }
try { const j = await page.evaluate(async () => (await (await fetch('keys.json')).json())); bodies = j.bodies || j; placed = bodies.filter(b => b.on_wafer && b.verified && Number.isFinite(b.key) && b.key >= 0).map(b => { const [x, y] = keyPlace(b.key); return { key: b.key, x, y, title: b.title, repo: b.repo }; }); } catch (e) { placed = []; }
// 2 EDITION opens
const titleRect = (panel) => { const t = p.titles.find(t => t.panel === panel); return t && t.rect; };
await tapRect(titleRect('top')); await framesPass(1); p = await probe();
const tp = p.panels.top; let scrolled = null;
if (tp && tp.visible) {
const sh = Math.max(tp.scrollHeight - tp.clientHeight, p.sub ? p.sub.scrollHeight - p.sub.clientHeight : 0);
if (sh > 8) { // a one-finger drag upward inside the panel must scroll the panel, not the page
const x = (tp.rect.left + tp.rect.right) / 2, y0 = tp.rect.bottom - 30, y1 = Math.max(tp.rect.top + 20, y0 - 160);
await touch('touchStart', [[x, y0]]); for (let i = 1; i <= 10; i++) { await touch('touchMove', [[x, y0 + (y1 - y0) * i / 10]]); await sleep(25); } await touch('touchEnd', []); await framesPass(2);
const q = await probe(); scrolled = { panelScrollTop: q.panels.top.scrollTop, subScrollTop: q.sub ? q.sub.scrollTop : null, pageScrollY: q.viewport.scrollY, scrollable: sh };
scrolled.ok = (scrolled.panelScrollTop > 4 || (scrolled.subScrollTop || 0) > 4) && q.viewport.scrollY === 0;
} else scrolled = { scrollable: sh, ok: true, note: 'panel content fits, nothing to scroll' };
}
const underBar = tp && tp.visible && tp.rect.top >= p.bar.bottom - 1 && tp.rect.bottom <= p.viewport.h + 1 && /auto|scroll/.test(tp.overflowY);
record('edition-open', 'tap EDITION: panel opens under the bar and scrolls inside', tp && tp.visible && underBar && scrolled && scrolled.ok,
{ panel: tp, barBottom: p.bar.bottom, titleOn: (p.titles.find(t => t.panel === 'top') || {}).on, scroll: scrolled, screenshot: await shot('edition-open') },
!tp || !tp.visible ? 'EDITION panel did not open' : (!underBar ? 'panel top ' + tp.rect.top + ' vs bar bottom ' + p.bar.bottom + ', bottom ' + tp.rect.bottom + ', overflow ' + tp.overflowY : (scrolled && !scrolled.ok ? 'drag inside the panel did not scroll it (scrollTop ' + scrolled.panelScrollTop + '/' + scrolled.subScrollTop + ')' : '')));
// 3 EDITION closes
await tapRect(titleRect('top')); await framesPass(1); p = await probe();
record('edition-close', 'tap EDITION again: panel closes', !p.panels.top.visible && !(p.titles.find(t => t.panel === 'top') || {}).on, { panel: p.panels.top, screenshot: await shot('edition-close') }, p.panels.top.visible ? 'panel still visible' : '');
// 4 LINES
await tapRect(titleRect('lines')); await sleep(800); p = await probe();
const lp = p.panels.lines;
record('lines-open', 'tap LINES: panel opens under the bar with the rows', lp.visible && lp.rect.top >= p.bar.bottom - 1 && lp.rect.bottom <= p.viewport.h + 1 && p.lines.rows > 0,
{ panel: lp, rows: p.lines.rows, firstRow: p.lines.firstRow, find: p.lines.find, screenshot: await shot('lines-open') }, lp.visible ? (p.lines.rows ? '' : 'no rows') : 'LINES did not open');
// 5 filter "acceptance"
if (p.lines.find) { await tapRect(p.lines.find); await sleep(300); await page.keyboard.type('acceptance', { delay: 30 }); await sleep(600); }
p = await probe();
const rowsMatch = await page.evaluate(() => [...document.querySelectorAll('#lineslist .ln[data-i]')].every(r => /acceptance/i.test(r.textContent)));
const findVisible = p.lines.find && p.lines.find.bottom <= p.viewport.h && p.lines.firstRow && p.lines.firstRow.bottom <= p.viewport.h;
record('lines-filter', 'type "acceptance": the list narrows to matching rows, input and first row on screen', p.lines.rows > 0 && rowsMatch && p.lines.findValue === 'acceptance' && findVisible,
{ rows: p.lines.rows, allRowsMatch: rowsMatch, findValue: p.lines.findValue, firstRow: p.lines.firstRow, firstRowText: p.lines.firstRowText, pageScrollY: p.viewport.scrollY, activeElement: p.activeElement, screenshot: await shot('lines-filter') },
p.lines.rows ? (rowsMatch ? (findVisible ? '' : 'filter input or first row off screen (keyboard/visual viewport)') : 'rows do not all match') : 'no rows match');
// 6 tap the first row
const before = p;
if (p.lines.firstRow) await tapRect(p.lines.firstRow);
await sleep(150); const early = await probe(); p = await settle();
const cs6 = clearSpace(p), cap6 = cardUnderCap(p);
const flew = early.magenta && p.magenta ? +Math.hypot(early.magenta.x - p.magenta.x, early.magenta.y - p.magenta.y).toFixed(1) : null;
record('lines-pick', 'tap the first row: LINES closes, camera flies, card opens, spark in the clear space', !p.panels.lines.visible && p.card.open && cs6.ok && cap6.ok,
{ linesVisible: p.panels.lines.visible, card: { open: p.card.open, rect: p.card.rect, index: p.card.index, total: p.card.total, title: p.card.title, ...cap6 }, clear: cs6, sparkMovedAfterTapPx: flew, rowTapped: before.lines.firstRowText, screenshot: await shot('lines-pick') },
[p.panels.lines.visible ? 'LINES still open' : '', p.card.open ? '' : 'no card', cs6.ok ? '' : cs6.why, cap6.ok ? '' : 'card over its cap'].filter(Boolean).join('; '));
// 7 details
const h1 = p.card.height; if (p.card.detailsRect) await tapRect(p.card.detailsRect); await sleep(700); p = await probe();
const cap7 = cardUnderCap(p), cs7 = clearSpace(p);
record('card-details', 'tap details: the card grows, stays under its cap and on screen', p.card.open && p.card.detailsOpen && p.card.detailsVisible && p.card.height > h1 && cap7.ok,
{ heightBefore: h1, heightAfter: p.card.height, ...cap7, cardRect: p.card.rect, cardScrollHeight: p.card.scrollHeight, detailsOpen: p.card.detailsOpen, sparkStillClear: cs7.ok, clear: cs7, screenshot: await shot('card-details') },
[p.card.detailsOpen ? '' : 'details did not open', p.card.height > h1 ? '' : 'card did not grow', cap7.ok ? '' : 'card ' + p.card.height + ' px over cap ' + cap7.cap, cs7.ok ? '' : 'spark no longer clear: ' + cs7.why].filter(Boolean).join('; '));
// 8 ×
const xr = p.card.closeRect; if (xr) await tapRect(xr); await sleep(600); p = await probe();
record('card-close', 'tap ×: the card closes and the selection clears', !p.card.open && !p.magenta, { closeRect: xr, closeSize: xr ? [xr.width, xr.height] : null, cardOpen: p.card.open, magenta: p.magenta, screenshot: await shot('card-close') }, p.card.open ? 'card still open' : (p.magenta ? 'spark still selected' : (xr && (xr.width < 24 || xr.height < 24) ? 'note: × is ' + xr.width + 'x' + xr … [line shortened here: 435 characters; full line on GitHub]
// 9 e × 3
let prevIndex = null;
for (let k = 1; k <= 3; k++) {
await page.evaluate(() => { if (document.activeElement && document.activeElement.blur) document.activeElement.blur(); });
await page.keyboard.press('e'); p = await settle();
const cs = clearSpace(p), cap = cardUnderCap(p);
const seq = prevIndex == null || p.card.index == null ? true : (p.card.index === prevIndex + 1 || (p.card.index === 1 && prevIndex === p.card.total));
record('key-e-' + k, 'press e (' + k + '): next line, card open, spark in the clear space', p.card.open && cs.ok && cap.ok && seq,
{ card: { index: p.card.index, total: p.card.total, title: p.card.title, rect: p.card.rect, ...cap }, clear: cs, screenshot: await shot('key-e-' + k) },
[p.card.open ? '' : 'no card', cs.ok ? '' : cs.why, cap.ok ? '' : 'card over cap', seq ? '' : 'index did not advance'].filter(Boolean).join('; '));
prevIndex = p.card.index;
}
// 10 pinch out, then drag: the camera moves, the page neither scrolls nor zooms. The camera stays known
// throughout: zoom 14 after a fly, then zoom × (finger distance ratio) per pinch, cx/cy solved from the selected spark.
const solve = (p, zoom) => { if (!p.magenta || p.card.index == null || !placed[p.card.index - 1]) return null; const b = placed[p.card.index - 1]; return { zoom, cx: b.x - (p.magenta.x - p.viewport.w / 2) / zoom, cy: b.y - (p.viewport.h / 2 - p.magenta.y) / zoom }; };
const toScreen = (c, b, p) => [(b.x - c.cx) * c.zoom + p.viewport.w / 2, p.viewport.h / 2 - (b.y - c.cy) * c.zoom];
const pinchAt = async (mx, my, d0, d1, horizontal = true) => { const pts = d => horizontal ? [[mx - d / 2, my], [mx + d / 2, my]] : [[mx, my - d / 2], [mx, my + d / 2]];
await touch('touchStart', pts(d0)); for (let i = 1; i <= 10; i++) { await touch('touchMove', pts(d0 + (d1 - d0) * i / 10)); await sleep(30); } await touch('touchEnd', []); return settle(); };
let zoomNow = 14, cam = solve(p, zoomNow);
const P0 = p.magenta, vv0 = p.viewport; let pinch = null, drag = null, zoomOut = [];
if (P0) {
// the fingers' midpoint must be well away from the spark (edFly puts the spark at the centre of the clear space, so the
// centre is the one place not to pinch: the spark would stay put and the ratio would be noise); go 100 px up or down,
// whichever side of the spark has more clear room
const bandTop = p.bar.bottom + 30, bandBot = (p.card.open ? p.card.rect.top : p.viewport.h) - 30;
const off = Math.min(100, Math.max(20, Math.max(P0.y - bandTop, bandBot - P0.y) - 10));
const mx = p.viewport.w / 2, my = (bandBot - P0.y >= P0.y - bandTop) ? Math.min(bandBot, P0.y + off) : Math.max(bandTop, P0.y - off), d0 = Math.min(220, p.viewport.w - 60), d1 = d0 / 2;
const q = await pinchAt(mx, my, d0, d1); // pinchAt settles, so the last drawn frame is the finished pinch, not one from the middle of it
const r0 = Math.hypot(P0.x - mx, P0.y - my), r1 = q.magenta ? Math.hypot(q.magenta.x - mx, q.magenta.y - my) : null;
pinch = { centre: [mx, +my.toFixed(1)], sparkBefore: [P0.x, P0.y], fingerDistance: [d0, d1], sparkDistanceFromCentre: [+r0.toFixed(1), r1 && +r1.toFixed(1)], ratio: r1 != null ? +(r1 / r0).toFixed(3) : null, expected: 0.5, pageScroll: [q.viewport.scrollX, q.viewport.scrollY], vvScale: q.viewport.vvScale, innerWidth: q.viewport.w };
pinch.ok = pinch.ratio != null && r0 >= 25 && Math.abs(pinch.ratio - 0.5) < 0.12 && q.viewport.scrollX === 0 && q.viewport.scrollY === 0 && Math.abs((q.viewport.vvScale || 1) - 1) < 0.01 && q.viewport.w === vv0.w;
if (pinch.ok) zoomNow *= d1 / d0;
const P1 = q.magenta; if (P1) {
const ax = p.viewport.w / 2, ay = my, dx = -90, dy = 70;
await touch('touchStart', [[ax, ay]]); for (let i = 1; i <= 12; i++) { await touch('touchMove', [[ax + dx * i / 12, ay + dy * i / 12]]); await sleep(25); } await touch('touchEnd', []);
const s = await settle(); drag = { finger: [dx, dy], sparkMoved: s.magenta ? [+(s.magenta.x - P1.x).toFixed(1), +(s.magenta.y - P1.y).toFixed(1)] : null, pageScroll: [s.viewport.scrollX, s.viewport.scrollY], vvScale: s.viewport.vvScale, vvOffset: s.viewport.vvOffset, cardOpen: s.card.open };
drag.ok = !!drag.sparkMoved && Math.abs(drag.sparkMoved[0] - dx) <= 12 && Math.abs(drag.sparkMoved[1] - dy) <= 12 && s.viewport.scrollX === 0 && s.viewport.scrollY === 0 && Math.abs((s.viewport.vvScale || 1) - 1) < 0.01;
p = s;
}
// zoom out until the whole belt of sparks is in view (the engine clamps zoom at 1e-4): the selected spark, under the
// midpoint of the fingers, must stay put, which is the pinch law measured a second time at a large ratio
if (pinch.ok && drag && drag.ok && p.magenta && placed.length) {
const rmax = Math.max(...placed.map(b => Math.hypot(b.x, b.y)));
const clearH = (p.card.open ? p.card.rect.top : p.viewport.h) - p.bar.bottom;
const target = Math.max(1.2e-4, 0.40 * Math.min(p.viewport.w, clearH) / rmax);
for (let k = 0; k < 7 && zoomNow > target * 1.05; k++) {
// fingers centred on the selected spark (it must not move), on whichever axis has more room, and never off the
// screen: a touch point outside the viewport is dropped by Chromium and the pinch degrades into a one-finger drag
const M = p.magenta; const mx2 = M.x, my2 = M.y;
const roomX = 2 * Math.min(mx2, p.viewport.w - mx2) - 16, roomY = 2 * Math.min(my2 - p.bar.bottom, (p.card.open ? p.card.rect.top : p.viewport.h) - my2) - 16;
const horizontal = roomX >= roomY, D0 = Math.min(300, Math.max(40, horizontal ? roomX : roomY));
const ratio = Math.min(D0 / 12, zoomNow / target), D1 = D0 / ratio;
const q2 = await pinchAt(mx2, my2, D0, D1, horizontal);
const moved = q2.magenta ? +Math.hypot(q2.magenta.x - mx2, q2.magenta.y - my2).toFixed(1) : null;
const ok = moved != null && moved <= 3 && q2.viewport.scrollY === 0 && Math.abs((q2.viewport.vvScale || 1) - 1) < 0.01;
zoomOut.push({ centre: [mx2, my2], axis: horizontal ? 'x' : 'y', fingerDistance: [D0, +D1.toFixed(2)], ratio: +(1 / ratio).toFixed(5), zoomAfter: +(zoomNow / ratio).toExponential(3), selectedSparkMovedPx: moved, greensInView: [p.greensCount, q2.greensCount], ok });
if (!ok) break; zoomNow /= ratio; p = q2;
}
cam = solve(p, zoomNow);
}
}
record('pinch-drag', 'pinch out then drag: the wafer zooms and pans, the page neither scrolls nor zooms', pinch && pinch.ok && drag && drag.ok && zoomOut.length > 0 && zoomOut.every(z => z.ok), { pinch, drag, zoomOut, zoomNow: +zoomNow.toExponential(3), screenshot: await shot('pinch-drag') },
!P0 ? 'no selected spark to measure against' : [pinch && !pinch.ok ? 'pinch ratio ' + pinch.ratio + ' (expected 0.5) or page moved' : '', drag ? (drag.ok ? '' : 'drag moved spark by ' + JSON.stringify(drag.sparkMoved) + ' for finger ' + JSON.stringify(drag.finger)) : 'no drag measured', zoomOut.length && zoomOut.every(z => z.ok) ? '' : 'zoom-out pinch failed: ' + JSON.stringify(zoomOut.slice … [line shortened here: 435 characters; full line on GitHub]
// 11 tap a spark directly: the nearest spark by the law must be the one the card shows
p = await probe();
let cand = null, predicted = null, predictedDist = null, secondDist = null;
if (cam && placed.length && p.greens.length) {
const top = p.bar.bottom + 20, bot = (p.card.open ? p.card.rect.top : p.viewport.h) - 20;
const pos = placed.map(b => toScreen(cam, b, p));
const scored = p.greens.filter(g => g.y > top && g.y < bot && g.x > 20 && g.x < p.viewport.w - 20 && (!p.magenta || Math.hypot(g.x - p.magenta.x, g.y - p.magenta.y) > 30)).map(g => {
let b1 = -1, d1 = 1e18, d2 = 1e18; pos.forEach(([x, y], i) => { const d = (x - g.x) ** 2 + (y - g.y) ** 2; if (d < d1) { d2 = d1; d1 = d; b1 = i; } else if (d < d2) d2 = d; });
return { g, b1, d1: Math.sqrt(d1), d2: Math.sqrt(d2) }; }).filter(s => s.d1 <= 2.5 && s.d2 - s.d1 >= 6).sort((a, b) => (b.d2 - b.d1) - (a.d2 - a.d1));
if (scored.length) { cand = scored[0].g; predicted = scored[0].b1; predictedDist = +scored[0].d1.toFixed(1); secondDist = +scored[0].d2.toFixed(1); }
}
const prevCardIndex = p.card.index;
if (cand) { await tapAt(cand.x, cand.y); p = await settle(); }
const csS = clearSpace(p);
const gotNearest = cand && p.card.open && p.card.index != null && p.card.index === predicted + 1;
record('spark-tap', 'tap a green spark: the card for the nearest spark opens and the camera places it clear', !!gotNearest && csS.ok,
{ tapped: cand || null, greensInView: p.greensCount, cameraKnown: !!cam, predictedIndex: predicted == null ? null : predicted + 1, predictedTitle: predicted == null ? null : placed[predicted].title, predictedDistanceFromTapPx: predictedDist, secondNearestPx: secondDist, cardIndex: p.card.index, previousCardIndex: prevCardIndex, cardTitle: p.card.title, clear: csS, screenshot: await shot('spa … [line shortened here: 411 characters; full line on GitHub]
!cand ? 'no unambiguous spark to tap (camera known: ' + !!cam + ', greens in view: ' + p.greensCount + ')' : (!p.card.open || p.card.index == null ? 'tap did not open a line card (card text: ' + (p.card.title || 'none') + ')' : (gotNearest ? (csS.ok ? '' : csS.why) : 'card shows ' + p.card.index + ', nearest by the law is ' + (predicted + 1))));
// 12 COMMANDS → WHOLE WAFER
p = await probe(); await tapRect(titleRect('foot')); await sleep(700); p = await probe();
const fp = p.panels.foot; const ww = await page.evaluate(() => { const b = [...document.querySelectorAll('button[data-k="Backspace"]')].find(e => getComputedStyle(e).display !== 'none' && e.getBoundingClientRect().height > 0); if (!b) return null; const r = b.getBoundingClientRect(); return { text: b.textContent.trim(), left: r.left, top: r.top, right: r.right, bottom: r.bottom, width: r.width … [line shortened here: 425 characters; full line on GitHub]
const cmdOpen = fp.visible && fp.rect.top >= p.bar.bottom - 1 && ww && ww.bottom <= p.viewport.h;
if (ww) await tapRect(ww); p = await settle({ noSpark: true });
const panelStillOpen = p.panels.foot.visible;
if (panelStillOpen) { await tapAt(p.viewport.w - 4, p.viewport.h - 4); await sleep(800); p = await probe(); } // a tap on the empty corner of the wafer closes the layer
const png12 = await shotPng(); const wafer12 = png12 ? await waferFromPng(page, png12.toString('base64'), p.bar.bottom) : { error: 'screenshot timed out', bbox: null };
const whole = wafer12.bbox && wafer12.bboxW > 0.4 * Math.min(p.viewport.w, p.viewport.h - p.bar.bottom) && Math.abs(wafer12.bboxW / wafer12.bboxH - 1) < 0.25 && wafer12.bbox[1] >= p.bar.bottom - 1 && wafer12.bbox[3] <= p.viewport.h;
record('whole-wafer', 'tap COMMANDS then WHOLE WAFER: the card closes and the whole wafer is on screen under the bar', cmdOpen && !p.card.open && !p.magenta && !p.panels.foot.visible && whole,
{ commandsPanel: fp, wholeWaferButton: ww, commandsOpenedUnderBar: !!cmdOpen, panelStayedOpenAfterTap: panelStillOpen, cardOpen: p.card.open, magenta: p.magenta, wafer: wafer12, screenshot: await shot('whole-wafer') },
[cmdOpen ? '' : 'COMMANDS did not open under the bar or WHOLE WAFER off screen', p.card.open ? 'card still open' : '', p.panels.foot.visible ? 'COMMANDS still open' : '', whole ? '' : 'wafer not whole on screen: ' + JSON.stringify(wafer12.bbox)].filter(Boolean).join('; '));
// 13 SEE THROUGH
p = await probe(); let st = null;
if (p.seeThrough) {
const newPage = context.waitForEvent('page', { timeout: 10000 }).catch(() => null);
const nav = page.waitForURL(/see-through/, { timeout: 10000 }).then(() => 'same-tab').catch(() => null);
await tapRect(p.seeThrough.rect);
const np = await newPage; let how = null, url = null;
if (np) { how = 'new-tab'; await np.waitForURL(/see-through\/(\d{12}\/)?/, { timeout: 20000 }).catch(() => {}); url = np.url(); await np.close().catch(() => {}); }
else if (await nav) { how = 'same-tab'; await page.waitForURL(/see-through\/(\d{12}\/)?/, { timeout: 20000 }).catch(() => {}); url = page.url(); }
st = { control: p.seeThrough, how, url, ok: !!how && /\/see-through\//.test(url || '') };
}
record('see-through', 'tap SEE THROUGH: ../../see-through/ opens (new tab or navigation)', st && st.ok, { ...(st || { control: null }), screenshot: await shot('see-through') }, !p.seeThrough ? 'no SEE THROUGH control in #bar' : (st.ok ? st.how + ' → ' + st.url : 'tap did not open see-through (url ' + st.url + ')'));
} catch (e) {
record('harness', 'harness error', false, { error: String(e && e.stack || e) }, String(e && e.message || e));
}
report.consoleErrors = errors.slice(); report.pass = steps.every(s => s.pass); report.passed = steps.filter(s => s.pass).length; report.failed = steps.filter(s => !s.pass).length;
report.finishedAt = new Date().toISOString();
await context.close();
return report;
}
(async () => {
fs.mkdirSync(OUT, { recursive: true });
const browser = await chromium.launch({ args: ['--use-gl=angle', '--use-angle=swiftshader', '--enable-unsafe-swiftshader', '--ignore-gpu-blocklist'] });
const out = { url: URL0, outdir: OUT, generatedAt: new Date().toISOString(), devices: [] };
try { for (const d of DEVICES) { out.devices.push(await runDevice(browser, d)); fs.writeFileSync(path.join(OUT, 'report.json'), JSON.stringify(out, null, 1)); } }
finally { await browser.close(); }
out.pass = out.devices.every(d => d.pass);
out.summary = out.devices.map(d => ({ device: d.device, passed: d.passed, failed: d.failed, failedSteps: d.steps.filter(s => !s.pass).map(s => s.id), consoleErrors: d.consoleErrors.length }));
fs.writeFileSync(path.join(OUT, 'report.json'), JSON.stringify(out, null, 1));
console.log(JSON.stringify(out, null, 1));
process.exit(out.pass ? 0 : 1);
})().catch(e => { console.error(e); process.exit(2); });Jrun T10
A shell script in the controller folder of Neural Link Between Agents.
automationneural-link-between-agents / FIXES/NL-010/tools/controller/jrun-t10.sh · lines 1–7 of 7 · 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/jrun-t10.sh:1-7 · blob 7677912174f46c180efb06e9d53f4fb92245b7e4 · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# jrun-t10.sh <snap> <device>: team 10 tester's android-journey.cjs (ecde2f34) on one device against a frozen WATCHER-B snapshot on port 8590
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'); cd $S/journey; uptime > $N-$s.load
NODE_PATH=$(npm root -g) node $S/journey-t10.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; echo DONE $N $DJrun
A shell script in the controller folder of Neural Link Between Agents.
automationneural-link-between-agents / FIXES/NL-010/tools/controller/jrun.sh · lines 1–9 of 9 · 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/jrun.sh:1-9 · blob d2b694e7b63eea5d5f436f8e520a506d93767016 · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# jrun.sh <name> <device> [keep]: snapshot (unless keep) + journey-5 on one device; log/json in scratchpad/journey
set -u
S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad; N=$1; D=$2
[ "${3:-}" = keep ] || $S/snap.sh $N >/dev/null
s=$(echo "$D" | tr ' A-Z' '-a-z'); cd $S/journey; uptime > $N-$s.load
NODE_PATH=$(npm root -g) node /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
grep -hE "PASS|FAIL|NOT EVAL" $N-$s.log > $N-$s.sum; echo DONE $N $DK1
A Python module in the controller folder of Neural Link Between Agents.
ingestneural-link-between-agents / FIXES/NL-010/tools/controller/k1.py · lines 1–5 of 5 · Not reached from any entry point (candidate for review)
- What it does
- It loads data. Uses libraries sys, check_proof. 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: command-line arguments.
- 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.
- Application
- neural-link-between-agents · FIXES/NL-010/tools/controller · Python module
- Uses
- sys, check_proof
- 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/k1.py:1-5 · blob 6642b70b1a0ae3630f9a78a23d1846de0e7ca4e6 · GitHub at these lines
- State
- achieves: name · context: auto · stage: ingest · effects: filesystem, process · domain stage: agent_infra · users: ai_agent · canonical: unreached_review
import sys
sys.path.insert(0, '/home/user/estate/kuiper-belt/tools')
from check_proof import leaks
bad=[f for f in sys.argv[1:] if leaks(open(f,encoding='utf-8',errors='replace').read())]
print('K1', len(sys.argv)-1, 'files,', len(bad), 'leak:', ' '.join(bad)); sys.exit(1 if bad else 0)Poll
A shell script in the controller folder of Neural Link Between Agents.
automationneural-link-between-agents / FIXES/NL-010/tools/controller/poll.sh · lines 1–6 of 6 · 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/poll.sh:1-6 · blob cbb10c7b26d39bfed811a8907d9ab75a5a944d52 · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# poll.sh [max_seconds]: block until state.sh output changes or max elapses; print the diff
S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad; M=${1:-560}
[ -f $S/state.last ] || $S/state.sh | cat > $S/state.last
t=0; while [ $t -lt $M ]; do $S/state.sh | cat > $S/state.now; if ! cmp -s $S/state.now $S/state.last; then echo "CHANGED after ${t}s at $(date -u +%H:%M)"; diff $S/state.last $S/state.now; cp $S/state.now $S/state.last; exit 0; fi; sleep 30; t=$((t+30)); done
echo "NO CHANGE in ${M}s at $(date -u +%H:%M)"; uptimePoll6
A shell script in the controller folder of Neural Link Between Agents.
automationneural-link-between-agents / FIXES/NL-010/tools/controller/poll6.sh · lines 1–6 of 6 · 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/poll6.sh:1-6 · blob 81e4db4342b569d0eacf96038a9e22a4a8090c54 · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# poll6.sh [max_seconds]: block until state6.sh output changes or max elapses; print the diff (OPUS-CONTROLLER-2)
D=$(dirname "$0"); S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad; M=${1:-560}
[ -f $S/state6.last ] || $D/state6.sh > $S/state6.last
t=0; while [ $t -lt $M ]; do $D/state6.sh > $S/state6.now; if ! cmp -s $S/state6.now $S/state6.last; then echo "CHANGED after ${t}s at $(date -u +%H:%M)"; diff $S/state6.last $S/state6.now; cp $S/state6.now $S/state6.last; exit 0; fi; sleep 45; t=$((t+45)); done
echo "NO CHANGE in ${M}s at $(date -u +%H:%M)"; uptimeSnap
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/snap.sh · lines 1–10 of 10 · 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/snap.sh:1-10 · blob e0114dc25eb79929d754575aff41858418031c1e · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# snap.sh <name>: frozen mirror of the kuiper-belt root for one journey run (WATCHER-B); edition folder copied without handoff/, the rest symlinked
set -e
R=/home/user/estate/kuiper-belt; S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad/snap/$1
rm -rf "$S"; mkdir -p "$S/editions"
for f in "$R"/* "$R"/.[!.]*; do b=$(basename "$f"); [ "$b" = editions ] || [ "$b" = .git ] || ln -s "$f" "$S/$b"; done
for f in "$R"/editions/*; do b=$(basename "$f"); [ "$b" = 202611012135 ] || ln -s "$f" "$S/editions/$b"; done
mkdir "$S/editions/202611012135"; (cd "$R/editions/202611012135" && tar cf - --exclude=./handoff .) | (cd "$S/editions/202611012135" && tar xf -)
(cd "$S/editions/202611012135" && find . -type f ! -path './proof/*' | sort | xargs sha256sum) > "$S.sha256"
echo "$S"Snap6
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/snap6.sh · lines 1–18 of 18 · 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).
- Inputs & outputs
- In: JSON file modules.json.
- 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/snap6.sh:1-18 · blob a915d80027e00e786f1d1d5b0b862ac3a7228de6 · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# snap6.sh <name> [modules.json] [module-file ...]: OPUS-CONTROLLER-2. Frozen mirror of the kuiper-belt root for one
# journey run on Edition 6+ (editions/202611020326 copied without handoff/, everything else symlinked). Optional
# candidate manifest and module files are overlaid into the SNAPSHOT ONLY; the working tree is never touched.
set -e
R=/home/user/estate/kuiper-belt; ED=${ED:-202611020326}
S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad/snap/$1; shift
rm -rf "$S"; mkdir -p "$S/editions"
for f in "$R"/* "$R"/.[!.]*; do b=$(basename "$f"); [ "$b" = editions ] || [ "$b" = .git ] || ln -s "$f" "$S/$b"; done
for f in "$R"/editions/*; do b=$(basename "$f"); [ "$b" = "$ED" ] || ln -s "$f" "$S/editions/$b"; done
mkdir "$S/editions/$ED"; (cd "$R/editions/$ED" && tar cf - --exclude=./handoff --exclude=./GREEN.md --exclude=./CONTROLLER.md .) | (cd "$S/editions/$ED" && tar xf -)
if [ -n "${1:-}" ]; then cp "$1" "$S/editions/$ED/modules.json"; shift; fi
for m in "$@"; do cp "$m" "$S/editions/$ED/modules/"; done
# INDEX=<page> overlays index.html; DATA="<file> ..." copies files into data/ (snapshot only)
[ -n "${INDEX:-}" ] && cp "$INDEX" "$S/editions/$ED/index.html"
if [ -n "${DATA:-}" ]; then mkdir -p "$S/editions/$ED/data"; for d in $DATA; do cp "$d" "$S/editions/$ED/data/"; done; fi
(cd "$S/editions/$ED" && find . -type f ! -path './proof/*' | LC_ALL=C sort | xargs sha256sum) > "$S.sha256"
echo "$S"State
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/state.sh · lines 1–12 of 12 · 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/state.sh:1-12 · blob 6e9a80df7a7f94328b259c1dbc31cba1bc18baee · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# state.sh: the controller's wake list (sha12 of each), order 5, 8, 6, 7, 3, 9 (harness ruling 01:2x)
H=/home/user/estate/kuiper-belt/editions/202611012135; S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad
cd $H
for f in handoff/01-shell/MODULE.sha256 handoff/04-loader/MODULE.sha256 handoff/05-see-through/MODULE.sha256 \
handoff/08-drift/MODULE.sha256 handoff/08-drift/TEST.md handoff/08-drift/HANDOFF.md \
handoff/06-file/MODULE.sha256 handoff/06-file/TEST.md handoff/06-file/HANDOFF.md \
handoff/07-apps/TEST.md handoff/07-apps/HANDOFF.md handoff/03-layers/TEST.md handoff/03-layers/HANDOFF.md \
handoff/09-law/HANDOFF.md handoff/09-law/TEST.md index.html modules.json; do
if [ -f "$f" ]; then echo "$f $(sha256sum "$f" | cut -c1-12)"; else echo "$f -"; fi; done
for f in $S/journey/*.log; do grep -q "^exit" "$f" && echo "JOURNEY-DONE $(basename $f)"; done
echo "issue10-to-me $(gh api "repos/Ventusltd/neural-link-between-agents/issues/10/comments?per_page=100&page=1" --jq "[.[] | select(.body | split(\"\\n\")[0] | test(\"CONTROLLER|OPUS-10\")) | .id] | last" 2>/dev/null) $(gh api "repos/Ventusltd/neural-link-between-agents/issues/10/comments?per_page=100&page=2" --jq "[.[] | select(.body | split(\"\\n\")[0] | test(\"CONTROLLER|OPUS-10\")) | .id] | l … [line shortened here: 418 characters; full line on GitHub]State6
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/state6.sh · lines 1–14 of 14 · 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/state6.sh:1-14 · blob a39077d4139445853b271a2e6763fa7942b3da7b · GitHub at these lines
- State
- achieves: name · context: auto · stage: unknown · effects: process · domain stage: agent_infra · users: ai_agent · canonical: unknown
#!/bin/bash
# state6.sh: OPUS-CONTROLLER-2's wake list for Edition 6+ admissions (sha12 of each hand-off file, finished journeys,
# newest #10 comment addressed to a controller).
H=/home/user/estate/kuiper-belt/editions/202611012135; S=/tmp/claude-0/-home-user/e5bfe783-54ef-5c7a-8d30-0a492af18594/scratchpad
cd $H
for f in handoff/02-card/edition-6/MODULE.sha256 handoff/02-card/edition-6/TEST.md handoff/02-card/TEST.md \
handoff/07-apps/TEST.md handoff/07-apps/MODULE.sha256 handoff/06-file/TEST.md handoff/06-file/MODULE.sha256 \
handoff/03-layers/TEST.md handoff/03-layers/MODULE.sha256 handoff/08-drift/TEST.md handoff/08-drift/MODULE.sha256 \
handoff/05-see-through/TEST.md handoff/05-see-through/MODULE.sha256 handoff/01-shell/MODULE.sha256 \
../202611020326/index.html ../202611020326/modules.json; do
if [ -f "$f" ]; then echo "$f $(sha256sum "$f" | cut -c1-12)"; else echo "$f -"; fi; done
for f in $S/journey/e6-*.log; do [ -f "$f" ] && grep -q "^exit" "$f" && echo "JOURNEY-DONE $(basename $f)"; done
n=$(gh api "repos/Ventusltd/neural-link-between-agents/issues/10" --jq .comments 2>/dev/null); p=$(( (n+99)/100 ))
echo "issue10-to-controller $(gh api "repos/Ventusltd/neural-link-between-agents/issues/10/comments?per_page=100&page=$p" --jq "[.[] | select(.body | split(\"\\n\")[0] | test(\"→.*CONTROLLER|→ ALL\")) | .id] | last" 2>/dev/null)"Measure
A JavaScript module in the evidence folder of Neural Link Between Agents.
renderneural-link-between-agents / FIXES/NL-010/tools/evidence/nl009/01/measure.cjs · lines 1–59 of 59 · Not reached from any entry point (candidate for review)
- What it does
- It fetches data. Defines r. Uses libraries playwright, fs. 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: command-line arguments.
- 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.
- Application
- neural-link-between-agents · FIXES/NL-010/tools/evidence/nl009/01 · JavaScript module
- Uses
- playwright, fs
- Used by
- none found
- Produces
- r
- Defines here
- r
- 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/evidence/nl009/01/measure.cjs:1-59 · blob 359e8f285aee9ec25d1ed15d458bfbd5a01b29be · GitHub at these lines
- State
- achieves: name · context: auto · stage: output · effects: dom, filesystem, network, process · domain stage: agent_infra · users: ai_agent · canonical: unreached_review
// usage: node measure.cjs <url> <device> <outpng|-> [widthxheight override] [fontScale]
const { chromium, devices } = require('playwright');
const [,, url, devName, out, patched, wh, fs] = process.argv;
const fsmod = require('fs');
const PROBE = "\n;Object.defineProperty(window,'__probe',{value:{safeBox:()=>safeBox(),placePanels:()=>placePanels(),panels:()=>PANELS,setPanel:n=>setPanel(n),open:()=>openPanel}});\n";
(async () => {
const browser = await chromium.launch({ args: ['--use-gl=angle','--use-angle=swiftshader','--enable-unsafe-swiftshader','--ignore-gpu-blocklist'] });
const dev = Object.assign({}, devices[devName]);
if (wh) { const [w, h] = wh.split('x').map(Number); dev.viewport = { width: w, height: h }; }
const ctx = await browser.newContext(dev);
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('pageerror: ' + e.message));
await page.route(u => /\/editions\/202611012027\/(index\.html)?$/.test(u.pathname), async route => {
let body = (patched && patched !== '-') ? fsmod.readFileSync(patched, 'utf8') : await (await route.fetch()).text();
body = body.replace('</script>', PROBE + '</script>');
route.fulfill({ status: 200, contentType: 'text/html; charset=utf-8', body });
});
await page.goto(url, { waitUntil: 'load', timeout: 120000 });
if (fs) await page.addStyleTag({ content: `#bar{font-size:calc(1em*${fs})} #barname{font-size:calc(1em*${fs})}` });
await page.waitForTimeout(7000);
const m = await page.evaluate(() => {
const r = el => { const b = el.getBoundingClientRect(); return { x: +b.x.toFixed(1), y: +b.y.toFixed(1), w: +b.width.toFixed(1), h: +b.height.toFixed(1), bottom: +b.bottom.toFixed(1), right: +b.right.toFixed(1) }; };
const bar = document.getElementById('bar'), bn = document.getElementById('barname');
const cs = getComputedStyle(bar), bncs = getComputedStyle(bn);
const btns = [...bar.querySelectorAll('.gm-title')].map(b => { const c = getComputedStyle(b); return { text: b.textContent, rect: r(b), font: c.fontSize, ls: c.letterSpacing, pad: c.padding, minH: c.minHeight, lh: c.lineHeight }; });
const rows = [...new Set(btns.map(b => Math.round(b.rect.y)))];
const P = window.__probe; const sb = P.safeBox();
P.placePanels();
const tops = Object.fromEntries(Object.entries(P.panels()).map(([k, el]) => [k, el.style.top]));
const last = btns[btns.length - 1];
return {
inner: [innerWidth, innerHeight], dpr: devicePixelRatio, coarse: matchMedia('(pointer:coarse)').matches,
bar: { rect: r(bar), pad: cs.padding, gap: cs.gap, wrap: cs.flexWrap, ovx: cs.overflowX, scrollW: bar.scrollWidth, clientW: bar.clientWidth, font: cs.fontSize },
barname: { text: bn.textContent, rect: r(bn), font: bncs.fontSize, ls: bncs.letterSpacing, visibleText: bn.innerText },
buttons: btns, rows, rowCount: rows.length,
slack: +(bar.clientWidth - parseFloat(cs.paddingRight) - last.rect.right).toFixed(1),
safeBox: sb, safeStartsUnderBar: sb.y0 >= bar.getBoundingClientRect().bottom + 8 - 0.01,
panelTops: tops, panelTopOK: Object.values(tops).every(t => parseFloat(t) >= bar.getBoundingClientRect().height + 2 - 0.01),
vhUnits: { card: getComputedStyle(document.getElementById('card')).maxHeight, lines: getComputedStyle(document.getElementById('lines')).maxHeight, vh100: innerHeight, docH: document.documentElement.clientHeight },
fontFamily: getComputedStyle(document.body).fontFamily,
};
});
// open a panel and check it starts under the bar, then close it
const pan = await page.evaluate(() => { const P = window.__probe; P.setPanel('top'); const t = document.getElementById('top').getBoundingClientRect(); const b = document.getElementById('bar').getBoundingClientRect(); P.setPanel('top'); return { panelTop: +t.top.toFixed(1), barBottom: +b.bottom.toFixed(1), ok: t.top >= b.bottom }; });
m.openedPanel = pan;
// touch tap the last button and see that the right panel opens (foot = commands)
const tap = await page.evaluate(() => { const b = document.querySelector('#bar .gm-title[data-panel="foot"]').getBoundingClientRect(); return [b.x + b.width/2, b.y + b.height/2]; });
await page.touchscreen.tap(tap[0], tap[1]);
await page.waitForTimeout(400);
m.tapOpensCommands = await page.evaluate(() => window.__probe.open() === 'foot' && getComputedStyle(document.getElementById('foot')).display === 'block');
await page.evaluate(() => { const P = window.__probe; if (P.open()) P.setPanel(P.open()); });
await page.waitForTimeout(600);
m.errors = errors;
console.log(JSON.stringify(m, null, 1));
if (out && out !== '-') { await page.screenshot({ path: out, scale: 'css', timeout: 180000 }); }
await browser.close();
})().catch(e => { console.error(e); process.exit(1); });