GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Electricity markets and data pipelines / globalgrid2050 / uk_renewables_pipeline/202611161757/tests

Check V9 29 and 8 more files

A JavaScript module in the tests folder of GlobalGrid2050 that tests major project news, interconnectors and the Renewable Energy Planning Database (REPD) register, using SHA-256.

680 lines of JavaScript and Shell and CSS from globalgrid2050, in 9 files. Topic: Electricity markets and data pipelines. Section 943 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. Check V9 28 test · globalgrid2050 / uk_renewables_pipeline/202611161757/tests/check_v9_28.mjs lines 1–114
  2. Run V9 28 test · globalgrid2050 / uk_renewables_pipeline/202611161757/tests/run_v9_28.sh lines 1–113
  3. Catalogue other · globalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/catalogue.mjs lines 1–18
  4. Controls interaction · globalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/controls.mjs lines 1–60
  5. Registry ingest · globalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/registry.mjs lines 1–85
  6. URL Policy transform · globalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/url-policy.mjs lines 1–14
  7. Views interaction · globalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/views.mjs lines 1–117
  8. Preview V928 render · globalgrid2050 / uk_renewables_pipeline/202611162354/styles/preview-v928.css lines 1–36
  9. Check V9 29 test · globalgrid2050 / uk_renewables_pipeline/202611162354/tests/check_v9_29.mjs lines 1–123

Check V9 28

A JavaScript module in the tests folder of GlobalGrid2050 that tests major project news, interconnectors and the Renewable Energy Planning Database (REPD) register, using SHA-256.

testglobalgrid2050 / uk_renewables_pipeline/202611161757/tests/check_v9_28.mjs · lines 1–114 of 114 · version 2026-11-16 17:57

What it does
It tests major project news, interconnectors and the REPD register. Defines text, json, sha256, fmt. Uses libraries node:assert/strict, node:crypto, node:fs/promises, node:url, node:path. Side effects: reads or writes files.
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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: interconnectors, the REPD register.
Inputs & outputs
In: JSON file release.v9.1.json; JSON file release.v9.5.1.json; JSON file build_manifest.json; JSON file major_project_news_v9_5_1.json; JSON file interconnectors.v9.8.json; JSON file interconnectors.json; JSON file interconnectors_manifest.json.
Downstream impact
Used directly by 1 file: Run V9 28 (globalgrid2050). Reached from 1 other entry point, including GlobalGrid2050 V928 Preview Acceptance Workflow (globalgrid2050).
What it achieves
It is built from the text step (`text`), the JSON step (`json`) and the sha256 step (`sha256`). Pipeline News V9.28, proven from the bytes and through the page's OWN loaders (the pattern of `check_v9_13.mjs`).
Why it matters
Checked by Run V9 28.
Application
globalgrid2050 · uk_renewables_pipeline/202611161757/tests · JavaScript module
Uses
Canonical Projects V9 5 1 (new URL import.meta.url), node:assert/strict, node:crypto, node:fs/promises, node:url, node:path
Used by
run by Run V9 28 (script call)
Produces
text, json, sha256, fmt
Defines here
text, json, sha256, fmt
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611161757/tests/check_v9_28.mjs:1-114 · blob 8dc78ccac43465d54f8f3e1f041bde8459e990b4 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: filesystem · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
/* check_v9_28.mjs - Pipeline News V9.28, proven from the bytes and through the
 * page's OWN loaders (the pattern of check_v9_13.mjs).
 *
 *   1. The contracts bind the fixtures held by 202611132345 by path and sha256.
 *   2. The page's own loader chain is imported unmodified and executed against the
 *      files in this folder; every invariant the browser asserts is asserted here.
 *   3. The spine partitions are what the manifest says (sha256 and counts).
 *   4. The UK newspaper feed is unchanged and Beacon Fen still resolves.
 *   5. The interconnector product and contract are the parent's, byte for byte.
 *   6. The page states its own identity and version label.
 *
 * Run: node tests/check_v9_28.mjs
 */
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import { basename, dirname, join } from "node:path";

const HERE = dirname(fileURLToPath(import.meta.url));
const RELEASE = join(HERE, "..");
const ID = basename(RELEASE);
const ROOT = join(RELEASE, "..", "..");
const VERSION = "9.28";
const STATE = "RELEASE CANDIDATE";
const PARENT_ID = "202611161747";
const FIXTURE_OWNER = "202611132345";
const PARENT = join(RELEASE, "..", PARENT_ID);
const text = (p) => readFile(p, "utf8");
const json = async (p) => JSON.parse(await text(p));
const sha256 = (b) => createHash("sha256").update(b).digest("hex");

const NEWS_FEED_SHA256 = "cea104c3e9cfc07971680afdf5f64073e1d4825b63bfaf4e969266df8386ebbd";

// 1. contracts bind fixtures
const c91 = await json(join(RELEASE, "contracts", "release.v9.1.json"));
const c951 = await json(join(RELEASE, "contracts", "release.v9.5.1.json"));
assert.equal(c91.source.dataset, "DESNZ Renewable Energy Planning Database Q3 2026");
for (const [pathKey, shaKey] of [["identity_fixture", "identity_fixture_sha256"], ["coordinate_fixture", "coordinate_fixture_sha256"]]) {
  const rel = c91.source[pathKey];
  assert.ok(rel.startsWith(`uk_renewables_pipeline/${FIXTURE_OWNER}/fixtures/`), `${pathKey} must be the fixture owner's: ${rel}`);
  assert.equal(sha256(await readFile(join(ROOT, rel))), c91.source[shaKey], `${pathKey} bytes`);
}
const coords = await json(join(ROOT, c91.source.coordinate_fixture));
assert.equal(coords.source_workbook_sha256, c91.source.workbook_sha256, "coordinate fixture names the contract workbook");
const identity = await json(join(ROOT, c91.source.identity_fixture));
assert.equal(identity.schema, "globalgrid2050.project-identity.v6");
assert.equal(identity.records.length, identity.raw_record_count);
assert.equal(coords.source_records, identity.raw_record_count, "workbook and identity hold the same refs");

// 2. the page's own loader, unmodified, against these bytes
const ORIGIN = "http://release.invalid";
const BASE = `${ORIGIN}/uk_renewables_pipeline/${ID}/`;
globalThis.window = { location: { origin: ORIGIN, href: BASE } };
globalThis.fetch = async (path) => {
  const url = new URL(path, BASE);
  assert.ok(url.pathname.startsWith(`/uk_renewables_pipeline/${ID}/`), `loader fetched outside the release: ${url}`);
  const file = join(RELEASE, decodeURIComponent(url.pathname.slice(`/uk_renewables_pipeline/${ID}/`.length)));
  const body = await text(file);
  return { ok: true, status: 200, url: url.href, json: async () => JSON.parse(body) };
};
const loader = await import(new URL("../scripts/data/canonical-projects-v9-5-1.js", import.meta.url).href);
const model = await loader.loadCanonicalProjectsV9_5_1();
assert.equal(model.projects.length, c951.expected.project_count);
assert.equal(Math.round(model.metadata.capacity_mw), c951.expected.displayed_capacity_mw);

// 3. partitions are the manifest's bytes
const manifest = await json(join(RELEASE, "data", "v9.1", "build_manifest.json"));
for (const part of [...manifest.project_partitions, ...manifest.atlas_partitions]) {
  assert.equal(sha256(await readFile(join(RELEASE, part.path))), part.sha256, `${part.path} hash`);
}
const atlasFeatures = manifest.atlas_partitions.reduce((n, p) => n + p.feature_count, 0);
assert.equal(atlasFeatures, manifest.geometry_count, "atlas features = valid geometries");
for (const key of Object.keys(c91.expected)) assert.equal(manifest[key], c91.expected[key], `manifest ${key}`);
assert.equal(manifest.source_dataset, c91.source.dataset);
assert.equal(manifest.source_record_count, identity.raw_record_count);

