In this section
- Wafer Development Environment — Underground render · globalgrid2050 / testcode/wafer-development-environment/202609180205-underground/app.mjs lines 701–819
- Wafer Development Environment — Underground Page render · globalgrid2050 / testcode/wafer-development-environment/202609180205-underground/index.html lines 1–53
- Pilot Rules transform · globalgrid2050 / testcode/wafer-development-environment/202609180205-underground/pilot-rules.js lines 1–51
- Pilot interaction · globalgrid2050 / testcode/wafer-development-environment/202609180205-underground/pilot.mjs lines 1–266
- Wafer Development Environment — Real Systems Page render · globalgrid2050 / testcode/wafer-development-environment/202609180245-real-systems/index.html lines 1–63
Wafer Development Environment — Underground
A JavaScript module in the testcode folder of GlobalGrid2050 that draws lines meta and families, using SHA-256. Served with the page at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
renderglobalgrid2050 / testcode/wafer-development-environment/202609180205-underground/app.mjs · lines 701–819 of 819 · version 2026-09-18 02:05 (continued from section 1464) · Entry point · pattern keplerTargets (shared by 5 files)
- What it does
- It draws lines meta and families. Defines 50 functions or classes, including $, indexOfKey, bin, tier1, tier2. Side effects: changes the web page (DOM); makes network requests.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
- Inputs & outputs
- In: JSON file all-lines.meta.json; JSON file families.json; JSON file line-index.json. Out: WebGL/WebGPU drawing.
- Downstream impact
- Used directly by 3 files: Wafer Development Environment — Underground Page (globalgrid2050, https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/); Wafer Development Environment — Real Systems Page (globalgrid2050, https://globalgrid2050.com/testcode/wafer-development-environment/202609180245-real-systems/); Wafer Development Environment — Proof S0004 Page (globalgrid2050, https://globalgrid2050.com/testcode/wafer-development-environment/202609192215-proof-s0004/). Reached from 172 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); GlobalGrid2050 — Compute Page (globalgrid2050, https://globalgrid2050.com/compute/). It is itself an entry point, published at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
- What it achieves
- It indexes key (`indexOfKey`), builds gl (`buildGL`) and draws marks (`drawMarks`). WHAT THIS IS. Every line of code in the estate that has been given a permanent number is one point on one surface. It responds to click, pointerdown and pointermove events.
- Why it matters
- Loaded by the page of the same name at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/ and 2 other pages.
- Application
- globalgrid2050 · testcode/wafer-development-environment/202609180205-underground · JavaScript module
- Uses
- Galaxies Wafers — Lib (import), Pick (import), Read (import)
- Used by
- loaded by Wafer Development Environment — Underground Page (script src), loaded by Wafer Development Environment — Real Systems Page (script src), loaded by Wafer Development Environment — Proof S0004 Page (script src)
- Produces
- $, indexOfKey, bin, tier1, tier2, compile, initGL, fallback2d, buildGL, put, resize, ensureOverlay
- Defines here
- gestures, up, readURL, refuse, writeURL
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/wafer-development-environment/202609180205-underground/app.mjs:701-819 · blob bcc8e85757d77b987a91d4648eb4678d64955df3 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, network · domain stage: experimental · users: none · canonical: production_core
/* ── gestures ────────────────────────────────────────────────────────────── */
function gestures() {
let down = null, moved = 0, pinch = null;
const pts = new Map();
stage.addEventListener('pointerdown', e => {
stage.setPointerCapture(e.pointerId);
pts.set(e.pointerId, [e.clientX, e.clientY]);
if (pts.size === 1) { down = [e.clientX, e.clientY]; moved = 0; }
if (pts.size === 2) {
const [p, q] = [...pts.values()];
pinch = { d: Math.hypot(p[0] - q[0], p[1] - q[1]), z: view.zoom };
}
});
stage.addEventListener('pointermove', e => {
if (!pts.has(e.pointerId)) return;
const prev = pts.get(e.pointerId);
pts.set(e.pointerId, [e.clientX, e.clientY]);
if (pts.size === 2 && pinch) {
const [p, q] = [...pts.values()];
const d = Math.hypot(p[0] - q[0], p[1] - q[1]);
if (pinch.d > 0) view.zoom = Math.max(0.02, Math.min(4000, pinch.z * (d / pinch.d)));
draw(); return;
}
if (pts.size === 1) {
const dx = e.clientX - prev[0], dy = e.clientY - prev[1];
moved += Math.abs(dx) + Math.abs(dy);
view.x -= dx / view.zoom; view.y += dy / view.zoom;
draw();
}
});
const up = e => {
if (pts.size === 1 && down && moved < 7) {
const key = nearestKeyAt(e.clientX, e.clientY);
if (key >= 0) { view.focus = key; paintPanel(key); view.link = null; draw(); }
}
pts.delete(e.pointerId);
if (pts.size < 2) pinch = null;
if (pts.size === 0) down = null;
};
stage.addEventListener('pointerup', up);
stage.addEventListener('pointercancel', e => { pts.delete(e.pointerId); pinch = null; down = null; });
stage.addEventListener('wheel', e => {
e.preventDefault();
const f = Math.exp(-e.deltaY * 0.0016);
view.zoom = Math.max(0.02, Math.min(4000, view.zoom * f));
draw();
}, { passive: false });
stage.addEventListener('dblclick', () => { view.focus = -1; view.link = null; $('panel').hidden = true; home(); });
}
/* ── URL state: the whole of it, in permanent numbers ────────────────────── */
function readURL() {
const q = new URLSearchParams(location.search);
const pa = parseKey(q.get('line') ?? ''), pb = parseKey(q.get('to') ?? '');
if (!pa.ok) { if (q.get('line')) refuse(`The link carried a line number this page cannot use: ${pa.why}.`); return; }
$('a').value = String(pa.key);
const rawTo = q.get('to');
if (pb.ok) { $('b').value = String(pb.key); view.link = [pa.key, pb.key]; connect(pa.key, pb.key); }
else if (rawTo !== null && rawTo.trim() !== '') {
/* focus stays unset: tier 2 repaints the panel for a focused key when it
lands, which would silently replace this refusal with an ordinary card. */
refuse(`The link asked to connect to "${rawTo}", which is not a line number: ${pb.why}. `
+ `Line ${pa.key} is where the beam is pointing.`);
flyTo(pa.key);
}
else { view.focus = pa.key; paintPanel(pa.key); flyTo(pa.key); }
}
/* One refusal path, so a bad number is always visible rather than ignored. */
function refuse(sentence) {
$('panelbody').replaceChildren();
const h = document.createElement('h2'); h.textContent = 'Refused';
const p2 = document.createElement('p'); p2.className = 'refuse'; p2.textContent = sentence;
$('panelbody').append(h, p2);
$('panel').hidden = false;
}
function writeURL(a, b) {
const q = new URLSearchParams();
if (a) q.set('line', String(a));
if (b) q.set('to', String(b));
history.replaceState(null, '', q.toString() ? '?' + q : location.pathname);
}
/* ── start ───────────────────────────────────────────────────────────────── */
(async function start() {
try {
await tier1();
} catch (e) {
$('count').textContent = 'Could not load the numbered database: ' + e.message
+ '. Check the internet connection and reload.';
return;
}
resize();
try { initGL(); } catch (e) {
ctx2d = stage.getContext('2d');
$('hint').textContent = 'GPU not available: drawn without animation';
}
home();
gestures();
window.addEventListener('resize', () => { resize(); draw(); });
$('beam').addEventListener('submit', e => {
e.preventDefault();
const pa = parseKey($('a').value), pb = parseKey($('b').value);
if (!pa.ok) { refuse(`That is not a line number: ${pa.why}.`); return; }
if ($('b').value.trim() && !pb.ok) { refuse(`Second number: ${pb.why}.`); return; }
if (pb.ok) { view.focus = -1; connect(pa.key, pb.key); writeURL(pa.key, pb.key); }
else { view.focus = pa.key; view.link = null; paintPanel(pa.key); flyTo(pa.key); writeURL(pa.key, null); }
document.activeElement?.blur();
});
$('close').addEventListener('click', () => { $('panel').hidden = true; view.focus = -1; view.link = null; draw(); });
readURL();
tier2().catch(e => { $('prov').textContent = 'family index unavailable: ' + e.message; });
})();Wafer Development Environment — Underground Page
A web page in the testcode folder of GlobalGrid2050. Published at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
renderglobalgrid2050 / testcode/wafer-development-environment/202609180205-underground/index.html · lines 1–53 of 53 · version 2026-09-18 02:05 · Entry point
- What it does
- It draws its content. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
- Inputs & outputs
- In: form fields (user input). Out: web page.
- Downstream impact
- Used directly by 6 files: Testcode — Wafer Development Environment Page (globalgrid2050, https://globalgrid2050.com/testcode/wafer-development-environment/); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage Versions — Before Refresh Page (globalgrid2050, https://globalgrid2050.com/homepage_versions/20260922-before-refresh/); Homepage V123 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v123.html); and 2 more. Reached from 115 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); Homepage V037 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v037.html); Homepage V038 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v038.html). It is itself an entry point, published at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
- What it achieves
- It responds to click events.
- Why it matters
- Loaded by the Wafer Development Environment page at https://globalgrid2050.com/testcode/wafer-development-environment/ and 5 other pages.
- Application
- globalgrid2050 · testcode/wafer-development-environment/202609180205-underground · page
- Uses
- GlobalGrid2050 — Testcode Style Sheet (stylesheet), Wafer Development Environment — Underground (script src), Pilot Rules (script src), Pilot (script src)
- Used by
- linked from Testcode — Wafer Development Environment Page (link), linked from GlobalGrid2050 Homepage Before Four Nests (link), linked from Homepage Versions — Before Refresh Page (link), linked from Homepage V123 (link), linked from Homepage V124 (link), linked from Homepage V125 (link)
- 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
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/wafer-development-environment/202609180205-underground/index.html:1-53 · blob ac9fe9c21506e678524a7e5719944498d1058b13 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, maximum-scale=5">
<meta name="color-scheme" content="dark">
<title>202609180205-underground</title>
<meta name="wafer-data" content="../shared/">
<meta name="wafer-start" content="draw underground">
<link rel="stylesheet" href="style.css">
</head>
<body>
<canvas id="stage" aria-label="Every permanently numbered line of code in the estate, placed by its own number."></canvas>
<header id="bar">
<span id="wordmark">THE LINE WAFER</span>
<span id="count" class="dim">loading the numbered database…</span>
</header>
<form id="beam" autocomplete="off">
<input id="a" inputmode="numeric" pattern="[0-9]*" placeholder="line number" aria-label="line number to fly to">
<input id="b" inputmode="numeric" pattern="[0-9]*" placeholder="connect to…" aria-label="second line number to connect to">
<button id="go" type="submit">FLY</button>
</form>
<section id="panel" hidden>
<button id="close" type="button" aria-label="close">✕</button>
<div id="panelbody"></div>
</section>
<nav id="presets" aria-label="presets" style="position:fixed;left:12px;top:44px;z-index:19;display:flex;gap:6px;flex-wrap:wrap;max-width:60vw">
<button type="button" data-cmd="state 39885">home</button>
<button type="button" data-cmd="draw underground">underground</button>
<button type="button" data-cmd="gravity gridatlas">orbit gridatlas</button>
<button type="button" data-cmd="logo">logo</button>
<button type="button" data-cmd="release">release</button>
</nav>
<style>#presets button{font:11px/1.6 ui-monospace,Menlo,Consolas,monospace;color:#8b93a7;background:#0b0e14;border:1px solid #232a3a;border-radius:4px;padding:2px 9px;cursor:pointer}#presets button:hover{color:#e6e9f0;border-color:#4a5573}</style>
<script>document.getElementById('presets').addEventListener('click',e=>{const b=e.target.closest('button');if(b&&window.__pilot)window.__pilot(b.dataset.cmd);});</script>
<footer id="foot">
<span id="prov" class="dim">provenance loading</span>
<span id="hint" class="dim">drag to steer · pinch or scroll to focus the beam · tap a line</span>
<a id="proofs" href="proof/">check every claim on this page</a>
</footer>
<noscript><p class="dim" style="padding:1rem">This surface is drawn from the numbered database at run time, so it needs JavaScript. Nothing here is typed into the page.</p></noscript>
<script type="module" src="app.mjs"></script>
<script src="pilot-rules.js"></script>
<script type="module" src="pilot.mjs"></script>
</body>
</html>
Pilot Rules
A JavaScript module in the testcode folder of GlobalGrid2050 that works with substations. Served with the page at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
transformglobalgrid2050 / testcode/wafer-development-environment/202609180205-underground/pilot-rules.js · lines 1–51 of 51 · version 2026-09-18 02:05 · Entry point
- What it does
- It calculates substations. Defines plan, num.
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: substations.
- Downstream impact
- Used directly by 2 files: Wafer Development Environment — Underground Page (globalgrid2050, https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/); Wafer Development Environment — Real Systems Page (globalgrid2050, https://globalgrid2050.com/testcode/wafer-development-environment/202609180245-real-systems/). Reached from 146 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage V037 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v037.html). It is itself an entry point, published at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
- What it achieves
- It is built from the plan step (`plan`) and the num step (`num`). Pilot by typing anything, with no model: plain words are matched to commands by rules the page can show you.
- Why it matters
- Loaded by the Underground page at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/ and 1 other page.
- Application
- globalgrid2050 · testcode/wafer-development-environment/202609180205-underground · JavaScript module
- Uses
- none found
- Used by
- loaded by Wafer Development Environment — Underground Page (script src), loaded by Wafer Development Environment — Real Systems Page (script src)
- Produces
- plan, num
- Defines here
- plan, num
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/wafer-development-environment/202609180205-underground/pilot-rules.js:1-51 · blob 00855d9f0f187c99abe557afc8889d85aebe42fc · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: transform · effects: none found · domain stage: experimental · users: none · canonical: production_core
// Pilot by typing anything, with no model: plain words are matched to commands by rules the page can show you.
// plan(sentence, ctx) → { commands: [...], because: '...' } ctx = { appNames: [...], dies: [...] }
function plan(sentence, ctx) {
const t = sentence.replace(/Ω/g, ' ohm').toLowerCase(); const out = [];
const num = re => { const m = t.match(re); return m ? parseFloat(m[1]) : null; };
const appNames = (ctx && ctx.appNames) || []; const DIES = (ctx && ctx.dies) || [];
const appHit = appNames.find(n => t.includes(n)) || (t.includes('atlas') ? 'gridatlas' : null);
const dieHit = t.includes('substation') ? 'substation' : t.includes('sld') ? 'sld-sandbox' : /\bsearch\b/.test(t) ? 'search' : /(bridge|parquet)/.test(t) ? 'bridge' : DIES.find(d => t.includes(d.split('-')[0])) || null;
const wantArrange = /(arrange|re-?arrange|layout|lay out|as a cpu|floorplan|floor plan|\brings?\b|\bgrid\b|sector|by app)/.test(t);
const earthNames = ['spider sandbox', 'periodic table', 'gridatlas', 'pipelinenews', 'pipeline news', 'globalgrid2050', 'grid-dictionary', 'spiders', 'star-solar-star', 'code-generator', 'testcode', 'galaxies-wafers', 'ventus-grid-engine', 'stars'];
if (/\b(back to space|to space|space)\b/.test(t) && !/\bland\b/.test(t)) return { commands: ['space'], because: 'back to the wafer' };
if (/\b(land|land on|take me to|go down to|visit|open|show me the app)\b/.test(t)) { const e = earthNames.find(n => t.includes(n)); if (e) return { commands: [`land ${e.replace('pipeline news', 'pipelinenews')}`], because: 'down to the live app' }; }
if (/\bplasma\b/.test(t)) out.push('plasma');
if (/\b(lightning|strike)\b/.test(t)) out.push(`lightning ${appHit || 'gridatlas'}`);
if (/(voltage drop|volt drop|vdrop)/.test(t)) {
const A = num(/(\d+(?:\.\d+)?)\s*(?:amps?\b|a\b)/), L = num(/(\d+(?:\.\d+)?)\s*(?:metres?|meters?|m\b)/), R = num(/(\d+(?:\.\d+)?)\s*(?:ohms?|Ω)/);
let pf = num(/(?:pf|power factor)\s*(?:of\s*)?(\d+(?:\.\d+)?)\s*%/) ?? num(/(\d+(?:\.\d+)?)\s*%\s*(?:pf|power factor)/); if (pf != null) pf = pf / 100; if (pf == null) pf = num(/(?:pf|power factor)\s*(?:of\s*)?(\d?\.?\d+)/) ?? num(/(\d?\.?\d+)\s*(?:pf|power factor)/);
const X = num(/(?:reactance|x)\s*(?:of\s*)?(\d+(?:\.\d+)?)/);
const ph = /single/.test(t) ? 'single' : 'three';
const missing = [A == null && 'current in A', L == null && 'length in m', R == null && 'resistance in ohm/km', pf == null && 'power factor'].filter(Boolean);
if (missing.length) return { commands: [], because: `voltage drop needs: ${missing.join(', ')} (say e.g. 120 A, 250 m, 0.32 ohm/km, pf 0.95)` };
out.push(`run voltage-drop.voltageDropVolts ${JSON.stringify(X != null ? { currentA: A, lengthM: L, resistanceOhmPerKm: R, reactanceOhmPerKm: X, powerFactor: pf, phases: ph } : { currentA: A, lengthM: L, resistanceOhmPerKm: R, powerFactor: pf, phases: ph })}`);
} else if (/(diversif|houses|dwellings|units)/.test(t) && /\bk(w|va)\b/.test(t)) {
const n = num(/(\d+)\s*(?:houses|dwellings|units)/), kw = num(/(\d+(?:\.\d+)?)\s*k(?:w|va)\b/), cf = num(/(?:coincidence|diversity)\s*(?:factor\s*)?(?:of\s*)?(\d?\.\d+)/);
if (n == null || kw == null || cf == null) return { commands: [], because: 'diversified demand needs: number of houses, kW each, coincidence factor' };
out.push(`run diversified-demand.diversifiedDemandKw ${JSON.stringify({ unitCount: n, perUnitKw: kw, coincidenceFactor: cf })}`);
}
if (/(entangle|\btwin|coupl)/.test(t)) out.push('entangle');
const key = num(/(?:read|block|key|fly to|go to|twin|state|qubit|measure)\s+(\d{1,7})\b/) ?? (/(voltage|amp|metre|meter|ohm|houses|kw|kva)/.test(t) ? null : num(/\b(\d{2,7})\b/));
if (/(\bread\b|show me the code|the real line)/.test(t) && key != null) out.push(`read ${key}`);
else if (/(fly to|go to|\bblock\b|\bkey\b)/.test(t) && key != null) out.push(`block ${key}`);
if (/\b(seed|grow)\b/.test(t)) out.push(`seed ${sentence.replace(/^.*?\b(seed|grow)\b\s*/i, '') || sentence}`);
if (/\b(twin)\b/.test(t) && key != null) out.push(`twin ${key}`); if (/\b(qubit)\b/.test(t) && key != null) out.push(`qubit ${key}`); if (/\b(measure)\b/.test(t) && key != null) out.push(`measure ${key}`);
if (/(versions|history|\bclock\b|over time)/.test(t)) out.push(/\b(run|play|all)\b/.test(t) ? 'clock run' : 'versions');
if (/\b(explode|blow)\b/.test(t)) out.push('explode');
if (/\b(implode|come back)\b/.test(t)) out.push('implode');
if (/\bhome\b/.test(t)) out.push('home');
if (/(engine|calculations?|modules?)/.test(t) && /\b(list|show|what)\b/.test(t)) out.push('engine');
if (/\b(apps|applications)\b/.test(t) && /\b(list|show|what|which)\b/.test(t)) out.push('apps');
if (dieHit && !out.some(c => c.startsWith('lightning'))) out.push(`die ${dieHit}`);
else if (appHit && !out.some(c => /^(lightning|plasma)/.test(c))) out.push(appHit === 'gridatlas' && /\batlas\b/.test(t) && !t.includes('gridatlas') ? 'light atlas' : `app ${appHit}`);
if (wantArrange) out.push(`arrange ${/(floorplan|floor plan|cpu)/.test(t) ? 'floorplan' : /\brings?\b/.test(t) ? 'rings' : /\bgrid\b/.test(t) ? 'grid' : /(app|sector)/.test(t) ? 'apps' : 'time'}`);
if (/(\breset\b|start again|\bclear\b)/.test(t)) out.push('reset');
if (!out.length) return { commands: [], because: 'no command matched; try words like: atlas, app <name>, plasma, lightning, arrange floorplan, voltage drop 120 A 250 m 0.32 ohm pf 0.95, read <key>, entangle' };
return { commands: [...new Set(out)], because: 'matched by words and numbers in your sentence' };
}
if (typeof module !== 'undefined') module.exports = { plan };
Pilot
A JavaScript module in the testcode folder of GlobalGrid2050 that draws electron and qubit, and uses data from the ventus-grid-engine, GridAtlas and PipelineNews repositories. Served with the page at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
interactionglobalgrid2050 / testcode/wafer-development-environment/202609180205-underground/pilot.mjs · lines 1–266 of 266 · version 2026-09-18 02:05 · Entry point · pattern loadNet (shared by 4 files)
- What it does
- It draws electron, qubit and entangle. Defines 27 functions or classes, including $, here, hash32, mulberry32, atomOf. Side effects: changes the web page (DOM); makes network requests; uses storage (browser storage, DuckDB or Parquet).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
- Inputs & outputs
- In: data source: ventus-grid-engine data; data source: gridatlas data; data source: pipelinenews data; data source: grid-dictionary data; data source: spiders data; data source: star-solar-star data; data source: code-generator data; data source: testcode data. Out: browser storage (setItem); canvas drawing.
- Downstream impact
- Used directly by 1 file: Wafer Development Environment — Underground Page (globalgrid2050, https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/). Reached from 121 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage V037 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v037.html). It is itself an entry point, published at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
- What it achieves
- It describes line (`describeLine`) and loads net (`loadNet`). Quantum Twin — primary key to actual code flights. Its code works with 100 kW. It responds to pointerdown, pointermove and pointerup events.
- Why it matters
- Loaded by the Underground page at https://globalgrid2050.com/testcode/wafer-development-environment/202609180205-underground/.
- Application
- globalgrid2050 · testcode/wafer-development-environment/202609180205-underground · JavaScript module
- Uses
- GridAtlas — Atlas Page (estate URL), Grid Dictionary — Index Page (estate URL), Spiders — Index Page (estate URL), Code Generator — Index Page (estate URL), Galaxies Wafers — Index Page (estate URL), Stars — Index Page (estate URL)
- Used by
- loaded by Wafer Development Environment — Underground Page (script src)
- Produces
- $, here, hash32, mulberry32, atomOf, twinOf, say, esc, fly, gh, signal, plainLabel
- Defines here
- $, here, hash32, mulberry32, atomOf, twinOf, say, esc, fly, gh, signal, plainLabel, describeLine, run, earthUrl, W, hud, repoOf, scopeKeys, scopeFail, rasterLogo, toWafer, logoTargets, panelLink, j, loadNet, networkTargets
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/wafer-development-environment/202609180205-underground/pilot.mjs:1-266 · blob 1f11c82b80900752e6302e5f815d5f391dec234a · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, network, storage · domain stage: experimental · users: none · canonical: production_core
// Quantum Twin — primary key to actual code flights. The pilot on top of the Line Wafer.
// Two twins: the permanent key (chronological, never reused) and the actual line it stands for (repo, commit, path, line).
// This file drives the wafer through its own controls (line number · connect to… · FLY) and adds a command box,
// a narration card, qubit/measure (the Quantum Twin Star's own model and generator), apps, entanglement and engine calls.
// It runs in two modes: on the website (static files, engine imported live from ventus-grid-engine's published modules)
// and in CPU WORLD (a local server adds read-from-git and the runner swarm). No model, no colour beyond the wafer's own.
const $ = id => document.getElementById(id);
const here = (() => { const m = document.querySelector('meta[name="wafer-data"]'); return m ? new URL(m.content, location.href).href : new URL('.', location.href).href; })();
const ENGINE_WEB = 'https://ventusltd.github.io/ventus-grid-engine/engine/';
let labels = null, apps = null, keysDb = null, qubit = null, entangle = null, serverMode = false; const born = { count: 0, seed: '2026-09-14' };
const DIES = ['sld-sandbox', 'substation-intelligence', 'place-global-search', 'streaming-parquet-bridge'];
// The Quantum Twin Star's own generator (testcode/202609142202/quantum.js), copied exactly so a measurement here reproduces one there.
function hash32(str){ let h = 0x811c9dc5 >>> 0; for (let i = 0; i < str.length; i++) { h ^= str.charCodeAt(i); h = Math.imul(h, 0x01000193) >>> 0; } return h >>> 0; }
function mulberry32(a){ return function(){ a |= 0; a = a + 0x6D2B79F5 | 0; let t = Math.imul(a ^ a >>> 15, 1 | a); t = t + Math.imul(t ^ t >>> 7, 61 | t) ^ t; return ((t ^ t >>> 14) >>> 0) / 4294967296; }; }
function atomOf(k){ if (!keysDb || !qubit) return null; const i = keysDb.keys.indexOf(k); if (i < 0) return null; const fid = String(keysDb.family[i]); const a = qubit.atoms[fid]; return a ? { fid, i, ...a } : null; }
function twinOf(k){ if (!keysDb) return null; const i = keysDb.keys.indexOf(k); if (i < 0) return null; const pl = keysDb.places[keysDb.place[i]]; return { repo: pl[0], commit: pl[1], path: pl[2], line: keysDb.line[i] }; }
const css = document.createElement('style'); css.textContent = `
#pilot{position:fixed;left:0;right:0;bottom:0;display:flex;gap:8px;padding:8px 12px;background:#0e121bf2;border-top:1px solid #1b2030;z-index:20}
#pilot input{flex:1;font:12px/1.45 ui-monospace,SFMono-Regular,Menlo,Consolas,monospace;background:#11151f;color:#cfe3f2;border:1px solid #1b2030;border-radius:6px;padding:.6rem .9rem}
#pilot input:focus{outline:1px solid #5ec8f2}
#say{position:fixed;left:50%;top:12vh;transform:translateX(-50%);width:min(72ch,84vw);max-height:70vh;min-width:280px;min-height:64px;background:#0e121bf2;border:1px solid #1b2030;border-radius:8px;padding:0;font:14px/1.5 ui-monospace,Menlo,Consolas,monospace;color:#cfe3f2;display:none;z-index:20;white-space:pre-wrap;resize:both;overflow:hidden;display:none;flex-direction:column}
#say.open{display:flex} #say.max{left:12px;top:12px;right:12px;bottom:60px;transform:none;width:auto;max-height:none;height:auto}
#say.min{height:auto!important;max-height:none;resize:none;width:min(48ch,84vw)} #say.min #saybody{display:none}
#saybar{display:flex;align-items:center;gap:6px;padding:4px 8px;border-bottom:1px solid #1b2030;background:#11151f;cursor:move;user-select:none;font-size:11px;color:#8b93a7;letter-spacing:.06em;text-transform:uppercase}
#saybar span{flex:1;overflow:hidden;text-overflow:ellipsis;white-space:nowrap} #saybar button{font:12px ui-monospace,Menlo,Consolas,monospace;background:#0e121b;color:#cfe3f2;border:1px solid #1b2030;border-radius:4px;width:24px;height:22px;cursor:pointer;padding:0}
#saybar button:hover{border-color:#5ec8f2} #saybody{padding:.8rem 1.1rem;overflow:auto;flex:1}
#saybody b{color:#5ec8f2} #say i{color:#f2b05e;font-style:normal} #say a{color:#5ec8f2} #saybody pre{max-height:38vh;overflow:auto;background:#11151f;border:1px solid #1b2030;border-radius:4px;padding:6px 8px;margin:6px 0;font:12px/1.5 ui-monospace,Menlo,Consolas,monospace;white-space:pre}
#saybody pre em{color:#5b6377;font-style:normal} #saybody pre u{display:block;text-decoration:none;color:#5b6377;font-size:11px;padding-left:4.2em;margin:0 0 2px}
#saybody pre .hit u{color:#8b93a7}
#saybody pre .hit{display:inline-block;width:100%;background:#1b2030;color:#f2b05e}
#saybody a.dev{float:right;font-size:11px;color:#5b6377}
#say code{display:block;background:#11151f;border:1px solid #1b2030;border-radius:4px;padding:2px 6px;color:#cfe3f2;margin:4px 0}
#eg{position:fixed;right:12px;bottom:58px;background:#0e121bf2;border:1px solid #1b2030;border-radius:8px;padding:.5rem .7rem;display:flex;flex-direction:column;gap:4px;max-width:46vw;z-index:20}
#eg label{font:11px ui-monospace,Menlo,Consolas,monospace;letter-spacing:.08em;text-transform:uppercase;color:#8b93a7}
#eg select{font:12px ui-monospace,Menlo,Consolas,monospace;background:#11151f;color:#cfe3f2;border:1px solid #1b2030;border-radius:6px;padding:.45rem .7rem}
#plog{position:fixed;left:12px;bottom:58px;max-height:30vh;overflow:hidden;font:11px/1.5 ui-monospace,Menlo,Consolas,monospace;color:#8b93a7;white-space:pre;pointer-events:none;z-index:19}
#beam{bottom:58px !important}
#core button{pointer-events:auto;min-height:44px;min-width:44px;padding:.55rem .9rem;font:13px/1.2 ui-monospace,Menlo,Consolas,monospace;letter-spacing:.04em;background:#0e121bf2;color:#cfe3f2;border:1px solid #5ec8f2;border-radius:8px;cursor:pointer;touch-action:manipulation}
#core button:hover,#core button:focus-visible{background:#11151f;border-color:#f2b05e;outline:none} #core button small{display:block;color:#8b93a7;font-size:10px;letter-spacing:.06em;text-transform:uppercase}
@media (max-width:640px){#earth{position:fixed;inset:0;z-index:30;display:none;flex-direction:column;background:#0b0e15}
#earth.open{display:flex}
#earthbar{display:flex;align-items:center;gap:10px;padding:6px 12px;background:#11151f;border-bottom:1px solid #1b2030;font:12px ui-monospace,Menlo,Consolas,monospace;color:#cfe3f2}
#earthbar b{color:#f2b05e;letter-spacing:.08em} #earthbar span{flex:1;color:#8b93a7;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
#earthbar button,#earthbar a{font:12px ui-monospace,Menlo,Consolas,monospace;background:#0e121b;color:#5ec8f2;border:1px solid #1b2030;border-radius:6px;padding:.4rem .8rem;cursor:pointer;text-decoration:none}
#earthframe{flex:1;border:0;width:100%;background:#000}
`; document.head.appendChild(css);
document.body.insertAdjacentHTML('beforeend', `
<div id="say"></div><div id="plog"></div>
<div id="eg"><label>examples: pick one, it lands in the box, press Enter</label><select id="egs">
<option value="">— choose an example sentence —</option>
<option value="block 39885">Go to the most-copied line in the estate (39885)</option>
<option value="twin 39885">The code behind block 39885, in the card</option>
<option value="state 39885">State of block 39885: HOME or AWAY, from its callers</option>
<option value="measure 39885">Measure block 39885: one recorded draw, HOME or AWAY</option>
<option value="connect 39885 1217">Connect two lines with the beam</option>
<option value="app gridatlas">Go to GridAtlas</option>
<option value="land gridatlas">Land on GridAtlas: the live app, inside this page</option>
<option value="land pipelinenews">Land on Pipeline News</option>
<option value="space">Back to space: the wafer</option>
<option value="apps">List every app on the wafer</option>
<option value="run voltage-drop.voltageDropVolts {"currentA":120,"lengthM":250,"resistanceOhmPerKm":0.32,"powerFactor":0.95,"phases":"three"}">Engine: voltage drop, 120 A over 250 m, 0.32 Ω/km, pf 0.95</option>
<option value="entangle">Check: how many blocks are found at their recorded line</option>
<option value="help">Help</option></select></div>
<form id="pilot"><input id="pin" autocomplete="off" autofocus placeholder="type a sentence or a command: block 39885 · twin 39885 · state 39885 · measure 39885 · app gridatlas · run voltage-drop… · help"></form>`);
const EARTH_HTML = '<div id="earth"><div id="earthbar"><b>EARTH</b><span id="earthname"></span><a id="earthtab" target="_blank">open in its own tab</a><button id="earthback">back to space</button></div><iframe id="earthframe" title="the live app"></iframe></div>';
const lines = []; const log = s => { lines.push(s); if (lines.length > 12) lines.shift(); $('plog').textContent = lines.join('\n'); };
// the card is a small window: minimise, maximise, resize (drag the corner), close; any new answer reopens it
const sayEl = $('say'); sayEl.innerHTML = '<div id="saybar"><span id="saytitle">card</span><button id="saymin" title="minimise">–</button><button id="saymax" title="maximise">▢</button><button id="sayclose" title="close">×</button></div><div id="saybody"></div>';
let lastCard = '';
const say = html => { if (!html) { sayEl.classList.remove('open'); return; } lastCard = html; $('saybody').innerHTML = html; const t = $('saybody').querySelector('b'); $('saytitle').textContent = t ? t.textContent : 'card'; sayEl.classList.remove('min'); sayEl.classList.add('open'); };
$('saymin').onclick = e => { e.stopPropagation(); sayEl.classList.toggle('min'); }; $('saymax').onclick = e => { e.stopPropagation(); sayEl.classList.remove('min'); sayEl.classList.toggle('max'); }; $('sayclose').onclick = e => { e.stopPropagation(); sayEl.classList.remove('open', 'max', 'min'); };
$('saybar').ondblclick = () => sayEl.classList.toggle('min');
(() => { let d = null; $('saybar').addEventListener('pointerdown', e => { if (e.target.tagName === 'BUTTON' || sayEl.classList.contains('max')) return; const r = sayEl.getBoundingClientRect(); d = { x: e.clientX - r.left, y: e.clientY - r.top }; sayEl.style.transform = 'none'; sayEl.style.left = r.left + 'px'; sayEl.style.top = r.top + 'px'; $('saybar').setPointerCapture(e.pointerId); });
$('saybar').addEventListener('pointermove', e => { if (!d) return; sayEl.style.left = Math.max(0, e.clientX - d.x) + 'px'; sayEl.style.top = Math.max(0, e.clientY - d.y) + 'px'; }); $('saybar').addEventListener('pointerup', () => { d = null; }); $('saybar').addEventListener('pointercancel', () => { d = null; }); })();
window.__card = () => ({ open: sayEl.classList.contains('open'), min: sayEl.classList.contains('min'), max: sayEl.classList.contains('max'), w: sayEl.offsetWidth, h: sayEl.offsetHeight, title: $('saytitle').textContent });
const esc = s => String(s).replace(/</g, '<');
const fly = (a, b) => { $('a').value = String(a); $('b').value = b ? String(b) : ''; $('beam').requestSubmit(); };
const gh = t => `https://github.com/${t.repo}/blob/${t.commit}/${t.path}#L${t.line}`;
const signal = o => { if (serverMode) fetch('/signal', { method: 'POST', body: JSON.stringify(o) }).catch(() => {}); try { const L = JSON.parse(localStorage.getItem('qt-signals') || '[]'); L.push({ ...o, t: new Date().toISOString() }); localStorage.setItem('qt-signals', JSON.stringify(L.slice(-500))); } catch {} };
// ---------- plain English: engine calls get a label; every line in the code view gets a note (same rules as pipeline/describe.py) ----------
const PLAIN = {
'voltage-drop.voltageDropVolts': a => `voltage drop for ${a.currentA} A over ${a.lengthM} m at ${a.resistanceOhmPerKm} Ω/km${a.reactanceOhmPerKm ? ' (reactance ' + a.reactanceOhmPerKm + ')' : ''}, power factor ${a.powerFactor}, ${a.phases || 'three'}-phase`,
'voltage-drop.dropPercent': a => `${a.dropVolts} V drop as a share of ${a.nominalVolts} V`, 'voltage-drop.lossesWatts': a => `heat lost in the cable: ${a.currentA} A over ${a.lengthM} m at ${a.resistanceOhmPerKm} Ω/km`,
'diversified-demand.diversifiedDemandKw': a => `demand of ${a.unitCount} units at ${a.perUnitKw} kW each, coincidence ${a.coincidenceFactor}`,
'current-from-power.currentA': a => `current for ${a.apparentPowerVa} VA at ${a.voltageV} V, ${a.phases || 'three'}-phase`, 'firm-capacity.apparentPowerMva': a => `apparent power for ${a.mw} MW at power factor ${a.powerFactor}`,
'power-factor.reactivePowerKvar': a => `reactive power for ${a.kw} kW at power factor ${a.powerFactor}`,
};
const plainLabel = (mod, fn, args) => { const f = PLAIN[`${mod}.${fn}`]; try { return f ? f(args) : `${mod.replace(/-/g, ' ')}: ${fn.replace(/([A-Z])/g, ' $1').toLowerCase()}`; } catch { return `${mod}.${fn}`; } };
const DESCRIBE_RULES = [
[/^\s*$/, 'blank line'], [/^\s*\/\//, 'a comment'], [/^\s*\/\*|^\s*\*/, 'a comment block'],
[/^\s*(import|export)\b/, 'brings code in or out of this file'], [/^\s*(?:async\s+)?function\s+(\w+)/, 'defines the function $1'],
[/^\s*(?:const|let|var)\s+(\w+)\s*=\s*(?:async\s*)?\(?[^=]*=>/, 'defines the function $1'], [/^\s*(?:const|let|var)\s+(\w+)\s*=/, 'sets $1'],
[/\.addEventListener\(\s*['"](\w+)/, 'listens for a $1 on the page'], [/^\s*return\b/, 'hands a result back'], [/^\s*if\b/, 'decides: only when the condition holds'],
[/^\s*(?:else|\} else)/, 'otherwise'], [/^\s*for\b|^\s*while\b/, 'repeats for each item'], [/^\s*try\b/, 'tries, ready to catch a failure'], [/^\s*catch\b|\} catch/, 'handles a failure'],
[/\.(?:querySelector|getElementById)\(/, 'finds a part of the page'], [/\.innerHTML\s*=|\.textContent\s*=/, 'writes text onto the page'], [/\bfetch\(/, 'asks a server for data'],
[/\bclassList\./, 'changes how a part of the page looks'], [/\bconsole\./, 'writes to the developer console'], [/\bthrow\b/, 'stops with an error'],
[/^\s*\}\s*\)?;?\s*$|^\s*\]\s*;?\s*$/, 'closes a block'], [/^\s*(\w+)\s*\(.*\)\s*;?\s*$/, 'calls $1'], [/\bawait\b/, 'waits for a result'], [/=/, 'sets a value'],
];
const describeLine = line => { for (const [re, note] of DESCRIBE_RULES) { const m = line.match(re); if (m) return note.replace(/\$(\d)/g, (_, i) => m[+i] || ''); } return 'a line of code'; };
window.__describe = describeLine;
const cmds = {
help(){ say(`<b>commands</b>\nblock <key> · twin <key> · read <key> · state <key> · measure <key> [seed] · connect <a> <b> · land <app> · space · app <name> · apps · engine · run <module>.<fn> {…} · entangle · reset\nor a sentence: "fly to 39885", "show me gridatlas", "voltage drop for 120 A over 250 m at 0.32 ohm pf 0.95"\n\nEach … [line shortened here: 500 characters; full line on GitHub]
block(k){ k = parseInt(k, 10); if (!Number.isFinite(k)) return log('block <key>'); fly(k); say(`<b>block ${k}</b>\nthe beam is on line ${k}; the panel on the left shows what it is.\n<i>next:</i> twin ${k}`); log(`block ${k}`); },
fly(k){ return cmds.block(k); }, goto(k){ return cmds.block(k); },
async twin(k){ k = parseInt(k, 10); const t = twinOf(k); if (!t) return log(`twin ${k}: this block has no recorded line`); fly(k); return cmds.showCode(k, t, 'twin'); },
async read(k){ k = parseInt(k, 10); const t = twinOf(k); if (!t) return log(`read ${k}: this block has no recorded line`); fly(k); return cmds.showCode(k, t, 'read'); },
// the code itself, in the card, scrollable, the line highlighted; the source link is a fallback for developers
async showCode(k, t, verb){ const raw = `https://raw.githubusercontent.com/${t.repo}/${t.commit}/${t.path}`; let lines = null;
try { const r = await fetch(raw); if (r.ok) lines = (await r.text()).split(/\r?\n/); } catch {}
if (!lines && serverMode) { try { const r = await (await fetch('/line?key=' + k)).json(); if (!r.error) lines = [...r.before, r.text, ...r.after].map(x => x ?? ''); } catch {} }
const head = `<b>${verb} ${k}</b> — ${esc(t.repo.split('/').pop())} · ${esc(t.path.split('/').pop())} · line ${t.line}`;
if (!lines) { say(`${head}
could not load the file here.
<a target="_blank" href="${gh(t)}">source, for developers</a>`); return log(`${verb} ${k}: file not loaded; source link shown`); }
const from = Math.max(1, t.line - 20), to = Math.min(lines.length, t.line + 20); const rows = [];
for (let n = from; n <= to; n++) rows.push(`<span class="${n === t.line ? 'hit' : ''}"><em>${String(n).padStart(5)}</em> ${esc(lines[n - 1] ?? '')}<u>${esc(describeLine(lines[n - 1] ?? ''))}</u></span>`);
say(`${head}
<pre id="code">${rows.join('\n')}</pre><i>next:</i> state ${k} <a class="dev" target="_blank" href="${gh(t)}">source, for developers</a>`);
const hit = document.querySelector('#code .hit'); if (hit) hit.scrollIntoView({ block: 'center' }); log(`${verb} ${k}: ${t.path.split('/').pop()} line ${t.line}: ${(lines[t.line - 1] || '').trim().slice(0, 60)}`); },
state(k){ k = parseInt(k, 10); const a = atomOf(k); if (!a) return log(`state ${k}: this block has no family record`); const n = a.K + a.L + a.M; const pAway = n ? a.M / n : 0; const theta = 2 * Math.asin(Math.sqrt(pAway)); fly(k);
say(`<b>state ${k}</b> — block family #${esc(a.fid)} ${esc(a.name && a.name !== '(anonymous)' ? a.name : 'unnamed')} (${a.source === 'electron.json' ? 'from the published data' : 'estimated from where its copies sit'})\ncallers: K ${a.K} same directory · L ${a.L} same repository · M ${a.M} other repositories\nHOME P = ${(1 - pAway).toFixed(3)} · AWAY P = ${pAway.toFixed(3)} (AWAY = M ÷ (K+L+M) … [line shortened here: 593 characters; full line on GitHub]
qubit(k){ return cmds.state(k); },
measure(rest){ const [ks, seedArg] = (rest || '').split(/\s+/); const k = parseInt(ks, 10); const a = atomOf(k); if (!a) return log(`measure ${ks}: this block has no family record`); if (seedArg) born.seed = seedArg;
const n = a.K + a.L + a.M; const pAway = n ? a.M / n : 0; const r = mulberry32(hash32(`${born.seed}|${a.fid}|${born.count}`))(); born.count++; const away = r < pAway; const outcome = away ? 'AWAY' : 'HOME';
const audit = `Draw ${born.count + 1}: seed "${born.seed}" · state #${a.fid} · r=${r.toFixed(6)} ${away ? '<' : '≥'} P(away)=${pAway.toFixed(3)} → ${outcome}`;
say(`<b>measure ${k}</b> — result: <b>${outcome}</b>\n${esc(audit)}\nThe same seed, block and count always give the same result. Type <i>state ${k}</i> to see the probabilities again.`); log(audit);
signal({ kind: 'born', key: k, family: a.fid, seed: born.seed, count: born.count, r, p_away: pAway, outcome: away ? 'AWAY' : 'HOME', shells: { K: a.K, L: a.L, M: a.M } }); },
connect(ab){ const [a, b] = (ab || '').split(/\s+/).map(x => parseInt(x, 10)); if (!Number.isFinite(a) || !Number.isFinite(b)) return log('connect <a> <b>'); fly(a, b); say(`<b>connect ${a} → ${b}</b>\nthe beam joins two keys; both twins are real lines.`); log(`connect ${a} ${b}`); },
apps(){ if (!apps) return log('apps not loaded'); const list = apps.apps.filter(a => a.app); say(`<b>${list.length} apps</b> (${esc(apps.rule)})\n` + list.map((a, i) => { const L = labels && labels.labels[a.name]; return `${i + 1}. ${a.name} — ${L ? labels.kinds[L.kind] + ': ' + L.what : ''} · ${a.keys.toLocaleString()} blocks`; }).join('\n') + `\n<i>next:</i> app <name>`); log(`${list.len … [line shortened here: 415 characters; full line on GitHub]
app(name){ if (!apps) return log('apps not loaded'); const list = apps.apps.filter(a => a.app); const a = list.find(x => x.name === (name || '').toLowerCase()) || list.find(x => x.name.includes((name || '').toLowerCase())); if (!a) return log(`no app "${name}"`);
const [k0, k1] = apps.first[a.repo]; fly(k0, k1); const url = a.name === 'globalgrid2050' ? 'https://globalgrid2050.com/' : `https://ventusltd.github.io/${a.name}/`;
say(`<b>app ${esc(a.name)}</b> — ${(() => { const L = labels && labels.labels[a.name]; return L ? esc(labels.kinds[L.kind] + '. ' + L.what) : ''; })()}\n${a.keys.toLocaleString()} blocks in ${a.families} gates · index ${esc(a.index || '?')}\nthe beam spans its first and middle lines (${k0} → ${k1}).\n<a target="_blank" href="${url}">open ${esc(a.name)} — see the code in action</a> · <a targe … [line shortened here: 490 characters; full line on GitHub]
async engine(){ const mods = ['voltage-drop', 'diversified-demand', 'current-from-power', 'firm-capacity', 'power-factor', 'connection-capacity']; const out = []; for (const m of mods) { try { const mod = await import(ENGINE_WEB + m + '.js'); out.push(`${m}: ${Object.keys(mod).filter(k => typeof mod[k] === 'function').join(', ')}`); } catch (e) { out.push(`${m}: (not reachable: ${e.message})`); … [line shortened here: 403 characters; full line on GitHub]
say(`<b>engine</b> — ventus-grid-engine, imported live from its published modules\n${esc(out.join('\n'))}\n<i>next:</i> run voltage-drop.voltageDropVolts {…}`); log('engine listed'); },
async run(rest){ const m = /^([a-z0-9-]+)\.([A-Za-z0-9_]+)\s*(\{[\s\S]*\})?$/.exec((rest || '').trim()); if (!m) return log('run <module>.<fn> {…}'); let args = {}; try { args = m[3] ? JSON.parse(m[3]) : {}; } catch { return log('run: arguments are not valid JSON'); }
let result, err, us = 0; try { const mod = await import(ENGINE_WEB + m[1] + '.js'); if (typeof mod[m[2]] !== 'function') throw new Error(`no function ${m[2]} in ${m[1]}; has ${Object.keys(mod).filter(k => typeof mod[k] === 'function').join(', ')}`); const t0 = performance.now(); result = mod[m[2]](args); us = (performance.now() - t0) * 1000; } catch (e) { err = e.message; }
if (err) { say(`<b>engine ${esc(m[1])}.${esc(m[2])}</b>\n<code>refused: ${esc(err)}</code>`); return log(`run refused: ${err}`); }
const big = (result?.unit && /^(kW|kVA)$/.test(result.unit) && result.value > 100) || (result?.unit && /^(MW|MVA)$/.test(result.unit) && result.value > 0.1) || Object.entries(args).some(([k, v]) => (/mw|mva/i.test(k) && v * 1000 > 100) || (/kw|kva/i.test(k) && v > 100));
say(`<b>${esc(plainLabel(m[1], m[2], args))}</b>\nengine ${esc(m[1])}.${esc(m[2])} · ${us.toFixed(0)} µs · imported from ventusltd.github.io/ventus-grid-engine\nin <code>${esc(JSON.stringify(args))}</code>out <code>${esc(JSON.stringify(result, null, 1))}</code>${big ? '<i>above 100 kW: a chartered electrical engineer must sign any real design.</i>\n' : ''}This page shows figures; it is not the … [line shortened here: 563 characters; full line on GitHub]
entangle(){ if (!entangle) return log('entangle not loaded'); say(`<b>entangle</b> (${esc(entangle.generated_utc)})\n${entangle.resolved.toLocaleString()} of ${entangle.keys.toLocaleString()} blocks reach their twin line (${(entangle.rate * 100).toFixed(2)} %) · ${entangle.broken.toLocaleString()} broken\nmeasured by fetching every twin from its commit and hashing the line (pipeline/entangle.py) … [line shortened here: 503 characters; full line on GitHub]
reset(){ $('a').value = ''; $('b').value = ''; $('panel').hidden = true; say(''); log('reset'); }, home(){ return cmds.reset(); },
die(w){ return log('die: available in CPU WORLD (needs route-gridatlas.json)'); }, light(w){ return cmds.app('gridatlas'); },
};
async function run(line){ const [c, ...rest] = line.trim().split(/\s+/); const w = (c || '').toLowerCase(); const fn = Object.hasOwn(cmds, w) ? cmds[w] : null;
if (!fn) { const p = plan(line, { appNames: apps ? apps.apps.filter(a => a.app).map(a => a.name) : [], dies: DIES }); log(`> ${line}`); log(` plan: ${p.commands.length ? p.commands.join(' → ') : '(none)'} — ${p.because}`); if (p.commands.length) log(` you could have typed: ${p.commands.join(' then ')}`);
for (const c2 of p.commands) { const [w2, ...r2] = c2.split(/\s+/); if (Object.hasOwn(cmds, w2)) { try { await cmds[w2](r2.join(' ')); } catch (e) { log('error: ' + e.message); } } } signal({ kind: 'pilot', sentence: line, plan: p.commands }); return; }
log(`> ${line}`); try { await fn(rest.join(' ')); } catch (e) { log('error: ' + e.message); } }
$('pilot').onsubmit = e => { e.preventDefault(); const v = $('pin').value; $('pin').value = ''; if (v.trim()) run(v); };
$('egs').onchange = e => { if (e.target.value) { if (e.target.value === $('pin').dataset.last && lastCard && !sayEl.classList.contains('open')) { say(lastCard); log('card reopened'); } else { $('pin').value = e.target.value; $('pin').dataset.last = e.target.value; log('example loaded — press Enter to run it'); $('pin').focus(); } } e.target.selectedIndex = 0; };
addEventListener('keydown', e => { const t = e.target.tagName; if (t === 'INPUT' || t === 'SELECT' || t === 'TEXTAREA' || t === 'BUTTON') return; if (e.key.length === 1) $('pin').focus(); });
// ---------- space <-> earth: the live apps, by name, inside the page ----------
const EARTH = { gridatlas: 'https://ventusltd.github.io/gridatlas/atlas/', pipelinenews: 'https://ventusltd.github.io/pipelinenews/', globalgrid2050: 'https://globalgrid2050.com/', 'grid-dictionary': 'https://ventusltd.github.io/grid-dictionary/', spiders: 'https://ventusltd.github.io/spiders/', 'star-solar-star': 'https://ventusltd.github.io/star-solar-star/', 'code-generator': 'https://ventusltd … [line shortened here: 889 characters; full line on GitHub]
document.body.insertAdjacentHTML('beforeend', EARTH_HTML);
const earthUrl = name => EARTH[name] || (apps && apps.apps.find(a => a.app && a.name === name) ? `https://ventusltd.github.io/${name}/` : null);
cmds.land = function(name){ name = (name || '').toLowerCase().trim(); const key = Object.keys(EARTH).find(k => k === name) || Object.keys(EARTH).find(k => k.includes(name)) || (apps ? (apps.apps.find(a => a.app && a.name.includes(name)) || {}).name : null);
const url = key ? earthUrl(key) : null; if (!url) return log(`land <app>: ${Object.keys(EARTH).join(', ')}`);
$('earthname').textContent = `${key} · ${url}`; $('earthtab').href = url; $('earthframe').src = url; $('earth').classList.add('open'); say(''); log(`landed on ${key} — type space to come back`); };
cmds.visit = cmds.land; cmds.go = cmds.land; cmds.open = cmds.land;
cmds.space = function(){ $('earth').classList.remove('open'); $('earthframe').src = 'about:blank'; log('back in space: the wafer'); };
$('earthback').onclick = () => cmds.space();
document.body.insertAdjacentHTML('beforeend', '<div id="hud" style="position:fixed;right:12px;top:44px;font:11px/1.5 ui-monospace,Menlo,Consolas,monospace;color:#8b93a7;pointer-events:none;z-index:19"></div>');
const W = () => window.__wafer; const fmtN = n => n.toLocaleString('en-GB');
const hud = s => { const st = W() && W().state(); if (!st) return; $('hud').textContent = `showing ${fmtN(st.scopeN)} of ${fmtN(st.n)} lines${s ? ' · ' + s : ''}`; };
let scopeName = 'all';
const repoOf = name => { if (!apps) return null; const a = apps.apps.find(x => x.name === name) || apps.apps.find(x => x.name.includes(name)); return a ? a.repo : null; };
// a scope is a set with a rule: all · an app (apps.json keys per repo) · module <path> · gate <family#> · line <key>
function scopeKeys(spec){ const s = (spec || 'all').trim(); const [kind, ...r] = s.split(/\s+/); const arg = r.join(' ');
if (!s || s === 'all' || s === 'estate') return { name: 'all', keys: null };
if (kind === 'line' || kind === 'key') { const k = parseInt(arg, 10); return Number.isFinite(k) ? { name: `line ${k}`, keys: [k] } : null; }
if (kind === 'gate' || kind === 'family') { if (!keysDb) return null; const fid = parseInt(arg, 10); const ks = []; for (let i = 0; i < keysDb.keys.length; i++) if (keysDb.family[i] === fid) ks.push(keysDb.keys[i]); return ks.length ? { name: `gate ${fid}`, keys: ks } : null; }
if (kind === 'module' || kind === 'file' || kind === 'die') { if (!keysDb) return null; const ks = []; for (let i = 0; i < keysDb.keys.length; i++) if (keysDb.places[keysDb.place[i]][2].includes(arg)) ks.push(keysDb.keys[i]); return ks.length ? { name: `module ${arg}`, keys: ks } : null; }
const repo = repoOf(s.toLowerCase()); const ks = repo && apps.keys ? apps.keys[repo] : null; return ks ? { name: repo.split('/').pop(), keys: ks } : null; }
const scopeFail = spec => { log(`scope ${spec}: not a scope — try all, an app name (apps), module <path>, gate <family#>, line <key>`); };
cmds.scope = function(spec){ if (!W()) return log('the wafer is not ready'); const sc = scopeKeys(spec); if (!sc) return scopeFail(spec); const r = W().scope(sc.keys); scopeName = sc.name; hud(sc.name);
log(`scope ${sc.name}: showing ${fmtN(r.shown)} of ${fmtN(r.of)} lines${r.missing ? ` · ${fmtN(r.missing)} keys not numbered here` : ''}`); return r; };
cmds.gravity = async function(spec){ if (!W()) return log('the wafer is not ready'); const sc = scopeKeys(spec); if (!sc) return scopeFail(spec); scopeName = sc.name; const k = W().kepler();
log(`gravity ${sc.name}: Kepler r(θ) = p/(1 + e·cos θ), e = ${k.e}, p = ${k.p.toFixed(1)}, the wafer's centre at the focus, points in key order`); const r = await W().gravity(sc.keys); hud(sc.name + ' · kepler'); log(`gravity ${sc.name}: ${fmtN(r.shown)} lines in orbit${r.missing ? ` · ${fmtN(r.missing)} keys not numbered here` : ''}`); return r; };
cmds.orbit = cmds.gravity; cmds.isolate = cmds.gravity;
cmds.release = async function(){ if (!W()) return log('the wafer is not ready'); const r = await W().release(); scopeName = 'all'; hud(); log(`release: showing ${fmtN(r.shown)} of ${fmtN(r.of)} lines, back on the wafer law`); return r; };
// LOGO: the same dust, the same blend; the target is the wordmark rasterised once, deterministically, off screen (sampled only, never shown)
const LOGO = { lines: ['VENTUS — CABLES AND CONNECTIVITY', 'GLOBALGRID2050'], font: 'bold 120px ui-monospace', step: 2, lineGap: 150, fill: 1.6 };
let logoRaster = null;
function rasterLogo(){ if (logoRaster) return logoRaster; const c = document.createElement('canvas'); const g = c.getContext('2d'); g.font = LOGO.font;
const w = Math.ceil(Math.max(...LOGO.lines.map(t => g.measureText(t).width))) + 40, h = LOGO.lineGap * LOGO.lines.length + 40; c.width = w; c.height = h; g.font = LOGO.font; g.textAlign = 'center'; g.textBaseline = 'middle'; g.fillStyle = '#fff';
LOGO.lines.forEach((t, i) => g.fillText(t, w / 2, 20 + LOGO.lineGap * (i + 0.5))); const px = g.getImageData(0, 0, w, h).data; const on = new Uint8Array(w * h); const samples = [];
for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) { if (px[(y * w + x) * 4 + 3] > 127) { on[y * w + x] = 1; if (x % LOGO.step === 0 && y % LOGO.step === 0) samples.push(x, y); } }
const st = W().state(); const s = LOGO.fill * Math.sqrt(st.max) / w; /* wafer units per canvas px: the text spans 1.6·R inside the wafer */
const G = W().kepler().coreOut; /* the two lines part around the core: line 1 lifted by 0.10·R, line 2 lowered by it; the pupil stays empty */
const toWafer = (x, y) => [(x - w / 2) * s, (h / 2 - y) * s + (y < h / 2 ? G : -G)]; const toCanvas = (X, Y) => [X / s + w / 2, h / 2 - (Y > 0 ? Y - G : Y + G) / s];
return (logoRaster = { w, h, on, samples, n: samples.length / 2, s, toWafer, toCanvas }); }
function logoTargets(m){ const L = rasterLogo(); const t = new Float32Array(m * 2); const S = L.n;
for (let j = 0; j < m; j++) { let q, dx = 0, dy = 0; if (m <= S) q = Math.floor(j * S / m); else { q = j % S; const c = Math.floor(j / S); dx = ((c * 7) % LOGO.step) / LOGO.step - 0.5; dy = ((c * 3) % LOGO.step) / LOGO.step - 0.5; } /* cycle with a tiny deterministic offset */
const [X, Y] = L.toWafer(L.samples[2 * q] + dx, L.samples[2 * q + 1] + dy); t[2 * j] = X; t[2 * j + 1] = Y; } return t; }
cmds.logo = async function(spec){ if (!W()) return log('the wafer is not ready'); const sc = scopeKeys(spec || scopeName); if (!sc) return scopeFail(spec); const r = W().scope(sc.keys); scopeName = sc.name; const L = rasterLogo();
log(`logo ${sc.name}: ${fmtN(r.shown)} lines → "${LOGO.lines.join(' / ')}" (${fmtN(L.n)} glyph samples, ${LOGO.font}, grid ${LOGO.step} px)`); await W().blend(logoTargets(r.shown)); hud(sc.name + ' · logo'); log(`logo ${sc.name}: assembled`); return r; };
cmds.wordmark = cmds.logo;
// test instrument: share of in-scope points within tolPx (screen px) of a glyph pixel
window.__logoCheck = (tolPx = 3) => { const L = rasterLogo(); const st = W().state(); const rad = Math.max(1, Math.ceil(tolPx / (st.view.zoom * L.s))); const P = W().positions(); let hit = 0;
for (const [, X, Y] of P) { const [cx, cy] = L.toCanvas(X, Y); let ok = false; for (let y = Math.round(cy) - rad; y <= Math.round(cy) + rad && !ok; y++) for (let x = Math.round(cx) - rad; x <= Math.round(cx) + rad; x++) if (x >= 0 && y >= 0 && x < L.w && y < L.h && L.on[y * L.w + x]) { ok = true; break; } if (ok) hit++; }
return { n: P.length, hit, share: P.length ? hit / P.length : 0, radiusCanvasPx: rad, samples: L.n }; };
window.__scopeKeys = spec => { const sc = scopeKeys(spec); return sc ? { name: sc.name, count: sc.keys ? sc.keys.length : null } : null; };
setTimeout(() => hud(), 1500);
// an app is a scope with gravity: app <name> and land <name> pull that app's lines in under Kepler; space releases them to the wafer law
{ const _app = cmds.app, _land = cmds.land, _space = cmds.space;
cmds.app = async function(name){ const r = _app.call(cmds, name); if (W() && name && scopeKeys(name)) await cmds.gravity(name); return r; };
cmds.land = async function(name){ if (W() && name && scopeKeys(name)) await cmds.gravity(name); return _land.call(cmds, name); };
cmds.space = function(){ const r = _space.call(cmds); if (W()) cmds.release(); return r; }; }
window.__earth = () => ({ open: $('earth').classList.contains('open'), name: $('earthname').textContent, src: $('earthframe').src });
// the particles do the work: when the wafer's own panel opens for a line, add one plain link to the app that line belongs to
const APP_OF_REPO = { gridatlas: 'gridatlas', pipelinenews: 'pipelinenews', globalgrid2050: 'globalgrid2050', 'ventus-grid-engine': 'spider sandbox', elements: 'periodic table', 'grid-dictionary': 'grid-dictionary', spiders: 'spiders', 'star-solar-star': 'star-solar-star', 'code-generator': 'code-generator', testcode: 'testcode', 'galaxies-wafers': 'galaxies-wafers', stars: 'stars' };
const panelLink = () => { const body = $('panelbody'); if (!body || body.querySelector('.landlink')) return; const m = (body.innerText || '').match(/Line\s+([\d,]+)/); if (!m) return; const key = +m[1].replace(/,/g, ''); const t = twinOf(key); if (!t) return;
const repo = t.repo.split('/')[1]; const app = APP_OF_REPO[repo]; if (!app) return; const url = EARTH[app] || `https://ventusltd.github.io/${repo}/`;
body.insertAdjacentHTML('beforeend', `<p class="landlink" style="margin:.6rem 0 0"><a href="${url}" style="color:#5ec8f2">land on ${app} — this line's app</a> <span style="color:#8b93a7">· or type: land ${app}</span></p>`);
body.querySelector('.landlink a').addEventListener('click', e => { e.preventDefault(); run('land ' + app); }); };
new MutationObserver(panelLink).observe($('panelbody'), { childList: true, subtree: true });
window.__pilot = run;
(async () => {
serverMode = /^(127\.0\.0\.1|localhost)$/.test(location.hostname) && await fetch('/gpu', { cache: 'no-store' }).then(r => r.ok).catch(() => false);
if (serverMode) (async function poll(){ try { const { lines: L } = await (await fetch('/pilot/next')).json(); for (const l of L) { log(`[powershell] ${l}`); await run(l); } } catch {} setTimeout(poll, 500); })();
const j = async f => fetch(here + f).then(r => r.ok ? r.json() : null).catch(() => null);
[keysDb, qubit, apps, entangle, labels] = await Promise.all([j('keys.json'), j('qubit.json'), j('apps.json'), j('entangle.json'), j('labels.json')]);
log(`Quantum Twin — primary key to actual code. ${keysDb ? keysDb.count.toLocaleString() : '?'} blocks with a recorded line; ${qubit ? Object.keys(qubit.atoms).length.toLocaleString() : '?'} block families.`);
log('Type a sentence or a command. Every answer shows the command it became. Try: block 39885');
const start = document.querySelector('meta[name="wafer-start"]')?.content; if (start) { await new Promise(r => setTimeout(r, 1500)); const m = /^(land|visit|go|open)\s+(\S+)/.exec(start); if (m) { await run('app ' + m[2]); log(`This page stops here. To enter ${m[2]}, type: land ${m[2]} — space brings you back to the wafer.`); } else await run(start); sayEl.classList.add('min'); /* the wafer is t … [line shortened here: 459 characters; full line on GitHub]
})();
// ---------- NETWORK: a whole system drawn from a typed command, on the wafer's own dust (no new looks) ----------
// draw underground: the London Underground's topology (Transport for London open data; stations and the order of
// stops) laid out by an eight-direction schematic law, then the in-scope particles are placed along its edges and at
// its stations by the same blend gravity and the logo use. Positions are computed, never stored; identity never moves.
let netCache = null;
const loadNet = async () => netCache || (netCache = await fetch(new URL('underground-network.json', location.href)).then(r => r.ok ? r.json() : null).catch(() => null));
function networkTargets(N, m){
const S = 0.85 * W().kepler().R, st = N.stations, E = N.edges, GA = 2.399963229728653;
const perStation = 9, stationDots = Math.min(m, perStation * st.length), edgeDots = m - stationDots;
const lens = E.map(([a, b]) => Math.hypot(st[b][0] - st[a][0], st[b][1] - st[a][1])); const L = lens.reduce((a, b) => a + b, 0) || 1;
const t = new Float32Array(m * 2); let j = 0;
for (let e = 0; e < E.length && j < edgeDots; e++) { const [a, b] = E[e]; const k = Math.max(1, Math.round(edgeDots * lens[e] / L));
for (let i = 0; i < k && j < edgeDots; i++, j++) { const u = (i + 0.5) / k; t[2 * j] = S * (st[a][0] + (st[b][0] - st[a][0]) * u); t[2 * j + 1] = S * (st[a][1] + (st[b][1] - st[a][1]) * u); } }
for (let s = 0; j < m; s++, j++) { const q = s % st.length, c = Math.floor(s / st.length), th = c * GA, r = 0.004 * S * Math.sqrt(c);
t[2 * j] = S * st[q][0] + r * Math.cos(th); t[2 * j + 1] = S * st[q][1] + r * Math.sin(th); }
return t;
}
cmds.draw = async function(spec){
const what = (spec || '').trim().toLowerCase();
if (!/^(underground|tube|london)/.test(what)) return log('draw underground — the one network this version carries');
if (!W()) return log('the wafer is not ready');
const N = await loadNet(); if (!N) return log('draw underground: underground-network.json missing');
await W().scope(null); const m = W().state().scopeN;
log(`draw underground: ${N.stations.length} stations, ${N.edges.length} edges; ${m.toLocaleString('en-GB')} lines placed along them by ${N.law}`);
await W().blend(networkTargets(N, m)); hud('underground');
say(`<b>the Underground, drawn from a typed command</b>\n${N.stations.length} stations and ${N.edges.length} edges from Transport for London's open data, drawn with the wafer's own particles. Every dot is still a numbered line of code; only the law that places it changed.\n<i>next:</i> release · logo · gravity gridatlas\n<small>${N.attribution}</small>`);
log('draw underground: drawn'); return { stations: N.stations.length, edges: N.edges.length, placed: m };
};
cmds.underground = () => cmds.draw('underground'); cmds.tube = cmds.underground;Wafer Development Environment — Real Systems Page
A web page in the testcode folder of GlobalGrid2050 covering substations. Published at https://globalgrid2050.com/testcode/wafer-development-environment/202609180245-real-systems/.
Set aside from the main view: 96% of its lines are the same as testcode/wafer-development-environment/202609192215-proof-s0004/index.html (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 96% of lines shared with Wafer Development Environment — Proof S0004 Page; read that one first. All set-aside files, with reasons. Nothing was deleted.
Evidence
- line-jaccard 0.9649 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/wafer-development-environment/202609192215-proof-s0004/index.html:1-63 cd739175f40c0a7ca7e1002bf7cd6bda51b60134
- sha256 8d22f8fab97101f3faee21914d91129395a454ec0168e51bde07b861c46122a0
- target sha256 b5cba34ab0b5cf198fa126e3d9426cbe84572caf9ac1d6e3b580f14d64e0949e
- group of 2 (identity.json near-copy edges >= 0.9)
- canonical rule: reachable, newest stamp, core repo, most lines
renderglobalgrid2050 / testcode/wafer-development-environment/202609180245-real-systems/index.html · lines 1–63 of 63 · version 2026-09-18 02:45 · Entry point
- What it does
- It draws substations. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: substations, 400kV, 132kV.
- Inputs & outputs
- In: form fields (user input). Out: web page. Voltage levels named: 400kV, 132kV.
- Downstream impact
- Used directly by 26 files: Particles — 12 Substations Line Page (globalgrid2050, https://globalgrid2050.com/testcode/particles/12-substations-line-142743/); Particles — 21 Substations Line Page (globalgrid2050, https://globalgrid2050.com/testcode/particles/21-substations-line-335499/); Particles — 30 Substations Line Page (globalgrid2050, https://globalgrid2050.com/testcode/particles/30-substations-line-185459/); Particles — 06 UK Line Page (globalgrid2050, https://globalgrid2050.com/testcode/particles/06-uk-line-242769/); and 22 more. Reached from 120 other entry points, including GlobalGrid2050 Historical Builds (globalgrid2050, https://globalgrid2050.com/historical_builds.html); GlobalGrid2050 Homepage Before Four Nests (globalgrid2050, https://globalgrid2050.com/homepage-before-four-nests-20260925.html); Homepage V037 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v037.html). It is itself an entry point, published at https://globalgrid2050.com/testcode/wafer-development-environment/202609180245-real-systems/.
- What it achieves
- Its code works with 132 kV and 400 kV. It responds to click events.
- Why it matters
- Loaded by the 12 Substations Line page at https://globalgrid2050.com/testcode/particles/12-substations-line-142743/ and 25 other pages.
- Application
- globalgrid2050 · testcode/wafer-development-environment/202609180245-real-systems · page
- Uses
- GlobalGrid2050 — Testcode Style Sheet (stylesheet), Wafer Development Environment — Underground (script src), Pilot Rules (script src), Pilot (script src)
- Used by
- embedded by Particles — 12 Substations Line Page (iframe), embedded by Particles — 21 Substations Line Page (iframe), embedded by Particles — 30 Substations Line Page (iframe), embedded by Particles — 06 UK Line Page (iframe), embedded by Particles — 07 World Line Page (iframe), embedded by Particles — 08 Logo Line Page (iframe), embedded by Particles — 09 Grid Line Page (iframe), embedded by Particles — 10 Grid400 Line 61820 Page (iframe), and 18 more
- 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
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/wafer-development-environment/202609180245-real-systems/index.html:1-63 · blob 162e0007009d8203ef8dbd6769a581f73eb29298 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, viewport-fit=cover, maximum-scale=5">
<meta name="color-scheme" content="dark">
<title>202609180245-real-systems</title>
<meta name="wafer-data" content="../shared/">
<meta name="wafer-start" content="draw grid">
<link rel="stylesheet" href="style.css">
</head>
<body>
<canvas id="stage" aria-label="Every permanently numbered line of code in the estate, placed by its own number."></canvas>
<header id="bar">
<span id="wordmark">THE LINE WAFER</span>
<span id="count" class="dim">loading the numbered database…</span>
</header>
<form id="beam" autocomplete="off">
<input id="a" inputmode="numeric" pattern="[0-9]*" placeholder="line number" aria-label="line number to fly to">
<input id="b" inputmode="numeric" pattern="[0-9]*" placeholder="connect to…" aria-label="second line number to connect to">
<button id="go" type="submit">FLY</button>
</form>
<section id="panel" hidden>
<button id="close" type="button" aria-label="close">✕</button>
<div id="panelbody"></div>
</section>
<nav id="presets" aria-label="presets" style="position:fixed;left:12px;top:44px;z-index:19;display:flex;gap:6px;flex-wrap:wrap;max-width:62vw">
<button type="button" data-cmd="state 39885">home</button>
<button type="button" data-cmd="draw grid">the grid</button>
<button type="button" data-cmd="draw grid400">400 kV</button>
<button type="button" data-cmd="draw grid132">132 kV</button>
<button type="button" data-cmd="draw substations">substations</button>
<button type="button" data-cmd="draw shotwick">Shotwick solar farm</button>
<button type="button" data-cmd="draw underground">underground</button>
<button type="button" data-cmd="draw uk">British Isles</button>
<button type="button" data-cmd="draw world">world</button>
<button type="button" data-cmd="draw trench">cable trench</button>
<button type="button" data-cmd="draw fault">fault study</button>
<button type="button" data-cmd="gravity gridatlas">orbit gridatlas</button>
<button type="button" data-cmd="logo">logo</button>
<button type="button" data-cmd="clock">clock</button>
<button type="button" data-cmd="release">release</button>
</nav>
<style>#presets button{font:11px/1.6 ui-monospace,Menlo,Consolas,monospace;color:#8b93a7;background:#0b0e14;border:1px solid #232a3a;border-radius:4px;padding:2px 9px;cursor:pointer}#presets button:hover{color:#e6e9f0;border-color:#4a5573}</style>
<script>document.getElementById('presets').addEventListener('click',e=>{const b=e.target.closest('button');if(b&&window.__pilot)window.__pilot(b.dataset.cmd);});</script>
<footer id="foot">
<span id="prov" class="dim">provenance loading</span>
<span id="hint" class="dim">drag to steer · pinch or scroll to focus the beam · tap a line · provided as is, without warranty of any kind; a chart, not a design</span>
<a id="proofs" href="proof/">check every claim on this page</a>
</footer>
<noscript><p class="dim" style="padding:1rem">This surface is drawn from the numbered database at run time, so it needs JavaScript. Nothing here is typed into the page.</p></noscript>
<script type="module" src="app.mjs"></script>
<script src="pilot-rules.js"></script>
<script type="module" src="pilot.mjs"></script>
</body>
</html>