GLOBALGRID2050 / EXPLORE CODE

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

Renewable Energy Planning Database (REPD) Reports and 5 more files

A JavaScript module in the UK renewables pipeline folder of GlobalGrid2050 that builds interconnector capacity report (`buildInterconnectorCapacityReport`) and formats capacity (`formatCapacity`) and count (`formatCount`) (units: MW).

652 lines of JavaScript and CSS from globalgrid2050, in 6 files. Topic: Electricity markets and data pipelines. Section 957 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. V973 Renewable Energy Planning Database (REPD) Reports test · globalgrid2050 / uk_renewables_pipeline/202611222330/tests/v973-repd-reports.mjs lines 1–60
  2. Renewable Energy Planning Database (REPD) Reports Model energy-data · globalgrid2050 / uk_renewables_pipeline/202611231600/repd-reports-model.mjs lines 1–55
  3. Renewable Energy Planning Database (REPD) Reports energy-data · globalgrid2050 / uk_renewables_pipeline/202611231600/repd-reports.mjs lines 1–295
  4. Renewable Energy Planning Database (REPD) Scan energy-data · globalgrid2050 / uk_renewables_pipeline/202611231600/repd-scan.mjs lines 1–41
  5. Renewable Energy Planning Database (REPD) Mobile V976 energy-data · globalgrid2050 / uk_renewables_pipeline/202611232245/styles/repd-mobile-v976.css lines 1–88
  6. V976 Mobile Browser test · globalgrid2050 / uk_renewables_pipeline/202611232245/tests/v976-mobile-browser.mjs lines 1–113

V973 Renewable Energy Planning Database (REPD) Reports

A JavaScript module in the tests folder of GlobalGrid2050 that tests the REPD register and solar.

testglobalgrid2050 / uk_renewables_pipeline/202611222330/tests/v973-repd-reports.mjs · lines 1–60 of 60 · version 2026-11-22 23:30 · Entry point

What it does
It tests the REPD register and solar. Defines read, almost. Uses libraries node:assert/strict, node:test, node:fs, 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: the REPD register, solar.
Inputs & outputs
In: JSON file build_manifest.json.
Downstream impact
Used directly by 4 files: GlobalGrid2050 Pn V973 Capacity Reports Workflow (globalgrid2050); GlobalGrid2050 Pn V974 Cockpit Integration Workflow (globalgrid2050); GlobalGrid2050 Renewable Energy Planning Database (REPD) Mobile V976 Workflow (globalgrid2050); GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow (globalgrid2050).
What it achieves
Defines `read` and `almost`. It reads `data/v9.1/build_manifest.json`.
Why it matters
Run by 4 workflows and scripts, including GlobalGrid2050 Pn V973 Capacity Reports Workflow, GlobalGrid2050 Pn V974 Cockpit Integration Workflow and GlobalGrid2050 Renewable Energy Planning Database (REPD) Mobile V976 Workflow.
Application
globalgrid2050 · uk_renewables_pipeline/202611222330/tests · JavaScript module
Uses
Renewable Energy Planning Database (REPD) Reports Model (import), node:assert/strict, node:test, node:fs, node:url, node:path
Used by
run by GlobalGrid2050 Pn V973 Capacity Reports Workflow (workflow run), run by GlobalGrid2050 Pn V974 Cockpit Integration Workflow (workflow run), run by GlobalGrid2050 Renewable Energy Planning Database (REPD) Mobile V976 Workflow (workflow run), run by GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow (workflow run)
Produces
read, almost
Defines here
read, almost
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/202611222330/tests/v973-repd-reports.mjs:1-60 · blob f356262e6d0303a334c7229b8c90731324ef2678 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
import assert from "node:assert/strict";
import { test } from "node:test";
import { readFileSync } from "node:fs";
import { fileURLToPath } from "node:url";
import { dirname, resolve } from "node:path";
import { buildRepdCapacityReport, NOT_REPORTED } from "../repd-reports-model.mjs";

const root = resolve(dirname(fileURLToPath(import.meta.url)), "..");
const read = file => JSON.parse(readFileSync(resolve(root, file), "utf8"));
const almost = (a, b) => assert.ok(Math.abs(a - b) < 0.011, "Capacity mismatch " + a + " != " + b);

