GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Automation and CI / globalgrid2050 / automation/v940_preview

Build and 13 more files

A JavaScript module in the grid engine folder of GlobalGrid2050 that draws iterations and uses data from the ventus-grid-engine repository. Served with the page at https://globalgrid2050.com/grid_engine/.

607 lines of JavaScript and Python and YAML from globalgrid2050, in 14 files. Topic: Automation and CI. Section 1752 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. Test Migration test · globalgrid2050 / automation/v940_preview/test_migration.py lines 1–65
  2. Test Migration Origins test · globalgrid2050 / automation/v940_preview/test_migration_origins.py lines 1–53
  3. Browser render · globalgrid2050 / automation/v941_preview/browser.mjs lines 1–46
  4. Contracts Test test · globalgrid2050 / automation/v941_preview/contracts.test.mjs lines 1–10
  5. Minimum Test test · globalgrid2050 / automation/v941_preview/minimum.test.mjs lines 1–9
  6. Browser render · globalgrid2050 / automation/v942_preview/browser.mjs lines 1–42
  7. Contracts Test test · globalgrid2050 / automation/v942_preview/contracts.test.mjs lines 1–25
  8. Public interaction · globalgrid2050 / automation/v942_preview/public.mjs lines 1–53
  9. Browser other · globalgrid2050 / automation/v943_preview/browser.mjs lines 1–2
  10. Model Test test · globalgrid2050 / cartridges/202609052150-nasa-ice/model.test.mjs lines 1–4
  11. Model Test test · globalgrid2050 / cartridges/202609052156-rc-rl/model.test.mjs lines 1–2
  12. Manifest test · globalgrid2050 / feature_requests/test_simple_manifest/manifest.yml lines 1–3
  13. Manifest test · globalgrid2050 / feature_requests/test_simple_path/manifest.yml lines 1–6
  14. Build render · globalgrid2050 / grid_engine/build.mjs lines 1–287

Test Migration

A test in the automation folder of GlobalGrid2050 that checks Feature Contracts.

testglobalgrid2050 / automation/v940_preview/test_migration.py · lines 1–65 of 65 · Entry point · pattern tearDown (shared by 38 files)

What it does
It tests its inputs. Defines 8 functions or classes, including NeonMigrationTests, setUp, tearDown, save, test_pinned_successor_admits_one_scoped_probe. Uses libraries json, pathlib, shutil, sys, tempfile. Side effects: reads or writes files.
Inputs & outputs
In: JSON file ticker.v940.json; JSON file test.json. Out: JSON file test.json; JSON file ticker.v940.json.
Downstream impact
Used directly by 2 files: GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050); GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050).
What it achieves
It sets up (`setUp`) and is built from the neon migration tests class (`NeonMigrationTests`) and the tear down helper (`tearDown`). Adversarial checks for the explicit source-preserving presentation migration.
Why it matters
Run by GlobalGrid2050 Project Signals Acid Workflow and GlobalGrid2050 V934 Preview Acceptance Workflow.
Application
globalgrid2050 · automation/v940_preview · test
Uses
Feature Contracts (sys.path import), json, pathlib, shutil, sys, tempfile, unittest
Used by
run by GlobalGrid2050 Project Signals Acid Workflow (workflow run), run by GlobalGrid2050 V934 Preview Acceptance Workflow (workflow run)
Produces
NeonMigrationTests
Defines here
NeonMigrationTests, setUp, tearDown, save, test_pinned_successor_admits_one_scoped_probe, test_changed_shared_bytes_are_rejected, test_changed_policy_or_data_is_rejected, test_missing_pin_and_wrong_contract_cap_are_rejected
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v940_preview/test_migration.py:1-65 · blob 6dda14f5ae0c361d34258d54328d5ce98be8de9b · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem · domain stage: unknown · users: none · canonical: production_core
"""Adversarial checks for the explicit source-preserving presentation migration."""
import json
from pathlib import Path
import shutil
import sys
import tempfile
import unittest

ROOT = Path(__file__).resolve().parents[2]
sys.path.insert(0, str(ROOT / 'automation/pipeline_release'))
from feature_contracts import _ticker_neon


class NeonMigrationTests(unittest.TestCase):
    def setUp(self):
        self.tmp = tempfile.TemporaryDirectory()
        root = Path(self.tmp.name)
        self.folder, self.source = root / 'uk_renewables_pipeline/new', root / 'uk_renewables_pipeline/source'
        for folder in (self.folder, self.source):
            (folder / 'data').mkdir(parents=True)
            (folder / 'data/test.json').write_text('{"synthetic":true}')
            (folder / 'scripts/layers').mkdir(parents=True)
            (folder / 'scripts/layers/model.mjs').write_text('SYNTHETIC unchanged policy')
        (self.folder / 'scripts/layers/ticker.mjs').write_bytes((ROOT / 'uk_renewables_pipeline/202611171710/scripts/layers/ticker.mjs').read_bytes())
        (self.folder / 'contracts').mkdir()
        self.shared = root / 'automation/ticker_neon_ui/20261117-v940'
        shutil.copytree(ROOT / 'automation/ticker_neon_ui/20261117-v940', self.shared)
        self.contract = json.loads((ROOT / 'uk_renewables_pipeline/202611171710/contracts/ticker.v940.json').read_text())
        self.save()

    def tearDown(self):
        self.tmp.cleanup()

    def save(self):
        (self.folder / 'contracts/ticker.v940.json').write_text(json.dumps(self.contract))

    def test_pinned_successor_admits_one_scoped_probe(self):
        errors, probes = _ticker_neon(self.folder, self.source)
        self.assertEqual(errors, [])
        self.assertEqual(len(probes), 1)

    def test_changed_shared_bytes_are_rejected(self):
        (self.shared / 'ticker.mjs').write_text('changed')
        self.assertTrue(_ticker_neon(self.folder, self.source)[0])

    def test_changed_policy_or_data_is_rejected(self):
        for rel in ('scripts/layers/model.mjs', 'data/test.json'):
            path = self.folder / rel
            original = path.read_bytes()
            path.write_text('changed')
            self.assertTrue(_ticker_neon(self.folder, self.source)[0])
            path.write_bytes(original)

    def test_missing_pin_and_wrong_contract_cap_are_rejected(self):
        self.contract['limit'] = 101
        self.save()
        self.assertTrue(_ticker_neon(self.folder, self.source)[0])
        self.contract['limit'] = 100
        self.contract['shared_sha256'].pop('header.mjs')
        self.save()
        self.assertTrue(_ticker_neon(self.folder, self.source)[0])


if __name__ == '__main__':
    unittest.main()

Test Migration Origins

A test in the automation folder of GlobalGrid2050 that checks Feature Contracts.

testglobalgrid2050 / automation/v940_preview/test_migration_origins.py · lines 1–53 of 53 · Entry point · pattern verdict (shared by 6 files)

What it does
It tests its inputs. Defines 8 functions or classes, including NeonOriginTests, registry, verdict, test_identical_descendant_restatements_keep_exact_original_identity, test_changed_descendant_marker_is_rejected. Uses libraries copy, pathlib, sys, unittest, unittest.mock. Side effects: reads or writes files.
Inputs & outputs
In: JSON file original.json.
Downstream impact
Used directly by 2 files: GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050); GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050).
What it achieves
It is built from the neon origin tests class (`NeonOriginTests`), the registry step (`registry`) and the verdict step (`verdict`). Real ancestry restates V9.36 identities; changed declarations remain invalid.
Why it matters
Run by GlobalGrid2050 Project Signals Acid Workflow and GlobalGrid2050 V934 Preview Acceptance Workflow.
Application
globalgrid2050 · automation/v940_preview · test
Uses
Feature Contracts (sys.path import), copy, pathlib, sys, unittest, unittest.mock
Used by
run by GlobalGrid2050 Project Signals Acid Workflow (workflow run), run by GlobalGrid2050 V934 Preview Acceptance Workflow (workflow run)
Produces
NeonOriginTests
Defines here
NeonOriginTests, registry, verdict, test_identical_descendant_restatements_keep_exact_original_identity, test_changed_descendant_marker_is_rejected, test_identity_introduced_before_original_source_is_rejected, test_duplicate_identity_inside_one_edition_is_rejected, test_old_migration_still_requires_single_exact_source
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v940_preview/test_migration_origins.py:1-53 · blob c4cd06a5aee2a98ddc1003b52381f8c6a0078f97 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: filesystem · domain stage: unknown · users: none · canonical: production_core
"""Real ancestry restates V9.36 identities; changed declarations remain invalid."""
import copy
from pathlib import Path
import sys
import unittest
from unittest.mock import patch