// 4. the newspaper: unchanged Q2 feed, every bound ref still resolves
const feedBytes = await readFile(join(ROOT, "dist", "major_project_news_v9_5_1.json"));
assert.equal(sha256(feedBytes), NEWS_FEED_SHA256, "dist/major_project_news_v9_5_1.json must not be rebuilt by this release");
const feed = JSON.parse(feedBytes);
const byRef = new Map(model.projects.map((p) => [p.repd_ref, p]));
const boundRefs = new Set(feed.canonical_items.map((item) => String(item.repd_ref)));
const unresolved = [...boundRefs].filter((ref) => !byRef.has(ref));
const beacon = byRef.get(feed.beacon_fen_contract.repd_ref);
assert.ok(beacon, "Beacon Fen must be in the spine");
assert.equal(beacon.capacity_mw, feed.beacon_fen_contract.official_capacity_mw, "Beacon Fen official capacity");

// 5. interconnectors are the parent's
for (const rel of ["contracts/interconnectors.v9.8.json", "data/v9.8/interconnectors.json", "data/v9.8/interconnectors_manifest.json"]) {
  assert.equal(sha256(await readFile(join(RELEASE, rel))), sha256(await readFile(join(PARENT, rel))), `${rel} is the parent's`);
}

// 6. page identity
const fmt = (n) => n.toLocaleString("en-GB");
const html = await text(join(RELEASE, "index.html"));
assert.ok(html.includes(`data-edition="${ID}"`), "visible edition stamp names this release");
assert.ok(new RegExp(`Canonical DESNZ REPD Q3 2026[^<]*${fmt(manifest.project_count)} solar, BESS and wind records`).test(html), "index.html states the Q3 register count");
assert.ok(!html.includes("REPD Q2 2026: 7,680"), "index.html must not claim the Q2 register");
assert.ok(html.includes("scripts/app-v9-8.js"), "index.html loads the v9.8 app");
const label = html.slice(html.indexOf("<body>"), html.indexOf('<section class="newspaper"'));
assert.ok(label.includes(`<small>PIPELINE NEWS · V${VERSION}</small>`), "brand names the version");
assert.ok(label.includes(`<a class="active" href="#">V${VERSION} · PIPELINE NEWS</a>`), "nav names the version");
assert.ok(label.includes(`<a href="../${PARENT_ID}/">`), "nav links back to the parent");
assert.ok(label.includes('<a href="../versions.html">'), "nav links to the list of all versions");
assert.ok(label.includes(`V${VERSION} · 16 NOVEMBER 2026 · REPD OCTOBER 2026`), "compact stamp names the version and dated source");
assert.ok(html.includes(`<title>GlobalGrid2050 | Pipeline News V${VERSION} · ${ID}</title>`), "title names this release");
assert.equal((html.match(/<section\b/g)||[]).length,2,"exactly two principal blocks");
for (const tab of ['solarTab','bessTab','gridTab','datacentreTab']) assert.ok(html.includes(`id="${tab}" role="tab"`),`category ${tab}`);
assert.ok(!html.includes('<th>NEWS SIGNAL</th>')&&!html.includes('id="solar1000Pilot"'),"withdrawn panels/column do not return");

console.log(`check_v9_28: ${ID} loader PASS - ${fmt(model.projects.length)} records, ${model.metadata.capacity_mw.toLocaleString("en-GB", { minimumFractionDigits: 2 })} MW, `
  + `${manifest.geometry_count} with geometry / ${manifest.missing_geometry_count} without; news feed unchanged, `
  + `${boundRefs.size - unresolved.length}/${boundRefs.size} bound refs resolve${unresolved.length ? ` (unresolved: ${unresolved.join(", ")})` : ""}`);

Run V9 28

A shell script in the tests folder of GlobalGrid2050 that tests interconnectors.

Set aside from the main view: A comment at the top of the file says a tool wrote it. (noise-generated, proposed by noise.py). All set-aside files, with reasons. Nothing was deleted.

Evidence
  • line 4 comment: # Written by automation/pipeline_release/new_version.py by the pattern of run_v9_13.sh.

testglobalgrid2050 / uk_renewables_pipeline/202611161757/tests/run_v9_28.sh · lines 1–113 of 113 · version 2026-11-16 17:57 · Entry point · pattern is_listed (shared by 38 files)

What it does
It tests interconnectors. Defines is_listed, walk. Side effects: starts processes; uses storage (browser storage, DuckDB or Parquet).
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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: interconnectors.
Inputs & outputs
In: JSON file release.v9.1.json; command-line arguments.
Downstream impact
Used directly by 1 file: GlobalGrid2050 V928 Preview Acceptance Workflow (globalgrid2050).
What it achieves
Defines `is_listed` and `walk`.
Why it matters
Run by GlobalGrid2050 V928 Preview Acceptance Workflow.
Application
globalgrid2050 · uk_renewables_pipeline/202611161757/tests · shell script
Uses
Check V9 28 (script call)
Used by
run by GlobalGrid2050 V928 Preview Acceptance Workflow (workflow run)
Produces
is_listed, walk
Defines here
is_listed, walk
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611161757/tests/run_v9_28.sh:1-113 · blob 35b565c881b268bbbeb609f24f7b761f1eb98051 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: process, storage · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env bash
# run_v9_28.sh - Pipeline News V9.28: one visible step on its parent, same REPD
# October 2026 (Q3 2026) register. Offline, in a git checkout or a plain copy.
# Written by automation/pipeline_release/new_version.py by the pattern of run_v9_13.sh.
set -euo pipefail

HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
RELEASE="$(cd "$HERE/.." && pwd)"
ID="$(basename "$RELEASE")"
PARENT_ID="202611161747"
FIXTURE_OWNER="202611132345"
PARENT="$(cd "$RELEASE/../$PARENT_ID" && pwd)"
ROOT="$(cd "$RELEASE/../.." && pwd)"
# The parent by git tree of the bytes ON DISK.
PARENT_TREE="44e7f54ed14475edd72babf61a0e86fec965ef8d"

SCRATCH="$(mktemp -d)"
trap 'rm -rf "$SCRATCH"' EXIT
actual_tree="$(python - "$ROOT" "$PARENT_ID" <<'PYTREE'
import sys
sys.path.insert(0, sys.argv[1] + "/automation/pipeline_release")
from common import tree_hash
print(tree_hash(sys.argv[2]))
PYTREE
)"
test "$actual_tree" = "$PARENT_TREE" || { echo "parent $PARENT_ID tree is $actual_tree, expected $PARENT_TREE" >&2; exit 1; }

# WHAT THIS VERSION CHANGES FROM ITS PARENT, NAMED ONE FILE AT A TIME.
CHANGED_FROM_PARENT=(
  CHANGES.md
  README.md
  global-datacentres/README.md
  global-datacentres/build.py
  global-datacentres/data/facilities/generation=202611161757/source=WIKIDATA/global-data-centre-records-v1.parquet
  global-datacentres/integration-manifest.json
  global-datacentres/official-projects.json
  global-datacentres/pipeline-audit.json
  global-datacentres/project-groups.json
  global-datacentres/projects.json
  global-datacentres/selection-audit.json
  global-datacentres/source-facts.json
  index.html
  news/pipeline_headlines.snapshot.json
  news/snapshot-provenance.json
  scripts/plugins/live-news.js
  scripts/plugins/preview-v928.js
  scripts/plugins/projects-v9-8.js
  scripts/plugins/register-changes.js
  styles/preview-v928.css
  tests/check_v9_28.mjs
  tests/run_v9_28.sh
)
REMOVED_FROM_PARENT=(
  global-datacentres/data/facilities/generation=202611161630/source=WIKIDATA/global-data-centre-records-v1.parquet
  tests/check_v9_27.mjs
  tests/run_v9_27.sh
)
is_listed() {
  local needle="$1"; shift
  for entry in "$@"; do [[ "$entry" == "$needle" ]] && return 0; done
  return 1
}
walk() { find "$1" -type f -not -path '*/__pycache__/*' -not -name '*.pyc' -not -path '*/node_modules/*' | sort; }

while IFS= read -r file; do
  relative="${file#$PARENT/}"
  is_listed "$relative" "${CHANGED_FROM_PARENT[@]}" && continue
  if is_listed "$relative" "${REMOVED_FROM_PARENT[@]}"; then
    test ! -e "$RELEASE/$relative" || { echo "should not be copied: $relative" >&2; exit 1; }
    continue
  fi
  cmp -s "$file" "$RELEASE/$relative" || { echo "inherited file differs from parent: $relative" >&2; exit 1; }
