GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Electricity markets and data pipelines / testcode / sandbox/capsules/tool-layers

Ventus Corev8engine Exact Renewable Energy Planning Database (REPD) Delegation Excerpt and 3 more files

A JavaScript file in the receiver folder of Ventus Grid Engine covering elizabeth line, london underground, UK metros trams and HS2.

183 lines of JavaScript and Python from testcode, ventus-grid-engine, in 4 files. Topic: Electricity markets and data pipelines. Section 1070 of 2044.

Cut 2026-12-06T03:07:51+00:00. A copy for reading; the repository at the stated commit is the source.

In the State lines below, domain stage, users and canonical status are rule-based first approximations from code and path evidence (rules explore-agent-rules-v1), not observed facts: the rules.

In this section

  1. Registry Test test · testcode / sandbox/capsules/tool-layers/registry.test.mjs lines 1–55
  2. Dashboard interaction · ventus-grid-engine / assets/dashboard.js lines 1–5
  3. Ventus Corev8engine Exact Renewable Energy Planning Database (REPD) Delegation Excerpt energy-data · ventus-grid-engine / sources/deeplink-extracts/receiver/ventus-corev8engine-exact-repd-delegation.excerpt.js lines 1–102
  4. Build Dashboard storage · ventus-grid-engine / tools/build-dashboard.py lines 1–21

Registry Test

A test in the tool layers folder of Testcode that checks Registry. It is built from the fixture step (`fixture`).

testtestcode / sandbox/capsules/tool-layers/registry.test.mjs · lines 1–55 of 55 · Entry point · pattern fixture (shared by 30 files)

What it does
It tests solar and battery storage (BESS). Defines app, owner, tool, fixture. Uses libraries node:test, node:assert/strict.
Why it exists in the grid workflow
Domain stage experimental (path word 'sandbox'): 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: solar, battery storage (BESS).
Downstream impact
Used directly by 3 files: Codex Cartridges Workflow (testcode); Controls Layout Workflow (testcode); Offshore Route Workflow (testcode).
What it achieves
Defines `app`, `owner`, `tool` and 1 more.
Why it matters
Run by Codex Cartridges Workflow, Controls Layout Workflow and Offshore Route Workflow.
Application
testcode · sandbox/capsules/tool-layers · test
Uses
Registry (import), node:test, node:assert/strict
Used by
run by Codex Cartridges Workflow (workflow run), run by Controls Layout Workflow (workflow run), run by Offshore Route Workflow (workflow run)
Produces
app, owner, tool, fixture
Defines here
app, owner, tool, fixture
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
testcode@a8a215982b13d6e2f6019b40bf0bef5755719773 sandbox/capsules/tool-layers/registry.test.mjs:1-55 · blob ca3bd64351e85fa26dfa9a59061ebe5899b13dba · GitHub at these lines
State
achieves: name · context: readme_derived · stage: transform · effects: none found · domain stage: experimental · users: none · canonical: unknown
import test from 'node:test';
import assert from 'node:assert/strict';
import {buildNavigationRegistry} from './registry.mjs';

const app=id=>({id,entry:'solar-bess-topology-v7/'+id+'/index.html'});
const owner=(char,apps)=>({repository:'https://github.com/Ventusltd/layout-tool.git',commit:char.repeat(40),release:'202609051955',manifestSha256:char.repeat(64),applications:apps});
const tool=(id,pin,title=id)=>({id,title,entry:'../layer-apps/'+app(id).entry,owner:{repository:pin.repository,commit:pin.commit,release:pin.release,manifestSha256:pin.manifestSha256}});
function fixture() {
  const old=owner('a',[app('module-layout'),app('dc-ac-lv-topology-review')]);
  old.crossOwnerNavigation=[{path:'historical-sibling',commit:'c'.repeat(40)}];
  const current=owner('b',[app('module-layout')]);
  return {owners:[old,current],tools:[tool('module-layout',current,'Module Layout')]};
}

test('explicit current owner wins while unlaunched DC retains its sole historical producer',()=>{
  const config=fixture(),before=JSON.stringify(config),entries=buildNavigationRegistry(config);
  assert.equal(entries.length,2);
  const module=entries.find(x=>x.id==='module-layout'),dc=entries.find(x=>x.id==='dc-ac-lv-topology-review');
  assert.equal(module.owner.commit,'b'.repeat(40));assert.equal(module.title,'Module Layout');
  assert.equal(dc.owner.commit,'a'.repeat(40));assert.equal(dc.title,'DC/AC LV Topology Review');
  assert.equal(dc.entry,'../layer-apps/solar-bess-topology-v7/dc-ac-lv-topology-review/index.html');
  module.owner.commit='f'.repeat(40);assert.equal(JSON.stringify(config),before);
  assert.equal('crossOwnerNavigation' in dc.owner,false);
});