test("source nulls, all statuses and technologies remain separate", () => {
  const rows = [
    { repd_ref: "1", technology: "solar", capacity_mw: 10.5, operator: "Alpha", region: "South West", status: "Operational" },
    { repd_ref: "2", technology: "bess", capacity_mw: 20, operator: "Alpha", region: "South West", status: "Application Submitted" },
    { repd_ref: "3", technology: "wind_onshore", capacity_mw: 1.5, operator: "", region: null, status: "Refused" },
    { repd_ref: "4", technology: "solar", capacity_mw: 4, operator: "Beta", region: "Scotland", status: "Withdrawn" },
    { repd_ref: "IC-1", technology: "interconnector", capacity_mw: 9000, operator: "Alpha", status: "Operational" }
  ];
  const operators = buildRepdCapacityReport(rows, "operator");
  const statuses = buildRepdCapacityReport(rows, "status");
  const regions = buildRepdCapacityReport(rows, "region");
  assert.equal(operators.total.count, 4);
  almost(operators.total.recordedCapacity, 36);
  almost(operators.total.solarMwp, 14.5);
  almost(operators.total.otherMw, 21.5);
  assert.equal(operators.groups.find(g => g.name === "Alpha").count, 2);
  assert.deepEqual(new Set(statuses.groups.map(g => g.name)), new Set(["Operational", "Application Submitted", "Refused", "Withdrawn"]));
  assert.equal(regions.groups.find(g => g.name === NOT_REPORTED).count, 1);
  assert.equal(operators.groups.find(g => g.name === NOT_REPORTED).count, 1);
  assert.throws(() => buildRepdCapacityReport([rows[0], rows[0]], "operator"), /Duplicate REPD/);
  assert.throws(() => buildRepdCapacityReport([{}], "region"), /Missing REPD/);
  assert.throws(() => buildRepdCapacityReport(rows, "country"), /Unsupported/);
});
test("actual frozen DESNZ REPD spine reconciles across all three reports", () => {
  const manifest = read("data/v9.1/build_manifest.json");
  const rows = manifest.project_partitions.flatMap(item => read(item.path).projects);
  assert.equal(rows.length, 7775);
  const operators = buildRepdCapacityReport(rows, "operator");
  const statuses = buildRepdCapacityReport(rows, "status");
  const regions = buildRepdCapacityReport(rows, "region");
  for (const report of [operators, statuses, regions]) {
    assert.equal(report.total.count, rows.length, "No silently dropped REPD projects");
    assert.equal(report.uniqueRefs, rows.length, "Unique REPD identities");
    almost(report.total.recordedCapacity, manifest.capacity_mw);
    almost(report.groups.reduce((acc, g) => acc + g.recordedCapacity, 0), report.total.recordedCapacity);
    assert.equal(report.groups.reduce((acc, g) => acc + g.count, 0), rows.length);
    for (const group of report.groups) {
      assert.equal(group.statuses.size, new Set(group.projects.map(p => p.status?.trim() || "Not reported")).size);
      assert.equal([...group.statuses.values()].reduce((s, x) => s + x.count, 0), group.count);
      almost([...group.statuses.values()].reduce((s, x) => s + x.recordedCapacity, 0), group.recordedCapacity);
      almost(group.solarMwp + group.otherMw, group.recordedCapacity);
    }
  }
  assert.deepEqual(new Set(statuses.groups.map(g => g.name)), new Set(rows.map(p => p.status?.trim() || "Not reported")));
  assert.deepEqual(new Set(regions.groups.map(g => g.name)), new Set(rows.map(p => p.region?.trim() || "Not reported")));
  assert.deepEqual(new Set(operators.groups.map(g => g.name)), new Set(rows.map(p => p.operator?.trim() || "Not reported")));
  console.log("PASS: 7,775 unique REPD projects, three full-dimensional reconciliations; status count", statuses.groups.length,
    "region count", regions.groups.length, "operator count", operators.groups.length);
});

Renewable Energy Planning Database (REPD) Reports Model

A JavaScript module in the UK renewables pipeline folder of GlobalGrid2050 that works with the REPD register and interconnectors.

energy-dataglobalgrid2050 / uk_renewables_pipeline/202611231600/repd-reports-model.mjs · lines 1–55 of 55 · version 2026-11-23 16:00 · Entry point · pattern accumulate (shared by 2 files)

What it does
It calculates the REPD register and interconnectors. Defines label, emptySummary, accumulate, buildRepdCapacityReport.
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.
Downstream impact
Used directly by 6 files: Operator Aliases Test (globalgrid2050); Real V975 Test (globalgrid2050); V973 Renewable Energy Planning Database (REPD) Reports (globalgrid2050); Renewable Energy Planning Database (REPD) Reports (globalgrid2050); and 2 more. Reached from 7 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); GlobalGrid2050 Pn V974 Cockpit Integration Workflow (globalgrid2050).
What it achieves
It builds REPD capacity report (`buildRepdCapacityReport`) and is built from the empty summary helper (`emptySummary`). Defines `label`, `emptySummary`, `accumulate` and 1 more.
Why it matters
Imported by Renewable Energy Planning Database (REPD) Reports. Run by GlobalGrid2050 Pn V973 Capacity Reports Workflow and GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow. Checked by 3 tests, including Operator Aliases Test.
Application
globalgrid2050 · uk_renewables_pipeline/202611231600 · JavaScript module
Uses
Operator Aliases (import)
Used by
imported by Operator Aliases Test (import), imported by Real V975 Test (import), imported by V973 Renewable Energy Planning Database (REPD) Reports (import), imported by Renewable Energy Planning Database (REPD) Reports (import), run by GlobalGrid2050 Pn V973 Capacity Reports Workflow (workflow run), run by GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow (workflow run)
Produces
REPORT_DIMENSIONS, NOT_REPORTED, buildRepdCapacityReport
Defines here
label, emptySummary, accumulate, buildRepdCapacityReport
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/202611231600/repd-reports-model.mjs:1-55 · blob f0032dd55195a55179b12bbcafb07ccc29d70d0e · GitHub at these lines
State
achieves: name · context: readme_derived · stage: transform · effects: none found · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
// PipelineNews V9.73: pure, source-fidelity REPD capacity reporting.
import { canonicalOperator } from "../../automation/repd_reporting/v3/operator-aliases.mjs";
export const REPORT_DIMENSIONS = Object.freeze(["operator", "status", "region"]);
export const NOT_REPORTED = "Not reported";

function label(value) {
  const result = typeof value === "string" ? value.trim() : "";
  return result || NOT_REPORTED;
}
function emptySummary() {
  return { count: 0, recordedCapacity: 0, solarMwp: 0, otherMw: 0, missingCapacity: 0 };
}
function accumulate(summary, project) {
  summary.count += 1;
  const capacity = project.capacity_mw;
  if (typeof capacity !== "number" || !Number.isFinite(capacity) || capacity < 0) {
    summary.missingCapacity += 1;
    return;
  }
  summary.recordedCapacity += capacity;
  if (project.technology === "solar") summary.solarMwp += capacity;
  else summary.otherMw += capacity;
}
export function buildRepdCapacityReport(projects, dimension) {
  if (!REPORT_DIMENSIONS.includes(dimension)) throw new TypeError("Unsupported REPD report dimension");
  if (!Array.isArray(projects)) throw new TypeError("REPD report expects an array");
  const seen = new Set();
  const total = emptySummary();
  const grouped = new Map();
  for (const project of projects) {
    if (project?.technology === "interconnector") continue; // never count separate interconnector inventory
    const ref = String(project?.repd_ref ?? "").trim();
    if (!ref) throw new Error("Missing REPD identity");
    if (seen.has(ref)) throw new Error("Duplicate REPD identity: " + ref);
    seen.add(ref);
    const name = dimension === "operator" ? canonicalOperator(project.operator) : label(project[dimension]);
    let group = grouped.get(name);
    if (!group) {
      group = { name, ...emptySummary(), projects: [], statuses: new Map() };
      grouped.set(name, group);
    }
    const projectStatus = label(project.status);
    if (!group.statuses.has(projectStatus)) group.statuses.set(projectStatus, emptySummary());
    accumulate(group.statuses.get(projectStatus), project);
    accumulate(group, project);
    accumulate(total, project);
    group.projects.push(project);
  }
  const groups = [...grouped.values()].sort((a, b) =>
    b.recordedCapacity - a.recordedCapacity ||
    b.count - a.count ||
    a.name.localeCompare(b.name, "en-GB"));
  // Preserve every original status and source operator/region string. No ownership inference.
  return { dimension, total, groups, uniqueRefs: seen.size };
}

