GLOBALGRID2050 / EXPLORE CODE

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

Check V9 39 and 6 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.

662 lines of JavaScript and Shell from globalgrid2050, in 7 files. Topic: Electricity markets and data pipelines. Section 948 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 39 test · globalgrid2050 / uk_renewables_pipeline/202611171609/tests/check_v9_39.mjs lines 1–123
  2. Run V9 39 test · globalgrid2050 / uk_renewables_pipeline/202611171609/tests/run_v9_39.sh lines 1–97
  3. Ticker other · globalgrid2050 / uk_renewables_pipeline/202611171710/scripts/layers/ticker.mjs lines 1–3
  4. Check V9 40 test · globalgrid2050 / uk_renewables_pipeline/202611171710/tests/check_v9_40.mjs lines 1–123
  5. Run V9 40 test · globalgrid2050 / uk_renewables_pipeline/202611171710/tests/run_v9_40.sh lines 1–97
  6. Check V9 41 test · globalgrid2050 / uk_renewables_pipeline/202611171940/tests/check_v9_41.mjs lines 1–123
  7. Run V9 41 test · globalgrid2050 / uk_renewables_pipeline/202611171940/tests/run_v9_41.sh lines 1–96

Check V9 39

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 6f60bce60ad72c8184d12e28f2ea09dd16b43a08d9fb74dd3fcc744f70929c92
  • 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/202611171609/tests/check_v9_39.mjs · lines 1–123 of 123 · version 2026-11-17 16:09

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 39 (globalgrid2050).
What it achieves
It is built from the text step (`text`), the JSON step (`json`) and the sha256 step (`sha256`). Pipeline News V9.39, 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 39.
Application
globalgrid2050 · uk_renewables_pipeline/202611171609/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 39 (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/202611171609/tests/check_v9_39.mjs:1-123 · blob 24b940a153b755efac3927112f4254798facee58 · 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_39.mjs - Pipeline News V9.39, 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_39.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.39";
const STATE = "RELEASE CANDIDATE";
const PARENT_ID = "202611171550";
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_39: ${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 39

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/202611171609/tests/run_v9_39.sh · lines 1–97 of 97 · version 2026-11-17 16:09 · Entry point · pattern is_listed (shared by 38 files)

What it does
It tests interconnectors. Defines is_listed, walk. Side effects: starts processes.
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
It is itself an entry point (shell script); no other file was found loading it.
What it achieves
Defines `is_listed` and `walk`.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · uk_renewables_pipeline/202611171609/tests · shell script
Uses
Check V9 39 (script call)
Used by
none found
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/202611171609/tests/run_v9_39.sh:1-97 · blob a2f373451c783417799f4758ff74a61bef255254 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env bash
# run_v9_39.sh - Pipeline News V9.39: 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="202611171550"
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="a81e4f9dbebbe24f763fc6ec5160cd5d45a66311"

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
  contracts/document-facts.v939.json
  index.html
  scripts/plugins/datacentre-news.js
  tests/check_v9_39.mjs
  tests/run_v9_39.sh
)
REMOVED_FROM_PARENT=(
  tests/check_v9_38.mjs
  tests/run_v9_38.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_39.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.39 ($ID) validation suite: PASS ($ROOT)"

Ticker

A JavaScript module in the layers folder of GlobalGrid2050.

otherglobalgrid2050 / uk_renewables_pipeline/202611171710/scripts/layers/ticker.mjs · lines 1–3 of 3 · version 2026-11-17 17:10

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
No statement of purpose was found in the file, a README line naming it, or its name. Described from its file name only (a candidate, not yet checked against the code).
Why it matters
Imported by Layers V929.
Application
globalgrid2050 · uk_renewables_pipeline/202611171710/scripts/layers · JavaScript module
Uses
Model (import), Ticker (import)
Used by
imported by Layers V929 (import)
Produces
renderTicker
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/202611171710/scripts/layers/ticker.mjs:1-3 · blob 2cbed3174496dc1da523f1b6a6551868d15b4a4d · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
import {latestHeadlines} from './model.mjs';
import {createTickerRenderer} from '../../../../automation/ticker_neon_ui/20261117-v940/ticker.mjs';
export const renderTicker=createTickerRenderer(latestHeadlines);

Check V9 40

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 34341b223eb8c3dece58bf51a92de0d6f1a65f6f4590ceb50ef317e5c1935b56
  • 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/202611171710/tests/check_v9_40.mjs · lines 1–123 of 123 · version 2026-11-17 17:10

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 40 (globalgrid2050).
What it achieves
It is built from the text step (`text`), the JSON step (`json`) and the sha256 step (`sha256`). Pipeline News V9.40, 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 40.
Application
globalgrid2050 · uk_renewables_pipeline/202611171710/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 40 (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/202611171710/tests/check_v9_40.mjs:1-123 · blob ba5f9c73b290a73c1d4c1fada4db5156c9324816 · 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_40.mjs - Pipeline News V9.40, 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_40.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.40";
const STATE = "RELEASE CANDIDATE";
const PARENT_ID = "202611171609";
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_40: ${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 40

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/202611171710/tests/run_v9_40.sh · lines 1–97 of 97 · version 2026-11-17 17:10 · Entry point · pattern is_listed (shared by 38 files)

What it does
It tests interconnectors. Defines is_listed, walk. Side effects: starts processes.
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
It is itself an entry point (shell script); no other file was found loading it.
What it achieves
Defines `is_listed` and `walk`.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · uk_renewables_pipeline/202611171710/tests · shell script
Uses
Check V9 40 (script call)
Used by
none found
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/202611171710/tests/run_v9_40.sh:1-97 · blob 183a1003062675d02d812101e5fff2ea03a833f1 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env bash
# run_v9_40.sh - Pipeline News V9.40: 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="202611171609"
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="0d087c5758de958e6d7b751afc8dc37704d8f161"

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
  contracts/ticker.v940.json
  index.html
  scripts/layers/ticker.mjs
  tests/check_v9_40.mjs
  tests/run_v9_40.sh
)
REMOVED_FROM_PARENT=(
  tests/check_v9_39.mjs
  tests/run_v9_39.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_40.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.40 ($ID) validation suite: PASS ($ROOT)"

Check V9 41

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/202611180633/tests/check_v9_46.mjs (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 90% of lines shared with Check V9 46; read that one first. All set-aside files, with reasons. Nothing was deleted.

Evidence
  • line-jaccard 0.9099 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611180633/tests/check_v9_46.mjs:1-123 9f1538d9805be2e4a3a6c6ed26617a29434b2ea5
  • sha256 ab6a1c529b5eb2b1ea9f3d90a6a6f3d60467d89fdc42f6a58881491c8327bfea
  • target sha256 fa0a644be1fbe746f77a5f2dc4035f7d3e7cf316c73d778f43123d971eb378c8
  • group of 3 (identity.json near-copy edges >= 0.9)
  • canonical rule: reachable, newest stamp, core repo, most lines

testglobalgrid2050 / uk_renewables_pipeline/202611171940/tests/check_v9_41.mjs · lines 1–123 of 123 · version 2026-11-17 19:40

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 41 (globalgrid2050).
What it achieves
It is built from the text step (`text`), the JSON step (`json`) and the sha256 step (`sha256`). Pipeline News V9.41, 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 41.
Application
globalgrid2050 · uk_renewables_pipeline/202611171940/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 41 (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/202611171940/tests/check_v9_41.mjs:1-123 · blob cdadc6932385bd7f164ddd7488bba68789cb7e36 · 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_41.mjs - Pipeline News V9.41, 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_41.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.41";
const STATE = "BUILD";
const PARENT_ID = "202611171710";
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_41: ${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 41

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/202611171940/tests/run_v9_41.sh · lines 1–96 of 96 · version 2026-11-17 19:40 · Entry point · pattern is_listed (shared by 38 files)

What it does
It tests interconnectors. Defines is_listed, walk. Side effects: starts processes.
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
It is itself an entry point (shell script); no other file was found loading it.
What it achieves
Defines `is_listed` and `walk`.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · uk_renewables_pipeline/202611171940/tests · shell script
Uses
Check V9 41 (script call)
Used by
none found
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/202611171940/tests/run_v9_41.sh:1-96 · blob 5afed23915ffb23ce6273279b6a6f506834fc79e · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env bash
# run_v9_41.sh - Pipeline News V9.41: 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="202611171710"
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="2d44f3460bd5074044f5c90ff4a3c68a297122e5"

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
  contracts/ticker.v941.json
  index.html
  tests/check_v9_41.mjs
  tests/run_v9_41.sh
)
REMOVED_FROM_PARENT=(
  tests/check_v9_40.mjs
  tests/run_v9_40.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_41.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.41 ($ID) validation suite: PASS ($ROOT)"