done < <(walk "$PARENT")
while IFS= read -r file; do
  relative="${file#$RELEASE/}"
  is_listed "$relative" "${CHANGED_FROM_PARENT[@]}" && continue
  test -e "$PARENT/$relative" || { echo "unlisted new file: $relative" >&2; exit 1; }
done < <(walk "$RELEASE")
for relative in "${CHANGED_FROM_PARENT[@]}"; do
  test -f "$RELEASE/$relative" || { echo "listed but missing: $relative" >&2; exit 1; }
  if [[ -f "$PARENT/$relative" ]] && cmp -s "$PARENT/$relative" "$RELEASE/$relative"; then
    echo "listed as changed but identical to parent: $relative" >&2; exit 1
  fi
done

# The register is the parent's: contract, spine and interconnector product byte for byte.
cmp -s "$PARENT/contracts/release.v9.1.json" "$RELEASE/contracts/release.v9.1.json"
grep -q "\"identity_fixture\": \"uk_renewables_pipeline/$FIXTURE_OWNER/fixtures/2026q3/project_identity_2026q3.json\"" "$RELEASE/contracts/release.v9.1.json"
diff -r "$PARENT/data/v9.1" "$RELEASE/data/v9.1"
diff -r "$PARENT/data/v9.8" "$RELEASE/data/v9.8"

# Spine and interconnector product rebuilt in a scratch root that holds this version
# and, at the fixture owner's path, only the two fixtures the contract binds. They
# must reproduce the committed bytes.
SROOT="$SCRATCH/root"
COPY="$SROOT/uk_renewables_pipeline/$ID"
mkdir -p "$SROOT/uk_renewables_pipeline/$FIXTURE_OWNER/fixtures"
cp -a "$ROOT/uk_renewables_pipeline/$FIXTURE_OWNER/fixtures/2026q3" "$SROOT/uk_renewables_pipeline/$FIXTURE_OWNER/fixtures/"
cp -a "$RELEASE" "$COPY"
rm -rf "$COPY/data/v9.1"
PYTHONDONTWRITEBYTECODE=1 python "$COPY/scripts/data/build_v9_1_spine.py"
diff -r "$RELEASE/data/v9.1" "$COPY/data/v9.1"
node "$COPY/scripts/build/interconnectors-v9-8.mjs" >/dev/null
diff -r "$RELEASE/data/v9.8" "$COPY/data/v9.8"

node "$HERE/check_v9_28.mjs"
node "$HERE/check_map_contract_all_rows.mjs"

while IFS= read -r source; do
  node --check "$source"
done < <(find "$RELEASE/scripts" -type f \( -name '*.js' -o -name '*.mjs' \) -print | sort)

echo "V9.28 ($ID) validation suite: PASS ($ROOT)"

Catalogue

A JavaScript module in the layers folder of GlobalGrid2050 covering grid substations and offtakers filtered, using SHA-256, and uses data from the GridAtlas repository.

otherglobalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/catalogue.mjs · lines 1–18 of 18 · version 2026-11-16 23:54

Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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.
Downstream impact
Used directly by 1 file: Layers V929 (globalgrid2050). Reached from 5 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents).
What it achieves
Existing, immutable GridAtlas products; no new collector or copied archive.
Why it matters
Imported by Layers V929.
Application
globalgrid2050 · uk_renewables_pipeline/202611162354/scripts/layers · JavaScript module
Uses
GridAtlas — Index Page (estate URL)
Used by
imported by Layers V929 (import)
Produces
catalogue
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 uk_renewables_pipeline/202611162354/scripts/layers/catalogue.mjs:1-18 · blob c9054e0a51382e64bc4cccb9091c216329006db8 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
/* Existing, immutable GridAtlas products; no new collector or copied archive. */
const GRID = 'https://raw.githubusercontent.com/Ventusltd/gridatlas/1de35f9eca360a5d80d81542230fef546917f5c5/';
export const catalogue = {
  schema: 'globalgrid2050.pipeline-layers.v1',
  sourceComposition: 'gridatlas/202611161720',
  layers: [
    {id: 'substations', label: 'Substations', group: 'Grid', owner: 'Ventusltd/gridatlas', renderer: 'assets', kind: 'substation',
      sourceLabel: 'GridAtlas substation snapshot · OpenStreetMap contributors · ODbL 1.0',
      data: {url: GRID + 'atlas/releases/202608300453-atlas-v9/data/grid_substations.geojson', sha256: '87976435766a58ddf19c99540b58cd7f18a224148af42ba55075d8851f9e6251', maxBytes: 1500000, rows: 5800, schema: 'geojson.FeatureCollection'}},
    {id: 'grid-projects', label: 'Grid Projects', group: 'Grid', owner: 'Ventusltd/globalgrid2050', renderer: 'grid-projects',
      sourceLabel: 'Existing Ventus News Engine · independently reviewed project associations only'},
    {id: 'offtakers', label: 'Offtakers', group: 'Offtakers', owner: 'Ventusltd/gridatlas', renderer: 'assets', kind: 'offtaker',
      sourceLabel: 'Existing GridAtlas filtered offtaker snapshot · per-record attribution and licences retained',
      data: {url: GRID + 'data/offtakers_filtered_202610292000.geojson', sha256: '16dca56003e7a222e7a74025b9b61db3c1929ac7e34adc38daeb343074e68139', maxBytes: 2600000, rows: 1568, schema: 'geojson.FeatureCollection'}},
    {id: 'prices', label: 'Electricity Prices', group: 'Prices', owner: 'Ventusltd/globalgrid2050', renderer: 'prices',
      sourceLabel: 'Original Electricity Market Intelligence workspace; graphs and data ownership unchanged', url: 'https://globalgrid2050.com/uk_energy_tracking_v6/'}
  ]
};

Controls

A JavaScript module in the layers folder of GlobalGrid2050. It is built from the mount layer controls helper (`mountLayerControls`) and the activate step (`activate`).

interactionglobalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/controls.mjs · lines 1–60 of 60 · version 2026-11-16 23:54 · pattern activate (shared by 9 files)