Renewable Energy Planning Database (REPD) Reports

A JavaScript module in the UK renewables pipeline folder of GlobalGrid2050 that builds interconnector capacity report (`buildInterconnectorCapacityReport`) and formats capacity (`formatCapacity`) and count (`formatCount`) (units: MW).

energy-dataglobalgrid2050 / uk_renewables_pipeline/202611231600/repd-reports.mjs · lines 1–295 of 295 · version 2026-11-23 16:00 · Entry point · pattern buildInterconnectorCapacityReport (shared by 2 files)

What it does
It draws capacity, the REPD register, interconnectors and solar. Defines 22 functions or classes, including el, nativeTechnology, chosenFilter, buildInterconnectorCapacityReport, empty. 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: the REPD register, interconnectors, solar.
Inputs & outputs
Out: CSV file -capacity.csv; downloaded file repd-.
Downstream impact
Used directly by 4 files: GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pn V973 Capacity Reports Workflow (globalgrid2050); GlobalGrid2050 Pn V974 Cockpit Integration Workflow (globalgrid2050); GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow (globalgrid2050). Reached from 4 other entry points, including GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents); A4 Legal Model (globalgrid2050).
What it achieves
It builds interconnector capacity report (`buildInterconnectorCapacityReport`), formats capacity (`formatCapacity`) and formats count (`formatCount`). Its `downloadCsv` function gives CSV download or refusal from active table owner, filtered register rows and official detail partitions (VEDIC: export filtered projects). It responds to click, toggle and pipeline events.
Why it matters
Loaded by the UK Renewables Pipeline page at https://globalgrid2050.com/uk_renewables_pipeline/202611280922/. Run by GlobalGrid2050 Pn V973 Capacity Reports Workflow, GlobalGrid2050 Pn V974 Cockpit Integration Workflow and GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow.
Application
globalgrid2050 · uk_renewables_pipeline/202611231600 · JavaScript module
VEDIC
EXPORT FILTERED PROJECTS (GG2050-VEDIC-000060): Pipeline News · Renewable project register. active_table_owner, filtered_register_rows, official_detail_partitions → csv_download_or_refusal
Uses
State (import), Projects V9 8 (import), Renewable Energy Planning Database (REPD) Reports Model (import), Atlas Interconnector Link V9 8 (import)
Used by
loaded by GlobalGrid2050 — UK Renewables Pipeline Page (script src), run by GlobalGrid2050 Pn V973 Capacity Reports Workflow (workflow run), run by GlobalGrid2050 Pn V974 Cockpit Integration Workflow (workflow run), run by GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow (workflow run)
Produces
el, nativeTechnology, chosenFilter, buildInterconnectorCapacityReport, empty, add, formatCapacity, formatCount, capacityDescription, projectTableLink, projectMapLink, statusDetails
Defines here
el, nativeTechnology, chosenFilter, buildInterconnectorCapacityReport, empty, add, formatCapacity, formatCount, capacityDescription, projectTableLink, projectMapLink, statusDetails, projectRow, projectDetails, add, makeGroup, sourceRows, renderNativeSummary, render, selectReport, downloadCsv, quote
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/202611231600/repd-reports.mjs:1-295 · blob 962270212ac35a856374204669cbdbd1c4356035 · GitHub at these lines
State
achieves: code · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
// PipelineNews V9.75: reports use the existing filtered REPD table and gauges.
import { state } from "./scripts/core/state.js";
import { atlasUrlV9_5_1 } from "./scripts/plugins/projects-v9-8.js";
import { buildRepdCapacityReport } from "./repd-reports-model.mjs";
import { buildAtlasInterconnectorLinkV9_8 } from "./scripts/core/atlas-interconnector-link-v9-8.js";

const panel = document.getElementById("repdReportsPanel");
const reportButtons = [...document.querySelectorAll("[data-repd-report]")];
const reportBody = document.getElementById("repdReportsBody");
const reportSummary = document.getElementById("repdReportsSummary");
const csvButton = document.getElementById("repdReportCsv");
const closeButton = document.getElementById("repdReportsClose");
const titles = { operator: "Capacity by operator", status: "Capacity by official REPD status", region: "Capacity by region" };
let active = "";
let lastReport = null;
let lastSnapshot = null;
let lastSelection = null;

