GLOBALGRID2050 / EXPLORE CODE

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

Browser Smoke V9 8 and 3 more files

A JavaScript module in the tests folder of GlobalGrid2050 that tests the Renewable Energy Planning Database (REPD) register, interconnectors, substations and solar, and uses data from the GridAtlas repository.

561 lines of JavaScript and Shell from globalgrid2050, in 4 files. Topic: Electricity markets and data pipelines. Section 932 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. Browser Smoke V9 8 test · globalgrid2050 / uk_renewables_pipeline/202609071221/tests/browser_smoke_v9_8.mjs lines 1–284
  2. Check V9 8 test · globalgrid2050 / uk_renewables_pipeline/202609071221/tests/check_v9_8.mjs lines 1–140
  3. Run V9 8 test · globalgrid2050 / uk_renewables_pipeline/202609071221/tests/run_v9_8.sh lines 1–109
  4. App V9 9 other · globalgrid2050 / uk_renewables_pipeline/202609081016/scripts/app-v9-9.js lines 1–28

Browser Smoke V9 8

A JavaScript module in the tests folder of GlobalGrid2050 that tests the Renewable Energy Planning Database (REPD) register, interconnectors, substations and solar, and uses data from the GridAtlas repository.

testglobalgrid2050 / uk_renewables_pipeline/202609071221/tests/browser_smoke_v9_8.mjs · lines 1–284 of 284 · version 2026-09-07 12:21 · pattern clickCount (shared by 4 files)

What it does
It tests the REPD register, interconnectors, substations and solar. Defines pageAt, clickCount. Uses libraries node:assert/strict, node:module, playwright. Side effects: changes the web page (DOM); 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: the REPD register, interconnectors, substations, solar.
Inputs & outputs
In: data source: gridatlas data; DuckDB queries.
Downstream impact
Used directly by 1 file: Run V9 8 (globalgrid2050).
What it achieves
It is built from the page at helper (`pageAt`) and the click count helper (`clickCount`). Defines `pageAt` and `clickCount`.
Why it matters
Checked by Run V9 8.
Application
globalgrid2050 · uk_renewables_pipeline/202609071221/tests · JavaScript module
Uses
GridAtlas — Atlas Page (estate URL), node:assert/strict, node:module, playwright
Used by
run by Run V9 8 (script call)
Produces
pageAt, clickCount
Defines here
pageAt, clickCount
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/202609071221/tests/browser_smoke_v9_8.mjs:1-284 · blob 44d5eff98b1654b57fbccde912169ac2a127ee3e · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, storage · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
import assert from "node:assert/strict";
import { createRequire } from "node:module";

const require = createRequire(new URL("../package.json", import.meta.url));
const { chromium } = require("playwright");
const baseUrl = process.env.V9_BASE_URL || "http://127.0.0.1:8765/uk_renewables_pipeline/202609071221/";

async function pageAt(browser, width) {
  const context = await browser.newContext({ viewport: { width, height: 1000 } });
  const page = await context.newPage();
  await page.addInitScript(() => {
    window.Chart = class ChartStub {
      constructor(_canvas, config) { this.data = config.data; }
      update() {}
    };
  });
  await page.route("https://cdn.jsdelivr.net/**", (route) => route.fulfill({
    status: 200, contentType: "application/javascript", body: "",
  }));
  await page.goto(baseUrl, { waitUntil: "domcontentloaded" });
  /* The VIEW is a page of twenty; the DATA is still all 7,680. Waiting for 7,680
     rows in the DOM was the old contract and it can never be satisfied again -
     so the wait is on the windowed view being painted AND the loader reporting
     the complete record count. Both halves matter: dropping the second would
     let a short read pass unnoticed, which is the failure this whole gate is
     for. */
  await page.waitForFunction(() => (
    document.querySelectorAll("#tbody tr").length === 20
    && document.getElementById("tbody")?.dataset.total === "7680"
    && document.querySelectorAll("#stories .story").length === 133
    && document.querySelector("#newsMeta")?.textContent.includes("audited snapshot")
  ));
  return { context, page };
}

async function clickCount(page, mode) {
  await page.locator(`button[data-news="${mode}"]`).click();
  await page.waitForFunction(() => !document.querySelector("#stories .news-empty"));
  return page.locator("#stories .story").count();
}