What it does
It draws its content. Defines el, mountLayerControls, tab, keyboard, activate. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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.
Downstream impact
Used directly by 1 file: Layers V929 (globalgrid2050). Reached from 5 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents).
What it achieves
Defines `mountLayerControls`, `tab`, `keyboard` and 1 more. It responds to keydown and click events.
Why it matters
Imported by Layers V929.
Application
globalgrid2050 · uk_renewables_pipeline/202611162354/scripts/layers · JavaScript module
Uses
none found
Used by
imported by Layers V929 (import)
Produces
mountLayerControls
Defines here
el, mountLayerControls, tab, keyboard, activate
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611162354/scripts/layers/controls.mjs:1-60 · blob d973753af6361858232623a206fa575b20d21839 · 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: production_core
const el = (doc, tag, text, className) => { const n = doc.createElement(tag); if (text !== undefined) n.textContent = text; if (className) n.className = className; return n; };
export function mountLayerControls(root, {registry, renderers, initial = 'substations'}) {
  if (!root.id || !/^[A-Za-z][\w-]*$/.test(root.id)) throw Error('A unique named layer host is required');
  const doc = root.ownerDocument;
  root.classList.add('pn-layers'); root.replaceChildren();
  const top = el(doc, 'div', undefined, 'pn-groups'); top.setAttribute('role', 'tablist'); top.setAttribute('aria-label', 'Intelligence categories');
  const sub = el(doc, 'div', undefined, 'pn-subtabs'); sub.setAttribute('role', 'tablist'); sub.setAttribute('aria-label', 'Grid views');
  const panel = el(doc, 'div', undefined, 'pn-panel'); panel.id = root.id + '-panel'; panel.setAttribute('role', 'tabpanel');
  root.append(top, sub, panel);
  const groups = [...new Set(registry.layers.map(x => x.group))];
  const buttons = new Map(); let epoch = 0; let active = null; let cleanup = () => {}; let disposed = false;
  const groupButtons = new Map();
  function tab(button, chosen) { button.setAttribute('aria-selected', String(chosen)); button.tabIndex = chosen ? 0 : -1; }
  function keyboard(container) {
    container.addEventListener('keydown', event => {
      const keys = ['ArrowLeft', 'ArrowRight', 'Home', 'End']; if (!keys.includes(event.key)) return;
      const list = [...container.querySelectorAll('[role="tab"]')].filter(b => !b.hidden);
      if (!list.length) return;
      const i = list.indexOf(doc.activeElement);
      const next = event.key === 'Home' ? 0 : event.key === 'End' ? list.length-1 : (i + (event.key === 'ArrowRight' ? 1 : -1) + list.length) % list.length;
      event.preventDefault(); list[next].focus(); list[next].click();
    });
  }
  async function activate(id) {
    if (disposed) return;
    const layer = registry.layers.find(x => x.id === id); if (!layer) throw Error('Unknown layer');
    const turn = ++epoch; active = id; cleanup(); cleanup = () => {};
    panel.replaceChildren(el(doc, 'p', 'Loading…')); panel.dataset.state = 'loading';
    for (const [group, button] of groupButtons) tab(button, group === layer.group);
    for (const [key, button] of buttons) { button.hidden = registry.layers.find(x => x.id === key).group !== layer.group; tab(button, key === id); }
    sub.hidden = registry.layers.filter(x => x.group === layer.group).length < 2;
    panel.setAttribute('aria-labelledby', sub.hidden ? groupButtons.get(layer.group).id : buttons.get(id).id);
    const stage = el(doc, 'div');
    try {
      const renderer = Object.hasOwn(renderers, layer.renderer) ? renderers[layer.renderer] : null;
      if (typeof renderer !== 'function') throw Error('Renderer unavailable');
      const data = await registry.load(id);
      if (turn !== epoch || disposed) return;
      const destroy = await renderer(stage, {data, layer});
      if (turn !== epoch || disposed) { if (typeof destroy === 'function') destroy(); return; }
      cleanup = typeof destroy === 'function' ? destroy : () => {};
      panel.replaceChildren(stage); panel.dataset.state = 'available';
    } catch {
      if (turn !== epoch || disposed) return;
      panel.replaceChildren(el(doc, 'p', `${layer.label} unavailable. Other views remain usable.`)); panel.dataset.state = 'unavailable';
    }
  }
  for (const group of groups) {
    const button = el(doc, 'button', group); button.type = 'button'; button.id = root.id + '-group-' + group.toLowerCase().replace(/[^a-z0-9]/g, '-');
    button.setAttribute('role', 'tab'); button.setAttribute('aria-controls', panel.id); button.addEventListener('click', () => { void activate(registry.layers.find(x => x.group === group).id); });
    groupButtons.set(group, button); top.append(button);
  }
  for (const layer of registry.layers) {
    const button = el(doc, 'button', layer.label); button.type = 'button'; button.id = root.id + '-view-' + layer.id;
    button.dataset.layerId = layer.id; button.setAttribute('role', 'tab'); button.setAttribute('aria-controls', panel.id);
    button.addEventListener('click', () => { void activate(layer.id); }); buttons.set(layer.id, button); sub.append(button);
  }
  keyboard(top); keyboard(sub); void activate(initial);
  return {activate, get active() { return active; }, destroy() { disposed = true; ++epoch; cleanup(); registry.clear(); root.replaceChildren(); }};
}

Registry

A JavaScript module in the layers folder of GlobalGrid2050 that reads bounded (`readBounded`), using SHA-256.

ingestglobalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/registry.mjs · lines 1–85 of 85 · version 2026-11-16 23:54 · pattern validateRegistry (shared by 2 files)

What it does
Defines 6 functions or classes, including validateRegistry, sha256, readBounded, createDataRegistry, freeze.
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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.
Downstream impact
Used directly by 2 files: Layers V929 (globalgrid2050); Contracts Test (globalgrid2050). Reached from 10 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); GlobalGrid2050 V929 Preview Acceptance Workflow (globalgrid2050).
What it achieves
It reads bounded (`readBounded`) and is built from the sha256 step (`sha256`) and the freeze step (`freeze`). A data-plane extension of Pipeline's existing plugin host, not a script loader.
Why it matters
Imported by Layers V929. Checked by Contracts Test.
Application
globalgrid2050 · uk_renewables_pipeline/202611162354/scripts/layers · JavaScript module
Uses
URL Policy (import)
Used by
imported by Layers V929 (import), imported by Contracts Test (import)
Produces
validateRegistry, sha256, createDataRegistry
Defines here
validateRegistry, sha256, readBounded, createDataRegistry, freeze, work
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611162354/scripts/layers/registry.mjs:1-85 · blob 226fe5c5ad13c5535e587b85356a49948bf2fecb · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: transform · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
/* A data-plane extension of Pipeline's existing plugin host, not a script loader. */
import {publicHttpsUrl,priceWorkspaceUrl} from './url-policy.mjs';
const HEX = /^[a-f0-9]{64}$/;
const ID = /^[a-z][a-z0-9-]{0,63}$/;
export function validateRegistry(manifest) {
  if (manifest?.schema !== 'globalgrid2050.pipeline-layers.v1' || !Array.isArray(manifest.layers)) throw Error('Unsupported layer registry');
  const ids = new Set();
  for (const layer of manifest.layers) {
    if (!ID.test(layer.id) || ids.has(layer.id)) throw Error('Invalid or duplicate layer id');
    ids.add(layer.id);
    if (![layer.label, layer.group, layer.owner, layer.renderer].every(x => typeof x === 'string' && x.length > 0 && x.length <= 160)) throw Error('Layer metadata is incomplete');
    if (layer.url !== undefined) publicHttpsUrl(layer.url);
    if (layer.renderer === 'prices') priceWorkspaceUrl(layer.url);
    if (layer.data) {
      const u = publicHttpsUrl(layer.data.url);
      if (u.protocol !== 'https:' || u.username || u.password || u.hash || !HEX.test(layer.data.sha256)) throw Error('Invalid pinned data source');
      if (!Number.isSafeInteger(layer.data.maxBytes) || layer.data.maxBytes < 1 || layer.data.maxBytes > 8 * 1024 * 1024) throw Error('Layer exceeds browser byte policy');
      if (!Number.isSafeInteger(layer.data.rows) || layer.data.rows < 0 || layer.data.rows > 25000) throw Error('Layer exceeds browser row policy');
      if (typeof layer.data.schema !== 'string' || !layer.data.schema) throw Error('Missing source schema');
    }
  }
  return manifest;
}
export async function sha256(bytes) {
  return [...new Uint8Array(await crypto.subtle.digest('SHA-256', bytes))].map(x => x.toString(16).padStart(2, '0')).join('');
}
async function readBounded(response, maxBytes) {
  if (Number(response.headers.get('content-length')) > maxBytes) throw Error('Data exceeds byte budget');
  const reader = response.body?.getReader();
  if (!reader) {
    const bytes = new Uint8Array(await response.arrayBuffer());
    if (bytes.length > maxBytes) throw Error('Data exceeds byte budget');
    return bytes;
  }
  const parts = []; let size = 0;
  try {
    while (true) {
      const {done, value} = await reader.read();
      if (done) break;
      size += value.byteLength;
      if (size > maxBytes) throw Error('Data exceeds byte budget');
      parts.push(value);
    }
  } catch (error) { await reader.cancel().catch(() => {}); throw error; }
  const bytes = new Uint8Array(size); let offset = 0;
  for (const part of parts) { bytes.set(part, offset); offset += part.byteLength; }
  return bytes;
}
export function createDataRegistry(manifest, {fetchImpl = globalThis.fetch, timeoutMs = 20000} = {}) {
  validateRegistry(manifest);
  // Copy the accepted composition. Later caller mutation cannot repin loaded data.
  const freeze = value => { for (const item of Object.values(value)) if (item && typeof item === 'object') freeze(item); return Object.freeze(value); };
  const layers = freeze(structuredClone(manifest.layers));
  const cache = new Map();
  return {
    layers,
    async load(id) {
      const layer = layers.find(x => x.id === id);
      if (!layer) throw Error('Unknown layer');
      if (!layer.data) return null;
      // Validation belongs to the complete accepted contract, not merely its bytes.
      const key = JSON.stringify([layer.data.url, layer.data.sha256, layer.data.schema, layer.data.rows, layer.data.maxBytes]);
      if (!cache.has(key)) {
        const work = (async () => {
          const controller = new AbortController();
          const timer = setTimeout(() => controller.abort(), timeoutMs);
          try {
            const response = await fetchImpl(layer.data.url, {signal: controller.signal, redirect: 'error', cache: 'force-cache', credentials: 'omit'});
            if (!response.ok || response.redirected) throw Error('Source unavailable');
            const bytes = await readBounded(response, layer.data.maxBytes);
            if (await sha256(bytes) !== layer.data.sha256) throw Error('Source integrity changed');
            const payload = JSON.parse(new TextDecoder('utf-8', {fatal: true}).decode(bytes));
            if (layer.data.schema !== 'geojson.FeatureCollection' || payload.type !== 'FeatureCollection' || !Array.isArray(payload.features) || payload.features.length !== layer.data.rows) throw Error('Source schema/count mismatch');
            return payload;
          } finally { clearTimeout(timer); }
        })();
        cache.set(key, work);
        work.catch(() => { if (cache.get(key) === work) cache.delete(key); });
      }
      // Renderers never share mutable source objects.
      return structuredClone(await cache.get(key));
    },
    clear() { cache.clear(); }
  };
}

