In this section
- Ventus Corev8engine geodesy · gridatlas / atlas/releases/202608292311-atlas-v9/ventus-corev8engine.js lines 1401–1436
- Dock UI interaction · gridatlas / atlas/testcode/202609110849/dock-ui.js lines 1–149
- Browser Proof render · gridatlas / atlas/testcode/202609111007/browser-proof.py lines 1–125
- Build storage · gridatlas / atlas/testcode/202609111007/build.py lines 1–22
- Atlas — Testcode Page render · gridatlas / atlas/testcode/202609111007/index.html lines 1–70
Ventus Corev8engine
A JavaScript file in the atlas folder of GridAtlas that maps elizabeth line, london underground, UK metros trams and HS2, using haversine. Served with the page at https://gridatlas.globalgrid2050.com/atlas/releases/202608292311-atlas-v9/.
Set aside from the main view: 98% of its lines are the same as apps/substation-finder/Si/202609040045-ventus-corev8engine-deep-link-receiver.js (code-generator), which stays. (near-copy-of, proposed by families.py). 97% of lines shared with Ventus Corev8engine Deep Link Receiver; read that one first. All set-aside files, with reasons. Nothing was deleted.
Evidence
- line-jaccard 0.9794 to code-generator@3897d83efcd0259d21dce87704b0c33118fe2c2e apps/substation-finder/Si/202609040045-ventus-corev8engine-deep-link-receiver.js:1-1460 7537cbc360f3767fcdeff6949e6fa47233f4f23f
- sha256 9a75901ebdff05e094650e39973fc0f59204724753d393a734bb8cda7bc875ba
- target sha256 b1da9baca77c7ddc1b45ce3396c60d1da17e38fdf4faa0a5fc70ea1639a92dfc
- group of 4 (identity.json near-copy edges >= 0.9)
- canonical rule: reachable, newest stamp, core repo, most lines
geodesygridatlas / atlas/releases/202608292311-atlas-v9/ventus-corev8engine.js · lines 1401–1436 of 1436 · version 2026-08-29 23:11 (continued from section 608) · Entry point · pattern focusCanonicalProjectDeepLink (shared by 14 files)
- What it does
- It maps elizabeth line, london underground, UK metros trams and hs2. Defines 58 functions or classes, including deepFreeze, escapeHTML, normalizeStatus, fmt, haversine. Side effects: changes the web page (DOM); makes network requests.
- Why it exists in the grid workflow
- Domain stage upstream_foresight (path word 'atlas'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
- Inputs & outputs
- In: GeoJSON file elizabeth_line.geojson; GeoJSON file london_underground.geojson; GeoJSON file uk_metros_trams.geojson; GeoJSON file hs2.geojson; JSON file style.json; JSON file build_manifest.json; GeoJSON file grid_400kv.geojson; form fields (user input). Out: interactive map.
- Downstream impact
- Used directly by 2 files: Code Generator — Substation Finder Page (code-generator, https://ventusltd.github.io/code-generator/apps/substation-finder/); Releases — Atlas V9 Page (gridatlas, https://gridatlas.globalgrid2050.com/atlas/releases/202608292311-atlas-v9/). Reached from 95 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 V030 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v030.html). It is itself an entry point, published at https://gridatlas.globalgrid2050.com/atlas/releases/202608292311-atlas-v9/.
- What it achieves
- It normalizes status (`normalizeStatus`), toggles zone draw mode (`toggleZoneDrawMode`) and opens popup (`openPopup`). Its `snapLines` function gives line features whose first and last vertices are moved onto the nearest substation point within tolerance; other geometry unchanged from line features and substation point features (VEDIC: snap line ends to substations). It reads `/uk_renewables_pipeline/v9/data/v9.1/build_manifest.json`. It responds to fullscreenchange, webkitfullscreenchange and click events.
- Why it matters
- Loaded by the Substation Finder page in Code Generator at https://ventusltd.github.io/code-generator/apps/substation-finder/ and 1 other page.
- Application
- gridatlas · atlas/releases/202608292311-atlas-v9 · script
- VEDIC
- SNAP LINE ENDS TO SUBSTATIONS (GG2050-VEDIC-000106): GridAtlas / Substations · Geospatial data processing. line_features, substation_point_features → Line features whose first and last vertices are moved onto the nearest substation point within tolerance; other geometry unchanged.
- Uses
- none found
- Used by
- linked from Code Generator — Substation Finder Page (link), loaded by Releases — Atlas V9 Page (script src)
- Produces
- deepFreeze, escapeHTML, normalizeStatus, fmt, haversine, _zoneDrawGetRadius, _zoneDrawCirclePoints, _zoneDrawCalcArea, _zoneDrawUpdateLayers, _zoneDrawShowPopup, _zoneDrawShowPopupDebounced, _zoneDrawClear
- 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
- gridatlas@98b5004c5eda9f2ed915fb6fca4b9bbcaa426ca5 atlas/releases/202608292311-atlas-v9/ventus-corev8engine.js:1401-1436 · blob c53342c2cab7086cbd26be90f5524647165f76aa · GitHub at these lines
- State
- achieves: code · context: readme_derived · stage: output · effects: dom, network · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
if (_pendingToolClick) { clearTimeout(_pendingToolClick); _pendingToolClick = null; }
if (zoneDrawMode) { e.preventDefault(); return; }
if (!measureMode || measurePoints.length < 2) return;
e.preventDefault();
measureClosed = true;
updateMeasureLayers();
updateMeasureDisplay();
});
window.addEventListener('mouseup', () => { if (zoneDrawMode) _zoneDrawOnMouseUp(); });
map.on('mousemove', e => {
if (zoneDrawMode) { _zoneDrawOnMouseMove(e); return; }
if (measureMode || radiusMode || radiusAreaMode) { map.getCanvas().style.cursor = 'crosshair'; return; }
if (!_visibleHoverIds.length) { map.getCanvas().style.cursor = ''; return; }
const now = Date.now();
if (now - _lastHoverMs < HOVER_THROTTLE_MS) return;
_lastHoverMs = now;
if (_lastMouseMoveRaf) return;
_lastMouseMoveRaf = requestAnimationFrame(() => {
_lastMouseMoveRaf = null;
const features = map.queryRenderedFeatures(e.point, { layers: _visibleHoverIds });
map.getCanvas().style.cursor = features.length ? 'pointer' : '';
});
});
GRID_CONFIG.forEach(group => { group.layers.forEach(layer => { if (layer.preload && layer.id !== '400') hydrateLayer(layer.id); }); });
const state400 = RUNTIME_STATE['400'];
if (state400) { state400.loaded = true; state400.loading = false; updateUIState('400', 'OK'); }
focusCanonicalProjectDeepLink();
});
};Dock UI
A JavaScript file in the testcode folder of GridAtlas that works with schedule position (`schedulePosition`) and native quick buttons (`nativeQuickButtons`) and reads inputs for sat policy and sat scene.
interactiongridatlas / atlas/testcode/202609110849/dock-ui.js · lines 1–149 of 149 · version 2026-09-11 08:49 · Not reached from any entry point (candidate for review) · pattern schedulePosition (shared by 3 files)
- What it does
- It draws its content. Defines 13 functions or classes, including schedulePosition, sceneOptions, nativeQuickButtons, shownRect, bounds. Side effects: changes the web page (DOM); 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. README: "`dock-ui.js` is the authored UI tail"
- Inputs & outputs
- In: browser storage (getItem); form fields (user input). Out: browser storage (setItem).
- What it achieves
- It is built from the schedule position helper (`schedulePosition`), the scene options helper (`sceneOptions`) and the native quick buttons helper (`nativeQuickButtons`). This is the replacement UI tail of the satellite-only test cartridge. It responds to pointerdown, pointermove and pointerup events.
- Why it matters
- No other file in the estate was found to import it.
- Application
- gridatlas · atlas/testcode/202609110849 · script
- Uses
- none found
- Used by
- none found
- Produces
- schedulePosition, sceneOptions, nativeQuickButtons, shownRect, bounds, overlap, position, clampX, clampY, dragStart, dragMove, dragEnd
- Defines here
- schedulePosition, sceneOptions, nativeQuickButtons, shownRect, bounds, overlap, position, clampX, clampY, dragStart, dragMove, dragEnd, install
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- gridatlas@98b5004c5eda9f2ed915fb6fca4b9bbcaa426ca5 atlas/testcode/202609110849/dock-ui.js:1-149 · blob c36a28bb6b1964abc8dd504d5b892a5b72099e6a · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, storage · domain stage: experimental · users: none · canonical: unreached_review
// This is the replacement UI tail of the satellite-only test cartridge.
// It MOVES the original quick buttons; it never clones them or their logic.
let scheduled = false, nativeButtons = [], savedPosition = null, dragging = null;
let originalPositions = [], userCollapsed = false;
function schedulePosition() {
if (!scheduled) { scheduled = true; requestAnimationFrame(() => { scheduled = false; position(); }); }
}
function sceneOptions(selected) {
const select = document.getElementById('sat-scene');
if (!select) return;
select.replaceChildren();
for (const item of catalogue) {
const option = document.createElement('option'), cloud = item.properties['eo:cloud_cover'];
option.value = item.id;
option.textContent = item.properties.datetime.slice(0,16).replace('T',' ') + ' UTC · ' + (finite(cloud) ? cloud.toFixed(1)+'%' : '?') + ' scene cloud';
option.selected = item.id === selected; select.appendChild(option);
}
select.disabled = !catalogue.length;
}
function nativeQuickButtons() {
const all = [...document.querySelectorAll('button')].filter(e => !e.closest('#gridatlas-menu-bar,#sat-test-panel'));
return [all.find(e => /⚡\s*grid/i.test(e.textContent)), all.find(e => /[◉◎]\s*subs/i.test(e.textContent))];
}
function shownRect(e) {
if (!e) return null;
const r=e.getBoundingClientRect(), s=getComputedStyle(e);
return r.width && r.height && s.display!=='none' && s.visibility!=='hidden' && !e.closest('[hidden]') ? r : null;
}
function bounds() {
const h=map.getContainer().getBoundingClientRect(), v=window.visualViewport;
return {left:Math.max(h.left,v?.offsetLeft||0)+8, top:Math.max(h.top,v?.offsetTop||0)+8,
right:Math.min(h.right,(v?.offsetLeft||0)+(v?.width||innerWidth))-8,
bottom:Math.min(h.bottom,(v?.offsetTop||0)+(v?.height||innerHeight))-8,host:h};
}
function overlap(a,b,gap=6) { return a.left<b.right+gap && a.right>b.left-gap && a.top<b.bottom+gap && a.bottom>b.top-gap; }
function position() {
if (!panel?.isConnected || dragging) return;
const b=bounds();
const obstacles=[...document.querySelectorAll('.search-bar-wrapper,#search-results,#gridatlas-menu-bar,.gm-panel,.maplibregl-popup-content,#gridatlas-dash-toggle')]
.filter(e=>!panel.contains(e)).map(shownRect).filter(r=>r && r.bottom>b.top && r.top<b.bottom && r.right>b.left && r.left<b.right);
panel.hidden=false;
panel.dataset.collapsed=String(userCollapsed);
for (const compact of [false,true]) {
panel.dataset.autoCompact=String(compact);
const size=panel.getBoundingClientRect(), w=size.width,h=size.height;
const clampX=x=>Math.max(b.left,Math.min(b.right-w,x));
const clampY=y=>Math.max(b.top,Math.min(b.bottom-h,y));
const candidates=[];
if(savedPosition) candidates.push([clampX(b.host.left+savedPosition.x),clampY(b.host.top+savedPosition.y)]);
// Home is bottom-left, beside the existing map tools, never below search.
candidates.push([b.left,b.bottom-h],[b.right-w,b.bottom-h]);
for(const r of obstacles) { candidates.push([b.left,r.top-h-8],[b.right-w,r.top-h-8]); }
candidates.push([b.left,b.top+40],[b.right-w,b.top+40]);
for(const r of obstacles) candidates.push([b.left,r.bottom+8],[b.right-w,r.bottom+8]);
for(const [x,y] of candidates) {
const r={left:x,top:y,right:x+w,bottom:y+h};
if(x<b.left || r.right>b.right || y<b.top || r.bottom>b.bottom || obstacles.some(o=>overlap(r,o))) continue;
panel.style.left=(x-b.host.left)+'px'; panel.style.top=(y-b.host.top)+'px'; return;
}
}
// Native search / menus / cards have priority. Return the dock on close.
panel.hidden=true;
}
function dragStart(e) {
if (e.button!==undefined && e.button!==0) return;
e.preventDefault();e.stopPropagation();
const r=panel.getBoundingClientRect();
dragging={id:e.pointerId,x:e.clientX,y:e.clientY,left:r.left,top:r.top};
e.currentTarget.setPointerCapture(e.pointerId);
panel.dataset.dragging='true';
}
function dragMove(e) {
if(!dragging || dragging.id!==e.pointerId)return;
e.preventDefault();e.stopPropagation();
const b=bounds(),r=panel.getBoundingClientRect();
const x=Math.max(b.left,Math.min(b.right-r.width,dragging.left+e.clientX-dragging.x));
const y=Math.max(b.top,Math.min(b.bottom-r.height,dragging.top+e.clientY-dragging.y));
panel.style.left=(x-b.host.left)+'px';panel.style.top=(y-b.host.top)+'px';
}
function dragEnd(e) {
if(!dragging || e.pointerId!==dragging.id)return;
e.stopPropagation();
const b=bounds(),r=panel.getBoundingClientRect();
savedPosition={x:r.left-b.host.left,y:r.top-b.host.top};
dragging=null;panel.dataset.dragging='false';
try { sessionStorage.setItem('gridatlas.satellite.dock.position',JSON.stringify(savedPosition)); } catch(_) {}
schedulePosition();
}
function install(m) {
if(panel || !m.getLayer('l-sat'))return;
const quick=nativeQuickButtons();if(quick.some(e=>!e))return false;
map=m;nativeButtons=quick;window.__GRIDATLAS_SATELLITE_TEST_MAP__=map;
try { const p=JSON.parse(sessionStorage.getItem('gridatlas.satellite.dock.position')); if(p && finite(p.x)&&finite(p.y)) savedPosition=p; }catch(_){}
const css=document.createElement('style');css.id='sat-dock-css';css.textContent=`
#sat-test-panel{position:absolute;z-index:110;width:360px;max-width:calc(100% - 20px);box-sizing:border-box;padding:5px;background:#070d11f2;color:#cfe6e8;border:1px solid #426d73;border-radius:6px;font:11px/1.3 ui-monospace,monospace}
#sat-test-panel[hidden]{display:none!important}
#sat-test-panel .sat-head,#sat-test-panel .sat-row{display:flex;gap:4px;align-items:stretch}
#sat-test-panel .sat-head{margin-bottom:4px}
#sat-test-panel button,#sat-test-panel select{position:static!important;inset:auto!important;transform:none!important;box-sizing:border-box;min-width:44px;min-height:44px;margin:0!important;padding:5px;border:1px solid #426d73;border-radius:4px;background:#0d171c;color:#bde6e8;font:600 10px ui-monospace,monospace;cursor:pointer;touch-action:manipulation}
#sat-test-panel .sat-row button{flex:1 1 0;white-space:nowrap}
#sat-test-panel #sat-drag{flex:1;text-align:left;touch-action:none;cursor:grab;user-select:none}
#sat-test-panel[data-dragging=true] #sat-drag{cursor:grabbing}
#sat-test-panel #sat-reset,#sat-test-panel #sat-collapse{flex:0 0 44px}
#sat-test-panel button[aria-pressed=true]{border-color:#00ffff;background:#183940;color:#00ffff}
#sat-test-panel :focus-visible{outline:2px solid white;outline-offset:1px}
#sat-test-status{margin-top:5px;overflow-wrap:anywhere;font-size:10px;line-height:1.3}
#sat-scene-options{margin-top:6px;border-top:1px solid #426d73;padding-top:5px}
#sat-scene-options[hidden]{display:none!important}
#sat-test-panel select{width:100%;margin-top:4px!important;font-size:10px}
#sat-test-panel .sat-note{margin:5px 0 0;color:#9cb8bd;font-size:10px}
#sat-test-panel[data-collapsed=true] .sat-row,#sat-test-panel[data-collapsed=true] #sat-test-status,#sat-test-panel[data-collapsed=true] #sat-scene-options{display:none!important}
#sat-test-panel[data-auto-compact=true] #sat-test-status,#sat-test-panel[data-auto-compact=true] #sat-scene-options{display:none!important}
`;
document.head.appendChild(css);
panel=document.createElement('section');panel.id='sat-test-panel';panel.setAttribute('aria-label','Movable grid and imagery controls');
panel.innerHTML='<div class="sat-head"><button id="sat-drag" type="button" aria-label="Drag map controls; arrow keys also move">⠿ MOVE</button><button id="sat-scenes-toggle" type="button" aria-expanded="false" aria-controls="sat-scene-options">SCENES</button><button id="sat-reset" type="button" aria-label="Return controls to bottom">↩</button><button id="sat-collapse" type="button" aria-label= … [line shortened here: 1,344 characters; full line on GitHub]
map.getContainer().appendChild(panel);status=panel.querySelector('#sat-test-status');
const row=panel.querySelector('.sat-row');
for(let i=0;i<quick.length;i++) {
const node=quick[i];originalPositions.push({node,parent:node.parentNode,next:node.nextSibling});
node.dataset.satNative=i===0?'grid':'subs';
row.insertBefore(node,document.getElementById('sat-test-dark'));
}
const handle=panel.querySelector('#sat-drag');
handle.addEventListener('pointerdown',dragStart);handle.addEventListener('pointermove',dragMove);
handle.addEventListener('pointerup',dragEnd);handle.addEventListener('pointercancel',dragEnd);
handle.addEventListener('keydown',e=>{if(!['ArrowUp','ArrowDown','ArrowLeft','ArrowRight'].includes(e.key))return;e.preventDefault();e.stopPropagation();const b=bounds(),r=panel.getBoundingClientRect(),n=e.shiftKey?5:20;savedPosition={x:r.left-b.host.left+(e.key==='ArrowLeft'?-n:e.key==='ArrowRight'?n:0),y:r.top-b.host.top+(e.key==='ArrowUp'?-n:e.key==='ArrowDown'?n:0)};schedulePosition();});
for(const event of ['pointerdown','touchstart','dblclick','wheel'])panel.addEventListener(event,e=>e.stopPropagation(),{passive:true});
panel.addEventListener('click',e=>{
e.stopPropagation();const id=e.target.closest('button')?.id;
if(id==='sat-test-s2')sentinel();else if(id==='sat-test-esri')basic('esri');else if(id==='sat-test-dark')basic('dark');
else if(id==='sat-reset'){savedPosition=null;try{sessionStorage.removeItem('gridatlas.satellite.dock.position')}catch(_){}schedulePosition();}
else if(id==='sat-collapse'){userCollapsed=!userCollapsed;e.target.textContent=userCollapsed?'+':'−';e.target.setAttribute('aria-expanded',String(!userCollapsed));schedulePosition();}
else if(id==='sat-scenes-toggle'){const options=panel.querySelector('#sat-scene-options');options.hidden=!options.hidden;e.target.setAttribute('aria-expanded',String(!options.hidden));userCollapsed=false;panel.querySelector('#sat-collapse').textContent='−';panel.querySelector('#sat-collapse').setAttribute('aria-expanded','true');schedulePosition();}
else if(id==='sat-refresh')sentinel(null,true);
});
panel.addEventListener('change',e=>{e.stopPropagation();if(e.target.id==='sat-policy'){selectionPolicy=e.target.value;sentinel(null,true);}else if(e.target.id==='sat-scene')sentinel(e.target.value,true);});
document.addEventListener('change',e=>{if(e.target.name==='bm'||e.target.name==='bm-fs')basic(e.target.value==='sat'?'esri':'dark');});
const resize=new ResizeObserver(schedulePosition);resize.observe(map.getContainer());resize.observe(panel);
const search=document.querySelector('.search-bar-wrapper');if(search)resize.observe(search);
new MutationObserver(records=>{if(records.some(r=>!panel.contains(r.target) && (r.type==='childList'||r.target.matches?.('#search-results,.search-bar-wrapper,.gm-panel,.gm-menu,.maplibregl-popup-content,.maplibregl-popup,body,#gridatlas-dash-toggle'))))schedulePosition();}).observe(document.body,{subtree:true,childList:true,attributes:true,attributeFilter:['style','class','hidden']});
window.addEventListener('resize',schedulePosition);window.visualViewport?.addEventListener('resize',schedulePosition);window.visualViewport?.addEventListener('scroll',schedulePosition);
document.addEventListener('click',()=>setTimeout(schedulePosition,50));
map.on('moveend',()=>{if(mode==='s2'&&active){const c=map.getCenter();say(covers(active.item,[c.lng,c.lat])?sceneText(active.item)+' · Esri outside scene':'Outside S2 scene; Esri shown. Press S2 for this location.');}});
window.__GRIDATLAS_SATELLITE_TEST__={snapshot:()=>({version:VERSION,mode,scene:active?.item.id||null,date:active?.item.properties.datetime||null,bounds:active?.bounds||null,policy:selectionPolicy,scenes:catalogue.length,nativeNodesPreserved:nativeButtons.every(e=>panel.contains(e)),dockMoved:!!savedPosition,...metrics})};
updateButtons();say('Map tools · drag MOVE to reposition');return true;
}
let attempts=0;const timer=setInterval(()=>{const m=window.__GRIDATLAS_V9_MAP__;if(m?.getLayer('l-sat')&&install(m))clearInterval(timer);else if(++attempts>=240)clearInterval(timer);},250);
})();Browser Proof
A Python module in the testcode folder of GridAtlas that draws survey boundary. It toggles quick (`toggle_quick`) and is built from the check step (`check`) and the handler step (`handler`).
rendergridatlas / atlas/testcode/202609111007/browser-proof.py · lines 1–125 of 125 · version 2026-09-11 10:07 · Not reached from any entry point (candidate for review) · pattern satellite (shared by 2 files)
- What it does
- It draws survey boundary. Defines 10 functions or classes, including check, handler, response, req, state. Uses libraries os, pathlib, json, re, shutil. Side effects: changes the web page (DOM); reads or writes files; starts processes.
- 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. README: "`browser-proof.py` runs bounded Chrome checks with live external imagery"
- Inputs & outputs
- In: GeoJSON file EN010101-boundary.geojson; GeoJSON file survey-test-boundary.geojson. Out: JSON file report.json.
- What it achieves
- Bounded Chrome checks on a candidate or the published Satellite survey test.
- Why it matters
- No other file in the estate was found to import it.
- Application
- gridatlas · atlas/testcode/202609111007 · Python module
- Uses
- GridAtlas — Atlas Page (estate URL), os, pathlib, json, re, shutil, time, sys, playwright.sync_api
- Used by
- none found
- Produces
- check
- Defines here
- check, handler, response, req, state, snap, grid, satellite, visible_quick, toggle_quick
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- gridatlas@98b5004c5eda9f2ed915fb6fca4b9bbcaa426ca5 atlas/testcode/202609111007/browser-proof.py:1-125 · blob b351c616c76addb14d16926816948a3254612c82 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: experimental · users: none · canonical: unreached_review
"""Bounded Chrome checks on a candidate or the published Satellite survey test."""
import os, pathlib, json, re, shutil, time, sys
from playwright.sync_api import sync_playwright
HERE=pathlib.Path(__file__).resolve().parent
OUT=pathlib.Path('evidence'); OUT.mkdir(exist_ok=True)
ROOT='https://ventusltd.github.io/gridatlas/atlas/'
URL=ROOT+'testcode/202609111007/'
LIVE=os.environ.get('LIVE_TEST')=='1'
report={'url':URL,'live':LIVE,'checks':[],'errors':[],'imagery_http_errors':[],'stac_queries':[],'images':{}}
def check(name, ok, detail=None):
report['checks'].append({'name':name,'pass':bool(ok),'detail':detail}); print(name, 'PASS' if ok else 'FAIL', flush=True)
with sync_playwright() as p:
browser=p.chromium.launch(headless=True,executable_path=shutil.which('google-chrome') or shutil.which('chromium'),args=['--no-sandbox','--use-angle=swiftshader','--enable-unsafe-swiftshader'])
context=browser.new_context(viewport={'width':393,'height':740},is_mobile=True,has_touch=True,device_scale_factor=1)
context.set_default_timeout(15000)
page=context.new_page()
if not LIVE:
for name, mime in [('index.html','text/html'),('satellite.js','text/javascript')]:
data=(HERE/name).read_text()
route_url=URL+'**' if name=='index.html' else URL+name+'*'
def handler(route, request, *, data=data, mime=mime, name=name):
clean=request.url.split('?')[0]
if clean in [URL,URL+name]: route.fulfill(body=data,content_type=mime)
else: route.continue_()
page.route(route_url,handler)
page.on('pageerror',lambda e:report['errors'].append(str(e)))
def response(r):
if 'planetarycomputer.microsoft.com/api/data/' in r.url or '/World_Imagery/' in r.url:
source='S2' if 'planetarycomputer' in r.url else 'Esri'
report['images'][source]=report['images'].get(source,0)+(1 if r.ok else 0)
if r.status>=400: report['imagery_http_errors'].append({'url':r.url,'status':r.status})
page.on('response',response)
def req(r):
if '/api/stac/v1/search' in r.url:
try: report['stac_queries'].append(json.loads(r.post_data or '{}'))
except Exception: pass
page.on('request',req)
def state(): return page.evaluate('() => window.__GRIDATLAS_SATELLITE_TEST__.snapshot()')
def snap(name):
page.screenshot(path=str(OUT/(name+'.png')),full_page=False); report[name]=state()
def grid(opened=True):
b=page.locator('#gridatlas-menu-bar-title-4')
isopen=b.evaluate("e=>e.closest('.gm-menu').classList.contains('gm-open')")
if isopen!=opened: b.click()
def satellite(opened=True):
grid(True); d=page.locator('#satellite-survey')
if d.evaluate('e=>e.open')!=opened: d.locator(':scope > summary').click()
def visible_quick():
return page.evaluate('''()=>[...document.querySelectorAll('button')].filter(e=>!e.closest('#gridatlas-menu-bar')&&/⚡\\s*grid|[◉◎]\\s*subs/i.test(e.textContent)).map(e=>{const r=e.getBoundingClientRect(),top=document.elementFromPoint(r.x+r.width/2,r.y+r.height/2);return {text:e.textContent,parent:e.parentElement.id,rect:{x:r.x,y:r.y,w:r.width,h:r.height},hittable:top===e||e.contains(top)}})''')
def toggle_quick(label,layer):
grid(False); loc=page.get_by_role('button',name=re.compile(label))
old=page.evaluate('(id)=>window.__GRIDATLAS_V9_MAP__.getLayoutProperty(id,"visibility")',layer)
loc.click(timeout=8000); page.wait_for_timeout(150)
mid=page.evaluate('(id)=>window.__GRIDATLAS_V9_MAP__.getLayoutProperty(id,"visibility")',layer)
loc.click(timeout=8000); page.wait_for_timeout(150)
end=page.evaluate('(id)=>window.__GRIDATLAS_V9_MAP__.getLayoutProperty(id,"visibility")',layer)
check('Original '+layer+' toggle/restore',old!=mid and old==end,[old,mid,end])
try:
page.goto(URL,wait_until='domcontentloaded',timeout=60000)
page.wait_for_selector('#satellite-survey',state='attached',timeout=60000)
page.wait_for_timeout(5000)
check('No floating satellite dock',page.locator('#sat-test-panel').count()==0)
check('Satellite section inside Grid',state()['menuOnly'])
check('Satellite buttons hidden on initial screen',not page.locator('#sat-test-s2').is_visible())
report['quick_initial']=visible_quick();check('GRID/SUBS present and clickable',len(report['quick_initial'])==2 and all(x['hittable'] for x in report['quick_initial']))
snap('main-screen')
grid(True); check('Grid dropdown does not automatically expand survey',not page.locator('#sat-test-s2').is_visible())
satellite(True);check('S2 reachable inside Grid',page.locator('#sat-test-s2').is_visible());snap('grid-survey-menu')
grid(False)
page.locator('#search-input').fill('Botley')
page.wait_for_timeout(2500)
check('Search has no satellite obstruction',not page.locator('#sat-test-s2').is_visible())
snap('search-results')
page.locator('#search-input').press('Escape');page.locator('#search-input').fill('')
fixture=HERE/'EN010101-boundary.geojson'
if fixture.exists(): data=fixture.read_bytes(); name=fixture.name
else:
data=json.dumps({'type':'Polygon','coordinates':[[[-.593475,53.569066],[-.559087,53.569066],[-.559087,53.585988],[-.593475,53.585988],[-.593475,53.569066]]]}).encode();name='survey-test-boundary.geojson'
report['boundary_fixture']=name
satellite(True)
page.locator('#survey-file').set_input_files({'name':name,'mimeType':'application/geo+json','buffer':data})
page.wait_for_function('window.__GRIDATLAS_SATELLITE_TEST__.snapshot().boundary !== null')
check('Boundary parsed and drawn',page.evaluate('()=>!!window.__GRIDATLAS_V9_MAP__.getLayer("survey-boundary-line")'))
check('Boundary retains supplied filename',state()['boundary']['name']==name)
page.locator('#satellite-survey details').filter(has=page.locator('#survey-file')).evaluate('e=>e.open=true')
page.locator('#survey-fit').click();page.wait_for_timeout(400)
toggle_quick(r'^⚡\s*Grid$','l-400');toggle_quick(r'^[◉◎]\s*Subs$','l-subs')
satellite(True);page.locator('#sat-test-esri').click();page.locator('#survey-view').click();page.wait_for_timeout(4000)
check('Esri selected',state()['mode']=='esri');snap('boundary-esri')
satellite(True);t=time.monotonic();page.locator('#sat-test-s2').click();page.locator('#survey-view').click()
page.wait_for_function('window.__GRIDATLAS_SATELLITE_TEST__.snapshot().mode==="s2"',timeout=60000)
report['s2_first_seconds']=round(time.monotonic()-t,2);page.wait_for_timeout(1200)
check('Boundary query sent as polygon',any(q.get('intersects',{}).get('type')=='MultiPolygon' for q in report['stac_queries']))
check('Real S2 pixels returned',report['images'].get('S2',0)>0);snap('boundary-sentinel')
toggle_quick(r'^⚡\s*Grid$','l-400');toggle_quick(r'^[◉◎]\s*Subs$','l-subs')
first=state()['scene'];satellite(True)
page.locator('#satellite-survey details').filter(has=page.locator('#survey-set-A')).evaluate('e=>e.open=true')
page.locator('#survey-set-A').click()
options=page.locator('#sat-scene option').evaluate_all('es=>es.map(e=>({value:e.value,text:e.textContent}))')
first_date=state()['date'][:10];other=next((o for o in options if not o['text'].startswith(first_date)),None)
check('Multiple dated captures available',other is not None)
if other:
page.locator('#sat-scene').select_option(other['value']);grid(False)
page.wait_for_function('(id)=>window.__GRIDATLAS_SATELLITE_TEST__.snapshot().scene===id',arg=other['value'],timeout=60000)
snap('second-capture');satellite(True);page.locator('#survey-set-B').click();page.locator('#survey-show-A').click();grid(False)
page.wait_for_function('(id)=>window.__GRIDATLAS_SATELLITE_TEST__.snapshot().scene===id',arg=first,timeout=60000)
check('A restores actual first image',state()['scene']==first);satellite(True);page.locator('#survey-show-B').click();grid(False)
page.wait_for_function('(id)=>window.__GRIDATLAS_SATELLITE_TEST__.snapshot().scene===id',arg=other['value'],timeout=60000)
check('B restores actual second image',state()['scene']==other['value']);satellite(True);snap('capture-dates');grid(False)
for title,size in [('landscape',{'width':852,'height':393}),('desktop',{'width':1440,'height':900})]:
page.set_viewport_size(size);page.wait_for_timeout(500)
check(title+' satellite hidden at rest',not page.locator('#sat-test-s2').is_visible())
check(title+' native buttons remain',state()['nativeNodesUnmoved']);snap(title)
satellite(True);check(title+' menu S2 reachable',page.locator('#sat-test-s2').is_visible());grid(False)
check('No uncaught JavaScript errors',not report['errors'],report['errors'])
check('No imagery HTTP errors',not report['imagery_http_errors'],report['imagery_http_errors'])
except Exception as e:
check('Browser journey completed',False,str(e))
try:page.screenshot(path=str(OUT/'failure.png'),timeout=5000);(OUT/'failure.html').write_text(page.content())
except Exception:pass
finally:
report['success']=all(c['pass'] for c in report['checks']);(OUT/'report.json').write_text(json.dumps(report,indent=2))
print(json.dumps({'success':report['success'],'checks':len(report['checks']),'errors':report['errors'],'images':report['images'],'failed':[c for c in report['checks'] if not c['pass']]}),flush=True)
browser.close()
sys.exit(0 if report['success'] else 1)Build
A Python module in the testcode folder of GridAtlas that builds an isolated Satellite survey test; production composition is unchanged, using SHA-256.
storagegridatlas / atlas/testcode/202609111007/build.py · lines 1–22 of 22 · version 2026-09-11 10:07 · Not reached from any entry point (candidate for review)
- What it does
- It loads data. Uses libraries hashlib, json, pathlib, re. Side effects: reads or writes files.
- 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.
- 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
- gridatlas · atlas/testcode/202609111007 · Python module
- Uses
- hashlib, json, pathlib, re
- 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
- gridatlas@98b5004c5eda9f2ed915fb6fca4b9bbcaa426ca5 atlas/testcode/202609111007/build.py:1-22 · blob 19728584f8581732ad5da658cd16d0e59312c833 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: filesystem · domain stage: experimental · users: none · canonical: unreached_review
"""Build an isolated Satellite survey test; production composition is unchanged."""
import hashlib, json, pathlib, re
HERE = pathlib.Path(__file__).resolve().parent
BASE = HERE.parent / '202609110849'
VERSION = HERE.name
raw = (BASE / 'satellite.js').read_bytes()
assert hashlib.sha1(b'blob '+str(len(raw)).encode()+b'\0'+raw).hexdigest() == '7c47ce3035e31ef62ee75238d676e442344c9aae', 'Inherited helper file changed'
prior = raw.decode()
assert prior.count(' async function sentinel(') == 1
prefix = prior.split(' async function sentinel(', 1)[0].replace("const VERSION = '202609110849'", "const VERSION = '" + VERSION + "'")
js = prefix + (HERE / 'survey-ui.js').read_text()
js = js.replace("'Dark map · satellite test ' + VERSION", "'Dark map | Satellite survey ' + VERSION")
(HERE / 'satellite.js').write_text(js)
html = (BASE / 'index.html').read_text().replace('202609110849', VERSION)
new_hash = hashlib.sha256(js.encode()).hexdigest()
html, n = re.subn(r"(const addon=await script\(new URL\('satellite.js',testBase\),')[a-f0-9]{64}('\);)", lambda m: m[1] + new_hash + m[2], html)
assert n == 1, 'Loader addon hash slot not found'
html = html.replace('GridAtlas satellite test', 'GridAtlas Satellite survey test')
(HERE / 'index.html').write_text(html)
manifest = {'schema':'gridatlas.satellite-survey-test.v1','generation':VERSION,'production_generation':'202609080850','production_modified':False,'sha256':new_hash,'ui':'Grid > Satellite survey','native_grid_subs':'unchanged','imagery':['Esri World Imagery','Copernicus Sentinel-2 L2A via Microsoft Planetary Computer'],'scope':'Domestic and public-interest surveying of renewable projects'}
(HERE / 'manifest.json').write_text(json.dumps(manifest,indent=2)+'\n')
print(json.dumps(manifest))Atlas — Testcode Page
A web page in GridAtlas covering substations, using SHA-256. Published at https://gridatlas.globalgrid2050.com/atlas/testcode/202609111007/. It is built from the assert step (`assert`), the escape step (`escape`) and the hash step (`hash`).
rendergridatlas / atlas/testcode/202609111007/index.html · lines 1–70 of 70 · version 2026-09-11 10:07 · Entry point · pattern script (shared by 2 files)
- What it does
- It draws substations. Defines assert, escape, hash, script. Uses libraries '+escape(blob)+', '+escape(addon)+'. 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. Domain terms in the code: substations. README: "`atlas/index.html` is the stable composer."
- Inputs & outputs
- Out: web page.
- Downstream impact
- It is itself an entry point, published at https://gridatlas.globalgrid2050.com/atlas/testcode/202609111007/.
- What it achieves
- GridAtlas Satellite survey test.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- gridatlas · atlas/testcode/202609111007 · page
- Uses
- '+escape(blob)+', '+escape(addon)+'
- Used by
- none found
- Produces
- assert, escape, hash, script
- Defines here
- assert, escape, hash, script
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- gridatlas@98b5004c5eda9f2ed915fb6fca4b9bbcaa426ca5 atlas/testcode/202609111007/index.html:1-70 · blob 17da1b4cf991bb1e539dae9ca5967103a4f18444 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom, network · 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"><title>GridAtlas Satellite survey test 202609111007</title>
<style>html,body{height:100%;margin:0;background:#000;color:#00ffff;font:13px monospace}#gridatlas-loader{display:grid;place-items:center;height:100%;padding:24px;text-align:center}</style></head>
<body><main id="gridatlas-loader">GridAtlas Satellite survey test · verifying unchanged production cartridges…</main>
<script type="module">
// Isolated draggable-control successor to 202609110242. Only this loader and satellite.js are new.
// Production /atlas/, its immutable shell, all four cartridges and homepage are unchanged.
const CLOSE = '</scr' + 'ipt>';
const atlasBase = new URL('../../', location.href);
const testBase = new URL('./', location.href);
const entries = [
[
"streaming-parquet-bridge",
"202608292311-maplibre-worker-bridge.js",
"202609041945-streaming-parquet-bridge-v9-5.js",
"4a6b594f7705bc4d7d62cbe69d2e40726d12f9a759896430cfe5eb00d830d23e"
],
[
"uk-gazetteer-flyto",
"202608291818-place-postcode-search.js",
"202609071213-place-global-search-v9-5.js",
"15f324e5c279050882f7e3ce83a915c070b6ed19095efcac4ae20af4ef19fdfa"
],
[
"substation-intelligence",
"ventus-corev8engine.js",
"202609062358-substation-intelligence-v9-63.js",
"d94b0de50deddac77643325b10fbe490ce44b8c406dbc6c67e6e7cadbdaa8ec6"
],
[
"sld-sandbox",
"202608292126-pre-snapped-config-adapter.js",
"202609080850-sld-sandbox-v9-8.js",
"5d2b383ffd409e133970c0c62945624b927d12882af3823f8fda6855a7aa34f0"
]
];
const assert = (ok, message) => { if (!ok) throw Error(message); };
const escape = value => String(value).replace(/&/g, '&').replace(/"/g, '"').replace(/</g, '<');
async function hash(bytes) { return [...new Uint8Array(await crypto.subtle.digest('SHA-256', bytes))].map(n=>n.toString(16).padStart(2,'0')).join(''); }
async function script(url, expected) {
const r=await fetch(url); assert(r.ok,'Script HTTP '+r.status);
const bytes=await r.arrayBuffer(); assert(await hash(bytes)===expected,'Script hash mismatch: '+url);
return URL.createObjectURL(new Blob([bytes],{type:'text/javascript'}));
}
try {
const base = new URL('releases/202608300453-atlas-v9/', atlasBase);
const r=await fetch(new URL('index.html',base)); assert(r.ok,'Shell HTTP '+r.status);
let html=await r.text();
html=html.replace(/<head([^>]*)>/i,m=>m+'\n<base href="'+escape(base.href)+'">');
const pattern=/<script\b[^>]*\bsrc=(["'])([^"']+)\1[^>]*>\s*<\/script>/gi;
for (const [id, slot, path, expected] of entries) {
const blob=await script(new URL('cartridges/'+path,atlasBase),expected);
let found=false;
html=html.replace(pattern,(whole,q,src)=>{
if (String(src).split('/').pop()!==slot) return whole;
assert(!found,'Duplicate shell slot '+id); found=true;
return '<script data-gridatlas-cartridge="'+escape(id)+'" src="'+escape(blob)+'">'+CLOSE;
});
assert(found,'Missing shell slot '+id);
}
const addon=await script(new URL('satellite.js',testBase),'da489d2c10713ec97b432e600383cdab0db50c04f60ece91a29b158fd56d950c');
const state={schema:'gridatlas.current.v2',generation:'202609080850',release_id:'202608300453-atlas-v9',architecture:'IMMUTABLE_SHELL_PLUS_HASHED_CARTRIDGES',cartridge_order:entries.map(e=>e[0]),loaded_cartridges:entries.map(e=>({id:e[0],sha256:e[3]}))};
html=html.replace(/<body([^>]*)>/i,m=>m+'\n<script>window.__GRIDATLAS_ATLAS__='+JSON.stringify(state)+';document.documentElement.dataset.gridatlasTest="202609111007";'+CLOSE);
html=html.replace(/<\/body>/i,'<script src="'+escape(addon)+'">'+CLOSE+'\n</body>');
document.open();document.write(html);document.close();
} catch(error) {
console.error('[SATELLITE TEST]',error);
document.getElementById('gridatlas-loader').textContent='Satellite test failed: '+error.message;
}
</script></body></html>