const browser = await chromium.launch({ headless: true });
try {
  const { context, page } = await pageAt(browser, 1440);
  assert.equal(await page.locator("#tbody tr").count(), 20);
  // The pipeline is not windowed even though the view is.
  assert.equal(await page.locator("#tbody").getAttribute("data-total"), "7680");
  assert.equal(await page.locator("#tbody").getAttribute("data-pages"), "384");
  // Largest first, and the pager moves without re-filtering.
  const firstPageTop = await page.locator("#tbody td.mw").first().innerText();
  assert.equal(firstPageTop.trim(), "4,100 MW");
  await page.locator('[data-page-step="1"]').click();
  await page.waitForFunction(() => document.getElementById("tbody")?.dataset.page === "2");
  assert.equal(await page.locator("#tbody tr").count(), 20);
  assert.equal(await page.locator("#tbody").getAttribute("data-total"), "7680");
  await page.locator('[data-page-step="-1"]').click();
  await page.waitForFunction(() => document.getElementById("tbody")?.dataset.page === "1");

  /* THE MAP BUTTON FIRES LIKE THE ORACLE, ON HREFS THE TABLE ACTUALLY RENDERED.
     check_map_contract_all_rows.mjs has already proven all 7,680 hrefs carry the
     right identity. This takes a sample of them from the DOM - not typed in - and
     requires the grid engine to answer on each, the way testcode/202609051531
     answers. "Answer" means the card states "Nearest <n> kV substation:"; a
     project name on screen proves only that a card was built. */
  /* TWO KINDS OF ARRIVAL, MEASURED SEPARATELY - because they behave differently
     and conflating them hid a stall for a day.
       LOCATED   7,652 rows: REPD published a coordinate, the href carries it, and
                 the live Atlas answers in about a second. These are the gate.
       REF-ONLY     28 rows: REPD published no coordinate. The MAP note in the row
                 says the Atlas "centres on its own geometry". Measured 2026-09-06
                 against the live Atlas: REPD 20217 and 21087 - offshore projects
                 in the top twenty by capacity - spin for 30 s and never answer.
                 That is the spinner the architect photographed. It is an Atlas
                 fault, not this release's: the href is exactly what the contract
                 permits. So it is MEASURED and printed here, never asserted,
                 because a pipeline release must not be blocked on a receiver it
                 does not own - and never hidden, because it is real. */
  const { located, refOnly } = await page.evaluate(() => {
    const links = [...document.querySelectorAll("#tbody a")].filter((a) => /gridatlas/.test(a.href)).map((a) => a.href);
    const located = links.filter((h) => /latitude=/.test(h));
    const refOnly = links.filter((h) => !/latitude=/.test(h));
    const step = Math.max(1, Math.floor(located.length / 3));
    return { located: located.filter((_, i) => i % step === 0).slice(0, 3), refOnly: refOnly.slice(0, 1) };
  });
  const sampleHrefs = located;
  assert.ok(sampleHrefs.length >= 3, `expected located MAP hrefs in the rendered page, found ${sampleHrefs.length}`);
  /* A CLEAN context for the arrivals. The pipeline context above stubs every
     cdn.jsdelivr.net request to an empty body so the newspaper's Chart never
     loads - and the Atlas loads duckdb-wasm and its map libraries from that same
     CDN. Opening arrivals inside that context killed their dependencies and the
     engine could not fire, which is how the first run of this block timed out
     at 45 s on a page that answers in ~1.2 s. The arrival must see the CDN. */
  const arrivalContext = await browser.newContext({ viewport: { width: 1440, height: 900 } });
  for (const href of sampleHrefs) {
    const arrival = await arrivalContext.newPage();
    await arrival.goto(href, { waitUntil: "domcontentloaded" });
    await arrival.waitForFunction(() => /Nearest\s+\d+\s*kV substation:/.test(document.body.innerText), null, { timeout: 45000 });
    const ref = new URL(href).searchParams.get("repd_ref");
    assert.ok(await arrival.locator("body").innerText().then((t) => t.includes(`REPD ${ref}`)), `arrival for REPD ${ref} shows a different record`);
    await arrival.close();
  }
  for (const href of refOnly) {
    const arrival = await arrivalContext.newPage();
    const started = Date.now();
    let outcome = "FIRED";
    try {
      await arrival.goto(href, { waitUntil: "domcontentloaded" });
      await arrival.waitForFunction(() => /Nearest\s+\d+\s*kV substation:/.test(document.body.innerText), null, { timeout: 20000 });
    } catch { outcome = "STALLED - no engine answer and no refusal shown"; }
    console.log(`ref-only arrival REPD ${new URL(href).searchParams.get("repd_ref")}: ${outcome} (${Date.now() - started} ms) - measured, not gated; see the note above`);
    await arrival.close();
  }
  await arrivalContext.close();
  /* THE INTERCONNECTORS TAB. Sixteen rows outside the REPD spine, and ALL TECH
     stays 7,680 before and after. Every MAP href carries interconnector= and
     technology=interconnector against the canonical receiver and never a
     repd_ref; the six links with no converter coordinate held say NO MAP with
     the reason in the row. Largest first, and IFA leads at 2,000 MW. */
  await page.locator('#tech [data-technology="interconnector"]').click();
  await page.waitForFunction(() => document.getElementById("tbody")?.dataset.total === "16");
  assert.equal(await page.locator("#tbody tr").count(), 16);
  assert.equal(await page.locator("#tbody tr[data-technology=interconnector]").count(), 16);
  assert.match(await page.locator("#resultsMeta").innerText(), /16 of 16 interconnector records/);
  assert.equal(await page.locator("#v2").innerText(), "16");
  assert.equal(await page.locator("#v1").innerText(), "17,950");
  assert.equal(await page.locator("#v3").innerText(), "2,000");
  const interconnectorRows = await page.evaluate(() => {
    const rows = [...document.querySelectorAll("#tbody tr")];
    return {
      linked: rows.map((tr) => { const a = tr.querySelector("a.atlaslink"); return a ? a.href : ""; }).filter(Boolean),
      noMap: rows.filter((tr) => tr.querySelector(".action-disabled")).length,
      noMapReasons: rows.filter((tr) => tr.querySelector(".action-disabled")).map((tr) => tr.querySelector(".map-note").textContent),
      firstName: rows[0].querySelector("td.site").childNodes[0].textContent.trim(),
      badges: [...new Set(rows.map((tr) => tr.querySelector(".badge").textContent))],
    };
  });
  assert.equal(interconnectorRows.linked.length, 10, "ten interconnectors carry a converter coordinate");
  assert.equal(interconnectorRows.noMap, 6, "six carry none and say so");
  assert.ok(interconnectorRows.noMapReasons.every((r) => r.includes("no converter coordinates")));
  assert.equal(interconnectorRows.firstName, "IFA");
  assert.deepEqual(interconnectorRows.badges, ["Interconnector"]);
  for (const href of interconnectorRows.linked) {
    const url = new URL(href);
    assert.equal(url.origin + url.pathname, "https://ventusltd.github.io/gridatlas/atlas/", href);
    assert.ok(url.searchParams.get("interconnector"), href);
    assert.equal(url.searchParams.get("technology"), "interconnector", href);
    assert.equal(url.searchParams.has("repd_ref"), false, "an interconnector must never claim a REPD reference: " + href);
    assert.ok(url.searchParams.get("latitude") && url.searchParams.get("longitude"), href);
  }
  await page.locator('#tech [data-technology="all"]').click();
  await page.waitForFunction(() => document.getElementById("tbody")?.dataset.total === "7680");
  assert.equal(await page.locator("#tbody tr").count(), 20);

  assert.equal(await page.locator("#v1").innerText(), "356,474");
  assert.equal(await page.locator("#v2").innerText(), "7,680");
  assert.equal(await page.locator("#v3").innerText(), "4,100");
  assert.equal(await page.locator("#stories .story").count(), 133);

  assert.equal(await clickCount(page, "UK"), 45);
  assert.ok(await page.locator("#stories").innerText().then((text) => text.includes("Beacon Fen Energy Park development consent decision announced")));
  assert.ok(await page.locator("#stories").innerText().then((text) => !text.includes("New Jersey")));

  assert.equal(await clickCount(page, "INTERNATIONAL"), 19);
  const international = await page.locator("#stories").innerText();
  assert.match(international, /New Jersey/);
  assert.match(international, /County Kerry, Ireland/);
  assert.match(international, /Australia/);
  assert.doesNotMatch(international, /Kintore/);
  assert.doesNotMatch(international, /Canadian Solar says patent dispute/);
  assert.doesNotMatch(international, /Wilton International, Greystones Road/);
  assert.doesNotMatch(international, /Longhedge Solar Farm/);
  assert.match(international, /published decision ledger/);
  assert.doesNotMatch(international, /REPD \d/);

  assert.equal(await clickCount(page, "US"), 4);
  const us = await page.locator("#stories").innerText();
  assert.match(us, /New Jersey/);
  assert.doesNotMatch(us, /County Kerry/);

  assert.equal(await clickCount(page, "EUROPE"), 9);
  const europe = await page.locator("#stories").innerText();
  assert.match(europe, /County Kerry, Ireland/);
  assert.match(europe, /Germany BESS/);
  assert.doesNotMatch(europe, /New Jersey/);
  await context.close();

  for (const width of [390, 430, 440, 768]) {
    const mobile = await pageAt(browser, width);
    /* Seven columns were hidden below 768 px since 202609051100 - COUNTY, OPERATOR,
       REPD REF, GLOBALGRID REF and REPD UPDATED among them. The architect asked for
       them back; pipelinenews_intelligence/202608312339 shows thirteen at this width.
       "Visible" is computed display, not a class name. */
    if (width <= 768) {
      const visible = await mobile.page.evaluate(() =>
        [...document.querySelectorAll("thead th")].filter((th) => getComputedStyle(th).display !== "none").length);
      assert.ok(visible >= 11, `only ${visible} columns visible at ${width}px; REPD REF, GLOBALGRID REF and REPD UPDATED must show`);
      const pageWidens = await mobile.page.evaluate(() =>
        document.documentElement.scrollWidth > document.documentElement.clientWidth + 1);
      assert.equal(pageWidens, false, "the table scrolls inside .tablewrap; the page itself must not widen");
    }
    const layout = await mobile.page.evaluate(() => {
      const wrap = document.querySelector(".tablewrap");
      const table = wrap.querySelector("table");
      return {
        clientWidth: document.documentElement.clientWidth,
        scrollWidth: document.documentElement.scrollWidth,
        wrapClientWidth: wrap.clientWidth,
        wrapScrollWidth: wrap.scrollWidth,
        overflowX: getComputedStyle(wrap).overflowX,
        tableDisplay: getComputedStyle(table).display,
        columns: table.tHead.rows[0].cells.length,
        displays: [...table.tHead.rows[0].cells].map((cell) => getComputedStyle(cell).display),
      };
    });
    assert.ok(layout.scrollWidth <= layout.clientWidth, `${width}px document overflow`);
    assert.equal(layout.overflowX, "auto");
    /* THIS ASSERTION USED TO READ:
         assert.ok(layout.wrapScrollWidth > layout.wrapClientWidth, ...)
       — the table MUST be wider than its wrapper, at every phone width. It was
       the same mistake as the eleven-column one below, stated as a width: it
       required the overflow that put the MAP button off the screen, so no fix
       to that overflow could ever pass. With the five desktop-only columns
       hidden the table is 588 px, which still overflows at 390-440 px and now
       fits at 768 px, and fitting is the better outcome, not a regression.

       What the page actually owes the reader is that any overflow is absorbed
       by the table's own wrapper and never by the document — a page that
       scrolls sideways as a whole is the failure this was groping at — and
       that where the wrapper does overflow, it can be swiped. */
    assert.ok(layout.wrapScrollWidth >= layout.wrapClientWidth, `${width}px wrapper geometry`);
    if (layout.wrapScrollWidth > layout.wrapClientWidth) {
      const swiped = await mobile.page.locator(".tablewrap").evaluate((wrap) => {
        wrap.scrollLeft = wrap.scrollWidth;
        const reached = wrap.scrollLeft;
        wrap.scrollLeft = 0;
        return reached;
      });
      assert.ok(swiped > 0, `${width}px overflowing table does not accept a horizontal swipe`);
    }
    assert.equal(layout.tableDisplay, "table");
    assert.equal(layout.columns, 11);
    /* THIS ASSERTION USED TO READ:
         assert.ok(layout.displays.every((display) => display === "table-cell"));
       — every one of the eleven columns displayed on a phone. It was green on
       every run, and it was pinning the defect. With all eleven columns shown
       and the 1280 px table minimum applying at every width, the ACTIONS
       column's MAP anchor was drawn with its left edge 763 px past the right
       edge of a 393 px viewport, and document.elementFromPoint() at its centre
       returned null: the primary control of this page was unreachable on the
       device most readers use, and this check certified that state as correct.
       Reported by the architect 2026-09-05 on a real iPhone in portrait.

       What replaces it is the contract v7.css has always had below 769 px and
       that v9.6.1 overrode: the five .hide-mobile columns are hidden, the six
       that carry the facts a phone reader needs are shown, and the row's own
       .project-meta and .mobile-extra lines carry what the hidden columns held.
       Where the MAP control actually lands, and whether a thumb can hit it, is
       measured in tests/browser_map_reachability_v9_7.mjs — because a display
       value is not a position, and it was the position that was wrong. */
    /* 202609061329 REVERSES THE TWO LINES THAT USED TO FOLLOW:
         assert.equal(hidden, 5);  assert.equal(visible, 6);
       The architect asked for the columns back - REPD REF, GLOBALGRID REF and
       REPD UPDATED were named - and pipelinenews_intelligence/202608312339 shows
       thirteen on this viewport. So all eleven are shown again.

       The defect the old contract was defending against was REAL and it is not
       being re-opened: with a 1280 px table minimum and no pinned ACTIONS column,
       MAP sat 763 px off-screen. Two things now hold it in place - the ACTIONS
       column is pinned to the right edge, and any overflow is swiped inside
       .tablewrap, asserted above - and whether a thumb can actually hit MAP is
       measured where a position can be measured, in
       tests/browser_map_reachability_v9_7.mjs, which runs after this file. A
       display value is not a position; both are gated, separately. */
    const hidden = layout.displays.filter((display) => display === "none").length;
    assert.equal(hidden, 0, `${width}px: no column may be hidden on a phone - ${hidden} are`);
    assert.equal(layout.displays.length, 11, `${width}px: all eleven columns are shown`);
    assert.equal(await clickCount(mobile.page, "INTERNATIONAL"), 19);
    await mobile.context.close();
  }
} finally {
  await browser.close();
}