URL Policy

A JavaScript module in the layers folder of GlobalGrid2050 that works with public https URL (`publicHttpsUrl`) and price workspace URL (`priceWorkspaceUrl`).

transformglobalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/url-policy.mjs · lines 1–14 of 14 · version 2026-11-16 23:54 · pattern publicHttpsUrl (shared by 2 files)

What it does
It calculates its inputs. Defines publicHttpsUrl, priceWorkspaceUrl.
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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.
Downstream impact
Used directly by 4 files: Registry (globalgrid2050); Views (globalgrid2050); Model (globalgrid2050); Contracts Test (globalgrid2050). Reached from 14 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); GlobalGrid2050 V929 Preview Acceptance Workflow (globalgrid2050).
What it achieves
It is built from the public https URL helper (`publicHttpsUrl`) and the price workspace URL helper (`priceWorkspaceUrl`). Browser navigation policy, not a DNS-based source-rights or identity decision.
Why it matters
Imported by Registry, Views and Model. Checked by Contracts Test.
Application
globalgrid2050 · uk_renewables_pipeline/202611162354/scripts/layers · JavaScript module
Uses
none found
Used by
imported by Registry (import), imported by Views (import), imported by Model (import), imported by Contracts Test (import)
Produces
publicHttpsUrl, priceWorkspaceUrl
Defines here
publicHttpsUrl, priceWorkspaceUrl
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611162354/scripts/layers/url-policy.mjs:1-14 · blob fbec1bfab8c13325b0229c51aa2515665be2f6bb · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: transform · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
/* Browser navigation policy, not a DNS-based source-rights or identity decision. */
export function publicHttpsUrl(value) {
  if(typeof value!=='string')throw Error('URL must be text');
  const url=new URL(value),host=url.hostname.toLowerCase();
  if(url.protocol!=='https:'||url.username||url.password||!host.includes('.')||host.includes(':')||host.endsWith('.')
    ||/^[\d.]+$/.test(host)||/(^|\.)(localhost|local|internal)$/.test(host)
    ||(url.port&&url.port!=='443'))throw Error('Only public HTTPS hostnames are supported');
  return url;
}
export function priceWorkspaceUrl(value) {
  const url=publicHttpsUrl(value);
  if(url.href!=='https://globalgrid2050.com/uk_energy_tracking_v6/')throw Error('Price workspace is not an accepted host product');
  return url.href;
}

Views

A JavaScript module in the layers folder of GlobalGrid2050 that renders assets (`renderAssets`), draws analytics (`drawAnalytics`) and renders grid projects (`renderGridProjects`), covering substations, using SHA-256.

interactionglobalgrid2050 / uk_renewables_pipeline/202611162354/scripts/layers/views.mjs · lines 1–117 of 117 · version 2026-11-16 23:54 · pattern csvCell (shared by 33 files)

