GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Electricity markets and data pipelines / pipelinenews / archive/202608261547-pipelinenews/objects/modules/sha256

Objects — Sha256 and 5 more files

A JavaScript file in PipelineNews that renders table (`renderTable`), projects search (`projectSearchText`), applies project filters (`applyProjectFilters`) and reads inputs for status filter, region filter and min capacity, using SHA-256.

665 lines of JavaScript from pipelinenews, in 6 files. Topic: Electricity markets and data pipelines. Section 993 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. Objects — Sha256 interaction · pipelinenews / archive/202608261547-pipelinenews/objects/modules/sha256/ae4bb559312e84d7cdcb69dfee444644b328c370e198d5939ff8abeca92d6235.js lines 1–407
  2. Browser PipelineNews test · pipelinenews / archive/202608261547-pipelinenews/tests/browser-202608260159-pipelinenews.mjs lines 1–80
  3. Browser Live test · pipelinenews / archive/202608261547-pipelinenews/tests/browser-live-202608251929.mjs lines 1–62
  4. Check Release test · pipelinenews / archive/202608261547-pipelinenews/tests/check-202608251651-release.mjs lines 1–50
  5. Check PipelineNews test · pipelinenews / archive/202608261547-pipelinenews/tests/check-202608260159-pipelinenews.mjs lines 1–65
  6. Check Current Timestamp Release test · pipelinenews / archive/202608261547-pipelinenews/tests/check-current-timestamp-release.mjs lines 1–1

Objects — Sha256

A JavaScript file in PipelineNews that renders table (`renderTable`), projects search (`projectSearchText`), applies project filters (`applyProjectFilters`) and reads inputs for status filter, region filter and min capacity, using SHA-256.

interactionpipelinenews / archive/202608261547-pipelinenews/objects/modules/sha256/ae4bb559312e84d7cdcb69dfee444644b328c370e198d5939ff8abeca92d6235.js · lines 1–407 of 407 · version 2026-08-26 15:47 · Not reached from any entry point (candidate for review) · pattern applyProjectFilters (shared by 2 files)

What it does
It draws solar, battery storage (BESS), the REPD register and wind. Defines 28 functions or classes, including invariant, escapeHtml, safeHttpUrl, fetchJson, safeSiteLabel. Side effects: changes the web page (DOM); makes network requests.
Why it exists in the grid workflow
Domain stage experimental (path word 'archive'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: solar, battery storage (BESS), the REPD register, wind.
Inputs & outputs
In: JSON file build_manifest.json.
What it achieves
It fetches JSON (`fetchJson`), formats number (`formatNumber`) and renders table (`renderTable`). Defines `invariant`, `escapeHtml`, `safeHttpUrl` and 25 more. It responds to click, change and input events.
Why it matters
No other file in the estate was found to import it.
Application
pipelinenews · archive/202608261547-pipelinenews/objects/modules/sha256 · script
Uses
GlobalGrid2050 — Renewable Energy Planning Database (REPD) Grid Atlas v8 Page (estate URL)
Used by
mentioned in Standalone (comment link)
Produces
invariant, escapeHtml, safeHttpUrl, fetchJson, safeSiteLabel, technologyLabel, unitFor, formatNumber, displayDate, atlasUrl, connectionMarkup, renderTable
Defines here
invariant, escapeHtml, safeHttpUrl, fetchJson, safeSiteLabel, technologyLabel, unitFor, formatNumber, displayDate, atlasUrl, connectionMarkup, renderTable, projectSearchText, applyProjectFilters, populateProjectControls, bindProjectControls, csvCell, exportCsv, safeStory, visibleStories, renderNews, bindNewsControls, renderTechnologyGauges, loadProjects, loadNews, renderIntelligence, loadOptionalIntelligence, boot
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 archive/202608261547-pipelinenews/objects/modules/sha256/ae4bb559312e84d7cdcb69dfee444644b328c370e198d5939ff8abeca92d6235.js:1-407 · blob d13a4e03086c548083557de43d5d47d81d960037 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, network · domain stage: experimental · users: none · canonical: unreached_review
const RELEASE_ID = "202608251929-pipelinenews";
const EXPECTED_PROJECTS = 7680;
const EXPECTED_CAPACITY_MW = 356474.09;
const ROWS_PER_PAGE = 100;
const SITE_LABEL_REDACTIONS = new Set(["10199", "5212"]);
const PATHS = Object.freeze({
  projectManifest: "../newsv7/data/v9.1/build_manifest.json",
  projectRoot: "../newsv7/",
  evidence: document.documentElement.dataset.evidenceObject,
  summary: document.documentElement.dataset.summaryObject,
});
const state = {
  projects: [],
  filtered: [],
  news: [],
  regional: [],
  newsMode: "ALL",
  newsQuery: "",
  technology: "all",
  status: "All",
  region: "All",
  minMw: null,
  maxMw: null,
  query: "",
  sort: "capacity_desc",
  page: 0,
  newsByProject: new Map(),
  organisationEvidence: new Map(),
};

function invariant(condition, message) {
  if (!condition) throw new Error(`Release contract failed: ${message}`);
}

function escapeHtml(value) {
  return String(value ?? "").replace(/[&<>'"]/g, (character) => ({
    "&": "&amp;", "<": "&lt;", ">": "&gt;", "'": "&#39;", '"': "&quot;",
  })[character]);
}

function safeHttpUrl(value) {
  try {
    const url = new URL(String(value || ""));
    return ["http:", "https:"].includes(url.protocol) ? `${url.origin}/` : "";
  } catch {
    return "";
  }
}

async function fetchJson(path, timeoutMs = 15000) {
  const controller = new AbortController();
  const timer = setTimeout(() => controller.abort(), timeoutMs);
  try {
    const response = await fetch(new URL(path, window.location.href), {
      cache: "default",
      signal: controller.signal,
    });
    invariant(response.ok, `same-origin object returned ${response.status}`);
    invariant(new URL(response.url).origin === window.location.origin, "cross-origin redirect refused");
    return await response.json();
  } finally {
    clearTimeout(timer);
  }
}

function safeSiteLabel(project) {
  return SITE_LABEL_REDACTIONS.has(String(project.repd_ref))
    ? `SITE LABEL WITHHELD · ${project.gg_project_id}`
    : project.name;
}

function technologyLabel(value) {
  return ({ solar: "Solar", bess: "Battery storage", wind_onshore: "Onshore wind", wind_offshore: "Offshore wind" })[value] || value;
}

function unitFor(value) {
  return value === "solar" ? "MWp" : "MW";
}

function formatNumber(value, maximumFractionDigits = 2) {
  return Number(value || 0).toLocaleString("en-GB", { maximumFractionDigits });
}

function displayDate(value) {
  if (!value) return "NOT SUPPLIED";
  const parts = String(value).split("-");
  return parts.length === 3 ? `${parts[2]}/${parts[1]}/${parts[0]}` : String(value);
}