console.log("V9.8 browser smoke: PASS (interconnectors tab, committed regional ledger, frozen UK and mobile table)");

Check V9 8

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

testglobalgrid2050 / uk_renewables_pipeline/202609071221/tests/check_v9_8.mjs · lines 1–140 of 140 · version 2026-09-07 12:21

What it does
It tests interconnectors, the REPD register and cables. Defines text, json, sha256. 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, cables.
Inputs & outputs
In: JSON file interconnectors.v9.8.json; JSON file interconnectors_manifest.json; JSON file build_manifest.json.
Downstream impact
Used directly by 1 file: Run V9 8 (globalgrid2050).
What it achieves
It is built from the text step (`text`), the JSON step (`json`) and the sha256 step (`sha256`). The interconnector tab, proven from the bytes.
Why it matters
Checked by Run V9 8.
Application
globalgrid2050 · uk_renewables_pipeline/202609071221/tests · JavaScript module
Uses
Atlas Interconnector Link V9 8 (new URL import.meta.url), Atlas Receiver V9 7 (new URL import.meta.url), node:assert/strict, node:crypto, node:fs/promises, node:url, node:path
Used by
run by Run V9 8 (script call)
Produces
text, json, sha256
Defines here
text, json, sha256
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/202609071221/tests/check_v9_8.mjs:1-140 · blob 7706ea56f0898a4fed909858bfaeceee70f869c6 · 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_8.mjs - the interconnector tab, proven from the bytes.
 *
 * Three things, each of which was a way this could have shipped wrong:
 *   1. The data product is what the pinned fixtures build - rebuilt here in
 *      memory and compared byte for byte, so a hand edit to data/v9.8 fails.
 *   2. Every row's MAP link is built with the page's own function, carries the
 *      link's identity and technology, puts a coordinate in only when the
 *      record holds one, and targets the canonical receiver and nothing else.
 *   3. The REPD spine is untouched: 7,680 records, the same partitions and
 *      hashes as the parent, and no interconnector inside it.
 *
 * Run: node tests/check_v9_8.mjs
 */
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import { dirname, join } from "node:path";