sys.path.insert(0, str(Path(__file__).resolve().parents[1] / "pipeline_release"))
from feature_contracts import check_features, NEON_MIGRATIONS, SOLAR_MIGRATION


class NeonOriginTests(unittest.TestCase):
    def registry(self, migration=NEON_MIGRATIONS[0]):
        feature = {"id": migration["id"], "file": "original.json", "contains": "original marker"}
        source = {"id": migration["from"], "parent": None, "features": [feature]}
        repeated = {"id": "202611171609", "parent": source["id"], "features": [copy.deepcopy(feature)]}
        current = {"id": "202611171710", "parent": repeated["id"], "features": [],
                   "feature_migrations": [copy.deepcopy(migration)]}
        return current, {v["id"]: v for v in (source, repeated, current)}

    def verdict(self, current, registry):
        with patch("feature_contracts._ticker_neon", return_value=([], [])), patch("feature_contracts._solar_inline", return_value=([], [])):
            return check_features(current, registry, Path("synthetic"))[0]

    def test_identical_descendant_restatements_keep_exact_original_identity(self):
        current, registry = self.registry()
        self.assertTrue(self.verdict(current, registry)["pass"])

    def test_changed_descendant_marker_is_rejected(self):
        current, registry = self.registry()
        registry["202611171609"]["features"][0]["contains"] = "changed"
        self.assertFalse(self.verdict(current, registry)["pass"])

    def test_identity_introduced_before_original_source_is_rejected(self):
        current, registry = self.registry()
        source = registry[NEON_MIGRATIONS[0]["from"]]
        earlier = {"id": "202611171400", "parent": None, "features": copy.deepcopy(source["features"])}
        registry[earlier["id"]] = earlier
        source["parent"] = earlier["id"]
        self.assertFalse(self.verdict(current, registry)["pass"])

    def test_duplicate_identity_inside_one_edition_is_rejected(self):
        current, registry = self.registry()
        registry["202611171609"]["features"] *= 2
        self.assertFalse(self.verdict(current, registry)["pass"])

    def test_old_migration_still_requires_single_exact_source(self):
        current, registry = self.registry(SOLAR_MIGRATION)
        self.assertFalse(self.verdict(current, registry)["pass"])


if __name__ == "__main__":
    unittest.main()

Browser

A JavaScript module in the automation folder of GlobalGrid2050 that draws ticker and pipeline headlines snapshot, using SHA-256. It is built from the tap step (`tap`).

renderglobalgrid2050 / automation/v941_preview/browser.mjs · lines 1–46 of 46 · Not reached from any entry point (candidate for review)