test('multiple historical destinations require an explicit selection',()=>{
  const config=fixture();config.tools=[];
  assert.throws(()=>buildNavigationRegistry(config),/Ambiguous unlaunched/);
  config.tools=[tool('module-layout',config.owners[1])];
  assert.equal(buildNavigationRegistry(config).length,2);
});

test('unbound explicit pins and forged destinations are rejected',()=>{
  const config=fixture();config.tools[0].owner.commit='c'.repeat(40);
  assert.throws(()=>buildNavigationRegistry(config),/does not match/);
  config.tools[0]=tool('module-layout',config.owners[1]);config.tools[0].entry='../elsewhere/index.html';
  assert.throws(()=>buildNavigationRegistry(config),/does not match/);
  config.tools[0]=tool('missing',config.owners[1]);assert.throws(()=>buildNavigationRegistry(config),/does not match/);
});

test('duplicate exact historical records deduplicate but duplicate tools are refused',()=>{
  const config=fixture();config.owners.push(structuredClone(config.owners[0]));
  assert.equal(buildNavigationRegistry(config).length,2);
  config.tools.push(structuredClone(config.tools[0]));assert.throws(()=>buildNavigationRegistry(config),/Duplicate explicit/);
});

test('traversal, incomplete owner pins and colliding destination paths are rejected',()=>{
  for(const path of ['../escape','/absolute','a\\b','https://x/app','a/./b','a//b','a/index.html?x=1','a/%2e%2e/escape']) {
    const config=fixture();config.owners[0].applications[1].entry=path;
    assert.throws(()=>buildNavigationRegistry(config),/Unsafe/);
  }
  const config=fixture();config.owners[0].commit='main';assert.throws(()=>buildNavigationRegistry(config),/Complete navigation owner/);
  const collision=fixture();collision.owners[0].applications[1].entry=app('module-layout').entry;
  assert.throws(()=>buildNavigationRegistry(collision),/share a navigation destination/);
});

Dashboard

A JavaScript file in the assets folder of Ventus Grid Engine that keeps existing engine-map bookmarks working after introducing the dashboard.

interactionventus-grid-engine / assets/dashboard.js · lines 1–5 of 5 · Not reached from any entry point (candidate for review)

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage upstream_foresight (topic 'markets-data'): 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.
What it achieves
It responds to input events.
Why it matters
No other file in the estate was found to import it.
Application
ventus-grid-engine · assets · script
Uses
Spider Sandbox (link)
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
ventus-grid-engine@ad566356a44e006682e956483d569f31ddbb9630 assets/dashboard.js:1-5 · blob 496b6f9bc2223dd471c2c15b63530b15601122c9 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unreached_review
'use strict';
// Keep existing engine-map bookmarks working after introducing the dashboard.
if(['scope','focus','graph'].some(key=>new URLSearchParams(location.search).has(key)))location.replace('spider-sandbox.html'+location.search+location.hash);
const search=document.getElementById('search');const status=document.getElementById('status');
search.addEventListener('input',()=>{const q=search.value.trim().toLocaleLowerCase();let count=0;for(const card of document.querySelectorAll('.entry')){card.hidden=!card.textContent.toLocaleLowerCase().includes(q);if(!card.hidden)count++;}status.textContent=q?`${count} matching ${count===1?'entry':'entries'}.`:'5 places to explore.';});

Ventus Corev8engine Exact Renewable Energy Planning Database (REPD) Delegation Excerpt

A JavaScript file in the receiver folder of Ventus Grid Engine covering elizabeth line, london underground, UK metros trams and HS2.

energy-dataventus-grid-engine / sources/deeplink-extracts/receiver/ventus-corev8engine-exact-repd-delegation.excerpt.js · lines 1–102 of 102 · Not reached from any entry point (candidate for review) · pattern focusCanonicalProjectDeepLink (shared by 14 files)