const HERE = dirname(fileURLToPath(import.meta.url));
const RELEASE = join(HERE, "..");
const PARENT = join(RELEASE, "..", "202609061329");
const text = (p) => readFile(p, "utf8");
const json = async (p) => JSON.parse(await text(p));
const sha256 = (s) => createHash("sha256").update(s).digest("hex");

const builder = await import(new URL("../scripts/build/interconnectors-v9-8.mjs", import.meta.url).href);
const link = await import(new URL("../scripts/core/atlas-interconnector-link-v9-8.js", import.meta.url).href);
const receiver = await import(new URL("../scripts/core/atlas-receiver-v9-7.js", import.meta.url).href);

const contract = await json(join(RELEASE, "contracts", "interconnectors.v9.8.json"));
const manifest = await json(join(RELEASE, "data", "v9.8", "interconnectors_manifest.json"));
const partitionText = await text(join(RELEASE, manifest.partition.path));
const partition = JSON.parse(partitionText);

// 1. the product is the build of the pinned fixtures
assert.equal(manifest.schema, builder.MANIFEST_SCHEMA);
assert.equal(partition.schema, builder.SCHEMA);
assert.equal(sha256(partitionText), manifest.partition.sha256, "partition sha256 must match its manifest");
for (const [key, source] of Object.entries(builder.SOURCES)) {
  const bytes = await readFile(join(RELEASE, source.path));
  assert.equal(sha256(bytes), source.sha256, `${key}: fixture bytes are not the pinned blob`);
}
const cables = builder.parseCsv(await text(join(RELEASE, builder.SOURCES.cables_csv.path)));
const endpoints = await json(join(RELEASE, builder.SOURCES.endpoints.path));
const geojson = await json(join(RELEASE, builder.SOURCES.geojson.path));
const rebuilt = builder.buildRecords({ cables, endpoints, geojson });
assert.deepEqual(partition.records, rebuilt, "data/v9.8/interconnectors.json is not what the fixtures build");