What it does
It draws ticker and pipeline headlines snapshot. Defines sha, save, move, tap. Uses libraries node:assert/strict, node:fs, node:path, node:http, node:url. Side effects: changes the web page (DOM); reads or writes files.
Inputs & outputs
In: JSON file ticker.v941.json; JSON file pipeline_headlines.snapshot.json. Out: JSON file receipt.json.
What it achieves
Defines `sha`, `save`, `move` and 1 more.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · automation/v941_preview · JavaScript module
Uses
node:assert/strict, node:fs, node:path, node:http, node:url, node:crypto
Used by
none found
Produces
sha, save, move, tap
Defines here
sha, save, move, tap
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v941_preview/browser.mjs:1-46 · blob 8789d459caee3a079bc4bf2897a4d048479a4713 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: unknown · users: none · canonical: unreached_review
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import http from 'node:http';
import {pathToFileURL} from 'node:url';
import {createHash} from 'node:crypto';
const root=path.resolve(import.meta.dirname,'../..'),edition='uk_renewables_pipeline/202611171940',parent='uk_renewables_pipeline/202611171710',out=path.resolve(process.env.V941_OUT||path.join(root,'.qa-artifacts/v941'));
const {chromium,devices}=await import(process.env.PLAYWRIGHT_MODULE?pathToFileURL(path.resolve(process.env.PLAYWRIGHT_MODULE)).href:'playwright');
const sha=b=>createHash('sha256').update(b).digest('hex'),walk=p=>fs.readdirSync(p,{withFileTypes:true}).flatMap(e=>e.isDirectory()?walk(path.join(p,e.name)):e.name.endsWith('.pyc')?[]:[path.join(p,e.name)]);
fs.mkdirSync(out,{recursive:true});
const proof={status:'RUNNING',edition,parent,checks:[],environment:'Chromium desktop and named Android device emulation; physical handset/TalkBack unknown',external:'Blocked only to exercise the actual unchanged saved-news fallback'};
const save=()=>fs.writeFileSync(path.join(out,'receipt.json'),JSON.stringify(proof,null,2)+'\n');save();
const oldFiles=walk(path.join(root,parent)),allowed=new Set(['index.html','README.md','CHANGES.md','tests/check_v9_40.mjs','tests/run_v9_40.sh']);
const kept=oldFiles.map(p=>path.relative(path.join(root,parent),p).replaceAll('\\','/')).filter(p=>!allowed.has(p));
for(const p of kept)assert.equal(sha(fs.readFileSync(path.join(root,parent,p))),sha(fs.readFileSync(path.join(root,edition,p))),p+' changed');
proof.preservation={byteIdenticalParentFiles:kept.length,sourcePaths:kept.filter(p=>/^(data|news|solar1000|prospecting|datacentres)\//.test(p)).length};
proof.packageBytes=walk(path.join(root,edition)).reduce((n,p)=>n+fs.statSync(p).size,0);assert.ok(proof.packageBytes<18*1024*1024);
const contract=JSON.parse(fs.readFileSync(path.join(root,edition,'contracts/ticker.v941.json')));assert.equal(sha(fs.readFileSync(path.join(root,contract.shared_css))),contract.sha256);proof.css=contract;
const server=http.createServer((req,res)=>{try{const p=path.resolve(root,'.'+decodeURIComponent(new URL(req.url,'http://local').pathname));assert.ok(p.startsWith(root+path.sep));res.setHeader('Content-Type',({'.html':'text/html','.css':'text/css','.mjs':'text/javascript','.js':'text/javascript','.json':'application/json'})[path.extname(p)]||'application/octet-stream');res.end(fs.readFileSync(p));}  … [line shortened here: 435 characters; full line on GitHub]
await new Promise(r=>server.listen(0,'127.0.0.1',r));const origin='http://127.0.0.1:'+server.address().port;let browser;
const pageErrors=new WeakMap();
async function load(context,ed=edition){await context.route('**/*',r=>r.request().url().startsWith(origin+'/')?r.continue():r.abort());const p=await context.newPage(),errors=[];pageErrors.set(p,errors);p.on('pageerror',e=>errors.push(e.message));await p.goto(origin+'/'+ed+'/index.html?technology=all');await p.waitForFunction(()=>document.querySelector('#tbody')?.dataset.total==='7775'&&document.qu  … [line shortened here: 464 characters; full line on GitHub]
async function look(page){return page.locator('#headlineTicker').evaluate(n=>{const t=n.querySelector('.pn-ticker-track'),l=n.querySelector('ul'),s=getComputedStyle(t);return{rate:l.getBoundingClientRect().width/parseFloat(s.animationDuration),all:[n,...n.querySelectorAll('*')].map(e=>{const s=getComputedStyle(e);return{background:s.backgroundColor,image:s.backgroundImage,color:s.color,textShadow:  … [line shortened here: 492 characters; full line on GitHub]
async function move(page){const t=page.locator('#headlineTicker');await t.scrollIntoViewIfNeeded();await page.mouse.move(0,0);const a=await t.locator('ul').evaluate(n=>n.getBoundingClientRect().x);await page.waitForTimeout(500);return a-await t.locator('ul').evaluate(n=>n.getBoundingClientRect().x);}
async function tap(session,x,y){await session.send('Input.dispatchTouchEvent',{type:'touchStart',touchPoints:[{x,y,id:1,radiusX:2,radiusY:2,force:1}]});await session.send('Input.dispatchTouchEvent',{type:'touchEnd',touchPoints:[]});}
try{
 browser=await chromium.launch({headless:true});proof.browserVersion=browser.version();
 const oldContext=await browser.newContext({viewport:{width:1440,height:900}}),old=await load(oldContext,parent),baseline=await look(old);assert.ok(Math.abs(baseline.rate-42)<.02);const oldDelta=await move(old);assert.ok(oldDelta>15);proof.baseline={rate:baseline.rate,renderedDelta:oldDelta};await oldContext.close();
 for(const name of ['Desktop','Pixel 7','Galaxy S9+']){
  const cfg=name==='Desktop'?{viewport:{width:1440,height:900}}:devices[name],context=await browser.newContext({...cfg,reducedMotion:'no-preference'}),page=await load(context),errors=pageErrors.get(page);const session=await context.newCDPSession(page),result={device:name,descriptor:cfg,rotations:[]};
  await page.evaluate(()=>scrollTo(0,0));await page.screenshot({path:path.join(out,name.replaceAll(' ','-')+'-header.png')});
  for(const landscape of name==='Desktop'?[false]:[false,true,false]){
   if(name!=='Desktop'){const d=devices[name+(landscape?' landscape':'')],v=d.viewport;await page.setViewportSize(v);await session.send('Emulation.setDeviceMetricsOverride',{width:v.width,height:v.height,deviceScaleFactor:d.deviceScaleFactor,mobile:true,screenWidth:d.screen?.width||v.width,screenHeight:d.screen?.height||v.height,screenOrientation:{type:landscape?'landscapePrimary':'portraitPrimary  … [line shortened here: 458 characters; full line on GitHub]
   const style=await look(page);assert.ok(Math.abs(style.rate-50)<.02);for(const s of style.all){assert.equal(s.background,'rgb(0, 0, 0)');assert.equal(s.color,'rgb(255, 51, 51)');for(const k of ['image','textShadow','boxShadow','filter','backdropFilter'])assert.equal(s[k],'none');}
   const delta=await move(page);assert.ok(delta>20&&delta<31,'Actual frame movement about50px/s');assert.equal(await page.locator('#headlineTicker input,#headlineTicker button,.pn-ticker-count').count(),0);assert.equal(await page.locator('.masthead input[type=search]').count(),1);assert.equal(await page.locator('#headlinesHeading').evaluate(n=>getComputedStyle(n).color),'rgb(255, 255, 255)');asser  … [line shortened here: 482 characters; full line on GitHub]
   const actual=await page.evaluate(()=>({ua:navigator.userAgent,dpr:devicePixelRatio,touch:navigator.maxTouchPoints,width:innerWidth,height:innerHeight,angle:screen.orientation.angle,platform:navigator.platform}));if(name!=='Desktop'){assert.match(actual.ua,/Android/);assert.ok(actual.touch>0);assert.equal(actual.angle,landscape?90:0);}result.rotations.push({landscape,actual,rate:style.rate,rende  … [line shortened here: 522 characters; full line on GitHub]
  }
  const ticker=page.locator('#headlineTicker'),view=ticker.locator('.pn-ticker-viewport'),x=()=>ticker.locator('ul').evaluate(n=>n.getBoundingClientRect().x);
  if(name!=='Desktop'){const b=await view.boundingBox();await tap(session,b.x+b.width*.5,b.y+3);await page.waitForTimeout(80);assert.equal(await ticker.getAttribute('data-reading'),'true');const a=await x();await page.waitForTimeout(250);assert.ok(Math.abs(await x()-a)<1);await tap(session,b.x+b.width*.5,b.y+3);await page.waitForTimeout(80);assert.equal(await ticker.getAttribute('data-reading'),'f  … [line shortened here: 468 characters; full line on GitHub]
  await ticker.locator('ul a').last().focus();const a=await x();await page.waitForTimeout(250);assert.ok(Math.abs(await x()-a)<1);assert.ok(await ticker.locator('ul a').last().evaluate(n=>{const a=n.getBoundingClientRect(),b=n.closest('.pn-ticker-viewport').getBoundingClientRect();return a.right>b.left&&a.left<b.right;}));result.focusPausedLastLinkReadable=true;
  const literal=await ticker.locator('ul').textContent();assert.ok(literal.includes('Publisher date')&&literal.includes('Bloomberg'));
  const query=page.locator('.pn-news-header-search input'),saved=JSON.parse(fs.readFileSync(path.join(root,edition,'news/pipeline_headlines.snapshot.json'))),last=saved.items.at(-1);await query.fill(last.title);assert.ok((await page.locator('#liveNews').textContent()).includes(last.title));await page.locator('.pn-news-quality').getByRole('button',{name:'Clear news filters'}).click();assert.equal(a  … [line shortened here: 512 characters; full line on GitHub]
  await query.focus();assert.ok(await move(page)>20,'Normal motion resumes outside ticker before reduced-motion test');await page.emulateMedia({reducedMotion:'reduce'});await page.waitForTimeout(100);assert.equal(await page.evaluate(()=>matchMedia('(prefers-reduced-motion:reduce)').matches),true);assert.equal(await ticker.locator('.pn-ticker-track').evaluate(n=>getComputedStyle(n).animationName),'  … [line shortened here: 757 characters; full line on GitHub]
 }
 proof.status='PASS';proof.completedUTC=new Date().toISOString();save();
}catch(e){proof.status='FAIL';proof.failure={message:e.message,stack:e.stack};save();throw e;}finally{await browser?.close();await new Promise(r=>server.close(r));}

Contracts Test

A test in the automation folder of GlobalGrid2050 that checks Edition History, using SHA-256.

testglobalgrid2050 / automation/v941_preview/contracts.test.mjs · lines 1–10 of 10 · Entry point

What it does
It tests its inputs. Uses libraries node:test, node:assert/strict, node:fs, node:path, node:crypto. Side effects: reads or writes files.
Inputs & outputs
In: JSON file ticker.v941.json; JSON file ticker.v940.json; JSON file ticker.v936.json.
Downstream impact
Used directly by 1 file: GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050).
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
Run by GlobalGrid2050 V934 Preview Acceptance Workflow.
Application
globalgrid2050 · automation/v941_preview · test
Uses
Edition History (import), node:test, node:assert/strict, node:fs, node:path, node:crypto
Used by
run by GlobalGrid2050 V934 Preview Acceptance 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 automation/v941_preview/contracts.test.mjs:1-10 · blob 4043f0e8459addba9d40e4160c5fd0a86559cf7b · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: unknown · users: none · canonical: production_core
import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import {createHash} from 'node:crypto';
import {protectedEditionChanges} from '../pipeline_release/edition_history.mjs';
const root=path.resolve(import.meta.dirname,'../..'),current=path.join(root,'uk_renewables_pipeline/202611171940'),parent=path.join(root,'uk_renewables_pipeline/202611171710'),hash=p=>createHash('sha256').update(fs.readFileSync(p)).digest('hex');
test('new crisp contract pins the exact additive CSS and requested rate',()=>{const c=JSON.parse(fs.readFileSync(path.join(current,'contracts/ticker.v941.json')));assert.equal(c.schema,'globalgrid2050.crisp-headline-ticker.v941');assert.equal(c.background,'#000000');assert.equal(c.foreground,'#ff3333');assert.equal(c.effects,'none');assert.equal(c.durationMultiplier,.84);assert.equal(c.minimumDura  … [line shortened here: 750 characters; full line on GitHub]
test('source model, renderer binding and V9.40 pins stay byte-identical',()=>{for(const rel of ['scripts/layers/model.mjs','scripts/layers/ticker.mjs','contracts/ticker.v940.json','contracts/ticker.v936.json'])assert.equal(hash(path.join(current,rel)),hash(path.join(parent,rel)));const c=JSON.parse(fs.readFileSync(path.join(current,'contracts/ticker.v940.json')));for(const [name,sha]of Object.entr  … [line shortened here: 511 characters; full line on GitHub]
test('all historical editions in the accepted V9.40 publisher stay immutable',()=>{assert.deepEqual(protectedEditionChanges({cwd:root,base:'aaca1dd8138269b679d20db196a7c0d480d09389'}),[]);});

Minimum Test

A test in the automation folder of GlobalGrid2050.

testglobalgrid2050 / automation/v941_preview/minimum.test.mjs · lines 1–9 of 9 · Entry point

What it does
It tests its inputs. Uses libraries node:test, node:assert/strict, node:fs, node:path, node:url. Side effects: reads or writes files.
Downstream impact
Used directly by 1 file: GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050).
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
Run by GlobalGrid2050 V934 Preview Acceptance Workflow.
Application
globalgrid2050 · automation/v941_preview · test
Uses
node:test, node:assert/strict, node:fs, node:path, node:url
Used by
run by GlobalGrid2050 V934 Preview Acceptance 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 automation/v941_preview/minimum.test.mjs:1-9 · blob 1fc50d9fde3d4c7d5e70f7d68d5d575652e7d92b · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: unknown · users: none · canonical: production_core
import test from 'node:test';
import assert from 'node:assert/strict';
import fs from 'node:fs';
import path from 'node:path';
import {pathToFileURL} from 'node:url';
const root=path.resolve(import.meta.dirname,'../..');
const {chromium}=await import(process.env.PLAYWRIGHT_MODULE?pathToFileURL(process.env.PLAYWRIGHT_MODULE).href:'playwright');
const base=fs.readFileSync(path.join(root,'automation/ticker_neon_ui/20261117-v940/styles.css'),'utf8'),override=fs.readFileSync(path.join(root,'automation/ticker_crisp_ui/20261117-v941/styles.css'),'utf8');
test('computed short-feed minimum, long-cycle factor and static reading/reduced motion',async()=>{const browser=await chromium.launch({headless:true});try{const context=await browser.newContext({reducedMotion:'no-preference'}),page=await context.newPage();await page.setContent(`<style>${base}</style><style>${override}</style><div id="headlineTicker" class="pn-neon-ticker" style="--pn-cycle-duratio  … [line shortened here: 1,315 characters; full line on GitHub]

Browser

A JavaScript module in the automation folder of GlobalGrid2050 using data from the GridAtlas repository.

renderglobalgrid2050 / automation/v942_preview/browser.mjs · lines 1–42 of 42 · Not reached from any entry point (candidate for review)

What it does
It draws its content. Uses libraries node:assert/strict, node:http, node:fs, node:path, node:url. Side effects: changes the web page (DOM); reads or writes files.
Inputs & outputs
In: data source: gridatlas data. Out: JSON file receipt.json.
What it achieves
Real source tap -> public receiver.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · automation/v942_preview · JavaScript module
Uses
GridAtlas — Atlas Page (estate URL), node:assert/strict, node:http, node:fs, node:path, node:url
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v942_preview/browser.mjs:1-42 · blob cc4fbe225280192d9fb557bcf8d27a5f7d56dd0e · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: unknown · users: none · canonical: unreached_review
/* Real source tap -> public receiver. No request interception or forced click.
 * This proves sender navigation and engine completion, not handset acceptance
 * or the separate GridAtlas card-presentation repair. */
import assert from 'node:assert/strict';
import {createServer} from 'node:http';
import {readFileSync,writeFileSync,mkdirSync} from 'node:fs';
import {resolve,extname,sep,dirname} from 'node:path';
import {fileURLToPath,pathToFileURL} from 'node:url';
const root=resolve(dirname(fileURLToPath(import.meta.url)),'../..');
const output=process.env.V942_OUT||resolve(root,'work/v942-browser');mkdirSync(output,{recursive:true});
const {chromium}=await import(pathToFileURL(process.env.PLAYWRIGHT_MODULE||'D:/githubfiles/.qa-tools/node/node_modules/playwright/index.mjs').href);
const server=createServer((req,res)=>{try{const url=new URL(req.url,'http://local');let p=resolve(root,'.'+decodeURIComponent(url.pathname));assert.ok(p.startsWith(root+sep));if(url.pathname.endsWith('/'))p=resolve(p,'index.html');res.setHeader('Content-Type',({'.html':'text/html','.js':'text/javascript','.mjs':'text/javascript','.json':'application/json','.css':'text/css'})[extname(p)]||'applicat  … [line shortened here: 478 characters; full line on GitHub]
await new Promise(r=>server.listen(0,'127.0.0.1',r));const base='http://127.0.0.1:'+server.address().port;
const browser=await chromium.launch(),results=[];
try{
for(const width of [393,1440]){
 const mobile=width<500,context=await browser.newContext({viewport:{width,height:852},isMobile:mobile,hasTouch:mobile});
 const page=await context.newPage(),errors=[];page.on('pageerror',e=>errors.push(e.message));
 const source=base+'/uk_renewables_pipeline/202611172355/?technology=all';
 const receipt={width,source,started:new Date().toISOString()};results.push(receipt);
 try{
 await page.goto(source,{waitUntil:'domcontentloaded'});await page.waitForFunction(()=>Number(document.querySelector('#tbody')?.dataset.total)>0);
 await page.locator('#clearFilters').click();await page.waitForFunction(()=>document.querySelector('#tbody')?.dataset.total==='7775');
 await page.locator('#search').fill('2470');const anchor=page.locator('a.atlaslink[href*="repd_ref=2470"]').first();await anchor.scrollIntoViewIfNeeded();
 await page.waitForFunction(m=>document.querySelector('a.atlaslink')?.dataset.mapNavigation===(m?'current-tab':'new-tab'),mobile);
 const href=await anchor.getAttribute('href');receipt.href=href;assert.equal(new URL(href).searchParams.get('repd_ref'),'2470');
 receipt.hit=await anchor.evaluate(a=>{const r=a.getBoundingClientRect(),h=document.elementFromPoint(r.x+r.width/2,r.y+r.height/2);return{width:r.width,height:r.height,reachable:a===h||a.contains(h)}});
 assert.ok(receipt.hit.reachable&&receipt.hit.width>=44&&receipt.hit.height>=44);
 let arrival;
 if(mobile){await anchor.tap();await page.waitForURL('https://ventusltd.github.io/gridatlas/atlas/**');arrival=page;assert.equal(context.pages().length,1)}
 else{const opened=context.waitForEvent('page');await anchor.click();arrival=await opened;await arrival.waitForLoadState('domcontentloaded')}
 await arrival.waitForFunction(()=>window.__GRIDATLAS_NEON_LINKS__?.arrival_engine?.terminal&&window.__GRIDATLAS_NEON_LINKS__?.compute_receipt?.status==='completed',null,{timeout:85000});
 receipt.receiver=await arrival.evaluate(()=>{const s=window.__GRIDATLAS_NEON_LINKS__;return{url:location.href,generation:document.documentElement.dataset.gridatlasGeneration,engine:s.arrival_engine,identity:s.compute_receipt.entity,nearest:s.compute_receipt.summary,failures:s.failures}});
 assert.equal(new URL(receipt.receiver.url).searchParams.get('repd_ref'),'2470');assert.equal(receipt.receiver.identity.id,'2470');assert.deepEqual(receipt.receiver.failures,[]);assert.ok(receipt.receiver.nearest.measured_count>0);
 await arrival.screenshot({path:resolve(output,'receiver-'+width+'.png')});
 if(mobile){await page.goBack({waitUntil:'domcontentloaded'});await page.waitForFunction(()=>document.querySelector('#search')?.value==='2470'&&!!document.querySelector('a.atlaslink[href*="repd_ref=2470"]'),null,{timeout:60000});assert.equal(new URL(page.url()).searchParams.get('q'),'2470');receipt.backRetainedSearch=true}
 assert.deepEqual(errors,[]);receipt.pass=true;
 }catch(e){receipt.pass=false;receipt.error=String(e);throw e}
 finally{receipt.finished=new Date().toISOString();writeFileSync(resolve(output,'receipt.json'),JSON.stringify({scope:'sender native navigation and receiver computation; GridAtlas visible-card acceptance separate',results},null,2)+'\n');await context.close()}
}
}finally{await browser.close();await new Promise(r=>server.close(r))}
console.log(JSON.stringify(results));

Contracts Test

A test in the automation folder of GlobalGrid2050 that uses SHA-256.

testglobalgrid2050 / automation/v942_preview/contracts.test.mjs · lines 1–25 of 25 · Entry point

What it does
It tests its inputs. Defines read, hash, walk. Uses libraries node:test, node:assert/strict, node:fs, node:crypto, node:path. Side effects: reads or writes files.
Inputs & outputs
In: JSON file mobile-map.v942.json.
Downstream impact
Used directly by 1 file: GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050).
What it achieves
Defines `read`, `hash` and `walk`.
Why it matters
Run by GlobalGrid2050 V934 Preview Acceptance Workflow.
Application
globalgrid2050 · automation/v942_preview · test
Uses
node:test, node:assert/strict, node:fs, node:crypto, node:path, node:url
Used by
run by GlobalGrid2050 V934 Preview Acceptance Workflow (workflow run)
Produces
read, hash, walk
Defines here
read, hash, walk
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v942_preview/contracts.test.mjs:1-25 · blob 57579d772eb0e7edf8ac96ea0676ada91e44e93d · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: unknown · users: none · canonical: production_core
import {test} from 'node:test';
import assert from 'node:assert/strict';
import {readFileSync,readdirSync} from 'node:fs';
import {createHash} from 'node:crypto';
import {resolve,dirname} from 'node:path';
import {fileURLToPath} from 'node:url';
const root=resolve(dirname(fileURLToPath(import.meta.url)),'../..');
const edition=resolve(root,'uk_renewables_pipeline/202611172355'),parent=resolve(root,'uk_renewables_pipeline/202611171940');
const read=(base,p)=>readFileSync(resolve(base,p));
const hash=b=>createHash('sha256').update(b).digest('hex');
function walk(p,prefix=''){return readdirSync(p,{withFileTypes:true}).flatMap(e=>e.name==='node_modules'||e.name==='__pycache__'?[]:e.isDirectory()?walk(resolve(p,e.name),prefix+e.name+'/'):[prefix+e.name])}
test('mobile navigation module is exact-pinned and the real entry loads it',()=>{
 const c=JSON.parse(read(edition,'contracts/mobile-map.v942.json'));
 assert.equal(c.schema,'globalgrid2050.mobile-map-native.v942');
 const bytes=read(root,c.module);assert.equal(hash(bytes),c.sha256);
 const html=read(edition,'index.html').toString();assert.ok(html.includes('src="../../'+c.module+'" integrity="sha256-'+createHash('sha256').update(bytes).digest('base64')+'"'));
});
test('all retained parent application/data bytes are unchanged',()=>{
 const permitted=new Set(['index.html','README.md','CHANGES.md','tests/run_v9_41.sh','tests/check_v9_41.mjs']);
 const retained=walk(parent).filter(p=>!permitted.has(p));assert.ok(retained.length>280);
 for(const p of retained)assert.deepEqual(read(edition,p),read(parent,p),p);
});
test('published candidate remains inside accepted edition byte budget',()=>{
 const size=walk(edition).reduce((n,p)=>n+read(edition,p).length,0);assert.ok(size<=18*1024*1024,'edition bytes '+size);
});

Public

A JavaScript module in the automation folder of GlobalGrid2050 that uses SHA-256 using data from the GridAtlas repository.

interactionglobalgrid2050 / automation/v942_preview/public.mjs · lines 1–53 of 53 · Entry point · pattern within (shared by 16 files)

What it does
It draws its content. Defines digest, within. Uses libraries node:assert/strict, node:fs, node:crypto, node:path, node:url. Side effects: changes the web page (DOM); reads or writes files.
Inputs & outputs
In: data source: gridatlas data. Out: JSON file receipt.json.
Downstream impact
Used directly by 1 file: GlobalGrid2050 Deploy Pages Workflow (globalgrid2050).
What it achieves
It is built from the digest step (`digest`) and the within step (`within`). Actual public mobile tap, visible result, rotation and Back.
Why it matters
Run by GlobalGrid2050 Deploy Pages Workflow.
Application
globalgrid2050 · automation/v942_preview · JavaScript module
Uses
GridAtlas — Atlas Page (estate URL), node:assert/strict, node:fs, node:crypto, node:path, node:url
Used by
run by GlobalGrid2050 Deploy Pages Workflow (workflow run)
Produces
digest, within
Defines here
digest, within
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v942_preview/public.mjs:1-53 · blob a65c35959911c05b98d7dbef95e5f6a66ac54382 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: unknown · users: none · canonical: production_core
/* Actual public mobile tap, visible result, rotation and Back. No interception.
 * Browser device emulation is not physical handset certification. */
import assert from 'node:assert/strict';
import {readFileSync,writeFileSync,mkdirSync} from 'node:fs';
import {createHash} from 'node:crypto';
import {resolve,dirname} from 'node:path';
import {pathToFileURL,fileURLToPath} from 'node:url';
const root=resolve(dirname(fileURLToPath(import.meta.url)),'../..');
const pw=await import(pathToFileURL(process.env.PLAYWRIGHT_MODULE||'D:/githubfiles/.qa-tools/node/node_modules/playwright/index.mjs').href);
const output=process.env.V942_PUBLIC_OUT||resolve(root,'work/v942-public');mkdirSync(output,{recursive:true});
const source='https://globalgrid2050.com/uk_renewables_pipeline/202611172355/';
const expectedAtlasGeneration='202611172355';
const digest=b=>createHash('sha256').update(b).digest('hex');
const expected=digest(readFileSync(resolve(root,'uk_renewables_pipeline/202611172355/index.html')));
const report={started:new Date().toISOString(),scope:'actual public V9.42 sender and served Atlas mobile result; bounded sample, not fleet or physical-device acceptance',results:[]};
const cases=[{engine:'chromium',device:'Pixel 7'},{engine:'chromium',device:'Galaxy S9+'},{engine:'webkit',device:'iPhone 13'}];
try{
for(const spec of cases){
 const browser=await pw[spec.engine].launch({headless:true,...(spec.engine==='chromium'?{args:['--use-gl=angle','--use-angle=swiftshader','--enable-webgl','--ignore-gpu-blocklist']}: {})});
 try{for(const ref of ['2470','12588']){
 const options=pw.devices[spec.device];assert.ok(options,'device descriptor missing');
 const context=await browser.newContext(options),page=await context.newPage(),errors=[];
 const row={...spec,ref,started:new Date().toISOString(),errors};report.results.push(row);page.on('pageerror',e=>errors.push(e.message));
 try{
 const response=await page.goto(source,{waitUntil:'domcontentloaded',timeout:60000});assert.equal(response.status(),200);assert.equal(digest(await response.body()),expected);
 await page.waitForFunction(()=>Number(document.querySelector('#tbody')?.dataset.total)>0,null,{timeout:60000});
 await page.locator('#clearFilters').tap();await page.waitForFunction(()=>document.querySelector('#tbody')?.dataset.total==='7775');await page.locator('#search').fill(ref);
 const link=page.locator('a.atlaslink[href*="repd_ref='+ref+'"]').first();await link.scrollIntoViewIfNeeded();assert.equal(await link.getAttribute('target'),'_self');
 const href=await link.getAttribute('href'),url=new URL(href);assert.equal(url.origin+url.pathname,'https://ventusltd.github.io/gridatlas/atlas/');assert.equal(url.searchParams.get('repd_ref'),ref);row.clickedHref=href;
 row.hit=await link.evaluate(a=>{const r=a.getBoundingClientRect(),h=document.elementFromPoint(r.x+r.width/2,r.y+r.height/2);return{width:r.width,height:r.height,reachable:h===a||a.contains(h)}});assert.ok(row.hit.reachable&&row.hit.width>=44&&row.hit.height>=44);
 await link.tap();await page.waitForURL('https://ventusltd.github.io/gridatlas/atlas/**',{timeout:30000});assert.equal(context.pages().length,1);
 await page.waitForFunction(id=>{const s=window.__GRIDATLAS_NEON_LINKS__;return s?.compute_receipt?.status==='completed'&&s.compute_receipt.entity.id===id&&s.arrival_engine?.terminal&&s.last_selection?.nearest_name},ref,{timeout:100000});
 const summary=page.locator('.gridatlas-arrival-summary').first();await summary.waitFor({state:'visible',timeout:30000});
 row.receiver=await page.evaluate(()=>{const s=window.__GRIDATLAS_NEON_LINKS__;return{url:location.href,generation:document.documentElement.dataset.gridatlasGeneration,router:document.body.dataset.gridatlasRouter,selection:s.last_selection,identity:s.compute_receipt.entity,engine:s.arrival_engine,measurements:s.compute_receipt.summary,failures:s.failures}});
 const arrived=new URL(row.receiver.url);assert.equal(arrived.origin+arrived.pathname,'https://ventusltd.github.io/gridatlas/atlas/');assert.equal(arrived.searchParams.get('repd_ref'),ref);assert.equal(row.receiver.generation,expectedAtlasGeneration);assert.notEqual(row.receiver.router,'failed');
 assert.equal(row.receiver.identity.id,ref);assert.deepEqual(row.receiver.failures,[]);const text=await summary.innerText();assert.ok(text.includes(row.receiver.selection.nearest_name));assert.ok(text.includes('km straight-line'));assert.ok(text.includes('Screening only; connection unverified.'));row.visibleSummary=text;
 const within=async locator=>locator.evaluate(e=>{const r=e.getBoundingClientRect();return r.x>=0&&r.y>=0&&r.right<=innerWidth+1&&r.bottom<=innerHeight+1});assert.ok(await within(summary),'compact result outside viewport');
 const details=page.getByRole('button',{name:'Show project details',exact:true});const box=await details.boundingBox();assert.ok(box.width>=44&&box.height>=44);await details.tap();await page.locator('.neon-km').first().waitFor({state:'visible'});
 if(ref==='2470')await page.waitForTimeout(12000);
 assert.ok(await page.locator('.neon-km').first().isVisible(),'reader restore was lost');await page.getByRole('button',{name:'Minimise project details',exact:true}).tap();
 if(spec.engine==='chromium'){
   const cdp=await context.newCDPSession(page);await cdp.send('Emulation.setDeviceMetricsOverride',{width:844,height:390,deviceScaleFactor:options.deviceScaleFactor,mobile:true,screenOrientation:{type:'landscapePrimary',angle:90}});row.rotation='CDP portrait to landscape';
 }else{await page.setViewportSize({width:844,height:390});row.rotation='WebKit viewport landscape emulation'}
 await page.waitForTimeout(300);assert.ok(await within(summary),'landscape result outside viewport');assert.ok(await page.evaluate(()=>document.documentElement.scrollWidth<=innerWidth+1));
 await page.screenshot({path:resolve(output,spec.engine+'-'+spec.device.replaceAll(' ','-')+'-'+ref+'.png')});
 await page.goBack({waitUntil:'domcontentloaded'});await page.waitForFunction(id=>document.querySelector('#search')?.value===id&&!!document.querySelector('a.atlaslink[href*="repd_ref='+id+'"]'),ref,{timeout:60000});const returned=new URL(page.url());assert.equal(returned.origin+returned.pathname,source);assert.equal(returned.searchParams.get('q'),ref);row.backRetainedSearch=true;assert.deepEqual(e  … [line shortened here: 424 characters; full line on GitHub]
 }catch(e){row.pass=false;row.error=String(e);throw e}
 finally{row.finished=new Date().toISOString();writeFileSync(resolve(output,'receipt.json'),JSON.stringify(report,null,2)+'\n');await context.close()}
 }}finally{await browser.close()}
}
report.pass=true;
}finally{report.finished=new Date().toISOString();writeFileSync(resolve(output,'receipt.json'),JSON.stringify(report,null,2)+'\n')}
console.log(JSON.stringify(report));

Browser

A JavaScript module in the automation folder of GlobalGrid2050.

otherglobalgrid2050 / automation/v943_preview/browser.mjs · lines 1–2 of 2 · Not reached from any entry point (candidate for review)

What it achieves
Actual candidate host and pinned source inputs, no composition or interception.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · automation/v943_preview · JavaScript module
Uses
Entry Browser (import)
Used by
none found
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/v943_preview/browser.mjs:1-2 · blob 4584c3e53ed7ae516972635f8552d796b79ebcd9 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: none found · domain stage: unknown · users: none · canonical: unreached_review
// Actual candidate host and pinned source inputs, no composition or interception.
import '../journey_entry_ui/20261118/entry.browser.mjs';

Model Test

A test in the cartridges folder of GlobalGrid2050.

testglobalgrid2050 / cartridges/202609052150-nasa-ice/model.test.mjs · lines 1–4 of 4 · version 2026-09-05 21:50 · Entry point

What it does
It tests its inputs. Uses libraries node:test. Side effects: reads or writes files.
Inputs & outputs
In: JSON file source.json.
Downstream impact
Used directly by 1 file: GlobalGrid2050 Open Energy Cartridge Workflow (globalgrid2050).
What it achieves
It reads `./source.json`.
Why it matters
Run by GlobalGrid2050 Open Energy Cartridge Workflow.
Application
globalgrid2050 · cartridges/202609052150-nasa-ice · test
Uses
node:test
Used by
run by GlobalGrid2050 Open Energy Cartridge 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 cartridges/202609052150-nasa-ice/model.test.mjs:1-4 · blob d7a054e3e1ee865e1dd6ff7971426ecc3679842c · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: unknown · users: none · canonical: production_core
import test from 'node:test';import assert from 'node:assert/strict';import {iceRows} from './model.mjs';import {readFileSync} from 'node:fs';
const s=JSON.parse(readFileSync(new URL('./source.json',import.meta.url)));
test('UTC boundary resets and noon represents half a model day',()=>{assert.ok(iceRows(s,Date.UTC(2026,8,6)).every(r=>r.tonnes===0));const r=iceRows(s,Date.UTC(2026,8,6,12));assert.equal(r[0].fraction,.5);assert.ok(Math.abs(r[0].tonnes*2*s.modelYearDays-264e9)<.01);assert.ok(Math.abs(r[1].perSecond*86400*s.modelYearDays-135e9)<.01);});
test('invalid baseline rejected',()=>{assert.throws(()=>iceRows({...s,greenlandGtPerYear:NaN},0));assert.throws(()=>iceRows(null,0));});

Model Test

A test in the cartridges folder of GlobalGrid2050.

testglobalgrid2050 / cartridges/202609052156-rc-rl/model.test.mjs · lines 1–2 of 2 · version 2026-09-05 21:56 · Entry point

What it does
It tests its inputs. Uses libraries node:test.
Downstream impact
Used directly by 1 file: GlobalGrid2050 Open Energy Cartridge Workflow (globalgrid2050).
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
Run by GlobalGrid2050 Open Energy Cartridge Workflow.
Application
globalgrid2050 · cartridges/202609052156-rc-rl · test
Uses
node:test
Used by
run by GlobalGrid2050 Open Energy Cartridge 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 cartridges/202609052156-rc-rl/model.test.mjs:1-2 · blob 74e057e7205ac265063cad78a48aac5f21f9cf73 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: none found · domain stage: unknown · users: none · canonical: production_core
import test from 'node:test';import assert from 'node:assert/strict';import {response} from './model.mjs';const p={R:10,C:.001,L:.1,V:48};
test('ideal step starts empty, reaches63.2% at tau and energy follows squared state',()=>{const zero=response(p,0);assert.equal(zero.vc,0);assert.equal(zero.i,0);const r=response(p,.01);assert.ok(Math.abs(r.vc/48-(1-Math.exp(-1)))<1e-12);assert.ok(Math.abs(r.i/4.8-(1-Math.exp(-1)))<1e-12);assert.equal(r.ec,.5*p.C*r.vc**2);assert.equal(r.el,.5*p.L*r.i**2);assert.throws(()=>response({...p,R:0},1));}  … [line shortened here: 402 characters; full line on GitHub]

Manifest

A configuration file in the test simple manifest folder of GlobalGrid2050.

testglobalgrid2050 / feature_requests/test_simple_manifest/manifest.yml · lines 1–3 of 3 · Not reached from any entry point (candidate for review)

What it does
It tests its inputs.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · feature_requests/test_simple_manifest · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
test_simple
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 feature_requests/test_simple_manifest/manifest.yml:1-3 · blob 9131402f909ff3cc837d1cffd18accc1c7ac1c62 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: none found · domain stage: unknown · users: none · canonical: unreached_review
name: test_simple
summary: test only
operations: []

Manifest

A configuration file in the test simple path folder of GlobalGrid2050.

testglobalgrid2050 / feature_requests/test_simple_path/manifest.yml · lines 1–6 of 6 · Not reached from any entry point (candidate for review)

What it does
It tests its inputs.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · feature_requests/test_simple_path · configuration
Uses
none found
Used by
none found
Produces
none declared
Defines here
test_path
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 feature_requests/test_simple_path/manifest.yml:1-6 · blob b33659bc8b6c4f4c996efdfbd30a1cb7be509862 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: unknown · effects: none found · domain stage: unknown · users: none · canonical: unreached_review
name: test_path
summary: test only
operations:
  - type: assert_contains
    file: .github/workflows/gridbot_london_sunrise_sunset_ui_chart.yml
    text: "Sunrise and sunset"

Build

A JavaScript module in the grid engine folder of GlobalGrid2050 that draws iterations and uses data from the ventus-grid-engine repository. Served with the page at https://globalgrid2050.com/grid_engine/.

renderglobalgrid2050 / grid_engine/build.mjs · lines 1–287 of 287 · Not reached from any entry point (candidate for review) · pattern modules (shared by 2 files)

What it does
It draws iterations. Defines 9 functions or classes, including modules, esc, shell, el, num. Uses libraries node:fs, node:url, node:path. Side effects: changes the web page (DOM); reads or writes files.
Inputs & outputs
In: data source: ventus-grid-engine data; JSON file iterations.json; form fields (user input); command-line arguments.
What it achieves
It is built from the modules step (`modules`), the esc step (`esc`) and the shell step (`shell`). Emits a Grid Engine workbench as a self-contained immutable page.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · grid_engine · JavaScript module
Uses
Specs (import), node:fs, node:url, node:path
Used by
none found
Produces
modules, esc, shell, el, num, fig, refuse, panelHtml, emit
Defines here
modules, esc, shell, el, num, fig, refuse, panelHtml, emit
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 grid_engine/build.mjs:1-287 · blob d1c3f5d2d213cfc1f67778eb885ace6efb40d528 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem · domain stage: unknown · users: none · canonical: unreached_review
/* build.mjs — emits a Grid Engine workbench as a self-contained immutable page.
 *
 * WHY A GENERATOR AND NOT THIRTY HAND-WRITTEN PAGES.
 * Each published workbench is immutable: it is never edited once it exists, so
 * an improvement becomes the next timestamp. Hand-writing each one guarantees
 * that a fix to the shell — a touch target, a dark-mode colour, an overflow
 * rule — reaches only the page that happened to be open at the time, and the
 * thirty pages drift apart. Holding the generator instead means the shell is
 * one thing, each iteration is a small declarative delta, and any past page can
 * be re-emitted byte-for-byte from its spec if it ever needs to be audited.
 *
 * WHAT THE GENERATOR DOES NOT DO.
 * It does not compute anything and it does not embed the mathematics. Every
 * emitted page imports its engine module from ventus-grid-engine at RUNTIME, so
 * a figure on a published page is the figure the engine's proofs are run
 * against. If the engine cannot be reached the page shows no numbers rather
 * than falling back to a copy — a fallback copy is exactly how a view drifts
 * from the module it claims to use, silently, while still looking right.
 *
 * Run:  node grid_engine/build.mjs            (emit any spec not yet published)
 *       node grid_engine/build.mjs --check    (verify published pages match)
 */

import { readFileSync, writeFileSync, mkdirSync, existsSync } from 'node:fs';
import { fileURLToPath } from 'node:url';
import { dirname, join } from 'node:path';
import { SPECS } from './specs.mjs';

const here = dirname(fileURLToPath(import.meta.url));
const ENGINE_BASE = 'https://ventusltd.github.io/ventus-grid-engine/engine/';

const modules = spec => [].concat(spec.engineModule);
const esc = s => String(s).replace(/&/g, '&amp;').replace(/</g, '&lt;').replace(/>/g, '&gt;');

/* The shell. One place, so a fix reaches every page emitted after it, and no
   page emitted before it changes — which is the point of immutability. */
function shell({ spec, body, script }) {
    return `<!DOCTYPE html>
<html lang="en-GB">
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title>${esc(spec.title)} — Ventus Grid Engine</title>
<style>
:root{--bg:#000;--panel:#0b0e14;--line:#2f343d;--soft:#222;--text:#fff;
  --muted:#a6adbb;--accent:#00ffff;--ok:#00ff88;--warn:#ffae00;--no:#ff5c5c}
*{box-sizing:border-box;margin:0;padding:0;font-family:'Courier New',ui-monospace,monospace}
html,body{background:var(--bg);color:var(--text)}
body{font-size:14px;line-height:1.55;padding:0 0 48px}
.wrap{max-width:960px;margin:0 auto;padding:0 14px}
header{border-bottom:1px solid var(--soft);padding:18px 0 14px;margin-bottom:16px}
h1{font-size:17px;letter-spacing:2px;color:var(--accent)}
.sub{color:var(--muted);font-size:11px;margin-top:6px}
.stamp{color:#7f8996;font-size:10px;margin-top:8px;overflow-wrap:anywhere}
.status{border:1px solid var(--line);background:var(--panel);padding:9px 11px;
  margin-bottom:16px;font-size:11px}
.status.live{border-color:#167d4d;color:var(--ok)}
.status.dead{border-color:#7d1616;color:var(--no)}
section{border:1px solid var(--soft);background:var(--panel);margin-bottom:16px}
h2{font-size:12px;letter-spacing:1.4px;color:var(--accent);padding:11px 13px;
  border-bottom:1px solid var(--soft)}
.body{padding:13px}
.lede{color:var(--muted);font-size:11.5px;line-height:1.65;margin-bottom:13px}
label{display:block;color:var(--muted);font-size:10px;letter-spacing:.6px;
  text-transform:uppercase;margin:0 0 5px}
.field{margin-bottom:13px}
input[type=number],input[type=text]{width:100%;background:#000;border:1px solid var(--line);
  color:var(--text);padding:11px 10px;font-size:16px;font-weight:700}
input:focus{outline:none;border-color:var(--accent)}
input[type=range]{width:100%;accent-color:var(--accent);height:32px}
.rangerow{display:flex;justify-content:space-between;align-items:baseline;gap:10px}
.rangeval{color:var(--accent);font-weight:700;font-size:15px;white-space:nowrap}
.out{border:1px solid var(--line);background:#06080b;padding:11px;margin-top:11px}
.figure{display:flex;align-items:baseline;gap:8px;flex-wrap:wrap}
.figure .n{font-size:26px;font-weight:700;color:var(--ok);line-height:1.1}
.figure .n.over{color:var(--no)}
.figure .u{font-size:12px;color:var(--muted)}
.figure .q{font-size:10px;color:#7f8996;text-transform:uppercase;letter-spacing:.8px;
  flex:1 0 100%;margin-bottom:3px}
.basis{color:#8e98a5;font-size:10.5px;line-height:1.65;margin-top:9px;
  border-top:1px dashed #252a31;padding-top:8px}
.scroller{overflow-x:auto;-webkit-overflow-scrolling:touch}
table{width:100%;border-collapse:collapse;font-size:11px}
th{color:var(--accent);text-align:left;padding:7px 6px;border-bottom:1px solid var(--line);
  font-size:10px;letter-spacing:.5px}
td{padding:7px 6px;border-bottom:1px solid #1a1e25;color:var(--muted)}
td.n{color:var(--text);font-weight:700;text-align:right;white-space:nowrap}
.refuse{border:1px solid #5c2020;background:#120708}
.refuse h2{color:#ff8f8f;border-bottom-color:#5c2020}
.refuse dt{color:#ff8f8f;font-size:11px;font-weight:700;margin-top:11px}
.refuse dt:first-child{margin-top:0}
.refuse dd{color:#c9a9a9;font-size:10.5px;line-height:1.65;margin-top:3px}
footer{color:#69727d;font-size:10.5px;line-height:1.9;padding-top:14px;
  border-top:1px solid var(--soft);margin-top:20px}
/* Touch targets. Measured at 393px on 2026-09-06: footer links were 11.3px
   tall, below the 24px WCAG 2.2 minimum. Inline links keep their flow but are
   given real height through padding and line-height. */
footer a,.basis a{color:#66ccff;display:inline-block;padding:5px 2px;line-height:1.5}
.nav{margin-top:14px;font-size:11px}
.nav a{color:#66ccff;display:inline-block;padding:8px 10px 8px 0}
</style>
</head>
<body>
<div class="wrap">
<header>
  <h1>${esc(spec.title.toUpperCase())}</h1>
  <p class="sub">${esc(spec.sub)}</p>
  <p class="stamp">Generation ${esc(spec.stamp)} · engine ${esc(modules(spec).join(', '))} at ${esc(spec.engineCommit)}</p>
</header>
<div class="status" id="engine-status">Loading the engine module…</div>
${body}
<section class="refuse">
  <h2>WHAT THIS WORKBENCH WILL NOT COMPUTE</h2>
  <div class="body">
    <p class="lede" style="color:#c9a9a9">These are not features missing from a later
      version. The engine proof asserts that no function of these names exists, so
      their absence is a tested property rather than an oversight.</p>
    <dl id="refusals"></dl>
  </div>
</section>
<footer>
  <p>Every figure above is computed by
     ${modules(spec).map(m => `<a href="${ENGINE_BASE}${esc(m)}">${esc(m)}</a>`).join(' and ')}
     in the Ventus Grid Engine, imported at runtime and proven by ${spec.checks} checks.
     This page holds no copy of the mathematics: if the engine cannot be reached it
     shows no numbers rather than a stale answer.</p>
  <p class="nav">
     <a href="../">All workbenches</a>
     <a href="/papers/202609060203-electrification/">Electrification paper</a>
     <a href="/papers/202609060045-published-fault-level/">Fault-level paper</a>
     <a href="/">GlobalGrid2050</a></p>
  <p style="margin-top:6px">Scenario arithmetic is not evidence of connection headroom.
     A national load factor cannot establish utilisation at any particular transformer.</p>
</footer>
</div>
<script type="module">
const ENGINE_MODULES = ${JSON.stringify(modules(spec).map(m => ENGINE_BASE + m))};
const ENGINE_SCHEMAS = ${JSON.stringify([].concat(spec.schema))};
const statusEl = document.getElementById('engine-status');
let E = null;

const el = id => document.getElementById(id);
const num = id => Number(el(id).value);

function fig(target, r, decimals = 1, over = false) {
  el(target).innerHTML =
    '<div class="figure">' +
      '<span class="q">' + r.quantity.replace(/_/g, ' ') + '</span>' +
      '<span class="n' + (over ? ' over' : '') + '">' +
        r.value.toLocaleString('en-GB', { minimumFractionDigits: decimals, maximumFractionDigits: decimals }) +
      '</span><span class="u">' + r.unit + '</span></div>' +
    '<p class="basis">' + r.basis + '</p>';
}

function refuse(target, message) {
  el(target).innerHTML = '<p class="basis" style="color:#ffae00;border:0;padding:0;margin:0">'
    + 'Engine refused this input: ' + message + '</p>';
}

${script}

try {
  const loaded = [];
  for (const url of ENGINE_MODULES) loaded.push(await import(url));
  // Some engine modules predate the schema convention and declare none. A spec
  // says so by passing null, and the check is skipped rather than faked -- an
  // asserted schema that does not exist would fail every load for a module that
  // is perfectly good.
  loaded.forEach((m, i) => {
    const expected = ENGINE_SCHEMAS[i];
    if (expected && m.schema !== expected) {
      throw new Error('unexpected schema ' + m.schema + ' from ' + ENGINE_MODULES[i]);
    }
  });
  // Merge the modules into one namespace. A name collision would silently
  // shadow one module's function with another's, so it is refused loudly.
  E = {};
  const NOT_COMPUTED = {};
  // Refusals are not all shaped the same. The newer modules export
  // NOT_COMPUTED as an object of named reasons; the older ones export a single
  // string, or name their boundaries individually as NOT_A_CAPACITY,
  // NO_HEADROOM, NEVER_SUMMED, CAVEAT and so on. Spreading a string into an
  // object would render one character per letter, so each shape is handled.
  const REFUSAL_NAME = /^(NOT_|NO_|NEVER_|CAVEAT|IMPEDANCE_)/;
  for (const m of loaded) {
    for (const [k, v] of Object.entries(m)) {
      if (k === 'schema' || k === 'requires') continue;
      if (k === 'NOT_COMPUTED') {
        if (typeof v === 'string') NOT_COMPUTED.notComputed = v;
        else Object.assign(NOT_COMPUTED, v);
        continue;
      }
      if (REFUSAL_NAME.test(k) && typeof v === 'string') {
        NOT_COMPUTED[k.toLowerCase().replace(/_(.)/g, (_, c) => c.toUpperCase())] = v;
        continue;
      }
      if (k in E) throw new Error('two engine modules both export "' + k + '"');
      E[k] = v;
    }
  }
  E.NOT_COMPUTED = NOT_COMPUTED;
  statusEl.className = 'status live';
  statusEl.textContent = 'ENGINE LIVE — ' +
    ENGINE_SCHEMAS.map((sc, i) => sc || ENGINE_MODULES[i].split('/').pop()).join(' + ') +
    ' · every figure below is computed by the engine module' + (loaded.length > 1 ? 's' : '') + ', not by this page.';
  el('refusals').innerHTML = Object.entries(E.NOT_COMPUTED).map(([k, v]) =>
    '<dt>' + k.replace(/([A-Z])/g, ' $1').toUpperCase() + '</dt><dd>' + v + '</dd>').join('');
  bind();
  render();
} catch (err) {
  statusEl.className = 'status dead';
  statusEl.textContent = 'ENGINE UNREACHABLE — ' + err.message +
    '. Nothing on this page is computed; there is deliberately no local copy to fall back to.';
  document.querySelectorAll('.out').forEach(o => {
    o.innerHTML = '<p class="basis" style="color:#ff8f8f;border:0;padding:0;margin:0">'
      + 'No figure: the engine did not load.</p>'; });
}
</script>
</body>
</html>
`;
}

function panelHtml(p) {
    const controls = p.controls.map(c => {
        if (c.type === 'range') {
            return `    <div class="field">
      <div class="rangerow"><label for="${c.id}">${esc(c.label)}</label>
        <span class="rangeval" id="${c.id}-val">${c.value}</span></div>
      <input type="range" id="${c.id}" min="${c.min}" max="${c.max}" step="${c.step}" value="${c.value}">
    </div>`;
        }
        return `    <div class="field">
      <label for="${c.id}">${esc(c.label)}</label>
      <input type="${c.type}" id="${c.id}" value="${esc(c.value)}"${c.min !== undefined ? ` min="${c.min}"` : ''}${c.max !== undefined ? ` max="${c.max}"` : ''}${c.step !== undefined ? ` step="${c.step}"` : ''} inputmode="${c.type === 'number' ? 'decimal' : 'text'}">
    </div>`;
    }).join('\n');
    return `<section>
  <h2>${esc(p.heading)}</h2>
  <div class="body">
    <p class="lede">${p.lede}</p>
${controls}
    ${p.outId ? `<div class="out" id="${p.outId}"></div>` : ''}
    ${p.tableId ? `<div class="scroller"><table id="${p.tableId}"><thead><tr>${p.tableHead.map(h => `<th${h.right ? ' style="text-align:right"' : ''}>${esc(h.label)}</th>`).join('')}</tr></thead><tbody></tbody></table></div>` : ''}
    ${p.note ? `<p class="basis">${p.note}</p>` : ''}
  </div>
</section>`;
}

function emit(spec) {
    const body = spec.panels.map(panelHtml).join('\n');
    const html = shell({ spec, body, script: spec.script });
    const dir = join(here, `${spec.stamp}-${spec.slug}`);
    const file = join(dir, 'index.html');
    if (existsSync(file)) return { spec, written: false, file };
    mkdirSync(dir, { recursive: true });
    writeFileSync(file, html, 'utf8');
    return { spec, written: true, file };
}

const check = process.argv.includes('--check');
const ledgerPath = join(here, 'iterations.json');
const ledger = JSON.parse(readFileSync(ledgerPath, 'utf8'));

let wrote = 0;
for (const spec of SPECS) {
    const r = emit(spec);
    if (r.written) {
        wrote += 1;
        console.log(`emitted ${spec.stamp}-${spec.slug}/index.html`);
    }
    if (!ledger.iterations.some(i => i.stamp === spec.stamp)) {
        ledger.iterations.push({
            stamp: spec.stamp,
            path: `${spec.stamp}-${spec.slug}/`,
            title: spec.title,
            feature: spec.feature,
            engine: modules(spec).map(m => `engine/${m}`).join(' + '),
            engineCommit: spec.engineCommit,
            checks: spec.checks
        });
    }
}
if (!check) {
    writeFileSync(ledgerPath, JSON.stringify(ledger, null, 2) + '\n', 'utf8');
}
console.log(`${wrote} page(s) emitted; ledger holds ${ledger.iterations.length} iteration(s)`);