function el(tag, className, value) {
  const result = document.createElement(tag);
  if (className) result.className = className;
  if (value !== undefined) result.textContent = String(value);
  return result;
}
function nativeTechnology() {
  return document.querySelector('#tech [data-technology][aria-pressed="true"]')?.dataset.technology||"all";
}
function chosenFilter() {
  return {technology:nativeTechnology(),
    status:document.getElementById("repdNativeStatus")?.value||"All",
    operator:document.getElementById("repdNativeOperator")?.value||"All",
    region:document.getElementById("repdNativeRegion")?.value||"All"};
}
function buildInterconnectorCapacityReport(projects, dimension) {
  // Separate, explicitly labelled interconnector inventory; no REPD ID dedupe or mixing.
  const empty = () => ({count:0, recordedCapacity:0, solarMwp:0, otherMw:0, missingCapacity:0});
  const total = empty(), groups = new Map();
  const seen = new Set();
  const add = (target, project) => {
    target.count++;
    const capacity = project.capacity_mw;
    if (typeof capacity !== "number" || !Number.isFinite(capacity) || capacity < 0) target.missingCapacity++;
    else { target.recordedCapacity+=capacity;target.otherMw+=capacity; }
  };
  for (const project of projects) {
    const ref = String(project.asset_id ?? project.gg_project_id ?? project.bmrs_code ?? "").trim();
    if (!ref || seen.has(ref)) throw new Error("Missing/duplicate interconnector ID: " + ref);
    seen.add(ref);
    const name = String(project[dimension] || "Not reported").trim() || "Not reported";
    let group = groups.get(name);
    if (!group) { group = {name, ...empty(), projects:[], statuses:new Map()};groups.set(name,group); }
    const status = String(project.status || "Not reported").trim() || "Not reported";
    if (!group.statuses.has(status)) group.statuses.set(status,empty());
    add(group.statuses.get(status),project);add(group,project);add(total,project);
    group.projects.push(project);
  }
  return {dimension,total,groups:[...groups.values()].sort((a,b)=>b.recordedCapacity-a.recordedCapacity || b.count-a.count || a.name.localeCompare(b.name,"en-GB")), uniqueRefs:seen.size};
}
function formatCapacity(n) {
  return Number(n || 0).toLocaleString("en-GB", { maximumFractionDigits: 2 });
}
function formatCount(n) {
  return Number(n || 0).toLocaleString("en-GB");
}
function capacityDescription(summary) {
  return formatCapacity(summary.recordedCapacity) + " recorded MW/MWp · " +
    formatCapacity(summary.solarMwp) + " solar MWp · " +
    formatCapacity(summary.otherMw) + " other MW";
}
function projectTableLink(project) {
  const href = new URL(window.location.href);
  href.hash = "";
  href.search = "";
  href.searchParams.set("q", String(project.repd_ref));
  href.searchParams.set("technology", String(project.technology || "all"));
  return href.href;
}
function projectMapLink(project) {
  try {
    if (project.technology === "interconnector") {
      const link = buildAtlasInterconnectorLinkV9_8(project);
      return link ? new URL(link, window.location.href).href : "";
    }
    const href = atlasUrlV9_5_1(project);
    if (!href) return "";
    const url = new URL(href);
    if (url.origin !== "https://ventusltd.github.io" ||
        url.pathname !== "/gridatlas/atlas/" ||
        url.searchParams.get("repd_ref") !== String(project.repd_ref)) return "";
    return url.href;
  } catch {
    return "";
  }
}
function statusDetails(group, destination) {
  const heading = el("h4", "repd-report-subtitle", "All source-reported statuses");
  destination.append(heading);
  const statuses = [...group.statuses].sort((a, b) =>
    b[1].recordedCapacity - a[1].recordedCapacity || a[0].localeCompare(b[0], "en-GB"));
  const list = el("div", "repd-report-statuses");
  for (const [status, stats] of statuses) {
    const item = el("div", "repd-report-status-item");
    item.append(el("span", "", status));
    item.append(el("span", "", formatCount(stats.count) + " projects"));
    item.append(el("span", "", capacityDescription(stats)));
    list.append(item);
  }
  destination.append(list);
}
function projectRow(project) {
  const row = el("div", "repd-report-project");
  const link = el("a", "", String(project.name || "Unnamed REPD project"));
  link.href = projectTableLink(project);
  link.title = "Open this REPD record in the existing PipelineNews table, with MAP and A4";
  row.append(link);
  row.append(el("span", "", project.technology === "interconnector" ? "INTERCONNECTOR " + (project.bmrs_code || project.gg_project_id || "") : "REPD " + project.repd_ref));
  row.append(el("span", "", String(project.status || "Not reported")));
  row.append(el("span", "", (typeof project.capacity_mw === "number" && Number.isFinite(project.capacity_mw) ? formatCapacity(project.capacity_mw) : "Not reported") +
    (project.technology === "solar" ? " MWp" : " MW")));
  const mapHref = projectMapLink(project);
  if (mapHref) {
    const map = el("a", "repd-report-map", "MAP");
    map.href = mapHref;
    map.target = "_blank";
    map.rel = "noopener noreferrer";
    map.title = "Open canonical GridAtlas with the selected REPD project";
    row.append(map);
  } else {
    row.append(el("span", "repd-report-no-map", "NO MAP"));
  }
  return row;
}
function projectDetails(group, destination) {
  destination.append(el("h4", "repd-report-subtitle", "Projects · full REPD membership"));
  const projects = [...group.projects].sort((a, b) =>
    (Number(b.capacity_mw) || 0) - (Number(a.capacity_mw) || 0));
  const list = el("div", "repd-report-project-list");
  destination.append(list);
  let shown = 0;
  const more = el("button", "repd-report-more", "");
  more.type = "button";
  const add = () => {
    const fragment = document.createDocumentFragment();
    for (const project of projects.slice(shown, shown + 100)) fragment.append(projectRow(project));
    list.append(fragment);
    shown = Math.min(projects.length, shown + 100);
    more.textContent = "SHOW NEXT 100 · " + formatCount(shown) + " / " + formatCount(projects.length);
    more.hidden = shown >= projects.length;
  };
  more.addEventListener("click", add);
  add();
  destination.append(more);
}
function makeGroup(group, maximum, index) {
  const details = el("details", "repd-report-group");
  const heading = el("summary", "repd-report-row");
  heading.append(el("span", "repd-report-name", (active === "operator" ? "#" + String(index + 1) + "  " : "") + group.name));
  heading.append(el("span", "", formatCapacity(group.recordedCapacity)));
  heading.append(el("span", "", formatCapacity(group.solarMwp)));
  heading.append(el("span", "", formatCapacity(group.otherMw)));
  heading.append(el("span", "", formatCount(group.count)));
  const track = el("span", "repd-report-track");
  const bar = el("span", "repd-report-bar");
  bar.style.width = (maximum > 0 ? Math.max(0, group.recordedCapacity / maximum * 100) : 0) + "%";
  track.append(bar);
  heading.append(track);
  details.append(heading);
  const content = el("div", "repd-report-group-details");
  details.append(content);
  details.addEventListener("toggle", () => {
    if (!details.open || content.dataset.loaded) return;
    content.dataset.loaded = "true";
    statusDetails(group, content);
    projectDetails(group, content);
  });
  return details;
}
function sourceRows() {
  if(!Array.isArray(state.all)||!state.all.length)return null;
  lastSelection=chosenFilter();
  const ic=lastSelection.technology==="interconnector";
  const rows=state.filtered||[];
  lastSnapshot={source:ic?"interconnector":"repd",
    sourceProjects:ic?(state.interconnectors||[]).length:state.all.length,
    matchingProjects:rows.length};
  return rows;
}
function renderNativeSummary(report) {
  const wrap=el("div","tablewrap"), table=el("table","repd-native-report-table");
  wrap.setAttribute("aria-label","Ranked grouping of the original REPD table filters");
  const head=el("thead"),heading=el("tr");
  for(const name of ["Group","Projects","Solar MWp","Other MW","Recorded MW/MWp"])
    heading.append(el("th","",name));
  head.append(heading);
  const body=el("tbody");
  for(const group of report.groups) {
    const row=el("tr"),name=el("td","site"),action=el("button","btn",group.name);
    action.type="button";
    action.title="Apply this exact group to the original REPD table and gauges";
    action.addEventListener("click",()=>{
      const id=active==="operator"?"repdNativeOperator":active==="status"?"repdNativeStatus":"repdNativeRegion";
      const select=document.getElementById(id);
      if(!select||![...select.options].some(o=>o.value===group.name)) {
        reportSummary.textContent="No matching source filter for "+group.name;return;
      }
      select.value=group.name;
      select.dispatchEvent(new Event("change",{bubbles:true}));
      document.getElementById("repdScroll")?.scrollIntoView({block:"nearest"});
    });
    name.append(action);row.append(name);
    for(const [value,css] of [[group.count,""],[group.solarMwp,"mw"],[group.otherMw,"mw"],[group.recordedCapacity,"mw"]])
      row.append(el("td",css,css?formatCapacity(value):formatCount(value)));
    body.append(row);
  }
  table.append(head,body);wrap.append(table);reportBody.append(wrap);
}
function render() {
  if(!active||panel.hidden)return;
  reportBody.replaceChildren();
  try {
    const rows=sourceRows();
    if(!rows){lastReport=null;reportSummary.textContent="Loading original REPD register…";return;}
    const ic=lastSnapshot.source==="interconnector";
    const report=ic?buildInterconnectorCapacityReport(rows,active):buildRepdCapacityReport(rows,active);
    lastReport=report;
    const selection=lastSelection;
    const tech=selection.technology==="all"?"ALL REPD TECHNOLOGIES":selection.technology.replaceAll("_"," ").toUpperCase();
    reportSummary.textContent=titles[active]+" · "+tech+" · "+selection.status+
      " · CURRENT REPD TABLE FILTERS · SOURCE "+formatCount(lastSnapshot.sourceProjects)+
      " · SELECTED "+formatCount(rows.length)+" · "+formatCount(report.groups.length)+
      " groups · "+capacityDescription(report.total)+
      (ic?" · Separate interconnector inventory, not REPD":" · Select a group to filter the original table and gauges");
    if(ic) {
      const heading=el("div","repd-report-row repd-report-columns");
      for(const name of ["Group","Recorded MW","Solar MWp","Other MW","Projects"])heading.append(el("span","",name));
      heading.append(el("span","",""));
      reportBody.append(heading);
      const maximum=report.groups.length?report.groups[0].recordedCapacity:0;
      for(const [index,group] of report.groups.entries())reportBody.append(makeGroup(group,maximum,index));
    } else renderNativeSummary(report);
    if(!report.groups.length)reportBody.append(el("p","","No matching projects in the original REPD table."));
  } catch(error){
    lastReport=null;lastSnapshot=null;
    reportSummary.textContent="Report validation failed: "+String(error?.message||error);
  }
}
function selectReport(dimension) {
  if (active === dimension && !panel.hidden) {
    panel.hidden = true;
    active = "";
  } else {
    active = dimension;
    panel.hidden = false;
  }
  for (const button of reportButtons) {
    const pressed = button.dataset.repdReport === active;
    button.setAttribute("aria-pressed", String(pressed));
    button.setAttribute("aria-expanded", String(pressed));
  }
  if (active) render();
}
function downloadCsv() {
  if (!lastReport) return;
  const quote = value => { const text = String(value ?? ""); const safe = /^[=+@\-\t\r\n]/.test(text) ? "'" + text : text; return '"' + safe.replaceAll('"', '""') + '"'; };
  const rows = [["dimension", "technology selection", "status selection", "operator filter", "region filter", "group", "projects", "recorded MW/MWp", "solar MWp", "other MW", "missing capacity"]];
  for (const group of lastReport.groups) {
    rows.push([active, lastSelection?.technology, lastSelection?.status, lastSelection?.operator, lastSelection?.region,
      group.name, group.count, group.recordedCapacity, group.solarMwp, group.otherMw, group.missingCapacity]);
  }
  const blob = new Blob([rows.map(row => row.map(quote).join(",")).join("\r\n") + "\r\n"], { type: "text/csv;charset=utf-8" });
  const url = URL.createObjectURL(blob);
  const a = el("a");
  a.href = url;
  a.download = "repd-" + active + "-capacity.csv";
  document.body.append(a);
  a.click();
  a.remove();
  URL.revokeObjectURL(url);
}
if (panel && reportSummary && reportBody) {
  for (const button of reportButtons) button.addEventListener("click", () => selectReport(button.dataset.repdReport));
  closeButton?.addEventListener("click", () => {
    panel.hidden = true;
    active = "";
    for (const button of reportButtons) {
      button.setAttribute("aria-pressed", "false");
      button.setAttribute("aria-expanded", "false");
    }
  });
  csvButton?.addEventListener("click", downloadCsv);
  window.addEventListener("pipeline-category-changed", () => { if (active) render(); });
  window.addEventListener("pipeline-projects-rendered", () => {
    if (active) render();
  });
}