// the contract's expected figures
assert.equal(partition.records.length, contract.expected.record_count);
assert.equal(manifest.record_count, contract.expected.record_count);
assert.equal(manifest.capacity_mw, contract.expected.capacity_mw);
assert.equal(manifest.largest_mw, contract.expected.largest_mw);
for (const key of ["operational", "future", "geometry_valid", "geometry_gb_end_only", "geometry_missing"]) {
  assert.equal(manifest[key], contract.expected[key], `manifest ${key}`);
}
const refs = new Set(partition.records.map((r) => r.repd_ref));
assert.equal(refs.size, partition.records.length, "refs unique");
for (const record of partition.records) {
  assert.equal(record.technology, "interconnector");
  assert.match(record.repd_ref, /^IC-[A-Z0-9-]+$/);
  assert.equal(record.gg_project_id, `GG2050-${record.repd_ref}`);
  if (record.geometry_status === "valid") {
    assert.equal(record.anchor_kind, "MIDPOINT_LABEL_ANCHOR");
    assert.ok(record.span && record.span.straight_line_km > 0);
    assert.ok(record.gb_end && record.far_end);
  } else if (record.geometry_status === "gb_end_only") {
    assert.equal(record.anchor_kind, "GB_CONVERTER");
    assert.equal(record.longitude, record.gb_end.longitude);
    assert.equal(record.latitude, record.gb_end.latitude);
  } else {
    assert.equal(record.geometry_status, "missing");
    assert.equal(record.longitude, null);
    assert.equal(record.latitude, null);
  }
}
// the named spans, as measured
const britned = partition.records.find((r) => r.bmrs_code === "INTNED");
assert.equal(britned.span.straight_line_km, 234.9);
assert.equal(britned.geometry_status, "valid");
const eleclink = partition.records.find((r) => r.bmrs_code === "INTELEC");
assert.equal(eleclink.span.straight_line_km, 59.93);