function atlasUrl(project) {
  if (project.geometry_status !== "valid") return "";
  const url = new URL("https://globalgrid2050.com/repd_grid_atlasv8/");
  url.searchParams.set("repd_ref", project.repd_ref);
  url.searchParams.set("project", safeSiteLabel(project));
  url.searchParams.set("technology", project.technology);
  url.searchParams.set("capacity_mw", project.capacity_mw);
  url.searchParams.set("latitude", project.latitude);
  url.searchParams.set("longitude", project.longitude);
  url.searchParams.set("zoom", "12");
  return url.href;
}

function connectionMarkup(project) {
  const signal = state.newsByProject.get(String(project.repd_ref));
  const organisation = state.organisationEvidence.get(String(project.repd_ref));
  const event = signal ? String(signal.event || "PROJECT UPDATE").toUpperCase() : "NO EXACT NEWS SIGNAL";
  const evidence = organisation
    ? `<span class="organisation-evidence">NEWS/ORGANISATION EVIDENCE: ${escapeHtml(organisation)} · not an official REPD operator field</span>`
    : "";
  const discovery = String(project.repd_ref) === "17494"
    ? '<span class="abstain">DISCOVERY BINDING: ABSTAIN · fixture-only sentinel, not current live discovery</span>'
    : "";
  return `<span><b>TIMING:</b> <strong class="unknown">UNKNOWN</strong> · no exact dated network milestone in pinned evidence</span><span><b>METHOD:</b> <strong class="unknown">UNKNOWN</strong> · no exact voltage, substation, route, bay or connection method in pinned evidence</span><span>NEWS SIGNAL: ${escapeHtml(event)}</span>${discovery}${evidence}<small>Next gate: accepted connection offer, net  … [line shortened here: 480 characters; full line on GitHub]
}

function renderTable() {
  const body = document.getElementById("projectRows");
  const pages = Math.max(1, Math.ceil(state.filtered.length / ROWS_PER_PAGE));
  state.page = Math.min(state.page, pages - 1);
  const start = state.page * ROWS_PER_PAGE;
  const rows = state.filtered.slice(start, start + ROWS_PER_PAGE);
  body.innerHTML = rows.map((project) => {
    const atlas = atlasUrl(project);
    const location = [project.county, project.region].filter(Boolean).join(" · ") || "NOT SUPPLIED";
    return `<tr data-project-id="${escapeHtml(project.gg_project_id)}">
      <td class="site"><strong>${escapeHtml(safeSiteLabel(project))}</strong><small>Official REPD record</small></td>
      <td>${escapeHtml(location)}</td>
      <td><span class="withheld">OPERATOR LABEL WITHHELD</span></td>
      <td><span class="technology ${escapeHtml(project.technology)}">${escapeHtml(technologyLabel(project.technology))}</span></td>
      <td>${escapeHtml(project.status)}</td>
      <td class="number">${formatNumber(project.capacity_mw)} ${unitFor(project.technology)}</td>
      <td class="mono">${escapeHtml(project.repd_ref)}</td>
      <td class="mono">${escapeHtml(project.gg_project_id)}</td>
      <td>${escapeHtml(displayDate(project.repd_record_updated))}</td>
      <td class="connection">${connectionMarkup(project)}</td>
      <td><div class="actions">${atlas ? `<a href="${escapeHtml(atlas)}" target="_blank" rel="noopener">ATLAS ↗</a>` : '<span class="disabled">NO MAP</span>'}<a href="https://www.google.com/search?tbm=nws&q=${encodeURIComponent(`${safeSiteLabel(project)} UK energy project`)}" target="_blank" rel="noopener">NEWS ↗</a><button type="button" data-copy="${escapeHtml(project.gg_project_id)}">COPY ID</bu  … [line shortened here: 416 characters; full line on GitHub]
    </tr>`;
  }).join("");
  const from = state.filtered.length ? start + 1 : 0;
  const to = Math.min(start + ROWS_PER_PAGE, state.filtered.length);
  document.getElementById("pageStatus").textContent = state.filtered.length
    ? `SHOWING ${formatNumber(from, 0)}–${formatNumber(to, 0)} OF ${formatNumber(state.filtered.length, 0)} · PAGE ${state.page + 1} OF ${pages}`
    : "NO PROJECTS MATCH THIS FILTER";
  document.getElementById("previousPage").disabled = state.page === 0;
  document.getElementById("nextPage").disabled = state.page >= pages - 1 || !state.filtered.length;
}

function projectSearchText(project) {
  return [
    safeSiteLabel(project), project.repd_ref, project.gg_project_id, project.gg_development_id,
    project.planning_application_reference, project.planning_authority, project.county,
    project.region, project.status, project.technology,
  ].filter(Boolean).join(" ").toLocaleLowerCase("en-GB");
}

function applyProjectFilters({ resetPage = true } = {}) {
  const tokens = state.query.toLocaleLowerCase("en-GB").split(/\s+/u).filter(Boolean);
  state.filtered = state.projects.filter((project) => {
    if (state.technology !== "all" && project.technology !== state.technology) return false;
    if (state.status !== "All" && project.status !== state.status) return false;
    if (state.region !== "All" && project.region !== state.region) return false;
    if (state.minMw !== null && project.capacity_mw < state.minMw) return false;
    if (state.maxMw !== null && project.capacity_mw > state.maxMw) return false;
    if (tokens.length && !tokens.every((token) => projectSearchText(project).includes(token))) return false;
    return true;
  });
  const comparators = {
    capacity_desc: (left, right) => right.capacity_mw - left.capacity_mw,
    capacity_asc: (left, right) => left.capacity_mw - right.capacity_mw,
    updated_desc: (left, right) => String(right.repd_record_updated || "").localeCompare(String(left.repd_record_updated || "")),
    updated_asc: (left, right) => String(left.repd_record_updated || "").localeCompare(String(right.repd_record_updated || "")),
    site_asc: (left, right) => safeSiteLabel(left).localeCompare(safeSiteLabel(right), "en-GB"),
  };
  state.filtered.sort(comparators[state.sort] || comparators.capacity_desc);
  if (resetPage) state.page = 0;
  const totalCapacity = state.filtered.reduce((sum, row) => sum + row.capacity_mw, 0);
  document.getElementById("filteredProjects").textContent = formatNumber(state.filtered.length, 0);
  document.getElementById("filteredCapacity").textContent = formatNumber(totalCapacity);
  document.getElementById("largestProject").textContent = formatNumber(Math.max(0, ...state.filtered.map((row) => row.capacity_mw)));
  document.getElementById("resultsMeta").textContent = `${formatNumber(state.filtered.length, 0)} OF ${formatNumber(state.projects.length, 0)} PROJECTS · ${formatNumber(totalCapacity)} MW`;
  renderTable();
}

function populateProjectControls() {
  const regions = [...new Set(state.projects.map((row) => row.region).filter(Boolean))].sort((a, b) => a.localeCompare(b, "en-GB"));
  const region = document.getElementById("regionFilter");
  for (const value of regions) region.add(new Option(value, value));
  const statuses = [...new Set(state.projects.map((row) => row.status).filter(Boolean))].sort((a, b) => a.localeCompare(b, "en-GB"));
  const status = document.getElementById("statusFilter");
  for (const value of statuses) status.add(new Option(value, value));
}

function bindProjectControls() {
  document.querySelectorAll("[data-technology]").forEach((button) => {
    button.addEventListener("click", () => {
      state.technology = button.dataset.technology;
      document.querySelectorAll("[data-technology]").forEach((candidate) => candidate.classList.toggle("active", candidate === button));
      applyProjectFilters();
    });
  });
  document.getElementById("statusFilter").addEventListener("change", (event) => { state.status = event.target.value; applyProjectFilters(); });
  document.getElementById("regionFilter").addEventListener("change", (event) => { state.region = event.target.value; applyProjectFilters(); });
  document.getElementById("minCapacity").addEventListener("input", (event) => { state.minMw = event.target.value === "" ? null : Number(event.target.value); applyProjectFilters(); });
  document.getElementById("maxCapacity").addEventListener("input", (event) => { state.maxMw = event.target.value === "" ? null : Number(event.target.value); applyProjectFilters(); });
  document.getElementById("projectSearch").addEventListener("input", (event) => { state.query = event.target.value.trim(); applyProjectFilters(); });
  document.getElementById("projectSort").addEventListener("change", (event) => { state.sort = event.target.value; applyProjectFilters(); });
  document.getElementById("clearFilters").addEventListener("click", () => {
    Object.assign(state, { technology: "all", status: "All", region: "All", minMw: null, maxMw: null, query: "", sort: "capacity_desc" });
    document.querySelectorAll("[data-technology]").forEach((button) => button.classList.toggle("active", button.dataset.technology === "all"));
    document.getElementById("statusFilter").value = "All";
    document.getElementById("regionFilter").value = "All";
    document.getElementById("minCapacity").value = "";
    document.getElementById("maxCapacity").value = "";
    document.getElementById("projectSearch").value = "";
    document.getElementById("projectSort").value = "capacity_desc";
    applyProjectFilters();
  });
  document.getElementById("previousPage").addEventListener("click", () => { if (state.page > 0) { state.page -= 1; renderTable(); } });
  document.getElementById("nextPage").addEventListener("click", () => { if ((state.page + 1) * ROWS_PER_PAGE < state.filtered.length) { state.page += 1; renderTable(); } });
  document.getElementById("projectRows").addEventListener("click", async (event) => {
    const button = event.target.closest("[data-copy]");
    if (!button) return;
    await navigator.clipboard.writeText(button.dataset.copy);
    button.textContent = "COPIED";
  });
  document.getElementById("exportCsv").addEventListener("click", exportCsv);
}

function csvCell(value) {
  let text = String(value ?? "");
  if (/^[=+\-@]/u.test(text)) text = `'${text}`;
  return `"${text.replaceAll('"', '""')}"`;
}