Renewable Energy Planning Database (REPD) Scan

A JavaScript module in the UK renewables pipeline folder of GlobalGrid2050 that updates mode (`updateMode`), covering the REPD register.

energy-dataglobalgrid2050 / uk_renewables_pipeline/202611231600/repd-scan.mjs · lines 1–41 of 41 · version 2026-11-23 16:00 · Entry point · pattern updateMode (shared by 2 files)

What it does
It lists and searches the REPD register. Defines updateMode, sync. 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: the REPD register.
Downstream impact
Used directly by 2 files: GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow (globalgrid2050). Reached from 4 other entry points, including GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents); A4 Legal Model (globalgrid2050).
What it achieves
It updates mode (`updateMode`) and is built from the sync step (`sync`). Show only project, real capacity and MAP by default. It responds to click, change and pipeline events.
Why it matters
Loaded by the UK Renewables Pipeline page at https://globalgrid2050.com/uk_renewables_pipeline/202611280922/. Run by GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow.
Application
globalgrid2050 · uk_renewables_pipeline/202611231600 · JavaScript module
Uses
none found
Used by
loaded by GlobalGrid2050 — UK Renewables Pipeline Page (script src), run by GlobalGrid2050 Renewable Energy Planning Database (REPD) Native V975 Workflow (workflow run)
Produces
updateMode, sync
Defines here
updateMode, sync
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/202611231600/repd-scan.mjs:1-41 · blob c22c787f19f75a9a2263bf292279de6d54b6f3ad · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
// V9.62: manual prospect scan. Show only project, real capacity and MAP by default.
// Status and date selectors use the canonical existing REPD filter handlers, not a duplicate filter engine.
(() => {
  'use strict';
  const panel=document.getElementById('repdPanel');
  const wrap=document.getElementById('repdScroll');
  const toolbar=document.getElementById('pnScanToolbar');
  const switcher=document.getElementById('pnScanModeToggle');
  const statusSelect=document.getElementById('pnScanStatus');
  const dateCount=document.getElementById('pnScanDateCount');
  const years=toolbar?.querySelectorAll('[data-year-filter]');
  if(!panel||!wrap||!toolbar||!switcher||!statusSelect||!years?.length)return;
  let scan=true;
  const updateMode=()=>{
    wrap.classList.toggle('pn-scan-mode',scan);
    switcher.textContent=scan?'All columns':'Scan view';
    switcher.setAttribute('aria-pressed',String(scan));
    switcher.title=scan?'Display the unchanged full REPD table':'Return to Project / MW / MAP';
    if(scan)wrap.scrollLeft=0;
    wrap.dispatchEvent(new Event('scroll'));
  };
  switcher.addEventListener('click',()=>{scan=!scan;updateMode();});
  statusSelect.addEventListener('change',()=>{
    const selected=[...document.querySelectorAll('#status [data-official-status]')]
      .find(button=>button.dataset.officialStatus===statusSelect.value);
    if(selected)selected.click();
    else { const native=document.getElementById("repdNativeStatus"); if(native) {native.value=statusSelect.value;native.dispatchEvent(new Event("change",{bubbles:true}));} }
  });
  const sync=()=>{
    const active=document.querySelector('#status [data-official-status][aria-pressed="true"]');
    const native=document.getElementById("repdNativeStatus");
    const current=native?.value || active?.dataset.officialStatus || "All";
    if(statusSelect.value!==current)statusSelect.value=current;
    const count=[...years].filter(select=>select.value&&select.value!=='All').length;
    dateCount.textContent=count?String(count):'';
  };
  for(const select of years)select.addEventListener('change',sync);
  window.addEventListener('pipeline-projects-rendered',sync);
  sync();
  updateMode();
})();