// 2. every MAP link, with the page's own builder
const route = receiver.atlasReceiverV9_7();
assert.equal(route, contract.canonical_receiver, "the canonical receiver is the compiled contract's");
let linked = 0;
let unlinked = 0;
for (const record of partition.records) {
  const href = link.buildAtlasInterconnectorLinkV9_8(record);
  if (record.geometry_status === "missing") {
    assert.equal(href, "", `${record.name}: no coordinate held, so no link`);
    assert.match(link.interconnectorMapUnavailableReasonV9_8(record), /no converter coordinates/);
    unlinked += 1;
    continue;
  }
  linked += 1;
  const url = new URL(href);
  assert.equal(`${url.origin}${url.pathname}`, route.replace(/\/+$/u, "") + "/", `${record.name}: receiver`);
  assert.equal(url.searchParams.get("interconnector"), record.bmrs_code, `${record.name}: identity is the BMRS code`);
  assert.equal(url.searchParams.get("technology"), "interconnector");
  assert.equal(url.searchParams.get("project"), record.name);
  assert.equal(Number(url.searchParams.get("capacity_mw")), record.capacity_mw);
  assert.equal(Number(url.searchParams.get("latitude")), record.latitude, `${record.name}: THIS record's latitude`);
  assert.equal(Number(url.searchParams.get("longitude")), record.longitude);
  assert.equal(url.searchParams.get("anchor"), record.geometry_status === "valid" ? "midpoint" : "gb_converter");
  assert.equal(url.searchParams.get("zoom"), record.geometry_status === "valid" ? "7" : "10");
  assert.equal(url.searchParams.has("repd_ref"), false, `${record.name}: an interconnector must never claim a REPD reference`);
  assert.ok(link.interconnectorMapNoteV9_8(record).length > 20);
}
assert.equal(linked, contract.expected.geometry_valid + contract.expected.geometry_gb_end_only);
assert.equal(unlinked, contract.expected.geometry_missing);

// 3. the REPD spine is untouched
const spine = await json(join(RELEASE, "data", "v9.1", "build_manifest.json"));
const parentSpine = await json(join(PARENT, "data", "v9.1", "build_manifest.json"));
assert.deepEqual(spine, parentSpine, "the v9.1 spine manifest must be byte-identical to the parent's");
assert.equal(spine.project_count, 7680);
let spineRows = 0;
for (const part of spine.project_partitions) {
  const doc = JSON.parse(await text(join(RELEASE, part.path)));
  assert.equal(sha256(await text(join(RELEASE, part.path))), part.sha256, `${part.path} hash`);
  for (const project of doc.projects) {
    assert.notEqual(project.technology, "interconnector", `${project.repd_ref}: an interconnector inside the REPD spine`);
    assert.doesNotMatch(String(project.repd_ref), /^IC-/);
  }
  spineRows += doc.projects.length;
}
assert.equal(spineRows, 7680);

