In this section
- Browser Smoke V9 7 test · globalgrid2050 / uk_renewables_pipeline/v9.7/tests/browser_smoke_v9_7.mjs lines 1–101
- Check V9 5 1 test · globalgrid2050 / uk_renewables_pipeline/v9.7/tests/check_v9_5_1.mjs lines 1–271
- Check V9 7 test · globalgrid2050 / uk_renewables_pipeline/v9.7/tests/check_v9_7.mjs lines 1–159
- Run V9 7 test · globalgrid2050 / uk_renewables_pipeline/v9.7/tests/run_v9_7.sh lines 1–105
Browser Smoke V9 7
A JavaScript module in the tests folder of GlobalGrid2050 that tests solar. It is built from the page at helper (`pageAt`) and the click count helper (`clickCount`).
testglobalgrid2050 / uk_renewables_pipeline/v9.7/tests/browser_smoke_v9_7.mjs · lines 1–101 of 101 · Entry point · pattern clickCount (shared by 4 files)
- What it does
- It tests solar. Defines pageAt, clickCount. Uses libraries node:assert/strict, node:module, playwright. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage upstream_foresight (path word 'renewables'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: solar.
- Downstream impact
- Used directly by 2 files: Run V9 7 (globalgrid2050); GlobalGrid2050 Deploy Pages Workflow (globalgrid2050). Reached from 1 other entry point, including GlobalGrid2050 V9 7 Validate Workflow (globalgrid2050).
- What it achieves
- Defines `pageAt` and `clickCount`.
- Why it matters
- Run by GlobalGrid2050 Deploy Pages Workflow. Checked by Run V9 7.
- Application
- globalgrid2050 · uk_renewables_pipeline/v9.7/tests · JavaScript module
- Uses
- node:assert/strict, node:module, playwright
- Used by
- run by Run V9 7 (script call), run by GlobalGrid2050 Deploy Pages Workflow (workflow run)
- 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/v9.7/tests/browser_smoke_v9_7.mjs:1-101 · blob 57d583b08ceaed7b75505f03874f248969412dab · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
import 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/v9.7/";
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" });
await page.waitForFunction(() => (
document.querySelectorAll("#tbody tr").length === 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(), 7680);
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);
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");
assert.ok(layout.wrapScrollWidth > layout.wrapClientWidth, `${width}px table is not horizontally scrollable`);
assert.equal(layout.tableDisplay, "table");
assert.equal(layout.columns, 11);
assert.ok(layout.displays.every((display) => display === "table-cell"));
assert.equal(await clickCount(mobile.page, "INTERNATIONAL"), 19);
await mobile.context.close();
}
} finally {
await browser.close();
}
console.log("V9.7 browser smoke: PASS (committed regional ledger, frozen UK and mobile table)");Check V9 5 1
A JavaScript module in the tests folder of GlobalGrid2050 that tests major project news, using SHA-256 and uses data from the GridAtlas repository.
testglobalgrid2050 / uk_renewables_pipeline/v9.7/tests/check_v9_5_1.mjs · lines 1–271 of 271 · Not reached from any entry point (candidate for review) · pattern gitTree (shared by 16 files)
- What it does
- It tests major project news and the REPD register. Defines readText, readJson, sha256, gitBlob, gitTree. Uses libraries node:assert/strict, node:child_process, node:crypto, node:fs/promises, node:url. Side effects: changes the web page (DOM); reads or writes files; 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: the REPD register.
- Inputs & outputs
- In: data source: gridatlas data; JSON file release.v9.5.1.json; JSON file release.v9.5.json; JSON file release.v9.1.json; JSON file v9_manifest.json; JSON file build_manifest.json; JSON file major_project_news_v9_5_1.json.
- What it achieves
- It reads text (`readText`) and reads JSON (`readJson`). Defines `readText`, `readJson`, `sha256` and 2 more. It reads `contracts/release.v9.5.1.json`.
- Why it matters
- No other file in the estate was found to import it.
- Application
- globalgrid2050 · uk_renewables_pipeline/v9.7/tests · JavaScript module
- Uses
- Projects V9 5 1 (script call), Atlas Receiver V9 7 (script call), Project Filter V9 2 (import), UK Renewables Pipeline — V9 7 Page (new URL import.meta.url), GridAtlas — Atlas Page (estate URL), node:assert/strict, node:child_process, node:crypto, node:fs/promises, node:url
- Used by
- none found
- Produces
- readText, readJson, sha256, gitBlob, gitTree
- Defines here
- readText, readJson, sha256, gitBlob, gitTree
- 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/v9.7/tests/check_v9_5_1.mjs:1-271 · blob fdd378349bfdb98004456c4379a944b80cb2beff · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: duplicate_candidate
import assert from "node:assert/strict";
import { execFileSync } from "node:child_process";
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import {
buildProjectSearchTextV9_2,
projectMatchesV9_2,
summariseProjectsV9_2,
tokeniseSearchV9_2,
} from "../scripts/core/project-filter-v9-2.js";
import { atlasUrlV9_5_1, compareProjectUpdatesV9_5_1 } from "../scripts/plugins/projects-v9-5-1.js";
import {
atlasCentresOnRepdPointV9_7,
atlasReceiverV9_7,
isRetiredReceiverV9_7,
primeAtlasReceiverV9_7,
} from "../scripts/core/atlas-receiver-v9-7.js";
/* The deep-link contract, as the engine publishes it. Held here as the test's
own input so every branch runs with no network; the live file is audited
separately by Ventusltd/testcode drivers/link-targets.mjs, which reads
ventus-grid-engine/deeplink/receivers.json rather than restating it. */
const RECEIVER_CONTRACT = {
schema: "ventus.grid-engine.deeplink-receivers.v1",
canonical: { id: "gridatlas-v9", route: "https://ventusltd.github.io/gridatlas/atlas/", carries_engine: true },
/* A synthetic retired route. This fixture only needs SOMETHING retired to
exercise the refusal branch, and naming the estate's real dead route in a
test keeps a copy of it alive for the next person to copy. */
retired: [{ id: "synthetic-retired-receiver", route: "https://retired.invalid/no-engine/", carries_engine: false }],
};
const base = new URL("../", import.meta.url);
const root = new URL("../../../", import.meta.url);
const rootPath = fileURLToPath(root);
const readText = (path) => readFile(new URL(path, base), "utf8");
const readJson = async (path) => JSON.parse(await readText(path));
const sha256 = (value) => createHash("sha256").update(value).digest("hex");
const gitBlob = (path) => execFileSync("git", ["-C", rootPath, "hash-object", path], { encoding: "utf8" }).trim();
const gitTree = (revisionPath) => execFileSync("git", ["-C", rootPath, "rev-parse", revisionPath], { encoding: "utf8" }).trim();
const contract = await readJson("contracts/release.v9.5.1.json");
const parentContract = await readJson("contracts/release.v9.5.json");
const dataContract = await readJson("contracts/release.v9.1.json");
const releaseManifest = await readJson("data/v9_manifest.json");
const payload = await readJson("data/v9.1/build_manifest.json");
const projectParts = await Promise.all(payload.project_partitions.map(({ path }) => readJson(path)));
const projects = projectParts.flatMap((part) => part.projects);
const news = JSON.parse(await readFile(new URL("dist/major_project_news_v9_5_1.json", root), "utf8"));
assert.equal(contract.release, "9.5.1");
assert.equal(contract.frozen_parent.release, "9.5");
assert.equal(contract.frozen_parent.commit, "3acd56386d0bf2952f8f26754d615d20a7345e35");
assert.equal(contract.frozen_parent.subtree, "c4024d08340528a57f7b890a1d96a0ca0a343916");
assert.equal(contract.frozen_parent.tree_listing_sha256, "ddb147828316c7fba73cd7af4c7bb5c63280fb77b5410a66483b9618d460e15e");
assert.equal(contract.frozen_parent.must_remain_unchanged, true);
assert.equal(gitTree("HEAD:uk_renewables_pipeline/v9.5"), contract.frozen_parent.subtree, "V9.5 subtree changed while building V9.5.1");
assert.equal(gitTree("HEAD:uk_renewables_pipeline/v9.4"), contract.frozen_v9_4.subtree, "V9.4 subtree changed while building V9.5.1");
assert.equal(contract.data_parent.release, "9.1");
assert.equal(contract.data_parent.data_changed, false);
assert.equal(parentContract.release, "9.5");
assert.equal(dataContract.release, "9.1");
assert.equal(releaseManifest.version, "9.5.1");
assert.ok(["CANDIDATE", "LIVE_VALIDATED"].includes(releaseManifest.status));
assert.equal(releaseManifest.frozen_v9_5_commit, contract.frozen_parent.commit);
assert.equal(releaseManifest.frozen_v9_5_subtree, contract.frozen_parent.subtree);
assert.equal(contract.ui_contract.first_click, "updated_desc");
assert.equal(contract.ui_contract.second_click, "updated_asc");
assert.equal(contract.ui_contract.aria_sort_default, "none");
assert.equal(contract.ui_contract.aria_sort_newest, "descending");
assert.equal(contract.ui_contract.aria_sort_oldest, "ascending");
assert.equal(contract.ui_contract.project_table_columns, 11);
assert.equal(contract.news_contract.all_headline_count, 133);
assert.equal(contract.news_contract.relevant_headline_count, 45);
assert.equal(contract.news_contract.v9_4_baseline_headline_count, 125);
assert.equal(contract.news_contract.relevant_filter_is_functional, true);
assert.equal(contract.news_contract.discovery_only_drives_project_signal, false);
assert.equal(contract.news_contract.beacon_fen.repd_ref, "13599");
assert.equal(contract.news_contract.beacon_fen.official_capacity_mw, 400);
const frozenV92Blobs = {
"uk_renewables_pipeline/v9/scripts/core/project-filter-v9-2.js": "dceee01d0f51e85b071aef275250c1fb223eeba7",
"uk_renewables_pipeline/v9/scripts/core/news-relevance-v9-2.js": "f8374bfd6f0c47e98ca1e7f2f3312c9281a34e8a",
"uk_renewables_pipeline/v9/scripts/data/canonical-projects-v9-2.js": "e3d9b7bb0f39b813cf3b1f125467efbd6a021dda",
"uk_renewables_pipeline/v9/scripts/plugins/gauges-v9-2.js": "1d081d2d9e1630912b912953cf18f431754f9e19",
"uk_renewables_pipeline/v9/scripts/plugins/newspaper-v9-2.js": "6c72de9e9bd8f41bf525a32ca2436e53ddb466b0",
"uk_renewables_pipeline/v9/scripts/plugins/projects-v9-2.js": "0e222ea75e9db8dc3e9f1e829a15ac3ee1ca0acf",
"uk_renewables_pipeline/v9/styles/v9-2.css": "f4ac1a09145b0f4824e333ac2acbc767d84f2da6",
};
for (const [path, expected] of Object.entries(frozenV92Blobs)) {
assert.equal(gitBlob(path), expected, `${path} changed after the frozen V9.2 checkpoint`);
}
assert.equal(payload.project_count, 7680);
assert.equal(payload.capacity_mw, 356474.09);
assert.equal(payload.largest_mw, 4100);
assert.equal(payload.geometry_count, 7652);
assert.equal(payload.missing_geometry_count, 28);
assert.equal(payload.solar_count, 3563);
assert.equal(payload.bess_count, 1609);
assert.equal(payload.wind_onshore_count, 2399);
assert.equal(payload.wind_offshore_count, 109);
assert.equal(projects.length, 7680);
assert.equal(new Set(projects.map((project) => project.repd_ref)).size, 7680);
assert.ok(projects.every((project) => project.capacity_mw >= 1));
assert.deepEqual(summariseProjectsV9_2(projects), { count: 7680, capacity_mw: 356474.09, largest_mw: 4100 });
const datedProjects = projects.filter((project) => project.repd_record_updated);
const undatedProjects = projects.filter((project) => !project.repd_record_updated);
assert.ok(datedProjects.length > 1);
assert.ok(datedProjects.every((project) => /^\d{4}-\d{2}-\d{2}$/.test(project.repd_record_updated)));
const newestFirst = [...projects].sort((left, right) => compareProjectUpdatesV9_5_1(left, right, "desc"));
const oldestFirst = [...projects].sort((left, right) => compareProjectUpdatesV9_5_1(left, right, "asc"));
assert.ok(newestFirst[0].repd_record_updated >= newestFirst[1].repd_record_updated);
assert.ok(oldestFirst[0].repd_record_updated <= oldestFirst[1].repd_record_updated);
if (undatedProjects.length) {
assert.equal(newestFirst.at(-1).repd_record_updated, null);
assert.equal(oldestFirst.at(-1).repd_record_updated, null);
}
const berwick = projects.find((project) => project.repd_ref === "9873");
assert.ok(berwick);
const searchText = buildProjectSearchTextV9_2(berwick);
assert.equal(projectMatchesV9_2(berwick, {
technology: "wind_offshore",
status: "All",
county: "All",
tokens: tokeniseSearchV9_2("GG2050-REPD-9873 Berwick"),
}, searchText), true);
assert.equal(projectMatchesV9_2(berwick, {
technology: "solar",
status: "All",
county: "All",
tokens: [],
}, searchText), false);
/* Before the contract is read there is no receiver, so there is no link. This
is asserted FIRST because it is the branch that must never fall back to a
route someone typed: on 2026-09-05 every MAP link in this app was measured
pointing at a receiver carrying zero engine cartridges, and a fallback is how
that would come back. */
assert.equal(atlasUrlV9_5_1(berwick), "", "no contract read yet, so no link may be built");
assert.equal(primeAtlasReceiverV9_7(RECEIVER_CONTRACT), RECEIVER_CONTRACT.canonical.route);
assert.equal(atlasReceiverV9_7(), RECEIVER_CONTRACT.canonical.route);
const validAtlas = new URL(atlasUrlV9_5_1(berwick));
assert.equal(validAtlas.origin + validAtlas.pathname, "https://ventusltd.github.io/gridatlas/atlas/");
assert.equal(isRetiredReceiverV9_7(validAtlas.origin + validAtlas.pathname), false);
assert.equal(validAtlas.searchParams.get("repd_ref"), "9873");
assert.equal(validAtlas.searchParams.get("technology"), "wind_offshore");
assert.equal(validAtlas.searchParams.get("latitude"), String(berwick.latitude));
/* A record REPD published no coordinate for is still linkable: the contract
requires only repd_ref, and the canonical receiver resolves the project from
it -- measured live on REPD 13429, which arrives and names itself. It used to
return "", which rendered a button that silently did nothing. */
const missingGeometry = projects.find((project) => project.geometry_status !== "valid");
assert.ok(missingGeometry);
assert.equal(atlasCentresOnRepdPointV9_7(missingGeometry), false);
const refOnly = new URL(atlasUrlV9_5_1(missingGeometry));
assert.equal(refOnly.origin + refOnly.pathname, "https://ventusltd.github.io/gridatlas/atlas/");
assert.equal(refOnly.searchParams.get("repd_ref"), String(missingGeometry.repd_ref));
assert.equal(refOnly.searchParams.get("latitude"), null);
assert.equal(refOnly.searchParams.get("zoom"), null);
/* A contract that names its own canonical route as retired must fail closed
rather than resolve itself. */
assert.equal(primeAtlasReceiverV9_7({
schema: RECEIVER_CONTRACT.schema,
canonical: { route: RECEIVER_CONTRACT.retired[0].route, carries_engine: true },
retired: RECEIVER_CONTRACT.retired,
}), "");
assert.equal(atlasUrlV9_5_1(berwick), "");
assert.equal(primeAtlasReceiverV9_7(RECEIVER_CONTRACT), RECEIVER_CONTRACT.canonical.route);
assert.equal(news.schema, "globalgrid2050.major-project-news.v9.5.1");
assert.equal(news.all_headline_count, news.all_items.length);
assert.equal(news.relevant_headline_count, news.canonical_items.length);
assert.equal(news.all_items.length, 133);
assert.equal(news.canonical_items.length, 45);
assert.equal(news.v9_4_baseline_headline_count, 125);
assert.ok(news.canonical_items.every((item) => item.role === "PRIMARY_MATCH"));
assert.ok(news.canonical_items.every((item) => item.eligible_for_news_signal === true));
assert.ok(news.canonical_items.every((item) => item.gg_project_id === `GG2050-REPD-${item.repd_ref}`));
assert.equal(news.all_items.filter((item) => item.canonical_relevant).length, 45);
const beacon = news.canonical_items.find((item) => item.headline === "Beacon Fen Energy Park development consent decision announced");
assert.ok(beacon);
assert.equal(beacon.repd_ref, "13599");
assert.equal(beacon.capacity_mw, 400);
assert.equal(beacon.operator, "Low Carbon Limited");
const brecks = news.canonical_items.filter((item) => item.repd_ref === "10087");
assert.ok(brecks.length > 0);
assert.ok(brecks.every((item) => item.gg_development_id));
const html = await readText("index.html");
const mobileCss = await readText("styles/mobile.css");
const additiveCss = await readText("styles/v9-3.css");
const parentAdditiveCss = await readText("styles/v9-2.css");
const headerCss = await readText("styles/v9-4.css");
const responsiveCss = await readText("styles/v9-5-1.css");
const frozenParentCss = await readFile(new URL("uk_renewables_pipeline/v9/styles/v9-3.css", root), "utf8");
const projectsV95 = await readText("scripts/plugins/projects-v9-5-1.js");
const newspaperV95 = await readText("scripts/plugins/newspaper-v9-5-1.js");
const app = await readText("scripts/app-v9-5-1.js");
const rootIndex = await readFile(new URL("index.html", root), "utf8");
const packageJson = await readJson("package.json");
assert.match(html, /UK RENEWABLES PIPELINE V9\.5\.1/);
assert.match(html, />V9\.5\.1 (?:CANDIDATE|LIVE)</);
assert.match(html, /V9\.5 FROZEN APP/);
assert.match(html, /V9\.4 FROZEN APP/);
const styleOrder = [
html.indexOf("styles/v7.css?v=9.5.1"),
html.indexOf("styles/mobile.css?v=9.5.1"),
html.indexOf("styles/v9-3.css?v=9.5.1"),
html.indexOf("styles/v9-4.css?v=9.5.1"),
html.indexOf("styles/v9-5-1.css?v=9.5.1"),
];
assert.ok(styleOrder.every((value) => value >= 0));
assert.ok(styleOrder.every((value, index) => index === 0 || value > styleOrder[index - 1]));
assert.equal((html.match(/<canvas id="g[1-3]"/g) || []).length, 3);
assert.equal((html.match(/<th(?:\s|>)/g) || []).length, 11);
assert.match(html, /<th class="hide-mobile">REPD REF<\/th>/);
assert.match(html, /<th class="hide-mobile">GLOBALGRID REF<\/th>/);
assert.match(html, /id="repdUpdatedHeader" aria-sort="none"/);
assert.match(html, /id="sortUpdated"/);
assert.match(html, /id="updatedSortIndicator"[^>]*>↕<\/span>/);
assert.match(html, /id="sortProjects"/);
assert.match(html, /value="updated_desc"/);
assert.match(html, /value="updated_asc"/);
assert.match(html, /scripts\/app-v9-5-1\.js\?v=9\.5\.1/);
assert.equal(sha256(mobileCss), "9855b9c11255a85f477873d07cca45b057aedcdc8a6cc4aab2d29a0ffaac9b85");
assert.equal(additiveCss, frozenParentCss, "V9.4 changed its inherited V9.3.1 stylesheet copy");
const parentCssPrefix = parentAdditiveCss.trimEnd();
assert.ok(additiveCss.startsWith(parentCssPrefix), "V9.3 additive CSS no longer preserves the complete V9.2 prefix");
assert.match(headerCss, /\.repd-updated-heading button/);
assert.match(headerCss, /#updatedSortIndicator/);
assert.match(headerCss, /focus-visible/);
assert.match(responsiveCss, /@media\s*\(min-width:\s*921px\)\s*and\s*\(max-width:\s*1100px\)/);
assert.match(responsiveCss, /\.header\s*\{[^}]*flex-direction:\s*column[^}]*\}/s);
assert.match(responsiveCss, /\.status\s*\{[^}]*width:\s*100%[^}]*white-space:\s*normal[^}]*\}/s);
assert.match(app, /gauges-v9-2\.js/);
assert.match(app, /projects-v9-5-1\.js/);
assert.match(app, /newspaper-v9-5-1\.js/);
assert.match(projectsV95, /globalgrid2050_uk_renewables_pipeline_v9_5_1_/);
assert.match(projectsV95, /compareProjectUpdatesV9_5_1/);
assert.match(projectsV95, /function updateSortHeader\(\)/);
assert.match(projectsV95, /sortMode === "updated_desc" \? "updated_asc" : "updated_desc"/);
assert.match(projectsV95, /document\.getElementById\("sortUpdated"\)\.onclick/);
assert.match(projectsV95, /header\.setAttribute\("aria-sort", "descending"\)/);
assert.match(projectsV95, /header\.setAttribute\("aria-sort", "ascending"\)/);
assert.match(newspaperV95, /item\.role === "PRIMARY_MATCH"/);
assert.match(newspaperV95, /newsIndex\.get\(String\(project\.repd_ref\)\)/);
assert.match(newspaperV95, /major_project_news_v9_5_1\.json/);
assert.match(newspaperV95, /state\.newsMode === "RELEVANT" && item\.canonical_relevant !== true/);
assert.match(newspaperV95, /payload\.v9_4_baseline_headline_count === 125/);
assert.doesNotMatch(newspaperV95, /normaliseProject\(project\.name\)/);
assert.match(rootIndex, /UK Renewables Pipeline V9\.3\.1/);
assert.match(rootIndex, /UK Renewables Pipeline V9\.4/);
assert.match(rootIndex, /UK Renewables Pipeline V9\.5/);
assert.match(rootIndex, /UK Renewables Pipeline V9\.5\.1/);
assert.equal(packageJson.version, "9.5.1");
assert.equal(packageJson.scripts.validate, "bash tests/run_v9_5_1.sh");
assert.equal(packageJson.scripts["validate:browser"], "V9_BROWSER_SMOKE=1 bash tests/run_v9_5_1.sh");
console.log("V9.5.1: PASS (133 ALL, 45 RELEVANT, Beacon Fen REPD 13599; V9.5/V9.4 frozen)");Check V9 7
A JavaScript module in the tests folder of GlobalGrid2050 that tests regional news sources, news module registry, regional decisions and major project news, using SHA-256.
testglobalgrid2050 / uk_renewables_pipeline/v9.7/tests/check_v9_7.mjs · lines 1–159 of 159 · pattern gitTree (shared by 16 files)
- What it does
- It tests regional news sources, news module registry, regional decisions and major project news. Defines text, json, hash, gitTree. Uses libraries node:assert/strict, node:crypto, node:child_process, node:fs/promises, node:url. Side effects: reads or writes files; 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.
- Inputs & outputs
- In: JSON file release.v9.7.json; JSON file regional-news-sources.v9.7.json; JSON file news-module-registry.v9.7.json; JSON file regional_news.json; JSON file regional_decisions.json; JSON file regional_manifest.json; JSON file major_project_news_v9_5_1.json; JSON file major_project_news.json.
- Downstream impact
- Used directly by 1 file: Run V9 7 (globalgrid2050). Reached from 1 other entry point, including GlobalGrid2050 V9 7 Validate Workflow (globalgrid2050).
- What it achieves
- It is built from the git tree helper (`gitTree`). Defines `text`, `json`, `hash` and 1 more. Its code works with 160 MWh.
- Why it matters
- Checked by Run V9 7.
- Application
- globalgrid2050 · uk_renewables_pipeline/v9.7/tests · JavaScript module
- Uses
- Classifier V9 7 (import), UK Renewables Pipeline — V9 7 Page (new URL import.meta.url), node:assert/strict, node:crypto, node:child_process, node:fs/promises, node:url, ../scripts/build/regional-news-v9-7.mjs
- Used by
- run by Run V9 7 (script call)
- Produces
- text, json, hash, gitTree
- Defines here
- text, json, hash, gitTree
- 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/v9.7/tests/check_v9_7.mjs:1-159 · blob 00c704e0808ed0bba6499ea5b23df0657ea08d6d · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: ingest · effects: filesystem, process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { execFileSync } from "node:child_process";
import { readFile } from "node:fs/promises";
import { fileURLToPath } from "node:url";
import { pinnedInputObjectV9_7, readPinnedInputV9_7 } from "../scripts/build/regional-news-v9-7.mjs";
import { classifyRegionalV9_7 } from "../scripts/news/classifier-v9-7.mjs";
const base = new URL("../", import.meta.url);
const root = new URL("../../../", import.meta.url);
const rootPath = fileURLToPath(root);
const text = (url) => readFile(url, "utf8");
const json = async (url) => JSON.parse(await text(url));
const hash = (value) => createHash("sha256").update(value).digest("hex");
const gitTree = (revisionPath) => execFileSync(
"git", ["-C", rootPath, "rev-parse", revisionPath], { encoding: "utf8" },
).trim();
assert.equal(
gitTree("HEAD:uk_renewables_pipeline/v9.6.2"),
"68e44cd061736bab1ce2f8e7bf8302aa290a131f",
"the validated V9.6.2 parent subtree changed",
);
const [contract, sourceContractText, moduleRegistry, html, packageJson, regionalText, ledgerText, manifest] = await Promise.all([
json(new URL("contracts/release.v9.7.json", base)),
text(new URL("contracts/regional-news-sources.v9.7.json", base)),
json(new URL("contracts/news-module-registry.v9.7.json", base)),
text(new URL("index.html", base)),
json(new URL("package.json", base)),
text(new URL("data/v9.7/regional_news.json", base)),
text(new URL("data/v9.7/regional_decisions.json", base)),
json(new URL("data/v9.7/regional_manifest.json", base)),
]);
const sourceContract = JSON.parse(sourceContractText);
const sourceMeta = sourceContract.adapters.find((adapter) => adapter.enabled);
const inputBytes = await readPinnedInputV9_7(rootPath, sourceMeta);
const inputText = inputBytes.toString("utf8");
const feed = JSON.parse(inputText);
const regional = JSON.parse(regionalText);
const ledger = JSON.parse(ledgerText);
const moduleRegistryText = await text(new URL("contracts/news-module-registry.v9.7.json", base));
assert.equal(contract.release, "9.7");
assert.equal(contract.status, "CANDIDATE");
assert.equal(contract.frozen_parent.subtree, "68e44cd061736bab1ce2f8e7bf8302aa290a131f");
assert.equal(contract.runtime.project_data_changed, false);
assert.equal(contract.runtime.project_javascript_changed, false);
assert.equal(contract.runtime.project_styles_changed, false);
assert.equal(contract.runtime.mobile_interface_changed, false);
assert.equal(contract.runtime.regional_project_signal_eligible, false);
/* The post-release Atlas deep-link repair is declared, not discovered. The four
project_*_changed flags above describe V9.7's own feature work and stay false;
the eight files the 2026-09-05 repair rewrote across every live version are
listed here and byte-pinned on both sides in tests/run_v9_7.sh. A file that
quietly joins that set fails the shell gate; one that quietly leaves this list
fails here. Before this the repair existed in the tree and in no contract, and
the only thing that noticed was a flat styles diff that had been red a week. */
assert.equal(contract.runtime.post_release_repair.files_differing_from_frozen_parent.length, 8);
assert.ok(contract.runtime.post_release_repair.files_differing_from_frozen_parent
.includes("styles/v9-6-1.css"));
assert.ok(contract.runtime.post_release_repair.files_differing_from_frozen_parent
.includes("scripts/plugins/projects-v9-5-1.js"));
assert.equal(packageJson.version, "9.7.0");
assert.equal(sourceContract.adapters.filter((adapter) => adapter.enabled).length, 1);
assert.equal(sourceContract.adapters[0].independent_of_repd_signals, true);
assert.equal(sourceMeta.input_commit, "91e948338115b8f523f049e8cdc5369296d9451e");
assert.equal(
pinnedInputObjectV9_7(sourceMeta),
"91e948338115b8f523f049e8cdc5369296d9451e:dist/major_project_news_v9_5_1.json",
);
assert.throws(
() => pinnedInputObjectV9_7({ ...sourceMeta, input_commit: "main" }),
/full lowercase Git commit SHA/,
);
assert.throws(
() => pinnedInputObjectV9_7({ ...sourceMeta, input: "../major_project_news.json" }),
/safe repository-relative path/,
);
await assert.rejects(
readPinnedInputV9_7(rootPath, { ...sourceMeta, input_commit: "0000000000000000000000000000000000000000" }),
/could not read pinned input/,
);
assert.equal(moduleRegistry.modules.length, 7);
assert.equal(new Set(moduleRegistry.modules.map((item) => item.role)).size, 7);
assert.equal(new Set(moduleRegistry.modules.map((item) => item.id)).size, moduleRegistry.modules.length);
assert.equal(new Set(moduleRegistry.modules.map((item) => item.path)).size, moduleRegistry.modules.length);
assert.equal(contract.regional_pipeline.modules_are_independently_extensible, true);
for (const item of moduleRegistry.modules) {
await readFile(new URL(item.path, base), "utf8");
}
assert.match(html, /UK RENEWABLES PIPELINE V9\.7/);
assert.match(html, /V9\.7 CANDIDATE/);
assert.match(html, /scripts\/app-v9-7\.js\?v=9\.7/);
assert.doesNotMatch(html, /scripts\/app-v9-6-2\.js/);
assert.equal((html.match(/<th(?:\s|>)/g) || []).length, 11);
for (const mode of ["UK", "INTERNATIONAL", "US", "EUROPE"]) {
assert.match(html, new RegExp(`data-news="${mode}"`));
}
assert.equal(feed.all_items.length, 133);
assert.equal(feed.canonical_items.length, 45);
assert.equal(regional.release, "9.7");
assert.equal(regional.articles.length, 19);
assert.equal(ledger.decisions.length, 133);
assert.equal(new Set(ledger.decisions.map((item) => item.article_id)).size, 133);
assert.deepEqual(manifest.telemetry.by_region, { US: 4, EUROPE: 9, INTERNATIONAL_OTHER: 6 });
assert.equal(manifest.telemetry.by_decision.UK_CANONICAL, 45);
assert.equal(manifest.telemetry.accepted_count, 19);
assert.equal(manifest.telemetry.last_known_good, true);
assert.deepEqual(manifest.source_adapter, sourceMeta);
assert.deepEqual(manifest.modules, moduleRegistry.modules);
assert.equal(manifest.hashes.source_contract_sha256, hash(sourceContractText));
assert.equal(manifest.hashes.module_registry_sha256, hash(moduleRegistryText));
assert.equal(manifest.hashes.input_sha256, hash(inputBytes));
assert.equal(manifest.hashes.input_sha256, "cea104c3e9cfc07971680afdf5f64073e1d4825b63bfaf4e969266df8386ebbd");
assert.equal(manifest.hashes.regional_news_sha256, hash(regionalText));
assert.equal(manifest.hashes.decision_ledger_sha256, hash(ledgerText));
const forbidden = ["project", "project_id", "repd_ref", "gg_project_id", "operator", "county", "capacity_mw", "eligible_for_news_signal"];
for (const item of regional.articles) {
assert.equal(item.project_signal_eligible, false);
assert.equal(item.canonical_identity, false);
assert.ok(["US", "EUROPE", "INTERNATIONAL_OTHER"].includes(item.region));
assert.ok(["SOLAR", "BESS", "SOLAR + BESS"].includes(item.technology));
for (const key of forbidden) assert.equal(Object.hasOwn(item, key), false, `regional article leaked ${key}`);
}
const hostile = [
["Battery storage helps us cut emissions at a utility-scale project", "ABSTAIN_NO_EXPLICIT_GEOGRAPHY"],
["American Battery Technology announces quarterly earnings", "ABSTAIN_NO_UTILITY_CONTEXT"],
["Canadian Solar says patent dispute is formally terminated", "ABSTAIN_NO_UTILITY_CONTEXT"],
["Utility-scale battery project opens in South Korea", "ACCEPT_REGIONAL"],
["U.S. utility commissions a grid-scale battery project", "ACCEPT_REGIONAL"],
["Developer finances US$100 million battery project", "ABSTAIN_NO_EXPLICIT_GEOGRAPHY"],
];
for (const [headline, decision] of hostile) {
assert.equal(classifyRegionalV9_7({ headline }).decision, decision, headline);
}
assert.equal(classifyRegionalV9_7({
headline: "EDF to optimise Chinese supplier's 160MWh Kintore battery storage system",
project: "Kintore Battery Storage",
county: "Scotland",
}).decision, "REJECT_UK_EVIDENCE");
assert.equal(classifyRegionalV9_7({
headline: "Beacon Fen Energy Park development consent decision announced",
canonical_relevant: true,
}).decision, "UK_CANONICAL");
const runtime = await text(new URL("scripts/plugins/newspaper-v9-7.js", base));
const writer = await text(new URL("scripts/build/regional-news-v9-7.mjs", base));
assert.match(runtime, /data\/v9\.7\/regional_news\.json/);
assert.doesNotMatch(runtime, /classifyRegional|classifyInternational|news-regions-v9-6-2/);
assert.match(runtime, /project_signal_eligible === false/);
assert.doesNotMatch(writer, /const (?:SOLAR|BESS|UK|LOCATION_RULES|UTILITY_CONTEXT)/);
assert.match(writer, /buildRegionalArtifactsV9_7/);
console.log("V9.7 static gate: PASS (133 ledger decisions; 19 sanitized regional articles; 45 UK frozen)");Run V9 7
A shell script in the tests folder of GlobalGrid2050 that works with assert blob (`assert_blob`).
testglobalgrid2050 / uk_renewables_pipeline/v9.7/tests/run_v9_7.sh · lines 1–105 of 105 · Entry point
- What it does
- It tests its inputs. Defines assert_blob. 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.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 V9 7 Validate Workflow (globalgrid2050).
- What it achieves
- Defines `assert_blob`.
- Why it matters
- Run by GlobalGrid2050 V9 7 Validate Workflow.
- Application
- globalgrid2050 · uk_renewables_pipeline/v9.7/tests · shell script
- Uses
- Check V9 7 (script call), Browser Smoke V9 7 (script call)
- Used by
- run by GlobalGrid2050 V9 7 Validate Workflow (workflow run)
- Produces
- assert_blob
- Defines here
- assert_blob
- 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/v9.7/tests/run_v9_7.sh:1-105 · blob 53681de78f6867a959e0159505836c5c523925eb · GitHub at these lines
- State
- achieves: name · 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)"
V97="$(cd "$HERE/.." && pwd)"
V962="$(cd "$V97/../v9.6.2" && pwd)"
ROOT="$(cd "$V97/../.." && pwd)"
test "$(git -C "$ROOT" rev-parse 'HEAD:uk_renewables_pipeline/v9.6.2')" = "68e44cd061736bab1ce2f8e7bf8302aa290a131f"
diff -qr -x __pycache__ -x '*.pyc' -x v9.7 "$V962/data" "$V97/data"
diff -qr -x __pycache__ -x '*.pyc' "$V962/fixtures" "$V97/fixtures"
# THE MAP-ROUTE REPAIR IS AN ALLOWED DELTA, NOT A DRIFT.
#
# This block used to say, flatly, that V9.7's project styles and project plugins
# were byte-identical to the frozen V9.6.2 parent. That was true the day V9.7 was
# cut and stopped being true on 2026-09-05, when the Atlas deep-link repair
# (5fa6ebf7, 313f5623) landed in every live version - V9.7 included. Seven
# plugins here now read the receiver from the deep-link contract the engine
# publishes instead of each carrying its own copy of a route that had quietly
# stopped carrying the engine, and one stylesheet gained the .map-note rule that
# prints in the cell why a record has no map point, because a phone reports
# hover: none and cannot reach a title attribute. 87fe1250 trimmed that work back
# and moved the release forward to 202609051156, but it left these files repaired
# on purpose: the fix was wanted, the extra test scaffolding was not.
#
# Since then `diff -qr styles` has failed on every push, on files nobody was
# touching - two LF-only stylesheets of 321 and 738 bytes that genuinely differ.
# That is how a red run stopped meaning anything here.
#
# The gate is not loosened, it is made specific. Every file the repair touched is
# named, with the blob the parent must hold and the blob this version must hold.
# Anything that is not exactly this repair - a drift, a re-edit, a half-finished
# revert of the kind 87fe1250 left behind - is still red, and so is any change to
# a file outside the list.
assert_blob() {
actual="$(git -C "$ROOT" rev-parse "HEAD:$1" 2>/dev/null || true)"
if [ "$actual" != "$2" ]; then
echo "V9.7 allowed-delta gate: $1 is ${actual:-absent}, expected $2" >&2
exit 1
fi
}
diff -qr -x v9-6-1.css "$V962/styles" "$V97/styles"
assert_blob uk_renewables_pipeline/v9.6.2/styles/v9-6-1.css bb5c920402ba3639ef165de59cc2e4c345861322
assert_blob uk_renewables_pipeline/v9.7/styles/v9-6-1.css cd936f0cd102cca4f5bbbf3113a28a366c66a122
for relative in \
scripts/core/project-filter-v9-2.js \
scripts/data/canonical-projects-v9-5-1.js \
scripts/plugins/gauges-v9-2.js \
scripts/plugins/capacity-presentation-v9-3.js; do
diff -q "$V962/$relative" "$V97/$relative"
done
# The seven project plugins the deep-link repair rewrote, pinned on both sides.
# projects-v9-5-1.js is the one the app actually loads; the other six are carried
# for archive fidelity and were repaired with it. The flat diff above only ever
# covered one of the seven, so six of them could drift unseen - the gate that was
# failing was also the gate that was not looking.
assert_blob uk_renewables_pipeline/v9.6.2/scripts/plugins/projects-v9-1.js cc36472e4d9d23146851f928408b6efaea85cdcb
assert_blob uk_renewables_pipeline/v9.7/scripts/plugins/projects-v9-1.js 4259f28f52b5113ae3b33f7bb6f0ff29da3b4699
assert_blob uk_renewables_pipeline/v9.6.2/scripts/plugins/projects-v9-2.js 0e222ea75e9db8dc3e9f1e829a15ac3ee1ca0acf
assert_blob uk_renewables_pipeline/v9.7/scripts/plugins/projects-v9-2.js e0697a60666700a9f73ccbe608005c905f052a48
assert_blob uk_renewables_pipeline/v9.6.2/scripts/plugins/projects-v9-3.js c28216d1e4a4d26cb13dcf99cc1f9886e6c9e276
assert_blob uk_renewables_pipeline/v9.7/scripts/plugins/projects-v9-3.js 4d26d31f9acfae5360875e4ad27e54d1dbc328ae
assert_blob uk_renewables_pipeline/v9.6.2/scripts/plugins/projects-v9-4.js 15f1e132344924075f81c39886c50c9fdea13ff7
assert_blob uk_renewables_pipeline/v9.7/scripts/plugins/projects-v9-4.js a5437c9a584d156210a52a0097b52ce9db100108
assert_blob uk_renewables_pipeline/v9.6.2/scripts/plugins/projects-v9-5.js 9d9c8f3fb660b8ffbd071f82b805082f387a7002
assert_blob uk_renewables_pipeline/v9.7/scripts/plugins/projects-v9-5.js 5ac0583723a12a3280cfc0ab33728c0d52135237
assert_blob uk_renewables_pipeline/v9.6.2/scripts/plugins/projects-v9-5-1.js ac2cffee071baee3e297053f3f6334de10ab8004
assert_blob uk_renewables_pipeline/v9.7/scripts/plugins/projects-v9-5-1.js 41442816749072255e2e15fcebdaf7979a795544
assert_blob uk_renewables_pipeline/v9.6.2/scripts/plugins/canonical-project-table.js be1098e923cbcf37a05cd5150d1350303af315d8
assert_blob uk_renewables_pipeline/v9.7/scripts/plugins/canonical-project-table.js 8c983a2777b1d5950891afe737d692c951879189
V9_BROWSER_SMOKE=0 bash "$V962/tests/run_v9_6_2.sh"
node "$V97/scripts/build/regional-news-v9-7.mjs"
git -C "$ROOT" diff --exit-code -- uk_renewables_pipeline/v9.7/data/v9.7
node "$HERE/check_v9_7.mjs"
while IFS= read -r source; do
node --check "$source"
done < <(find "$V97/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/v9.7/}"
if [[ "$browser_base_url" == http://127.0.0.1:* ]]; then
python3 -m http.server 8765 --directory "$ROOT" >/tmp/globalgrid2050-v9-7-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_7.mjs"
if [[ -n "${server_pid:-}" ]]; then
kill "$server_pid" 2>/dev/null || true
trap - EXIT
fi
fi
echo "V9.7 validation suite: PASS ($ROOT)"