What it does
It draws substations. Defines 10 functions or classes, including node, link, csvCell, assetCsv, renderAssets. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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: substations.
Inputs & outputs
Out: CSV file -results.csv; canvas drawing.
Downstream impact
Used directly by 2 files: Layers V929 (globalgrid2050); Contracts Test (globalgrid2050). Reached from 10 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); GlobalGrid2050 V929 Preview Acceptance Workflow (globalgrid2050).
What it achieves
It renders assets (`renderAssets`), draws analytics (`drawAnalytics`) and renders grid projects (`renderGridProjects`). Defines `node`, `link`, `csvCell` and 7 more. It responds to toggle, input and click events.
Why it matters
Imported by Layers V929. Checked by Contracts Test.
Application
globalgrid2050 · uk_renewables_pipeline/202611162354/scripts/layers · JavaScript module
Uses
Model (import), URL Policy (import)
Used by
imported by Layers V929 (import), imported by Contracts Test (import)
Produces
assetCsv, renderAssets, renderGridProjects, renderPrices, renderers
Defines here
node, link, csvCell, assetCsv, renderAssets, draw, drawAnalytics, update, renderGridProjects, renderPrices
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611162354/scripts/layers/views.mjs:1-117 · blob 2f5fd51b43fbb2ed6f9fa0022a284b424cf481fa · 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: production_core
import {assetRows, selectRows, locationLink, voltageLabel} from './model.mjs';
import {priceWorkspaceUrl} from './url-policy.mjs';
const node = (doc, tag, text, cls) => { const n=doc.createElement(tag); if(text!==undefined)n.textContent=text; if(cls)n.className=cls; return n; };
function link(doc, label, href) { const a=node(doc,'a',label); a.href=href; a.target='_blank'; a.rel='noopener noreferrer'; return a; }
function csvCell(value) {
  let s=String(value??'');
  if(typeof value!=='number' && /^[=+@\-\t\r]/.test(s))s="'"+s;
  return /[",\r\n]/.test(s)?'"'+s.replaceAll('"','""')+'"':s;
}
export function assetCsv(rows,{sourceUrl=null,datasetAttribution=null}={}) {
  return [['Source ID','Name','Operator','Category','Published voltage','Longitude','Latitude','MAP location','Source dataset URL','Source attribution and licences','Dataset attribution and licence','Source record'],
    ...rows.map(r=>[r.sourceId,r.name,r.operator,r.category,r.voltage,r.coordinates?.[0],r.coordinates?.[1],locationLink(r),sourceUrl,
      JSON.stringify(r.properties?.sources??[]),JSON.stringify(datasetAttribution),JSON.stringify(r.properties)])]
    .map(row=>row.map(csvCell).join(',')).join('\r\n')+'\r\n';
}
export function renderAssets(host,{data,layer}) {
  const doc=host.ownerDocument, rows=assetRows(data,layer.kind); let page=0;
  host.append(node(doc,'p',layer.sourceLabel,'pn-source'));
  const provenance={sourceUrl:layer.data.url,sha256:layer.data.sha256,
    datasetAttribution:data.licence??data.license??data.attribution??layer.sourceLabel};
  const disclosure=node(doc,'details'),disclosureTitle=node(doc,'summary','Dataset source and attribution');
  disclosure.append(disclosureTitle,node(doc,'pre',JSON.stringify(provenance,null,2)));host.append(disclosure);
  host.append(node(doc,'p',layer.kind==='substation'
    ? 'Mapped substations; source names and voltages retained. A mapped site does not establish available capacity or a project connection.'
    : 'Potential offtakers for screening. Data-centre overlap is retained; a listed site is not confirmed demand, a contract or a connection.','pn-note'));
  const tools=node(doc,'div',undefined,'pn-tools');
  const search=node(doc,'input'); search.type='search'; search.placeholder='Name, operator, source ID…'; search.setAttribute('aria-label','Search '+layer.label);
  const exportButton=node(doc,'button','Export results'); exportButton.type='button';
  const plotButton=node(doc,'button','2D locations'); plotButton.type='button'; plotButton.setAttribute('aria-pressed','false');
  const statsButton=node(doc,'button','Analytics'); statsButton.type='button'; statsButton.setAttribute('aria-pressed','false');
  tools.append(search,exportButton,plotButton,statsButton); host.append(tools);
  const status=node(doc,'p',undefined,'pn-count'); status.setAttribute('role','status');
  const graph=node(doc,'div',undefined,'pn-plot'); graph.hidden=true;
  const graphTitle=node(doc,'p','2D source locations · schematic longitude/latitude view, north up');
  const canvas=node(doc,'canvas'); canvas.width=720; canvas.height=360; canvas.setAttribute('aria-label','Source locations. Use the searchable table for names and MAP links.');
  graph.append(graphTitle,canvas);
  const analytics=node(doc,'div',undefined,'pn-analytics'); analytics.hidden=true;
  const wrap=node(doc,'div',undefined,'pn-tablewrap'), table=node(doc,'table'), head=node(doc,'thead'), header=node(doc,'tr'), body=node(doc,'tbody');
  for(const value of ['Name / source ID','Operator','Voltage / category','Map']) { const th=node(doc,'th',value); th.scope='col'; header.append(th); }
  head.append(header); table.append(head,body); wrap.append(table);
  const paging=node(doc,'div',undefined,'pn-tools'), previous=node(doc,'button','Previous'), next=node(doc,'button','Next'), pageText=node(doc,'span');
  previous.type=next.type='button'; paging.append(previous,pageText,next);
  host.append(status,graph,analytics,wrap,paging);
  let filtered=rows, points=[];
  function draw() {
    if(graph.hidden)return;
    const context=canvas.getContext('2d'); if(!context)return;
    context.clearRect(0,0,canvas.width,canvas.height);
    const located=filtered.filter(r=>r.coordinates);
    if(!located.length) { graphTitle.textContent='No locations recorded for these results'; points=[]; return; }
    graphTitle.textContent='2D source locations · schematic longitude/latitude view, north up';
    const xs=located.map(r=>r.coordinates[0]),ys=located.map(r=>r.coordinates[1]);
    const minX=Math.min(...xs),maxX=Math.max(...xs),minY=Math.min(...ys),maxY=Math.max(...ys);
    points=located.map(row=>({row,x:18+(row.coordinates[0]-minX)/(maxX-minX||1)*684,y:342-(row.coordinates[1]-minY)/(maxY-minY||1)*324}));
    context.fillStyle='#00ffff';
    for(const p of points){context.beginPath();context.arc(p.x,p.y,2.1,0,Math.PI*2);context.fill();}
  }
  function drawAnalytics() {
    if(analytics.hidden)return;
    const counts=new Map();
    for(const row of filtered){const key=String(layer.kind==='substation'?(row.voltage??'Voltage not recorded'):(row.category??'Category not recorded'));counts.set(key,(counts.get(key)||0)+1);}
    analytics.replaceChildren(node(doc,'p',`Source-record counts by ${layer.kind==='substation'?'published voltage text (volts)':'category'}; not MW, demand or available capacity.`));
    const ordered=[...counts].sort((a,b)=>b[1]-a[1]||a[0].localeCompare(b[0])).slice(0,20), maximum=Math.max(1,...ordered.map(x=>x[1]));
    for(const [label,count] of ordered){const row=node(doc,'div',undefined,'pn-bar-row'), text=node(doc,'span',`${label}: ${count}`),bar=node(doc,'meter');bar.min=0;bar.max=maximum;bar.value=count;bar.setAttribute('aria-label',label);row.append(text,bar);analytics.append(row);}
  }
  function update() {
    filtered=selectRows(rows,search.value); page=Math.min(page,Math.max(0,Math.ceil(filtered.length/100)-1));
    const located=filtered.filter(r=>r.coordinates).length,named=filtered.filter(r=>r.name).length;
    status.textContent=`${filtered.length.toLocaleString('en-GB')} records · ${named.toLocaleString('en-GB')} source names · ${located.toLocaleString('en-GB')} locations`;
    body.replaceChildren();
    for(const row of filtered.slice(page*100,(page+1)*100)) {
      const tr=node(doc,'tr'); tr.dataset.sourceId=row.sourceId;
      const name=node(doc,'td'); name.append(node(doc,'strong',row.name||'Name not recorded'),node(doc,'small',row.sourceId));
      const details=node(doc,'details'),summary=node(doc,'summary','Source record');details.append(summary);
      details.addEventListener('toggle',()=>{if(!details.open || details.childNodes.length>1)return;
        const pre=node(doc,'pre',JSON.stringify(row.properties,null,2));details.append(pre);
      });name.append(details);
      tr.append(name,node(doc,'td',row.operator||'Not recorded'),node(doc,'td',layer.kind==='substation'?voltageLabel(row.voltage):String(row.category??'Not recorded')));
      const td=node(doc,'td'),href=locationLink(row); if(href){const a=link(doc,'MAP',href);a.title='Open source location in GridAtlas; not a declared connection';td.append(a);}else td.textContent='Location not recorded';
      tr.append(td);body.append(tr);
    }
    previous.disabled=page===0;next.disabled=(page+1)*100>=filtered.length;pageText.textContent=`Page ${page+1} / ${Math.max(1,Math.ceil(filtered.length/100))}`;
    draw();drawAnalytics();
  }
  search.addEventListener('input',()=>{page=0;update();});
  previous.addEventListener('click',()=>{page--;update();});next.addEventListener('click',()=>{page++;update();});
  plotButton.addEventListener('click',()=>{graph.hidden=!graph.hidden;plotButton.setAttribute('aria-pressed',String(!graph.hidden));draw();});
  statsButton.addEventListener('click',()=>{analytics.hidden=!analytics.hidden;statsButton.setAttribute('aria-pressed',String(!analytics.hidden));drawAnalytics();});
  canvas.addEventListener('click',event=>{
    const b=canvas.getBoundingClientRect(),x=(event.clientX-b.left)*canvas.width/b.width,y=(event.clientY-b.top)*canvas.height/b.height;
    let selected=null,distance=144;
    for(const p of points){const d=(p.x-x)**2+(p.y-y)**2;if(d<distance){selected=p.row;distance=d;}}
    if(selected){search.value=selected.sourceId;page=0;update();search.focus();}
  });
  exportButton.addEventListener('click',()=>{
    const href=URL.createObjectURL(new Blob([assetCsv(filtered,provenance)],{type:'text/csv;charset=utf-8'}));
    const a=link(doc,'',href);a.download=layer.id+'-results.csv';doc.body.append(a);a.click();a.remove();setTimeout(()=>URL.revokeObjectURL(href),1000);
  });
  update();
}
export function renderGridProjects(host) {
  const doc=host.ownerDocument;
  host.append(node(doc,'p','No independently approved news-derived Grid project records are connected to this view yet.'));
  host.append(node(doc,'p','The existing Ventus News Engine owns acquisition and candidate associations. Unreviewed fixtures, nearby assets and name matches are not published project events.','pn-note'));
}
export function renderPrices(host,{layer}) {
  const doc=host.ownerDocument;
  const acceptedUrl=priceWorkspaceUrl(layer.url);
  host.append(node(doc,'p',layer.sourceLabel,'pn-source'),link(doc,'Open original electricity market workspace',acceptedUrl));
  host.append(node(doc,'p','Inspect each graph’s observation dates and actual-data label. The existing workspace can show indicative price baselines when actual prices are unavailable.','pn-note'));
  const button=node(doc,'button','Show original graphs here');button.type='button';host.append(button);
  button.addEventListener('click',()=>{
    const frame=node(doc,'iframe');frame.title='Original Electricity Market Intelligence graphs';frame.loading='lazy';frame.src=acceptedUrl;frame.referrerPolicy='no-referrer';
    host.append(frame);button.remove();
  },{once:true});
}
export const renderers={assets:renderAssets,'grid-projects':renderGridProjects,prices:renderPrices};

Preview V928

A style sheet in the styles folder of GlobalGrid2050.

renderglobalgrid2050 / uk_renewables_pipeline/202611162354/styles/preview-v928.css · lines 1–36 of 36 · version 2026-11-16 23:54 · Entry point

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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.
Downstream impact
Used directly by 1 file: GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/). Reached from 4 other entry points, including GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents); A4 Legal Model (globalgrid2050).
What it achieves
Bounded successor layout; approved V9.24 styles remain the substrate.
Why it matters
Loaded by the UK Renewables Pipeline page at https://globalgrid2050.com/uk_renewables_pipeline/202611280922/.
Application
globalgrid2050 · uk_renewables_pipeline/202611162354/styles · style sheet
Uses
none found
Used by
loaded by GlobalGrid2050 — UK Renewables Pipeline Page (stylesheet)
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 uk_renewables_pipeline/202611162354/styles/preview-v928.css:1-36 · blob 1ded752c4f8ea228d75b7a1b1dac8882efe0b8ca · 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: production_core
/* Bounded successor layout; approved V9.24 styles remain the substrate. */
[hidden]{display:none!important}
.preview-status{font-size:10px;color:var(--muted);margin:0 0 12px;padding:7px 0;border-bottom:1px solid var(--soft)}
.pipeline-tabs{display:flex;flex-wrap:wrap;gap:6px;margin:0 0 14px;border-bottom:1px solid var(--line);padding-bottom:8px}
.pipeline-tabs button{background:#000;color:var(--muted);border:1px solid var(--line);padding:10px 14px;min-height:44px;cursor:pointer;font:700 12px 'Courier New',monospace}
.pipeline-tabs [aria-selected="true"]{border-color:var(--accent);color:var(--accent);background:#001414}
button:focus-visible,a:focus-visible,input:focus-visible,select:focus-visible,summary:focus-visible{outline:2px solid var(--solar);outline-offset:3px}
.category-scope{font-size:11px;color:var(--muted);line-height:1.5;margin:0 0 12px;overflow-wrap:anywhere}
.scope-notes{font-size:11px;color:var(--muted);margin:12px 0;line-height:1.5}
.scope-notes>summary{cursor:pointer;padding:9px 0;color:var(--accent);min-height:36px}
.scope-notes .meta{margin-bottom:0}.scope-notes .category-scope{margin-top:10px}
#officialRegister{min-width:0}#officialRegister>[role="tabpanel"]{min-width:0}
#gridDirectory{max-height:60vh;overflow:auto;border:1px solid var(--line)}
.grid-source{padding:10px 12px;border-bottom:1px solid var(--soft);line-height:1.6}
.grid-source a{color:var(--accent)}.grid-source small{display:block;color:var(--muted)}
.grid-source p{margin-top:5px;overflow-wrap:anywhere}
.v925-inherited-source{font-size:11px;line-height:1.5;margin-top:8px;color:var(--muted)}
.v925-inherited-source a{color:var(--accent)}
.newspaper .live-news{max-height:420px;overflow:auto;overscroll-behavior:contain}
.masthead h2{font-size:21px}.gauges{margin-bottom:15px}.chart{height:95px}
.tablewrap{max-height:60vh}.machine-note-cell{min-width:180px}
#contextHost{min-width:0}.transition-context{max-height:55vh;overflow:auto}
@media(max-width:768px){.main{padding:14px 12px}.pipeline-tabs{gap:5px}.pipeline-tabs button{padding:9px 10px;font-size:11px}.masthead h2{font-size:18px}.gauges{gap:8px}.card{padding:9px 4px}.card h3{font-size:9px}.chart{height:78px}.value{font-size:18px}.newspaper .live-news{max-height:360px}.category-scope{font-size:10px}}

/* Owner requested a full-width page: history lives on the Versions page. */
.main{width:100%;margin-left:0}
.release-header{display:flex;align-items:center;justify-content:space-between;gap:12px;flex-wrap:wrap;border-bottom:1px solid var(--soft);padding:0 0 8px;margin:0 0 8px}
.release-brand b{color:var(--text);font-size:14px;letter-spacing:2px}.release-brand small{display:block;color:var(--muted);font-size:9px;margin-top:3px}
.release-links{display:flex;align-items:center;gap:4px 12px;flex-wrap:wrap}.release-links a{color:var(--muted);font-size:10px;text-decoration:none;display:inline-flex;align-items:center;min-height:32px}.release-links a:hover,.release-links .active{color:var(--accent)}
@media(max-width:768px){.release-header{gap:4px}.release-links{gap:0 10px}.release-links a{min-height:44px;font-size:9px}}

/* Native document flow remains usable when mobile viewport dimensions rotate. */
html{height:auto;overflow-y:auto}body{display:block;height:auto;min-height:100vh;min-height:100dvh;overflow:visible}.main{height:auto;min-height:100vh;min-height:100dvh;overflow:visible;margin:0;width:100%}
/* Canvas intrinsic sizes must not enlarge mobile landscape before Chart.js loads. */
.gauges{grid-template-columns:repeat(3,minmax(0,1fr))}.gauges .card,.gauges .chart{min-width:0}.gauges .chart canvas{display:block;max-width:100%}
@media(max-width:768px){.gauges{grid-template-columns:minmax(0,1fr)}}

Check V9 29

A JavaScript module in the tests folder of GlobalGrid2050 that tests major project news, interconnectors and the Renewable Energy Planning Database (REPD) register, using SHA-256.

Set aside from the main view: 91% of its lines are the same as uk_renewables_pipeline/202611180520/tests/check_v9_45.mjs (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 90% of lines shared with Check V9 45; read that one first. All set-aside files, with reasons. Nothing was deleted.

Evidence
  • line-jaccard 0.9099 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611180520/tests/check_v9_45.mjs:1-123 41fe9e5b51a076d6ffbe2ce5a8afe5a5265f4d56
  • sha256 902b6929c304d0d2ae4d8dd6b90d5b5de1645a36e448a9b07977b4daadcaa091
  • target sha256 e8956eb33f4e20f2a38ba682b879bfbfb35a358854d686c40467140d601f9e5b
  • group of 15 (identity.json near-copy edges >= 0.9)
  • canonical rule: reachable, newest stamp, core repo, most lines

testglobalgrid2050 / uk_renewables_pipeline/202611162354/tests/check_v9_29.mjs · lines 1–123 of 123 · version 2026-11-16 23:54

What it does
It tests major project news, interconnectors and the REPD register. Defines text, json, sha256, fmt. Uses libraries node:assert/strict, node:crypto, node:fs/promises, node:url, node:path. Side effects: reads or writes files.
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): 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: interconnectors, the REPD register.
Inputs & outputs
In: JSON file release.v9.1.json; JSON file release.v9.5.1.json; JSON file build_manifest.json; JSON file major_project_news_v9_5_1.json; JSON file interconnectors.v9.8.json; JSON file interconnectors.json; JSON file interconnectors_manifest.json.
Downstream impact
Used directly by 1 file: Run V9 29 (globalgrid2050). Reached from 1 other entry point, including GlobalGrid2050 V929 Preview Acceptance Workflow (globalgrid2050).
What it achieves
It is built from the text step (`text`), the JSON step (`json`) and the sha256 step (`sha256`). Pipeline News V9.29, proven from the bytes and through the page's OWN loaders (the pattern of `check_v9_13.mjs`).
Why it matters
Checked by Run V9 29.
Application
globalgrid2050 · uk_renewables_pipeline/202611162354/tests · JavaScript module
Uses
Canonical Projects V9 5 1 (new URL import.meta.url), node:assert/strict, node:crypto, node:fs/promises, node:url, node:path
Used by
run by Run V9 29 (script call)
Produces
text, json, sha256, fmt
Defines here
text, json, sha256, fmt
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611162354/tests/check_v9_29.mjs:1-123 · blob 8184ec86ff381bc45bd4e0a3829d47962744c5b5 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: filesystem · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
/* check_v9_29.mjs - Pipeline News V9.29, proven from the bytes and through the
 * page's OWN loaders (the pattern of check_v9_13.mjs).
 *
 *   1. The contracts bind the fixtures held by 202611132345 by path and sha256.
 *   2. The page's own loader chain is imported unmodified and executed against the
 *      files in this folder; every invariant the browser asserts is asserted here.
 *   3. The spine partitions are what the manifest says (sha256 and counts).
 *   4. The UK newspaper feed is unchanged and Beacon Fen still resolves.
 *   5. The interconnector product and contract are the parent's, byte for byte.
 *   6. The page states its own identity and version label.
 *
 * Run: node tests/check_v9_29.mjs
 */
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import { basename, dirname, join } from "node:path";

const HERE = dirname(fileURLToPath(import.meta.url));
const RELEASE = join(HERE, "..");
const ID = basename(RELEASE);
const ROOT = join(RELEASE, "..", "..");
const VERSION = "9.29";
const STATE = "RELEASE CANDIDATE";
const PARENT_ID = "202611161757";
const FIXTURE_OWNER = "202611132345";
const PARENT = join(RELEASE, "..", PARENT_ID);
const text = (p) => readFile(p, "utf8");
const json = async (p) => JSON.parse(await text(p));
const sha256 = (b) => createHash("sha256").update(b).digest("hex");

const NEWS_FEED_SHA256 = "cea104c3e9cfc07971680afdf5f64073e1d4825b63bfaf4e969266df8386ebbd";

// 1. contracts bind fixtures
const c91 = await json(join(RELEASE, "contracts", "release.v9.1.json"));
const c951 = await json(join(RELEASE, "contracts", "release.v9.5.1.json"));
assert.equal(c91.source.dataset, "DESNZ Renewable Energy Planning Database Q3 2026");
for (const [pathKey, shaKey] of [["identity_fixture", "identity_fixture_sha256"], ["coordinate_fixture", "coordinate_fixture_sha256"]]) {
  const rel = c91.source[pathKey];
  assert.ok(rel.startsWith(`uk_renewables_pipeline/${FIXTURE_OWNER}/fixtures/`), `${pathKey} must be the fixture owner's: ${rel}`);
  assert.equal(sha256(await readFile(join(ROOT, rel))), c91.source[shaKey], `${pathKey} bytes`);
}
const coords = await json(join(ROOT, c91.source.coordinate_fixture));
assert.equal(coords.source_workbook_sha256, c91.source.workbook_sha256, "coordinate fixture names the contract workbook");
const identity = await json(join(ROOT, c91.source.identity_fixture));
assert.equal(identity.schema, "globalgrid2050.project-identity.v6");
assert.equal(identity.records.length, identity.raw_record_count);
assert.equal(coords.source_records, identity.raw_record_count, "workbook and identity hold the same refs");

// 2. the page's own loader, unmodified, against these bytes
const ORIGIN = "http://release.invalid";
const BASE = `${ORIGIN}/uk_renewables_pipeline/${ID}/`;
globalThis.window = { location: { origin: ORIGIN, href: BASE } };
globalThis.fetch = async (path) => {
  const url = new URL(path, BASE);
  assert.ok(url.pathname.startsWith(`/uk_renewables_pipeline/${ID}/`), `loader fetched outside the release: ${url}`);
  const file = join(RELEASE, decodeURIComponent(url.pathname.slice(`/uk_renewables_pipeline/${ID}/`.length)));
  const body = await text(file);
  return { ok: true, status: 200, url: url.href, json: async () => JSON.parse(body) };
};
const loader = await import(new URL("../scripts/data/canonical-projects-v9-5-1.js", import.meta.url).href);
const model = await loader.loadCanonicalProjectsV9_5_1();
assert.equal(model.projects.length, c951.expected.project_count);
assert.equal(Math.round(model.metadata.capacity_mw), c951.expected.displayed_capacity_mw);

// 3. partitions are the manifest's bytes
const manifest = await json(join(RELEASE, "data", "v9.1", "build_manifest.json"));
for (const part of [...manifest.project_partitions, ...manifest.atlas_partitions]) {
  assert.equal(sha256(await readFile(join(RELEASE, part.path))), part.sha256, `${part.path} hash`);
}
const atlasFeatures = manifest.atlas_partitions.reduce((n, p) => n + p.feature_count, 0);
assert.equal(atlasFeatures, manifest.geometry_count, "atlas features = valid geometries");
for (const key of Object.keys(c91.expected)) assert.equal(manifest[key], c91.expected[key], `manifest ${key}`);
assert.equal(manifest.source_dataset, c91.source.dataset);
assert.equal(manifest.source_record_count, identity.raw_record_count);

// 4. the newspaper: unchanged Q2 feed, every bound ref still resolves
const feedBytes = await readFile(join(ROOT, "dist", "major_project_news_v9_5_1.json"));
assert.equal(sha256(feedBytes), NEWS_FEED_SHA256, "dist/major_project_news_v9_5_1.json must not be rebuilt by this release");
const feed = JSON.parse(feedBytes);
const byRef = new Map(model.projects.map((p) => [p.repd_ref, p]));
const boundRefs = new Set(feed.canonical_items.map((item) => String(item.repd_ref)));
const unresolved = [...boundRefs].filter((ref) => !byRef.has(ref));
const beacon = byRef.get(feed.beacon_fen_contract.repd_ref);
assert.ok(beacon, "Beacon Fen must be in the spine");
assert.equal(beacon.capacity_mw, feed.beacon_fen_contract.official_capacity_mw, "Beacon Fen official capacity");

// 5. interconnectors are the parent's
for (const rel of ["contracts/interconnectors.v9.8.json", "data/v9.8/interconnectors.json", "data/v9.8/interconnectors_manifest.json"]) {
  assert.equal(sha256(await readFile(join(RELEASE, rel))), sha256(await readFile(join(PARENT, rel))), `${rel} is the parent's`);
}

// 6. page identity
const fmt = (n) => n.toLocaleString("en-GB");
const html = await text(join(RELEASE, "index.html"));
const compact = html.includes(`data-edition="${ID}"`);
assert.ok(compact || html.includes(`UK RENEWABLES PIPELINE ${ID}`), "visible page identity names this release");
assert.ok(new RegExp(`Canonical DESNZ REPD Q3 2026[^<]*${fmt(manifest.project_count)} solar, BESS and wind records`).test(html), "index.html states the Q3 register count");
assert.ok(!html.includes("REPD Q2 2026: 7,680"), "index.html must not claim the Q2 register");
assert.ok(html.includes("scripts/app-v9-8.js"), "index.html loads the v9.8 app");
const label = html.slice(html.indexOf("<body>"), html.indexOf('<section class="newspaper">'));
assert.ok(!/CANDIDATE/.test(label.replaceAll("RELEASE CANDIDATE", "")), "brand, nav, h1 and meta carry no candidate label other than this version's own state");
if (compact) {
  assert.ok(label.includes(`<small>PIPELINE NEWS · V${VERSION}</small>`), "compact brand names the version");
  assert.ok(label.includes(`>V${VERSION} · PIPELINE NEWS</a>`), "compact nav names the version");
  assert.ok(label.includes(`V${VERSION} · `) && label.includes(' · REPD OCTOBER 2026 · '), "compact stamp names the version and source vintage");
  assert.ok(html.includes(`<title>GlobalGrid2050 | Pipeline News V${VERSION} · ${ID}</title>`), "compact title names this release");
  assert.equal((html.match(/<section\b/g)||[]).length,2,"exactly two principal blocks");
  for (const tab of ['solarTab','bessTab','gridTab','datacentreTab']) assert.ok(html.includes(`id="${tab}" role="tab"`),`category ${tab}`);
  assert.ok(!html.includes('<th>NEWS SIGNAL</th>')&&!html.includes('id="solar1000Pilot"'),"withdrawn panels/column do not return");
} else {
assert.ok(label.includes(`<small>UK RENEWABLES PIPELINE · V${VERSION}</small>`), "brand names the version");
assert.ok(label.includes(`<a class="active" href="#">V${VERSION} ${STATE} · REPD Q3 2026</a>`), "nav names the version");
assert.ok(new RegExp(`<strong>V${VERSION.replace(".", "\\.")} · REPD OCTOBER 2026 \\(Q3\\) · [^<]+ · ${STATE} · \\d+ November 2026</strong>`).test(label), "meta line names the version and its date");
assert.ok(html.includes(`<title>GlobalGrid2050 | UK Renewables Pipeline ${ID}</title>`), "title names this release");
}
assert.ok(label.includes(`<a href="../${PARENT_ID}/">`), "nav links back to the parent");
assert.ok(label.includes('<a href="../versions.html">'), "nav links to the list of all versions");

console.log(`check_v9_29: ${ID} loader PASS - ${fmt(model.projects.length)} records, ${model.metadata.capacity_mw.toLocaleString("en-GB", { minimumFractionDigits: 2 })} MW, `
  + `${manifest.geometry_count} with geometry / ${manifest.missing_geometry_count} without; news feed unchanged, `
  + `${boundRefs.size - unresolved.length}/${boundRefs.size} bound refs resolve${unresolved.length ? ` (unresolved: ${unresolved.join(", ")})` : ""}`);