What it does
Defines focusCanonicalProjectDeepLink. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'repd'): 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.
What it achieves
`head_sha` (GridAtlas): (repo HEAD, file unchanged since) lines: 61-90 and 796-840 (two ranges from the same file, concatenated).
Why it matters
No other file in the estate was found to import it.
Application
ventus-grid-engine · sources/deeplink-extracts/receiver · script
Uses
none found
Used by
none found
Produces
focusCanonicalProjectDeepLink
Defines here
focusCanonicalProjectDeepLink
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
ventus-grid-engine@ad566356a44e006682e956483d569f31ddbb9630 sources/deeplink-extracts/receiver/ventus-corev8engine-exact-repd-delegation.excerpt.js:1-102 · blob df2f448639a7cb1876027f6b4f8f8c24037e2d40 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unreached_review
/*
 * PROVENANCE (excerpt)
 * source_repo: gridatlas
 * source_path: atlas/parts/202609040229-ventus-corev8engine-exact-repd-delegation.js
 * head_sha (gridatlas): 2d8cc7bacf80a3f20ecfb96ea24548fcea43a19d (repo HEAD
 *   64268fd06a0da54ddffbcdaaaee382e314e829f7, file unchanged since)
 * lines: 61-90 and 796-840 (two ranges from the same file, concatenated)
 *
 * Carried into the LIVE cartridge "substation-intelligence" (current.json
 * generation 202609041330, v9.111) as its 'carried_shell_script', replacing
 * ventus-corev8engine.js -- the THIRD script the shell loads.
 *
 * Range 1 (lines 61-90): REPD_IDS -- the engine's OWN real layer-id vocabulary.
 * Note it has 'wind' but neither 'wind_onshore' nor 'wind_offshore', and no
 * 'other' -- this is WHY the sld-sandbox bucket-to-layer-id mapping table exists
 * (see receiver/sld-sandbox-technology-vocabulary.excerpt.js).
 *
 * Range 2 (lines 796-840): focusCanonicalProjectDeepLink() -- this engine's own
 * former deep-link handler. As of v9.101/v9.102 it no longer fetches or acts on
 * anything; it parses repd_ref/technology only to publish
 * window.__GRIDATLAS_V8_DEEP_LINK__ = { status: 'DEFERRED_TO_EXACT_REPD_RECEIVER', ... }
 * and returns -- all real handling belongs to the search cartridge (identity) and
 * the sld-sandbox cartridge (measurement, layers, card). Called once from
 * initVentusMap at line 1495 of this same file, during engine boot.
 */
    const layerConfigById = new Map(
        GRID_CONFIG.flatMap(g => g.layers).map(l => [l.id, l])
    );

    // Removed naei_co2 from here so it gets its own dedicated source
    const REPD_IDS    = ['solar','solar_operational','solar_roof','wind','wind_onshore_operational','wind_offshore_operational','bess','bess_operational','biomass','tidal','hydrogen','hydro','flywheel','act','geothermal','caes'];
    const TRANSIT_IDS = ['elizabeth','lu','dlr','metro','tram','hs2'];
    const TRANSIT_SOURCE_MAP = { 'elizabeth':'src-elizabeth','lu':'src-lu','dlr':'src-metros','metro':'src-metros','tram':'src-metros','hs2':'src-hs2' };
    const TRANSIT_URLS = { 'src-elizabeth':'/elizabeth_line.geojson','src-lu':'/london_underground.geojson','src-metros':'/uk_metros_trams.geojson','src-hs2':'/hs2.geojson' };

    const SEARCH_THRESHOLD = {
        'solar':50,'solar_roof':0.5,'wind':50,'bess':50,'biomass':50,
        'tidal':10,'hydrogen':10,'hydro':10,'flywheel':1,'act':10,'geothermal':1,'caes':1
    };

    const TECH_TERMS = new Map([
        ['solar','solar farm'],['solar_roof','rooftop solar'],['wind','wind farm'],
        ['bess','battery storage'],['biomass','biomass plant'],['tidal','tidal energy'],
        ['hydrogen','hydrogen plant'],['hydro','hydro power'],['flywheel','flywheel storage'],
        ['act','advanced conversion energy'],['geothermal','geothermal energy'],['caes','compressed air energy storage']
    ]);

    const TECH_COLOURS = new Map([
        ['solar','#ffff00'],['solar_roof','#ffcc00'],['wind','#00ffff'],['bess','#ffae00'],
        ['biomass','#39ff14'],['tidal','#00bfff'],['hydrogen','#ffffff'],['hydro','#00aaff'],
        ['flywheel','#ff69b4'],['act','#ff6600'],['geothermal','#ff3300'],['caes','#88aaff']
    ]);

    const STATUS_COLOURS = {
        'operational':'#00ff88','under construction':'#ffcc00','awaiting construction':'#ffaa00',

/* --- range 2, lines 796-840 --- */
    // V9 canonical project deep links. Identity is resolved only by official REPD Ref;
    // URL names and coordinates are never used to manufacture a match.
    async function focusCanonicalProjectDeepLink() {
        const params = new URLSearchParams(window.location.search);
        const repdRef = String(params.get('repd_ref') || '').trim();
        if (!/^[A-Za-z0-9-]{1,40}$/.test(repdRef)) return;

        try {
            const requestedTechnology = String(params.get('technology') || '').trim();
            const allowedTechnologies = new Set([
                'solar', 'solar_operational', 'solar_roof',
                'bess', 'bess_operational',
                'wind', 'wind_onshore', 'wind_onshore_operational',
                'wind_offshore', 'wind_offshore_operational',
                'biomass', 'tidal', 'hydrogen', 'hydro', 'flywheel',
                'act', 'geothermal', 'caes', 'other'
            ]);
            /* One exact identity owner. The search cartridge queries the pinned
               active-register product and publishes RESOLVED,
               NOT_IN_ACTIVE_REGISTER or FAILED. This carried V8 receiver used
               a site-relative /uk_renewables_pipeline path owned by another
               domain, so on GridAtlas Pages it issued a redundant 404 before
               falling back to the same supplied point. Delegate every REPD
               identity before any legacy fetch, including a ref-only arrival
               that legitimately supplies no technology. The measurement
               cartridge already uses valid supplied coordinates immediately
               and reconciles against the exact owner concurrently. */
            window.__GRIDATLAS_V8_DEEP_LINK__ = {
                status: 'DEFERRED_TO_EXACT_REPD_RECEIVER',
                repd_ref: repdRef,
                technology: requestedTechnology || null,
                technology_recognised: requestedTechnology
                    ? allowedTechnologies.has(requestedTechnology) : null,
                legacy_fetches: 0
            };
            return;
        } catch (error) {
            console.error('[V9 DEEP LINK FAILED]', error);
            const lon = Number(params.get('longitude'));
            const lat = Number(params.get('latitude'));
            if (Number.isFinite(lon) && Number.isFinite(lat) && Math.abs(lon) <= 180 && Math.abs(lat) <= 90) {
                map.flyTo({ center: [lon, lat], zoom: 12, duration: 1800, essential: true });
            }
        }
    }

Build Dashboard

A Python module in the tools folder of Ventus Grid Engine that reads solar.

storageventus-grid-engine / tools/build-dashboard.py · lines 1–21 of 21 · Entry point

What it does
It loads solar. Uses libraries pathlib, html, json, urllib.parse. Side effects: reads or writes files.
Why it exists in the grid workflow
Domain stage upstream_foresight (topic 'markets-data'): 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. Domain terms in the code: solar.
Inputs & outputs
In: JSON file dashboard.json; form fields (user input).
Downstream impact
Used directly by 1 file: Dashboard Review Workflow (ventus-grid-engine).
What it achieves
Render the static dashboard from its small, reviewed live-route catalogue.
Why it matters
Run by Dashboard Review Workflow.
Application
ventus-grid-engine · tools · Python module
Uses
pathlib, html, json, urllib.parse
Used by
run by Dashboard Review Workflow (workflow run)
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
ventus-grid-engine@ad566356a44e006682e956483d569f31ddbb9630 tools/build-dashboard.py:1-21 · blob 0861bc06f70f4025f2c322076bf004b875d3b961 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
"""Render the static dashboard from its small, reviewed live-route catalogue."""
from pathlib import Path
import html
import json
from urllib.parse import urlparse

root=Path(__file__).resolve().parents[1]
data=json.loads((root/'data/dashboard.json').read_text())
cards=[]
for e in data['entries']:
    u=urlparse(e['url'])
    assert u.scheme=='https' and u.hostname in {'globalgrid2050.com','ventusltd.github.io'} and not u.username
    v={k:html.escape(value,quote=True) for k,value in e.items()}
    cards.append(f'<article class="entry" id="{v["id"]}"><span class="category">{v["category"]}</span><h2>{v["label"]}</h2><p>{v["description"]}</p><a href="{v["url"]}">Open {v["label"]} &rarr;</a></article>')
page='''<!doctype html>
<html lang="en"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1"><meta name="description" content="Explore VENTUS Grid Engine experiments, solar topology drawings and engine maps."><title>VENTUS Grid Engine</title><link rel="icon" href="data:,"><link rel="stylesheet" href="assets/dashboard.css"><script defer src="assets/dashboard.js"></script></head><b  … [line shortened here: 404 characters; full line on GitHub]
<header><div class="brand">VENTUS / GLOBALGRID2050</div><h1>VENTUS Grid Engine</h1><p>Explore how a pulse travels, how solar strings connect and how the grid tools fit together.</p></header>
<main><nav class="topnav"><a href="https://globalgrid2050.com/">GlobalGrid2050</a><a href="spider-sandbox.html">Spider Sandbox</a><a href="genome/">Engine map</a></nav><label for="search">Find an engine or drawing</label><input id="search" type="search" autocomplete="off" placeholder="Search pulse, DC, AC, grid…"><p id="status" role="status">5 places to explore.</p><section class="entries" aria-la  … [line shortened here: 818 characters; full line on GitHub]
'''
(root/'index.html').write_text(page,encoding='utf-8')
print(f"Rendered {len(cards)} dashboard entries")