// the page itself carries the tab and loads the v9.8 app
const html = await text(join(RELEASE, "index.html"));
assert.match(html, /data-technology="interconnector"[^>]*>INTERCONNECTORS</);
assert.match(html, /scripts\/app-v9-8\.js/);
assert.match(html, /UK RENEWABLES PIPELINE 202609071221/);
assert.doesNotMatch(html, /202609061329\/index|app-v9-7\.js/);

console.log(`check_v9_8: ${partition.records.length} interconnectors (${manifest.operational} operational, ${manifest.future} future), `
  + `${linked} MAP links built, ${unlinked} honest NO MAP; REPD spine 7,680 untouched`);

Run V9 8

A shell script in the tests folder of GlobalGrid2050 that tests interconnectors and the Renewable Energy Planning Database (REPD) register. It is built from the is changed helper (`is_changed`).

testglobalgrid2050 / uk_renewables_pipeline/202609071221/tests/run_v9_8.sh · lines 1–109 of 109 · version 2026-09-07 12:21 · Entry point · pattern is_changed (shared by 3 files)

What it does
It tests interconnectors and the REPD register. Defines is_changed. Side effects: makes network requests; 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, the REPD register. README: "its REPD spine, fixtures and every inherited module are carried byte-for-byte and proven so by `tests/run_v9_8.sh`."
Downstream impact
It is itself an entry point (shell script); no other file was found loading it.
What it achieves
The README says: Its REPD spine, fixtures and every inherited module are carried byte-for-byte and proven so by `tests/run_v9_8.sh`.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · uk_renewables_pipeline/202609071221/tests · shell script
Uses
Check V9 8 (script call), Browser Smoke V9 8 (script call)
Used by
none found
Produces
is_changed
Defines here
is_changed
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/202609071221/tests/run_v9_8.sh:1-109 · blob ce1c4a1eecf899c4445bb9b03350a2103c66a4d4 · GitHub at these lines
State
achieves: readme · context: readme_derived · stage: ingest · effects: network, process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
#!/usr/bin/env bash
set -euo pipefail

HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
V98="$(cd "$HERE/.." && pwd)"
V97="$(cd "$V98/../202609061329" && pwd)"
ROOT="$(cd "$V98/../.." && pwd)"

# The frozen parent, by tree. If 202609061329 changes under this release, this
# release's claims about what it inherited are void.
test "$(git -C "$ROOT" rev-parse 'HEAD:uk_renewables_pipeline/202609061329')" = "42f0ebde853eb84236593ac7d455107e069ddeeb"

# The REPD spine and its fixtures are the parent's, byte for byte. v9.8 is the
# interconnector product and its three pinned inputs, and is checked separately.
diff -qr -x __pycache__ -x '*.pyc' -x v9.8 "$V97/data" "$V98/data"
diff -qr -x __pycache__ -x '*.pyc' -x v9.8 "$V97/fixtures" "$V98/fixtures"

# WHAT V9.8 CHANGES FROM ITS FROZEN PARENT, NAMED ONE FILE AT A TIME.
# Every file below must differ from the parent or be new; a stale entry fails.
CHANGED_FROM_PARENT=(
  # 202609071221 - the release states its own identity, carries the
  # INTERCONNECTORS tab, and loads the v9.8 app.
  index.html
  # 202609071221 - the runner for this release.
  tests/run_v9_8.sh
  # 202609071221 - the interconnector product, its builder, loader, link
  # module, plugin and app entry are new files; the parity list below still
  # holds for every inherited module, none of which is edited.
  scripts/app-v9-8.js
  scripts/plugins/projects-v9-8.js
  scripts/data/interconnectors-v9-8.js
  scripts/core/atlas-interconnector-link-v9-8.js
  scripts/build/interconnectors-v9-8.mjs
  tests/check_v9_8.mjs
  tests/browser_smoke_v9_8.mjs
  contracts/interconnectors.v9.8.json
  CHANGES.md
  README.md
)
is_changed() {
  local needle="$1"
  for entry in "${CHANGED_FROM_PARENT[@]}"; do
    [[ "$entry" == "$needle" ]] && return 0
  done
  return 1
}

while IFS= read -r style; do
  relative="styles/$(basename "$style")"
  is_changed "$relative" || diff -q "$V97/$relative" "$V98/$relative"
done < <(find "$V98/styles" -maxdepth 1 -type f -name '*.css' | sort)

# Inherited modules that must be byte-identical to the parent. projects-v9-5-1
# is on this list on purpose: v9.8 derives projects-v9-8.js from it and leaves
# the original untouched, so the parent's app would still run from these bytes.
for relative in \
  scripts/app-v9-7.js \
  scripts/core/atlas-receiver-v9-7.js \
  scripts/core/project-filter-v9-2.js \
  scripts/data/canonical-projects-v9-1.js \
  scripts/data/canonical-projects-v9-5-1.js \
  scripts/plugins/gauges-v9-2.js \
  scripts/plugins/projects-v9-5-1.js \
  scripts/plugins/newspaper-v9-7.js \
  scripts/plugins/capacity-presentation-v9-3.js \
  tests/check_map_contract_all_rows.mjs \
  tests/check_v9_7.mjs; do
  is_changed "$relative" || diff -q "$V97/$relative" "$V98/$relative"