function exportCsv() {
  const headers = ["Site label", "Region", "Operator", "Technology", "Official status", "Official capacity", "REPD Ref", "GlobalGrid Ref", "REPD updated", "Connection timing", "Connection method", "Next evidence gate", "Atlas URL"];
  const rows = state.filtered.map((project) => [
    safeSiteLabel(project), project.region, "OPERATOR LABEL WITHHELD", technologyLabel(project.technology), project.status,
    project.capacity_mw, project.repd_ref, project.gg_project_id, project.repd_record_updated, "UNKNOWN", "UNKNOWN",
    "Accepted connection offer, network register, energisation notice or exact official network document", atlasUrl(project),
  ]);
  const csv = `\ufeff${[headers, ...rows].map((row) => row.map(csvCell).join(",")).join("\r\n")}`;
  const url = URL.createObjectURL(new Blob([csv], { type: "text/csv;charset=utf-8" }));
  const anchor = document.createElement("a");
  anchor.href = url;
  anchor.download = `${RELEASE_ID}-projects.csv`;
  anchor.click();
  URL.revokeObjectURL(url);
}

function safeStory(item) {
  return {
    rank: Number(item.rank),
    evidenceId: String(item.evidence_id),
    evidenceUrlHash: String(item.source_url_sha256),
    evidenceUrl: safeHttpUrl(item.source_origin),
    date: item.published || "DATE NOT SUPPLIED",
    technology: String(item.technology || "ENERGY").toUpperCase(),
    event: String(item.event || "PROJECT UPDATE").toUpperCase(),
    projectId: item.project_id || "NO PROJECT BINDING",
    siteLabel: item.site_label || "",
    officialStatus: item.official_status || "",
    officialCapacityMw: Number.isFinite(item.official_capacity_mw) ? Number(item.official_capacity_mw) : null,
    geography: String(item.geography || ""),
    region: String(item.region || "DISCOVERY"),
    eligible: item.eligible === true,
    confidence: Number(item.confidence || 0),
    restricted: item.restricted === true,
  };
}

function visibleStories() {
  const base = state.news.map(safeStory);
  const regional = state.regional.map(safeStory);
  const rows = ["INTERNATIONAL", "US", "EUROPE"].includes(state.newsMode) ? regional : base;
  const query = state.newsQuery.toLocaleLowerCase("en-GB").split(/\s+/u).filter(Boolean);
  return rows.filter((story) => {
    if (state.newsMode === "UK" && !story.eligible) return false;
    if (state.newsMode === "US" && story.region !== "US") return false;
    if (state.newsMode === "EUROPE" && story.region !== "EUROPE") return false;
    if (state.newsMode === "SOLAR" && !story.technology.includes("SOLAR")) return false;
    if (state.newsMode === "BESS" && !story.technology.includes("BESS")) return false;
    if (state.newsMode === "CONSENT" && story.event !== "CONSENT") return false;
    if (state.newsMode === "CONSTRUCTION" && story.event !== "CONSTRUCTION") return false;
    if (query.length && !query.every((token) => [story.siteLabel, story.officialStatus, story.geography, story.technology, story.event, story.projectId, story.region, story.date, story.evidenceId, story.evidenceUrlHash, String(story.rank)].join(" ").toLocaleLowerCase("en-GB").includes(token))) return false;
    return true;
  });
}