Renewable Energy Planning Database (REPD) Mobile V976

A style sheet in the styles folder of GlobalGrid2050 covering the REPD register.

energy-dataglobalgrid2050 / uk_renewables_pipeline/202611232245/styles/repd-mobile-v976.css · lines 1–88 of 88 · version 2026-11-23 22:45 · Entry point

What it does
Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'renewables'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: the REPD register.
Downstream impact
Used directly by 1 file: GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/). Reached from 4 other entry points, including GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents); A4 Legal Model (globalgrid2050).
What it achieves
V9.76 — mobile-only readability fix for the V9.75 native REPD capacity reports.
Why it matters
Loaded by the UK Renewables Pipeline page at https://globalgrid2050.com/uk_renewables_pipeline/202611280922/.
Application
globalgrid2050 · uk_renewables_pipeline/202611232245/styles · style sheet
Uses
none found
Used by
loaded by GlobalGrid2050 — UK Renewables Pipeline Page (stylesheet)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611232245/styles/repd-mobile-v976.css:1-88 · blob 2210143d42ad7acf49aede064fbaaaf16d8efdd2 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
/* V9.76 — mobile-only readability fix for the V9.75 native REPD capacity reports.
   Original REPD/SCADA colours, all desktop styles and source data remain untouched.
   The normal REPD project table is deliberately NOT selected here.
*/
#repdReportSwipeHint{display:none}
@media (max-width:768px){
  /* Native status and operator/region filters are bounded to the phone viewport. */
  #repdPanel #repdNativeFilters{
    display:grid;grid-template-columns:repeat(2,minmax(0,1fr));
    gap:7px;min-width:0;max-width:100%;overflow:visible;
  }
  #repdPanel #repdNativeFilters > label{
    display:flex;flex-direction:column;gap:4px;min-width:0;
    color:var(--muted);font-size:10px;line-height:1.25;
  }
  #repdPanel #repdNativeFilters > label:first-child{grid-column:1/-1}
  #repdPanel #repdNativeFilters > label > select{
    box-sizing:border-box;width:100%!important;min-width:0!important;
    max-width:100%!important;min-height:40px;overflow:hidden;
    text-overflow:ellipsis;
  }
  /* The official status buttons never create an orphaned second row. */
  #repdPanel #status.filters{
    display:flex;flex-wrap:nowrap!important;gap:6px;
    width:100%;max-width:100%;overflow-x:auto;overflow-y:hidden;
    overscroll-behavior-x:contain;scroll-snap-type:x proximity;
    -webkit-overflow-scrolling:touch;padding:0 0 7px;margin-bottom:8px;
  }
  #repdPanel #status.filters > button{
    flex:0 0 auto;min-height:39px;white-space:nowrap;
    scroll-snap-align:start;
  }
  #repdPanel #repdReportsPanel{box-sizing:border-box;max-width:100%;min-width:0;overflow:hidden}
  #repdPanel #repdReportsBody{
    max-width:100%;min-width:0;
    overflow-x:hidden;overflow-y:auto;
  }
  #repdReportSwipeHint{
    display:block;margin:7px 0 5px;color:var(--muted);
    font:700 10px/1.35 "Courier New",monospace;
    letter-spacing:.25px;
  }
  /* Original table colours stay inherited; only the report's column geometry changes.
     Override the global #repdPanel .tablewrap table{min-width:0!important;table-layout:fixed}
     and #repdPanel .tablewrap td{overflow-wrap:anywhere} that crushed digits in V9.75.
  */
  #repdPanel #repdReportsBody > .tablewrap{
    display:block;box-sizing:border-box;width:100%;max-width:100%;
    min-width:0;max-height:none!important;
    overflow-x:auto!important;overflow-y:auto!important;
    overscroll-behavior-x:contain;
    -webkit-overflow-scrolling:touch;
    touch-action:pan-x pan-y;
    scrollbar-width:thin;
  }
  #repdPanel #repdReportsBody .repd-native-report-table{
    width:760px!important;min-width:760px!important;max-width:none!important;
    table-layout:fixed!important;
  }
  #repdPanel #repdReportsBody .repd-native-report-table :is(th,td){
    box-sizing:border-box;
    padding:8px 9px;
    white-space:nowrap!important;overflow-wrap:normal!important;
    word-break:normal!important;
    line-height:1.3;
    font-variant-numeric:tabular-nums;
    vertical-align:middle;
  }
  /* Sticky group name retains the lookup identity as capacities scroll past. */
  #repdPanel #repdReportsBody .repd-native-report-table :is(th,td):first-child{
    box-sizing:border-box;width:230px!important;min-width:230px!important;max-width:230px!important;
    position:sticky;left:0;z-index:6;
    background:var(--panel);
  }
  #repdPanel #repdReportsBody .repd-native-report-table th:first-child{
    background:#050505;z-index:9;
  }
  #repdPanel #repdReportsBody .repd-native-report-table :is(th,td):nth-child(2){width:88px!important}
  #repdPanel #repdReportsBody .repd-native-report-table :is(th,td):nth-child(3){width:125px!important}
  #repdPanel #repdReportsBody .repd-native-report-table :is(th,td):nth-child(4){width:112px!important}
  #repdPanel #repdReportsBody .repd-native-report-table :is(th,td):nth-child(5){width:205px!important;min-width:205px!important;max-width:205px!important}
  #repdPanel #repdReportsBody .repd-native-report-table td:first-child button{
    display:block;max-width:100%;width:100%;
    min-width:0;min-height:40px;text-align:left;
    white-space:normal!important;overflow-wrap:break-word!important;word-break:normal!important;
    font-size:11px;line-height:1.25;
  }
}