done

for relative in "${CHANGED_FROM_PARENT[@]}"; do
  test -f "$V98/$relative"
  if [[ -f "$V97/$relative" ]]; then
    ! diff -q "$V97/$relative" "$V98/$relative" >/dev/null
  fi
done

# The data product is rebuilt from its pinned fixtures and must not move.
node "$V98/scripts/build/interconnectors-v9-8.mjs"
git -C "$ROOT" diff --exit-code -- "uk_renewables_pipeline/$(basename "$V98")/data/v9.8"
node "$HERE/check_v9_8.mjs"
# Every REPD MAP button, not a sample: 7,680 hrefs with the page's own function.
node "$HERE/check_map_contract_all_rows.mjs"

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

if [[ "${V9_BROWSER_SMOKE:-0}" == "1" ]]; then
  browser_base_url="${V9_BASE_URL:-http://127.0.0.1:8765/uk_renewables_pipeline/$(basename "$V98")/}"
  if [[ "$browser_base_url" == http://127.0.0.1:* ]]; then
    python3 -m http.server 8765 --directory "$ROOT" >/tmp/globalgrid2050-v9-8-http.log 2>&1 &
    server_pid=$!
    trap 'kill "$server_pid" 2>/dev/null || true' EXIT
    for _ in {1..20}; do
      if curl --fail --silent --output /dev/null "$browser_base_url"; then break; fi
      sleep 0.25
    done
    curl --fail --silent --output /dev/null "$browser_base_url"
  fi
  V9_BASE_URL="$browser_base_url" node "$HERE/browser_smoke_v9_8.mjs"
  V9_BASE_URL="$browser_base_url" node "$HERE/browser_map_reachability_v9_7.mjs"
  if [[ -n "${server_pid:-}" ]]; then
    kill "$server_pid" 2>/dev/null || true
    trap - EXIT
  fi
fi

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

App V9 9

A JavaScript module in the scripts folder of GlobalGrid2050.

Set aside from the main view: 90% of its lines are the same as uk_renewables_pipeline/202609071221/scripts/app-v9-8.js (globalgrid2050), which stays. (near-copy-of, proposed by families.py). 90% of lines shared with App V9 8; read that one first. All set-aside files, with reasons. Nothing was deleted.

Evidence
  • line-jaccard 0.9 to globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202609071221/scripts/app-v9-8.js:1-28 6e7f8f6fa7477fdfdd68622f2d3588ee6dd794e7
  • sha256 a3fc54b8d145f4e43ab77301edc11651c1f9cc8dd78de78b2301a58c84a8ab34
  • target sha256 060c0d46d84847b602a51cd4e985185a0014251c8cf17779d8f9dab9615f8f96
  • group of 2 (identity.json near-copy edges >= 0.9)
  • canonical rule: reachable, newest stamp, core repo, most lines

otherglobalgrid2050 / uk_renewables_pipeline/202609081016/scripts/app-v9-9.js · lines 1–28 of 28 · version 2026-09-08 10:16 · Not reached from any entry point (candidate for review)

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.
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
No other file in the estate was found to import it.
Application
globalgrid2050 · uk_renewables_pipeline/202609081016/scripts · JavaScript module
Uses
Gauges V9 2 (import), Newspaper V9 7 (import), Projects V9 9 (import), Plugin Host (import)
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202609081016/scripts/app-v9-9.js:1-28 · blob b2d9de67aa2f5b3ebd45c410f19d23b4dccfa20b · 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: unreached_review
import { initialiseGaugesV9_2 } from "./plugins/gauges-v9-2.js";
import { bindNewspaperV9_7, loadNewsV9_7 } from "./plugins/newspaper-v9-7.js";
import {
  bindProjectControlsV9_8,
  loadProjectsV9_8,
  refreshProjectsV9_8,
} from "./plugins/projects-v9-9.js";
import { startPlugins } from "./core/plugin-host.js";

startPlugins([
  { id: "gauges", start: initialiseGaugesV9_2 },
  {
    id: "newspaper",
    dependsOn: ["gauges"],
    start() {
      bindNewspaperV9_7(refreshProjectsV9_8);
      loadNewsV9_7();
    },
  },
  {
    id: "projects",
    dependsOn: ["gauges", "newspaper"],
    start() {
      bindProjectControlsV9_8();
      loadProjectsV9_8();
    },
  },
]);