function renderNews() {
  const rows = visibleStories();
  document.getElementById("stories").innerHTML = rows.length ? rows.map((story) => {
    const title = story.restricted
      ? `EVIDENCE ITEM ${String(story.rank).padStart(3, "0")} · PERSONAL IDENTIFIER WITHHELD`
      : story.siteLabel
        ? `${story.siteLabel} · ${story.event}`
        : `${story.technology} · ${story.event} · ${story.geography || story.region}`;
    const binding = story.eligible
      ? `OFFICIAL REPD: ${story.officialStatus} · ${formatNumber(story.officialCapacityMw)} MW · ${story.projectId} · PRIMARY MATCH ${story.confidence}%`
      : `DISCOVERY ONLY · NO PROJECT SIGNAL · IDENTITY ABSTAINS`;
    const evidenceLink = !story.restricted && story.evidenceUrl
      ? `<a href="${escapeHtml(story.evidenceUrl)}" target="_blank" rel="noopener">SOURCE DOMAIN ↗</a>`
      : '<span class="disabled">EVIDENCE LINK WITHHELD</span>';
    return `<article class="story ${story.technology.includes("BESS") ? "bess" : "solar"}"><p class="kicker">${escapeHtml(story.region)} · ${escapeHtml(story.date)}</p><h3>${escapeHtml(title)}</h3><p>${escapeHtml(binding)}</p><p class="provenance"><span>${escapeHtml(story.evidenceId)}</span><code>URL SHA-256 ${escapeHtml(story.evidenceUrlHash)}</code></p><p class="story-law">Typed evidence label o  … [line shortened here: 511 characters; full line on GitHub]
  }).join("") : '<div class="empty">No evidence items match this filter.</div>';
  document.getElementById("newsMeta").textContent = `${rows.length} SHOWN · ${state.news.length} BASE LEDGER · ${state.regional.length} REGIONAL LEDGER`;
}

function bindNewsControls() {
  document.querySelectorAll("[data-news-mode]").forEach((button) => {
    button.addEventListener("click", () => {
      state.newsMode = button.dataset.newsMode;
      document.querySelectorAll("[data-news-mode]").forEach((candidate) => candidate.classList.toggle("active", candidate === button));
      renderNews();
    });
  });
  document.getElementById("newsSearch").addEventListener("input", (event) => { state.newsQuery = event.target.value.trim(); renderNews(); });
}

function renderTechnologyGauges() {
  for (const [technology, elementId] of [["solar", "solarGauge"], ["bess", "bessGauge"], ["wind_onshore", "onshoreGauge"], ["wind_offshore", "offshoreGauge"]]) {
    const rows = state.projects.filter((project) => project.technology === technology);
    const capacity = rows.reduce((sum, project) => sum + project.capacity_mw, 0);
    document.getElementById(elementId).textContent = `${formatNumber(rows.length, 0)} / ${formatNumber(capacity)}`;
  }
}

async function loadProjects() {
  const manifest = await fetchJson(PATHS.projectManifest);
  invariant(manifest.project_count === EXPECTED_PROJECTS, "project manifest count mismatch");
  invariant(Array.isArray(manifest.project_partitions) && manifest.project_partitions.length === 16, "project partition contract mismatch");
  const partitions = await Promise.all(manifest.project_partitions.map(async (descriptor) => {
    const payload = await fetchJson(`${PATHS.projectRoot}${descriptor.path}`);
    invariant(payload.record_count === descriptor.record_count, "partition count mismatch");
    return payload.projects;
  }));
  state.projects = partitions.flat();
  invariant(state.projects.length === EXPECTED_PROJECTS, "project spine count mismatch");
  const refs = new Set();
  let capacity = 0;
  for (const project of state.projects) {
    invariant(project.gg_project_id === `GG2050-REPD-${project.repd_ref}`, "stable project identity mismatch");
    invariant(!refs.has(project.repd_ref), "duplicate project identity");
    refs.add(project.repd_ref);
    capacity += project.capacity_mw;
  }
  invariant(Math.round(capacity * 100) / 100 === EXPECTED_CAPACITY_MW, "project capacity mismatch");
  invariant(refs.has("13599") && refs.has("17494"), "sentinel identity missing");
  renderTechnologyGauges();
  populateProjectControls();
  bindProjectControls();
  applyProjectFilters();
  document.getElementById("projectStatus").textContent = `${formatNumber(state.projects.length, 0)} OFFICIAL PROJECTS LOADED · ${formatNumber(capacity)} MW`;
}

async function loadNews() {
  const payload = await fetchJson(PATHS.evidence);
  invariant(payload.schema === "pipelinenews.safe-evidence-ledger.v2", "safe evidence contract mismatch");
  invariant(Array.isArray(payload.base) && payload.base.length === 133, "headline ledger count mismatch");
  invariant(Array.isArray(payload.regional) && payload.regional.length === 19, "regional ledger count mismatch");
  invariant(payload.raw_fields_republished === false, "raw evidence publication refused");
  invariant([...payload.base, ...payload.regional].every((item) => /^[a-f0-9]{64}$/u.test(item.source_url_sha256)), "evidence URL hash mismatch");
  state.news = payload.base;
  state.regional = payload.regional;
  state.newsByProject = new Map(payload.base.filter((item) => item.eligible === true && item.repd_ref).map((item) => [String(item.repd_ref), item]));
  renderNews();
}

function renderIntelligence(summary) {
  invariant(summary.schema === "pipelinenews.safe-intelligence-summary.v2", "safe intelligence summary mismatch");
  const cards = [
    ["FASTEST ROUTE TO NET ZERO", `${formatNumber(summary.spine.solar.capacity_mw)} MWp solar · ${formatNumber(summary.spine.bess.capacity_mw)} MW BESS`, "Official capacity and status remain distinct from news and planning evidence."],
    ["SOLAR + BESS PROGRESS", `${formatNumber(summary.spine.solar.projects, 0)} solar · ${formatNumber(summary.spine.bess.projects, 0)} BESS`, "Full admitted project spine retained; editorial focus never filters the register."],
    ["WHEN CONNECTING?", summary.connection.when, summary.connection.next_gate],
    ["HOW CONNECTING?", summary.connection.how, summary.connection.next_gate],
    ["OFFICIAL-SOURCE FRONTIER", `${summary.frontier.cursor} / ${formatNumber(summary.frontier.total_groups, 0)} groups · ${summary.frontier.records} observations`, `${summary.frontier.primary_match} authority-safe · ${summary.frontier.abstain} abstain · ${summary.frontier.status}`],
  ];
  document.getElementById("intelligenceCards").innerHTML = cards.map(([title, value, note]) => `<article><h3>${escapeHtml(title)}</h3><strong>${escapeHtml(value)}</strong><p>${escapeHtml(note)}</p></article>`).join("");
  state.organisationEvidence = new Map(summary.sentinels.filter((row) => row.organisation_evidence).map((row) => [String(row.repd_ref), row.organisation_evidence]));
  if (state.projects.length) renderTable();
  document.getElementById("intelligenceStatus").textContent = "SAFE TYPED SUMMARY LOADED · OPTIONAL TO CORE BOOT";
}

async function loadOptionalIntelligence() {
  try {
    renderIntelligence(await fetchJson(PATHS.summary));
  } catch {
    document.getElementById("intelligenceCards").innerHTML = '<div class="empty">Optional intelligence unavailable. Newspaper and full project register remain usable.</div>';
    document.getElementById("intelligenceStatus").textContent = "OPTIONAL INTELLIGENCE UNAVAILABLE · CORE UNAFFECTED";
  }
}

async function boot() {
  bindNewsControls();
  const projectPromise = loadProjects().catch(() => {
    document.getElementById("projectRows").innerHTML = '<tr><td colspan="11" class="empty">Official project spine unavailable. The project surface has failed closed.</td></tr>';
    document.getElementById("projectStatus").textContent = "OFFICIAL PROJECT SPINE UNAVAILABLE · FAILED CLOSED";
  });
  const newsPromise = loadNews().catch(() => {
    document.getElementById("stories").innerHTML = '<div class="empty">Newspaper ledger unavailable. The project register remains usable.</div>';
    document.getElementById("newsMeta").textContent = "NEWSPAPER UNAVAILABLE · PROJECT REGISTER UNAFFECTED";
  });
  await Promise.allSettled([projectPromise, newsPromise]);
  setTimeout(loadOptionalIntelligence, 0);
}

boot();

Browser PipelineNews

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

testpipelinenews / archive/202608261547-pipelinenews/tests/browser-202608260159-pipelinenews.mjs · lines 1–80 of 80 · version 2026-08-26 01:59 · Not reached from any entry point (candidate for review)

What it does
It tests the REPD register. Defines open. Uses libraries node:assert/strict, node:fs/promises, node:module, playwright. Side effects: changes the web page (DOM); reads or writes files.
Why it exists in the grid workflow
Domain stage experimental (path word 'archive'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: the REPD register.
What it achieves
Defines `open`.
Why it matters
No other file in the estate was found to import it.
Application
pipelinenews · archive/202608261547-pipelinenews/tests · JavaScript module
Uses
node:assert/strict, node:fs/promises, node:module, playwright
Used by
none found
Produces
open
Defines here
open
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 archive/202608261547-pipelinenews/tests/browser-202608260159-pipelinenews.mjs:1-80 · blob 5ee99362d43328538df790e077f537200bc3d4eb · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: experimental · users: none · canonical: unreached_review
import assert from "node:assert/strict";
import { mkdir } from "node:fs/promises";
import { createRequire } from "node:module";

let chromium;
try { ({ chromium } = await import("playwright")); }
catch { ({ chromium } = createRequire("/tmp/pn-playwright/package.json")("playwright")); }
const baseUrl = process.env.PIPELINENEWS_BASE_URL
  ? `${process.env.PIPELINENEWS_BASE_URL.replace(/\/$/u, "")}/202608260159-pipelinenews/`
  : "http://127.0.0.1:8765/202608260159-pipelinenews/";
const output = process.env.QA_SCREENSHOT_DIR || "/tmp/qa-202608260159";
await mkdir(output, { recursive: true });

async function open(browser, viewport) {
  const page = await browser.newPage({ viewport });
  const errors = [];
  page.on("console", (message) => { if (message.type() === "error") errors.push(`console:${message.text()}`); });
  page.on("pageerror", (error) => errors.push(`page:${error.message}`));
  page.on("requestfailed", (request) => errors.push(`network:${request.url()}`));
  const response = await page.goto(baseUrl, { waitUntil: "networkidle" });
  assert.ok(response?.ok());
  await page.waitForFunction(() => document.querySelectorAll("#tbody tr").length === 7680 && document.querySelectorAll("#stories .story").length === 133);
  return { page, errors };
}

const browser = await chromium.launch({ headless: true });
try {
  const desktop = await open(browser, { width: 1440, height: 1000 });
  const page = desktop.page;
  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("#stories .story").count(), 133);
  assert.equal(await page.locator("thead th").count(), 11);
  await page.evaluate(() => window.scrollTo(0, 0));
  await page.screenshot({ path: `${output}/desktop.png` });
  await page.locator('[data-news="UK"]').click();
  assert.equal(await page.locator("#stories .story").count(), 45);
  assert.match(await page.locator("#stories").innerText(), /GG2050-REPD-13599/);
  await page.locator('[data-news="INTERNATIONAL"]').click();
  assert.equal(await page.locator("#stories .story").count(), 19);
  await page.locator('[data-news="US"]').click(); assert.equal(await page.locator("#stories .story").count(), 4);
  await page.locator('[data-news="EUROPE"]').click(); assert.equal(await page.locator("#stories .story").count(), 9);
  await page.locator('[data-technology="solar"]').click();
  assert.match(await page.locator("#resultsMeta").innerText(), /3,563/);
  await page.locator("#clearFilters").click();
  await page.locator("#search").fill("GG2050-REPD-17494");
  assert.match(await page.locator("#resultsMeta").innerText(), /^1 /);
  assert.equal(await page.locator("#tbody tr").count(), 1);
  await page.locator("#clearFilters").click();
  const first = await page.locator("#tbody tr").first().locator("td").nth(7).innerText();
  await page.locator("#sortProjects").selectOption("updated_asc");
  const sorted = await page.locator("#tbody tr").first().locator("td").nth(7).innerText();
  assert.notEqual(first, sorted);
  const [download] = await Promise.all([page.waitForEvent("download"), page.locator("#exportInline").click()]);
  const stream = await download.createReadStream(); let csv = ""; for await (const chunk of stream) csv += chunk;
  assert.match(csv, /OPERATOR LABEL WITHHELD/);
  assert.ok(await page.locator("a.atlaslink").first().getAttribute("href"));
  assert.deepEqual(desktop.errors, []);
  await page.close();

  const mobile = await open(browser, { width: 390, height: 844 });
  const layout = await mobile.page.locator(".tablewrap").evaluate((wrap) => ({ client: wrap.clientWidth, scroll: wrap.scrollWidth, overflow: getComputedStyle(wrap).overflowX, columns: wrap.querySelectorAll("thead th").length, visible: [...wrap.querySelectorAll("thead th")].every((cell) => getComputedStyle(cell).display === "table-cell") }));
  assert.equal(layout.overflow, "auto"); assert.ok(layout.scroll > layout.client); assert.equal(layout.columns, 11); assert.equal(layout.visible, true);
  assert.ok(await mobile.page.locator("#stories .story").first().isVisible());
  await mobile.page.screenshot({ path: `${output}/mobile-390.png` });
  assert.deepEqual(mobile.errors, []);
  await mobile.page.close();

  const failContext = await browser.newContext({ viewport: { width: 390, height: 844 } });
  const failClosed = await failContext.newPage();
  await failClosed.route("**/dist/major_project_news_v9_5_1.json*", (route) => route.fulfill({ status: 503, body: "unavailable" }));
  await failClosed.goto(baseUrl, { waitUntil: "networkidle" });
  await failClosed.waitForFunction(() => document.querySelectorAll("#tbody tr").length === 7680);
  assert.equal(await failClosed.locator("#tbody tr").count(), 7680);
  assert.match(await failClosed.locator("#stories").innerText(), /unavailable|No governed|No headlines match/i);
  await failClosed.screenshot({ path: `${output}/mobile-390-fail-closed.png` });
  await failContext.close();
} finally { await browser.close(); }
console.log("BROWSER 202608260159: PASS · desktop · mobile 390 · interactions · fail-closed");

Browser Live

A JavaScript module in the tests folder of PipelineNews that tests the Renewable Energy Planning Database (REPD) register, using SHA-256. It opens exact release (`openExactRelease`).

testpipelinenews / archive/202608261547-pipelinenews/tests/browser-live-202608251929.mjs · lines 1–62 of 62 · version 2026-08-25 19:29 · Not reached from any entry point (candidate for review)

What it does
It tests the REPD register. Defines openExactRelease. Uses libraries node:assert/strict, node:fs/promises, playwright. Side effects: changes the web page (DOM); reads or writes files.
Why it exists in the grid workflow
Domain stage experimental (path word 'archive'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: the REPD register.
What it achieves
Defines `openExactRelease`.
Why it matters
No other file in the estate was found to import it.
Application
pipelinenews · archive/202608261547-pipelinenews/tests · JavaScript module
Uses
node:assert/strict, node:fs/promises, playwright
Used by
none found
Produces
openExactRelease
Defines here
openExactRelease
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 archive/202608261547-pipelinenews/tests/browser-live-202608251929.mjs:1-62 · blob 7b229009592f43b856c9463a6cc1ea195c9c328e · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: experimental · users: none · canonical: unreached_review
import assert from "node:assert/strict";
import { mkdir } from "node:fs/promises";

const base = process.env.PIPELINENEWS_BASE_URL;
if (!base) throw new Error("LIVE_QA_BASE_URL_REQUIRED");
const deploymentSha = process.env.PIPELINENEWS_DEPLOY_SHA || "UNSPECIFIED";
let chromium;
try { ({ chromium } = await import("playwright")); } catch { throw new Error("LIVE_QA_PLAYWRIGHT_REQUIRED"); }
const output = process.env.QA_SCREENSHOT_DIR || "reports/browser-202608251929";
await mkdir(output, { recursive: true });
const browser = await chromium.launch({ headless: true });
const releaseUrl = `${base.replace(/\/$/u, "")}/202608251929-pipelinenews/`;
async function openExactRelease(page, mode) {
  let lastStatus = 0;
  for (let attempt = 1; attempt <= 10; attempt += 1) {
    const response = await page.goto(`${releaseUrl}?deployment=${deploymentSha}&qa=${mode}&attempt=${attempt}`, { waitUntil: "domcontentloaded" });
    lastStatus = response?.status() || 0;
    if (response?.ok() && await page.locator("body").getByText("202608251929-pipelinenews", { exact: false }).count()) return;
    await page.waitForTimeout(5000);
  }
  throw new Error(`LIVE_QA_EXACT_RELEASE_UNAVAILABLE_${lastStatus}`);
}
for (const [label, viewport] of [["desktop", { width: 1365, height: 900 }], ["mobile-390", { width: 390, height: 844 }]]) {
  const page = await browser.newPage({ viewport });
  const consoleErrors = []; const failures = []; const pageErrors = []; const dataOrigins = [];
  page.on("console", (message) => { if (message.type() === "error") consoleErrors.push("CONSOLE_ERROR"); });
  page.on("requestfailed", () => failures.push("NETWORK_FAILURE"));
  page.on("pageerror", () => pageErrors.push("PAGE_ERROR"));
  page.on("request", (request) => { if (["fetch", "xhr", "script", "stylesheet"].includes(request.resourceType())) dataOrigins.push(new URL(request.url()).origin); });
  await openExactRelease(page, label); await page.waitForLoadState("networkidle");
  await page.waitForFunction(() => document.querySelectorAll("#projectRows tr").length === 100 && document.querySelectorAll("#stories .story").length === 133);
  assert.equal(await page.locator("thead th").count(), 11); assert.equal(await page.locator("#intelligenceCards article").count(), 5);
  assert.match(await page.locator("#solarGauge").textContent(), /^3,563 \/ 67,013\.29$/u); assert.match(await page.locator("#bessGauge").textContent(), /^1,609 \/ 147,681\.94$/u);
  assert.equal(await page.locator("#stories .provenance").count(), 133); assert.ok(await page.locator("#stories .provenance code").evaluateAll((nodes) => nodes.every((node) => /^URL SHA-256 [a-f0-9]{64}$/u.test(node.textContent))));
  assert.doesNotMatch(await page.locator("#stories .story h3").first().textContent(), /^EVIDENCE ITEM/u);
  await page.evaluate(() => window.scrollTo(0, 0)); await page.screenshot({ path: `${output}/${label}-newspaper.png` });
  assert.equal(await page.locator(".story a").count(), 130); assert.equal(await page.locator(".story .disabled").count(), 3);
  assert.ok(await page.locator(".story a").evaluateAll((links) => links.every((link) => new URL(link.href).pathname === "/" && !new URL(link.href).search && !new URL(link.href).hash)));
  await page.getByRole("button", { name: "UK", exact: true }).click(); await page.waitForFunction(() => document.querySelectorAll("#stories .story").length === 45); assert.equal(await page.locator("#stories .story").count(), 45); await page.locator("#newsSearch").fill("GG2050-REPD-13599"); assert.ok(await page.locator("#stories .story").count() >= 1); await page.locator("#newsSearch").fill(""); aw  … [line shortened here: 562 characters; full line on GitHub]
  await page.locator('[data-technology="solar"]').click(); assert.equal((await page.locator("#filteredProjects").textContent()).replaceAll(",", ""), "3563");
  await page.locator("#clearFilters").click(); await page.locator("#statusFilter").selectOption("Operational"); assert.ok(Number((await page.locator("#filteredProjects").textContent()).replaceAll(",", "")) > 0);
  await page.locator("#clearFilters").click(); const firstRegion = await page.locator("#regionFilter option").nth(1).getAttribute("value"); await page.locator("#regionFilter").selectOption(firstRegion); assert.ok(Number((await page.locator("#filteredProjects").textContent()).replaceAll(",", "")) > 0);
  await page.locator("#clearFilters").click(); await page.locator("#projectSearch").fill("GG2050-REPD-13599"); await page.waitForFunction(() => document.querySelector("#filteredProjects")?.textContent === "1"); assert.equal(await page.locator("#projectRows tr").count(), 1); assert.match(await page.locator("#projectRows tr td").nth(9).textContent(), /NEWS\/ORGANISATION EVIDENCE/);
  await page.locator("#projectSearch").fill("GG2050-REPD-17494"); await page.waitForFunction(() => document.querySelector("#filteredProjects")?.textContent === "1"); assert.match(await page.locator("#projectRows tr td").nth(9).textContent(), /TIMING:\s*UNKNOWN/); assert.match(await page.locator("#projectRows tr td").nth(9).textContent(), /METHOD:\s*UNKNOWN/); assert.match(await page.locator("#proj  … [line shortened here: 470 characters; full line on GitHub]
  await page.locator("#clearFilters").click(); await page.locator("#minCapacity").fill("400"); await page.locator("#maxCapacity").fill("400"); assert.equal((await page.locator("#filteredProjects").textContent()).replaceAll(",", ""), "37");
  await page.locator("#clearFilters").click(); const high = await page.locator("#projectRows tr").first().getAttribute("data-project-id"); await page.locator("#projectSort").selectOption("capacity_asc"); const low = await page.locator("#projectRows tr").first().getAttribute("data-project-id"); assert.notEqual(high, low); await page.locator("#projectSort").selectOption("capacity_desc");
  await page.locator("#projectSort").selectOption("updated_desc"); const newest = await page.locator("#projectRows tr").first().getAttribute("data-project-id"); await page.locator("#projectSort").selectOption("updated_asc"); const oldest = await page.locator("#projectRows tr").first().getAttribute("data-project-id"); assert.notEqual(newest, oldest); await page.locator("#projectSort").selectOption(  … [line shortened here: 417 characters; full line on GitHub]
  await page.locator("#nextPage").click(); assert.match(await page.locator("#pageStatus").textContent(), /PAGE 2 OF/); await page.locator("#previousPage").click(); assert.match(await page.locator("#pageStatus").textContent(), /PAGE 1 OF/);
  const [download] = await Promise.all([page.waitForEvent("download"), page.locator("#exportCsv").click()]); const stream = await download.createReadStream(); let csv = ""; for await (const chunk of stream) csv += chunk; assert.match(csv, /^\uFEFF?"Site label","Region","Operator"/u); assert.match(csv, /OPERATOR LABEL WITHHELD/); assert.doesNotMatch(csv, /undefined|null/u);
  const atlas = await page.locator("#projectRows a").filter({ hasText: "ATLAS" }).first().getAttribute("href"); assert.ok(new URL(atlas).searchParams.has("repd_ref"));
  await page.getByRole("button", { name: "INTERNATIONAL", exact: true }).click(); await page.waitForFunction(() => document.querySelectorAll("#stories .story").length === 19); assert.equal(await page.locator("#stories .story").count(), 19); assert.equal(await page.locator("#stories .disabled").count(), 1);
  if (label === "mobile-390") { assert.ok(await page.locator(".tablewrap").evaluate((node) => node.scrollWidth > node.clientWidth)); assert.equal(await page.locator("#projectRows tr").first().locator("td").count(), 11); assert.ok(await page.locator("#stories .story").first().isVisible()); const boxes = await Promise.all([page.locator("#minCapacity").boundingBox(), page.locator("#maxCapacity").boun  … [line shortened here: 584 characters; full line on GitHub]
  const expectedOrigin = new URL(base).origin; assert.ok(dataOrigins.every((origin) => origin === expectedOrigin)); assert.deepEqual(consoleErrors, []); assert.deepEqual(failures, []); assert.deepEqual(pageErrors, []);
  await page.locator(".tablewrap").scrollIntoViewIfNeeded(); await page.screenshot({ path: `${output}/${label}-project-table.png` }); await page.close();
}
const failClosed = await browser.newPage({ viewport: { width: 390, height: 844 } });
await failClosed.route("**/objects/data/sha256/*.json", (route) => route.abort());
await openExactRelease(failClosed, "fail-closed"); await failClosed.waitForLoadState("networkidle");
await failClosed.waitForFunction(() => document.querySelectorAll("#projectRows tr").length === 100 && document.querySelectorAll("#stories .story").length === 133);
assert.match(await failClosed.locator("#intelligenceStatus").textContent(), /OPTIONAL INTELLIGENCE UNAVAILABLE/);
await failClosed.locator("#intelligenceStatus").scrollIntoViewIfNeeded(); await failClosed.screenshot({ path: `${output}/mobile-390-fail-closed.png` });
await browser.close(); process.stdout.write("LIVE BROWSER QA 202608251929: PASS\n");

Check Release

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

testpipelinenews / archive/202608261547-pipelinenews/tests/check-202608251651-release.mjs · lines 1–50 of 50 · version 2026-08-25 16:51 · Not reached from any entry point (candidate for review)

What it does
It tests pipeline news and the REPD register. Defines read, json, sha256. Uses libraries node:assert/strict, node:crypto, node:fs/promises. Side effects: reads or writes files.
Why it exists in the grid workflow
Domain stage experimental (path word 'archive'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: the REPD register.
Inputs & outputs
In: JSON file current.json; JSON file release.json; JSON file 202608251528-PipelineNews.json; JSON file 202608251622-PipelineNews.json; JSON file 202608251636-PipelineNews.json.
What it achieves
Its name says it checks release. Defines `read`, `json` and `sha256`.
Why it matters
No other file in the estate was found to import it.
Application
pipelinenews · archive/202608261547-pipelinenews/tests · JavaScript module
Uses
node:assert/strict, node:crypto, node:fs/promises
Used by
none found
Produces
read, json, sha256
Defines here
read, json, sha256
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 archive/202608261547-pipelinenews/tests/check-202608251651-release.mjs:1-50 · blob defd6dddf1f38d61810cfba0b158dcd3ea7083d4 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: experimental · users: none · canonical: unreached_review
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { readFile, readdir } from "node:fs/promises";
const root = new URL("../", import.meta.url);
const read = (path) => readFile(new URL(path, root));
const json = async (path) => JSON.parse(await read(path));
const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex");

const pointer = await json("releases/current.json");
assert.equal(pointer.release_id, "202608251651-PipelineNews");
const manifest = await json(pointer.manifest);
assert.equal(manifest.app_title, "PipelineNews");
assert.equal(manifest.lineage.parent_release, "202608251636-PipelineNews");
assert.equal(manifest.lineage.frozen_versions_mutated, false);
const pinned = [...manifest.objects.inputs, ...manifest.objects.modules, ...manifest.objects.artifacts, ...manifest.objects.css, ...manifest.app.shell_files, manifest.build.builder, manifest.build.official_poller, manifest.build.repd_source_checker];
for (const item of pinned) { const bytes = await read(item.path); assert.equal(sha256(bytes), item.sha256, item.path); assert.equal(bytes.byteLength, item.bytes, item.path); }
assert.deepEqual((await readdir(new URL(manifest.app.release_folder, root))).sort(), ["README.md", "index.html", "release.json"]);
const contract = await json(manifest.objects.artifacts[0].path);
assert.equal(contract.spine.source_rows, 14657);
assert.equal(contract.spine.total_projects, 7680);
assert.equal(contract.spine.unique_planning_reference_groups, 6870);
assert.equal(contract.scheduler.max_concurrency, 1);
assert.equal(contract.scheduler.inter_request_delay_ms, 2000);
assert.equal(contract.publication_law.google_discovery_retained, true);
assert.equal(contract.fixture_proof.east_pye_binding.repd_ref, "17494");
assert.equal(contract.fixture_proof.duplicate_reference_decision.role, "ABSTAIN");
const input = await json(manifest.objects.inputs[0].path);
const engineUrl = new URL(manifest.objects.modules.find((item) => item.role === "official_frontier_engine").path, root);
const { buildFrontierContract } = await import(engineUrl.href);
assert.equal(sha256(Buffer.from(`${JSON.stringify(buildFrontierContract(input), null, 2)}\n`)), manifest.objects.artifacts[0].sha256);
const poller = (await read(manifest.build.official_poller.path)).toString("utf8");
assert.match(poller, /await sleep\(2_000\)/);
assert.match(poller, /response\.status === 429/);
assert.doesNotMatch(poller, /Promise\.all\(pair/);
const checker = (await read(manifest.build.repd_source_checker.path)).toString("utf8");
assert.match(checker, /Solar Photovoltaics/);
assert.match(checker, /Number\(row\["Installed Capacity \(MWelec\)"\]\) >= 1/);
assert.match(checker, /newRows\.map\(publicProject\)/);
for (const workflowPath of [".github/workflows/official-source-frontier.yml", ".github/workflows/repd-monthly-check.yml"]) {
  const workflow = (await read(workflowPath)).toString("utf8");
  assert.match(workflow, /group: pipelinenews-data-writers/);
  assert.match(workflow, /cancel-in-progress: false/);
  assert.match(workflow, /git pull --rebase origin main/);
}
for (const priorPath of ["releases/202608251528-PipelineNews.json", "releases/202608251622-PipelineNews.json", "releases/202608251636-PipelineNews.json"]) {
  const prior = await json(priorPath);
  const priorPinned = [...prior.objects.inputs, ...prior.objects.modules, ...prior.objects.artifacts, ...prior.objects.css, ...prior.app.shell_files, prior.build.builder];
  for (const item of priorPinned) { const bytes = await read(item.path); assert.equal(sha256(bytes), item.sha256, `frozen prior changed: ${item.path}`); assert.equal(bytes.byteLength, item.bytes, `frozen prior size changed: ${item.path}`); }
}
console.log("PASS 202608251651-PipelineNews: scoped quarterly REPD diff; sequential rate-aware PlanIt; writer jobs never cancel; Google retained");

Check PipelineNews

A JavaScript module in the tests folder that tests major project news, solar, battery storage (BESS) and the Renewable Energy Planning Database (REPD) register, using SHA-256.

testpipelinenews / archive/202608261547-pipelinenews/tests/check-202608260159-pipelinenews.mjs · lines 1–65 of 65 · version 2026-08-26 01:59 · Not reached from any entry point (candidate for review) · pattern technology (shared by 6 files)

What it does
It tests major project news, solar, battery storage (BESS) and the REPD register. Defines read, json, sha256, technology. Uses libraries node:assert/strict, node:crypto, node:fs/promises. Side effects: reads or writes files.
Why it exists in the grid workflow
Domain stage experimental (path word 'archive'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow. Domain terms in the code: solar, battery storage (BESS), the REPD register.
Inputs & outputs
In: JSON file build_manifest.json; JSON file major_project_news_v9_5_1.json.
Downstream impact
Used directly by 1 file: Check Current Timestamp Release (pipelinenews).
What it achieves
It is built from the technology step (`technology`). Its name says it checks PipelineNews. Defines `read`, `json`, `sha256` and 1 more.
Why it matters
Checked by Check Current Timestamp Release.
Application
pipelinenews · archive/202608261547-pipelinenews/tests · JavaScript module
Uses
node:assert/strict, node:crypto, node:fs/promises
Used by
imported by Check Current Timestamp Release (dynamic import)
Produces
read, json, sha256, technology
Defines here
read, json, sha256, technology
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 archive/202608261547-pipelinenews/tests/check-202608260159-pipelinenews.mjs:1-65 · blob caaca521f7ae685fc79e1b11559fbd682ebde84a · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: experimental · users: none · canonical: unreached_review
import assert from "node:assert/strict";
import { createHash } from "node:crypto";
import { readFile } from "node:fs/promises";

const id = "202608260159-pipelinenews";
const base = new URL(`../${id}/`, import.meta.url);
const read = (path) => readFile(new URL(path, base));
const json = async (path) => JSON.parse(await read(path));
const sha256 = (bytes) => createHash("sha256").update(bytes).digest("hex");
const manifest = await json("data/v9.1/build_manifest.json");
const news = await json("dist/major_project_news_v9_5_1.json");
const html = (await read("index.html")).toString("utf8");
const releaseManifest = JSON.parse(await readFile(new URL(`../releases/${id}.json`, import.meta.url), "utf8"));

assert.equal(manifest.project_count, 7680);
assert.equal(manifest.capacity_mw, 356474.09);
assert.equal(manifest.solar_count, 3563);
assert.equal(manifest.bess_count, 1609);
for (const entry of [...manifest.project_partitions, ...manifest.atlas_partitions]) {
  const bytes = await read(entry.path.replace(/^data\/v9\.1\//u, "data/v9.1/"));
  assert.equal(sha256(bytes), entry.sha256, entry.path);
}
const parts = await Promise.all(manifest.project_partitions.map((entry) => json(entry.path.replace(/^data\/v9\.1\//u, "data/v9.1/"))));
const projects = parts.flatMap((part) => part.projects);
assert.equal(projects.length, 7680);
assert.equal(Math.round(projects.reduce((sum, row) => sum + row.capacity_mw, 0) * 100) / 100, 356474.09);
const technology = (key) => {
  const rows = projects.filter((row) => row.technology === key);
  return [rows.length, Math.round(rows.reduce((sum, row) => sum + row.capacity_mw, 0) * 100) / 100];
};
assert.deepEqual(technology("solar"), [3563, 67013.29]);
assert.deepEqual(technology("bess"), [1609, 147681.94]);
assert.ok(projects.some((row) => String(row.repd_ref) === "13599"));
assert.ok(projects.some((row) => row.gg_project_id === "GG2050-REPD-17494"));
assert.ok(projects.every((row) => row.gg_project_id === `GG2050-REPD-${row.repd_ref}`));
assert.equal(news.all_items.length, 133);
assert.equal(news.canonical_items.length, 45);
assert.ok(news.all_items.every((row) => row.operator === "" && /^https:\/\/[^/]+\/$/u.test(row.url)));
assert.ok(news.all_items.every((row) => /^(?:UK|US|EUROPE|INTERNATIONAL|DISCOVERY) · (?:SOLAR|BESS|SOLAR \+ BESS) · /u.test(row.headline)));
assert.equal((html.match(/<th(?:\s|>)/gu) || []).length, 11);
assert.match(html, /vendor\/chart\.umd\.min\.js/);
assert.doesNotMatch(html, /cdn\.jsdelivr|raw\.githubusercontent/);
assert.match(html, /202608260159/);
for (const source of html.matchAll(/(?:src|href)="([^"]+)"/gu)) {
  const value = source[1];
  if (/^(?:https?:|#)/u.test(value)) continue;
  const local = value.split(/[?#]/u)[0];
  await read(local);
}
assert.equal(releaseManifest.timeline.incepted_at, "2026-08-26T01:59:35+01:00");
assert.equal(releaseManifest.publication.live, false);
assert.equal(releaseManifest.frozen_preservation.predecessor_release_bytes_written, false);
for (const [category, rows] of Object.entries(releaseManifest.byte_inventory)) {
  let bytes = 0;
  for (const item of rows) {
    const content = await readFile(new URL(`../${item.path}`, import.meta.url));
    assert.equal(content.length, item.bytes, item.path);
    assert.equal(sha256(content), item.sha256, item.path);
    bytes += content.length;
  }
  assert.deepEqual(releaseManifest.byte_accounting[category], { files: rows.length, bytes });
}
const proof = JSON.parse(await readFile(new URL(`../reports/${id}-proof.json`, import.meta.url), "utf8"));
assert.deepEqual(proof.byte_accounting, releaseManifest.byte_accounting);
console.log("CHECK 202608260159: PASS · 7,680 projects · 356,474.09 MW · 133 typed headlines · local closure");

Check Current Timestamp Release

A JavaScript module in the tests folder of PipelineNews.

testpipelinenews / archive/202608261547-pipelinenews/tests/check-current-timestamp-release.mjs · lines 1–1 of 1 · version 2026-08-26 15:47 · Not reached from any entry point (candidate for review)

What it does
It tests its inputs.
Why it exists in the grid workflow
Domain stage experimental (path word 'archive'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
What it achieves
Its name says it checks current timestamp release.
Why it matters
No other file in the estate was found to import it.
Application
pipelinenews · archive/202608261547-pipelinenews/tests · JavaScript module
Uses
Check PipelineNews (dynamic import)
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 archive/202608261547-pipelinenews/tests/check-current-timestamp-release.mjs:1-1 · blob 1f2a0b57ed3ace12174c57d9e0bc3daad478de19 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: none found · domain stage: experimental · users: none · canonical: unreached_review
await import("./check-202608260159-pipelinenews.mjs");