V976 Mobile Browser

A JavaScript module in the tests folder of GlobalGrid2050 that tests the Renewable Energy Planning Database (REPD) register.

testglobalgrid2050 / uk_renewables_pipeline/202611232245/tests/v976-mobile-browser.mjs · lines 1–113 of 113 · version 2026-11-23 22:45 · Entry point

What it does
It tests the REPD register. Uses libraries node:assert/strict, 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: the REPD register.
Downstream impact
Used directly by 1 file: GlobalGrid2050 Renewable Energy Planning Database (REPD) Mobile V976 Workflow (globalgrid2050).
What it achieves
Fail the build if numbers are rendered as one character per line.
Why it matters
Run by GlobalGrid2050 Renewable Energy Planning Database (REPD) Mobile V976 Workflow.
Application
globalgrid2050 · uk_renewables_pipeline/202611232245/tests · JavaScript module
Uses
node:assert/strict, playwright
Used by
run by GlobalGrid2050 Renewable Energy Planning Database (REPD) Mobile V976 Workflow (workflow run)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 uk_renewables_pipeline/202611232245/tests/v976-mobile-browser.mjs:1-113 · blob acba53b4e99b02f4339a13182dd3ee20269fd701 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
// V9.76: real REPD source, iPhone geometry, no vertical digits, native group/filters.
// Fail the build if numbers are rendered as one character per line.
import assert from "node:assert/strict";
import {chromium,webkit} from "playwright";
const url="http://127.0.0.1:8765/uk_renewables_pipeline/202611232245/";
const sizes=[
  {name:"iphone-se",width:320,height:695},
  {name:"iphone",width:393,height:852},
  {name:"iphone-max",width:430,height:932},
  {name:"landscape",width:852,height:393},
  {name:"desktop",width:1280,height:800}
];
for(const [engineName,engine] of [["chromium",chromium],["webkit",webkit]]) {
  const browser=await engine.launch({headless:true});
  try {
    for(const size of sizes) {
      const page=await browser.newPage({viewport:{width:size.width,height:size.height},
        hasTouch:size.width<=852,reducedMotion:"reduce"});
      const errors=[];page.on("pageerror",x=>errors.push(x.message));
      page.on("response",x=>{
        if(x.status()>=400&&/repd-mobile-v976|repd-reports|operator-aliases/.test(x.url()))
          errors.push(x.status()+" "+x.url());
      });
      try {
        await page.goto(url,{waitUntil:"domcontentloaded",timeout:75000});
        await page.waitForFunction(()=>(document.querySelector("#v2")?.textContent||"").replaceAll(",","").trim()==="3604",{timeout:75000});
        const oldHeading=await page.locator("#repdScroll th").first().evaluate(x=>getComputedStyle(x).color);
        const oldGaugeCount=await page.locator("#repdPanel>.hud-gauges>.card").count();
        assert.equal(oldGaugeCount,3,"All three original gauges");
        await page.locator('[data-repd-report="operator"]').click();
        await page.locator("#repdReportsPanel").waitFor({state:"visible"});
        await page.waitForSelector("#repdReportsBody .repd-native-report-table tbody tr");
        const geometry=await page.evaluate(()=>{
          const panel=document.querySelector("#repdReportsPanel");
          const wrap=document.querySelector("#repdReportsBody>.tablewrap");
          const table=wrap?.querySelector("table.repd-native-report-table");
          const row=table?.querySelector("tbody tr");
          const cells=[...(row?.cells||[])];
          const statuses=document.querySelector("#status");
          const buttons=[...statuses.querySelectorAll("button")];
          const hint=document.querySelector("#repdReportSwipeHint");
          const rect=panel.getBoundingClientRect();
          return {
            rectLeft:rect.left,rectRight:rect.right,screen:window.innerWidth,
            wrapWidth:wrap.clientWidth,wrapScroll:wrap.scrollWidth,
            tableWidth:table.getBoundingClientRect().width,cellCount:cells.length,
            numeric:cells.slice(1).map(x=>({
              width:x.getBoundingClientRect().width,
              height:x.getBoundingClientRect().height,
              whitespace:getComputedStyle(x).whiteSpace,
              text:x.textContent.trim()})),
            rowHeight:row.getBoundingClientRect().height,
            headerColour:getComputedStyle(table.querySelector("th")).color,
            statusScroll:statuses.scrollWidth,statusWidth:statuses.clientWidth,
            statusPositions:buttons.map(x=>Math.round(x.getBoundingClientRect().top)),
            statusWrap:getComputedStyle(statuses).flexWrap,
            hintDisplay:getComputedStyle(hint).display,
            groupText:cells[0]?.textContent.trim()||""
          };
        });
        assert.equal(geometry.cellCount,5,JSON.stringify(geometry));
        assert.equal(geometry.headerColour,oldHeading,"Inherited native REPD colours");
        if(size.width<=768) {
          assert.ok(geometry.rectLeft>=-2&&geometry.rectRight<=geometry.screen+2,
            "Report panel escaped viewport: "+JSON.stringify(geometry));
          assert.ok(geometry.wrapScroll>geometry.wrapWidth+200,
            "Report requires independent sideways swipe: "+JSON.stringify(geometry));
          assert.ok(geometry.tableWidth>=750,"Report must retain readable numeric columns");
          assert.equal(geometry.statusWrap,"nowrap","Status buttons must not orphan");
          assert.equal(new Set(geometry.statusPositions).size,1,"All status buttons must be on the same horizontal row");
          assert.ok(geometry.statusScroll>geometry.statusWidth+20,"Status buttons need horizontal swiping");
          assert.equal(geometry.hintDisplay,"block","Mobile-only swipe explanation required");
          assert.ok(geometry.rowHeight<140,"Digits are stacked vertically: "+JSON.stringify(geometry));
          for(const cell of geometry.numeric){
            assert.equal(cell.whitespace,"nowrap","Each number must be on one line");
            assert.ok(cell.width>=85,"Numbers have a narrow column: "+JSON.stringify(geometry));
            assert.ok(cell.height<140,"Numbers must not create very tall rows");
          }
          await page.locator("#repdReportsBody>.tablewrap").evaluate(node=>{node.scrollLeft=node.scrollWidth});
          const scrolled=await page.locator("#repdReportsBody>.tablewrap").evaluate(node=>node.scrollLeft);
          assert.ok(scrolled>200,"iOS horizontal swipe target should actually scroll");
          await page.locator("#status").evaluate(node=>{node.scrollLeft=node.scrollWidth});
          const statusScrolled=await page.locator("#status").evaluate(node=>node.scrollLeft);
          assert.ok(statusScrolled>30,"Native status scrolling works");
          await page.locator('#status [data-official-status="Application Submitted"]').click();
          await page.waitForFunction(()=>document.querySelector("#repdNativeStatus")?.value==="Application Submitted");
          const count=Number((await page.locator("#v2").textContent()).replaceAll(",",""));
          assert.ok(count>0&&count<3604,"Status action still changes original gauge");
          await page.locator("#repdNativeStatus").selectOption("All");
          await page.waitForFunction(()=>document.querySelector("#v2")?.textContent?.replaceAll(",","").trim()==="3604");
        }else{
          assert.equal(geometry.hintDisplay,"none","Desktop must have original appearance");
        }
        await page.locator("#repdNativeOperator").selectOption("Low Carbon");
        await page.waitForFunction(()=>{
          const n=Number((document.querySelector("#v2")?.textContent||"0").replaceAll(",",""));
          return n>0 && n<3604 && Number(document.querySelector("#tbody")?.dataset.total||0)===n;
        },{timeout:15000});
        assert.match(await page.locator("#repdReportsSummary").textContent(),/SELECTED /);
        await page.locator("#repdNativeOperator").selectOption("All");
        await page.locator('[data-repd-report="status"]').click();
        await page.waitForSelector("#repdReportsBody .repd-native-report-table tbody tr");
        await page.locator('[data-repd-report="region"]').click();
        await page.waitForSelector("#repdReportsBody .repd-native-report-table tbody tr");
        assert.equal(await page.locator("script[src='report-a4.mjs']").count(),1);
        assert.equal(await page.locator("script[src='map-entry.mjs']").count(),1);
        assert.deepEqual(errors,[],"Client errors: "+JSON.stringify(errors));
        console.log("PASS V9.76",engineName,size.name,size.width+"x"+size.height,
          "status scroll, numeric columns, panel containment, original colours, operator/status/region, MAP/A4");
      }finally{await page.close();}
    }
  }finally{await browser.close();}
}