In this section
- GlobalGrid2050 Verify V975 Public Workflow automation · globalgrid2050 / .github/workflows/verify-v975-public.yml lines 1–117
- GlobalGrid2050 Verify V976 Public Workflow automation · globalgrid2050 / .github/workflows/verify-v976-public.yml lines 1–120
- GlobalGrid2050 Wafer Development Environment Workflow automation · globalgrid2050 / .github/workflows/wafer-development-environment.yml lines 1–99
- GlobalGrid2050 Wire Generation Ecg Candidate Workflow automation · globalgrid2050 / .github/workflows/wire_generation_ecg_candidate.yml lines 1–78
- Actions render · globalgrid2050 / automation/dc_location_ui/83e7c36d08ef98f3665f7f35b8637405391dc4be/actions.css lines 1–13
- Actions render · globalgrid2050 / automation/dc_location_ui/83e7c36d08ef98f3665f7f35b8637405391dc4be/actions.mjs lines 1–219
- Model transform · globalgrid2050 / automation/document_facts_ui/20261117-v939/model.mjs lines 1–12
- View render · globalgrid2050 / automation/document_facts_ui/20261117-v939/view.mjs lines 1–21
- Model transform · globalgrid2050 / automation/grid_notice_ui/20261117-v938/model.mjs lines 1–17
GlobalGrid2050 Verify V975 Public Workflow
A GitHub Actions workflow using data from the GridAtlas repository. Runs on push and by hand.
automationglobalgrid2050 / .github/workflows/verify-v975-public.yml · lines 1–117 of 117 · Entry point
- What it does
- It runs automated jobs on GitHub Actions. Side effects: reads or writes files; makes network requests; starts processes.
- Inputs & outputs
- In: data source: gridatlas data; JSON file homepage-owner.json; JSON file homepage.json; JSON file active-pages.json; JSON file presentation.json; JSON file entity-types.json; JSON file current.json.
- Downstream impact
- It is itself an entry point (workflow); no other file was found loading it.
- What it achieves
- Named “Verify archived V9.75 public native Renewable Energy Planning Database (REPD), current owner homepage and V9.74 rollback”.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- globalgrid2050 · .github/workflows · workflow
- Uses
- none found
- Used by
- none found
- Produces
- none declared
- Defines here
- Verify archived V9.75 public native REPD, current owner homepage and V9.74 rollb
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 .github/workflows/verify-v975-public.yml:1-117 · blob 6c650456e5da3ae0d4b3bcde65016a2bed4f7505 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: ingest · effects: filesystem, network, process · domain stage: unknown · users: none · canonical: production_core
name: Verify archived V9.75 public native REPD, current owner homepage and V9.74 rollback
on:
push:
branches: [main]
paths:
- 'catalogue/homepage-owner.json'
- 'uk_renewables_pipeline/202611231600/**'
- '.github/workflows/verify-v975-public.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
served:
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Exact public bytes, source IDs, original colours and rollback
run: |
python3 - <<'PY'
import hashlib, json, os, time
from pathlib import Path
from urllib.request import urlopen, Request
pin=json.loads(Path('catalogue/homepage-owner.json').read_text())
assert pin['repository']=='Ventusltd/globalgrid2050-homepage'
assert pin['commit']=='63c5e2bfcb56695c0269d4172611e93c062d8ccd', 'owner SHA mismatch'
expected_owner_files={'index.html','assets/versioned-homepage.css','assets/versioned-homepage.js',
'data/homepage.json','data/active-pages.json','data/presentation.json','data/entity-types.json'}
assert set(pin['files'])==expected_owner_files, 'Owner file list modified'
def digest(v):return hashlib.sha256(v).hexdigest()
def fetch(url):
request=Request(url,headers={'Cache-Control':'no-cache','Accept-Encoding':'identity',
'User-Agent':'Ventus-V975-public-exact-byte-verifier'})
with urlopen(request,timeout=35) as response:
assert response.status==200, 'HTTP '+str(response.status)
data=response.read(4_500_000)
assert data, 'Empty response'
return data
source='https://raw.githubusercontent.com/'+pin['repository']+'/'+pin['commit']+'/'
owner={p:fetch(source+p) for p in pin['files']}
assert sum(map(len,owner.values()))<1_000_000,'Owner bundle too large'
for p,data in owner.items():
assert digest(data)==pin['files'][p], 'owner pinned hash drift: '+p
data=json.loads(owner['data/homepage.json'])
entity=next(x for x in data['entities'] if x['id']=='pipeline-news')
assert entity['operative_release_id']=='202611232245'
assert [x['id'] for x in entity['releases'][-3:]]==[
'202611231400','202611231600','202611232245']
assert entity['releases'][-2]['url']=='https://globalgrid2050.com/uk_renewables_pipeline/202611231600/'
assert entity['releases'][-2]['source_ref']==(
'https://github.com/Ventusltd/globalgrid2050/tree/'
'5cb111911073a149dd4a69992a02ff52b61f55bb/uk_renewables_pipeline/202611231600')
assert data['promotions'][-1]['from_release_id']=='202611231600'
assert data['promotions'][-1]['to_release_id']=='202611232245'
homepage=owner['index.html'].decode('utf-8-sig')
for name in ('versioned-homepage.css','versioned-homepage.js'):
source_path='./assets/'+name
assert homepage.count(source_path)==1, 'unexpected homepage source'
homepage=homepage.replace(source_path,'./homepage-shell/assets/'+name)
old='href="data/homepage.json"'
assert homepage.count(old)==1, 'unexpected catalogue route'
homepage=homepage.replace(old,'href="./homepage-shell/data/homepage.json"')
expected={
'index.html':(homepage.rstrip()+'\n').encode('utf-8'),
'homepage-shell/data/homepage.json':owner['data/homepage.json'],
'homepage-shell/assets/versioned-homepage.css':owner['assets/versioned-homepage.css'],
'homepage-shell/assets/versioned-homepage.js':owner['assets/versioned-homepage.js']
}
current='uk_renewables_pipeline/202611231600/'
previous='uk_renewables_pipeline/202611231400/'
rollback='uk_renewables_pipeline/202611222330/'
for f in ('index.html','repd-reports.mjs','repd-reports-model.mjs','repd-scan.mjs',
'styles/v7.css','styles/repd-reports.css','scripts/core/state.js',
'scripts/plugins/projects-v9-8.js','map-entry.mjs','report-a4.mjs',
'report-model.mjs','report-pdf.mjs','repd-expanded.mjs'):
expected[current+f]=Path(current+f).read_bytes()
expected['automation/repd_reporting/v3/operator-aliases.mjs']=Path(
'automation/repd_reporting/v3/operator-aliases.mjs').read_bytes()
for f in ('index.html','repd-reports.mjs','styles/v7.css','styles/repd-reports.css',
'map-entry.mjs','report-a4.mjs','report-pdf.mjs'):
expected[previous+f]=Path(previous+f).read_bytes()
for f in ('index.html','report-a4.mjs','report-pdf.mjs'):
expected[rollback+f]=Path(rollback+f).read_bytes()
html=expected[current+'index.html']
report=expected[current+'repd-reports.mjs']
project=expected[current+'scripts/plugins/projects-v9-8.js']
assert b'OPERATOR MW' in html and b'STATUS MW' in html and b'REGION MW' in html
assert all(b'id="'+x+b'"' in html for x in
[b'repdNativeStatus',b'repdNativeOperator',b'repdNativeRegion'])
assert b'Cockpit' not in html and b'COCKPIT' not in html
assert b'repdReportScope' not in html
assert b'state.filtered' in report and b'repdNativeOperator' in project
assert b'canonicalOperator(project.operator)' in project
assert b'canonicalOperator' in expected['automation/repd_reporting/v3/operator-aliases.mjs']
for f in ('styles/v7.css','styles/repd-reports.css','map-entry.mjs',
'report-a4.mjs','report-pdf.mjs','report-model.mjs','repd-expanded.mjs',
'scripts/core/state.js'):
assert Path(current+f).read_bytes()==Path(previous+f).read_bytes(), 'Inherited original altered: '+f
for attempt in range(1,49):
differences=[]
for name,content in expected.items():
url='https://globalgrid2050.com/'+name+'?v975_sha='+os.getenv('GITHUB_SHA','')[:8]+'-'+str(attempt)
try:
actual=fetch(url)
if digest(actual)!=digest(content):differences.append(name+' mismatch')
except Exception as exc: differences.append(name+': '+repr(exc))
if not differences:
print('PASS',len(expected),'exact public HTTPS SHA256 files. V9.75 native REPD and homepage; V9.74/V9.73 rollback intact',flush=True)
break
if attempt==48:raise SystemExit('V9.75 PUBLIC NOT VERIFIED: '+str(differences))
print('Attempt',attempt,'/48 outstanding',differences[:6],flush=True)
time.sleep(10)
receiver=json.loads(fetch('https://ventusltd.github.io/gridatlas/atlas/current.json'))
assert receiver.get('live_route')=='/gridatlas/atlas/'
assert {'pipeline-vicinity-button','vicinity-focus'}<=set(receiver.get('cartridge_order',[]))
print('PASS GridAtlas VICINITY contract; physical iPhone Safari still requires owner check',flush=True)
PYGlobalGrid2050 Verify V976 Public Workflow
A GitHub Actions workflow using data from the GridAtlas repository. Runs on push and by hand.
automationglobalgrid2050 / .github/workflows/verify-v976-public.yml · lines 1–120 of 120 · Entry point
- What it does
- It runs automated jobs on GitHub Actions. Side effects: reads or writes files; makes network requests; starts processes.
- Inputs & outputs
- In: data source: gridatlas data; JSON file homepage-owner.json; JSON file homepage.json; JSON file active-pages.json; JSON file presentation.json; JSON file entity-types.json; JSON file current.json.
- Downstream impact
- It is itself an entry point (workflow); no other file was found loading it.
- What it achieves
- Named “Verify V9.76 public iPhone Renewable Energy Planning Database (REPD), homepage, V9.75/V9.74 rollback”.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- globalgrid2050 · .github/workflows · workflow
- Uses
- none found
- Used by
- none found
- Produces
- none declared
- Defines here
- Verify V9.76 public iPhone REPD, homepage, V9.75/V9.74 rollback
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 .github/workflows/verify-v976-public.yml:1-120 · blob f0e9f7a5f26c1c7205ae332190f6eeece6c7d250 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: ingest · effects: filesystem, network, process · domain stage: unknown · users: none · canonical: production_core
name: Verify V9.76 public iPhone REPD, homepage, V9.75/V9.74 rollback
on:
push:
branches: [main]
paths:
- 'catalogue/homepage-owner.json'
- 'uk_renewables_pipeline/202611231600/**'
- '.github/workflows/verify-v975-public.yml'
workflow_dispatch:
permissions:
contents: read
jobs:
served:
runs-on: ubuntu-24.04
timeout-minutes: 25
steps:
- uses: actions/checkout@v4
- name: Exact public bytes, source IDs, original colours and rollback
run: |
python3 - <<'PY'
import hashlib, json, os, time
from pathlib import Path
from urllib.request import urlopen, Request
pin=json.loads(Path('catalogue/homepage-owner.json').read_text())
assert pin['repository']=='Ventusltd/globalgrid2050-homepage'
assert pin['commit']=='63c5e2bfcb56695c0269d4172611e93c062d8ccd', 'owner SHA mismatch'
expected_owner_files={'index.html','assets/versioned-homepage.css','assets/versioned-homepage.js',
'data/homepage.json','data/active-pages.json','data/presentation.json','data/entity-types.json'}
assert set(pin['files'])==expected_owner_files, 'Owner file list modified'
def digest(v):return hashlib.sha256(v).hexdigest()
def fetch(url):
request=Request(url,headers={'Cache-Control':'no-cache','Accept-Encoding':'identity',
'User-Agent':'Ventus-V976-public-exact-byte-verifier'})
with urlopen(request,timeout=35) as response:
assert response.status==200, 'HTTP '+str(response.status)
data=response.read(4_500_000)
assert data, 'Empty response'
return data
source='https://raw.githubusercontent.com/'+pin['repository']+'/'+pin['commit']+'/'
owner={p:fetch(source+p) for p in pin['files']}
assert sum(map(len,owner.values()))<1_000_000,'Owner bundle too large'
for p,data in owner.items():
assert digest(data)==pin['files'][p], 'owner pinned hash drift: '+p
data=json.loads(owner['data/homepage.json'])
entity=next(x for x in data['entities'] if x['id']=='pipeline-news')
assert entity['operative_release_id']=='202611232245'
assert [x['id'] for x in entity['releases'][-3:]]==[
'202611231400','202611231600','202611232245']
assert entity['releases'][-1]['url']=='https://globalgrid2050.com/uk_renewables_pipeline/202611232245/'
assert entity['releases'][-1]['source_ref']==(
'https://github.com/Ventusltd/globalgrid2050/tree/'
'032e28629125515650ea14d99091362ba46ee457/uk_renewables_pipeline/202611232245')
assert data['promotions'][-1]['from_release_id']=='202611231600'
assert data['promotions'][-1]['to_release_id']=='202611232245'
homepage=owner['index.html'].decode('utf-8-sig')
for name in ('versioned-homepage.css','versioned-homepage.js'):
source_path='./assets/'+name
assert homepage.count(source_path)==1, 'unexpected homepage source'
homepage=homepage.replace(source_path,'./homepage-shell/assets/'+name)
old='href="data/homepage.json"'
assert homepage.count(old)==1, 'unexpected catalogue route'
homepage=homepage.replace(old,'href="./homepage-shell/data/homepage.json"')
expected={
'index.html':(homepage.rstrip()+'\n').encode('utf-8'),
'homepage-shell/data/homepage.json':owner['data/homepage.json'],
'homepage-shell/assets/versioned-homepage.css':owner['assets/versioned-homepage.css'],
'homepage-shell/assets/versioned-homepage.js':owner['assets/versioned-homepage.js']
}
current='uk_renewables_pipeline/202611232245/'
previous='uk_renewables_pipeline/202611231600/'
rollback='uk_renewables_pipeline/202611231400/'
for f in ('index.html','repd-reports.mjs','repd-reports-model.mjs','repd-scan.mjs',
'styles/v7.css','styles/repd-reports.css','styles/repd-mobile-v976.css','scripts/core/state.js',
'scripts/plugins/projects-v9-8.js','map-entry.mjs','report-a4.mjs',
'report-model.mjs','report-pdf.mjs','repd-expanded.mjs'):
expected[current+f]=Path(current+f).read_bytes()
expected['automation/repd_reporting/v3/operator-aliases.mjs']=Path(
'automation/repd_reporting/v3/operator-aliases.mjs').read_bytes()
for f in ('index.html','repd-reports.mjs','styles/v7.css','styles/repd-reports.css',
'map-entry.mjs','report-a4.mjs','report-pdf.mjs'):
expected[previous+f]=Path(previous+f).read_bytes()
for f in ('index.html','report-a4.mjs','report-pdf.mjs'):
expected[rollback+f]=Path(rollback+f).read_bytes()
html=expected[current+'index.html']
report=expected[current+'repd-reports.mjs']
project=expected[current+'scripts/plugins/projects-v9-8.js']
assert b'OPERATOR MW' in html and b'STATUS MW' in html and b'REGION MW' in html
assert all(b'id="'+x+b'"' in html for x in
[b'repdNativeStatus',b'repdNativeOperator',b'repdNativeRegion'])
assert b'Cockpit' not in html and b'COCKPIT' not in html
assert b'repdReportScope' not in html
assert b'styles/repd-mobile-v976.css' in html and b'id="repdReportSwipeHint"' in html
assert b'white-space:nowrap!important' in expected[current+'styles/repd-mobile-v976.css']
assert b'#repdPanel #status.filters' in expected[current+'styles/repd-mobile-v976.css']
assert b'state.filtered' in report and b'repdNativeOperator' in project
assert b'canonicalOperator(project.operator)' in project
assert b'canonicalOperator' in expected['automation/repd_reporting/v3/operator-aliases.mjs']
for f in ('styles/v7.css','styles/repd-reports.css','repd-reports.mjs','scripts/plugins/projects-v9-8.js','map-entry.mjs',
'report-a4.mjs','report-pdf.mjs','report-model.mjs','repd-expanded.mjs',
'scripts/core/state.js'):
assert Path(current+f).read_bytes()==Path(previous+f).read_bytes(), 'Inherited original altered: '+f
for attempt in range(1,49):
differences=[]
for name,content in expected.items():
url='https://globalgrid2050.com/'+name+'?v976_sha='+os.getenv('GITHUB_SHA','')[:8]+'-'+str(attempt)
try:
actual=fetch(url)
if digest(actual)!=digest(content):differences.append(name+' mismatch')
except Exception as exc: differences.append(name+': '+repr(exc))
if not differences:
print('PASS',len(expected),'exact public HTTPS SHA256 files. V9.76 mobile REPD and homepage; V9.75/V9.74 rollback intact',flush=True)
break
if attempt==48:raise SystemExit('V9.76 PUBLIC NOT VERIFIED: '+str(differences))
print('Attempt',attempt,'/48 outstanding',differences[:6],flush=True)
time.sleep(10)
receiver=json.loads(fetch('https://ventusltd.github.io/gridatlas/atlas/current.json'))
assert receiver.get('live_route')=='/gridatlas/atlas/'
assert {'pipeline-vicinity-button','vicinity-focus'}<=set(receiver.get('cartridge_order',[]))
print('PASS GridAtlas VICINITY contract; physical iPhone Safari still requires owner check',flush=True)
PYGlobalGrid2050 Wafer Development Environment Workflow
A GitHub Actions workflow that builds and publishes the site. Runs on push and by hand.
automationglobalgrid2050 / .github/workflows/wafer-development-environment.yml · lines 1–99 of 99 · Entry point
- What it does
- It builds and publishes its content. Side effects: starts processes.
- Inputs & outputs
- In: JSON file versions.json; JSON file families.json; JSON file keys.json; JSON file qubit.json; JSON file apps.json; JSON file entangle.json; JSON file labels.json; JSON file line-index.json.
- Downstream impact
- It is itself an entry point (workflow); no other file was found loading it.
- What it achieves
- Forty checks from the outside, after every push that touches it.
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- globalgrid2050 · .github/workflows · workflow
- Uses
- none found
- Used by
- none found
- Produces
- none declared
- Defines here
- Wafer Development Environment
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 .github/workflows/wafer-development-environment.yml:1-99 · blob 634c6f18db0bf2233b86622c492c35f46a37e83a · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: unknown · effects: process · domain stage: unknown · users: none · canonical: production_core
# Wafer Development Environment: forty checks from the outside, after every push that touches it.
# Ten versions x five checks, each on its own self-hosted lane. Every lane waits for Pages to serve
# the pushed commit, then proves one thing about the live site. A lane that cannot prove it fails.
name: Wafer Development Environment
on:
push:
branches: [main]
paths:
- "testcode/wafer-development-environment/**"
- "index.html"
workflow_dispatch:
concurrency: wde-${{ github.ref }}
jobs:
check:
runs-on: [self-hosted, msi, gpu]
timeout-minutes: 20
strategy:
fail-fast: false
# JOB CAP. A 50-lane matrix on the same push that publishes a page can
# starve the Pages deploy behind it, and then "pushed" is reported as
# "live" while the site still serves the old bytes. Capped at 12.
max-parallel: 12
matrix:
version: [0, 1, 2, 3, 4, 5, 6, 7, 8, 9]
check: [page, nest, data, twin, physics]
env:
SITE: https://globalgrid2050.com
steps:
- uses: actions/checkout@v4
with: { sparse-checkout: "testcode/wafer-development-environment/versions.json", sparse-checkout-cone-mode: false }
- name: ${{ matrix.check }} for version ${{ matrix.version }}
shell: 'powershell -NoProfile -ExecutionPolicy Bypass -File {0}'
run: |
$ErrorActionPreference = 'Stop'
$versions = Get-Content 'testcode/wafer-development-environment/versions.json' -Raw | ConvertFrom-Json
$v = $versions[${{ matrix.version }}]
$folder = "$env:SITE/testcode/wafer-development-environment/$v/"
function Get-Live($url) { (Invoke-WebRequest -UseBasicParsing -Uri "$url`?t=$(Get-Date -UFormat %s)" -TimeoutSec 30).Content }
# wait for Pages: up to 12 minutes for the version folder to answer with its own title
$deadline = (Get-Date).AddMinutes(12); $page = $null
do { try { $page = Get-Live $folder } catch { $page = $null }
if ($page -and $page.Contains("<title>$v</title>")) { break }
Start-Sleep -Seconds 20 } while ((Get-Date) -lt $deadline)
if (-not $page) { throw "not served: $folder" }
switch ('${{ matrix.check }}') {
'page' {
if (-not $page.Contains("<title>$v</title>")) { throw "wrong title at $folder" }
if (-not $page.Contains('wafer-start')) { throw "no start command at $folder" }
if ($page -match 'qubit|anonymous') { throw "platform language broken at $folder" }
"OK page $v" }
'nest' {
# the homepage deploys with the same commit; wait for it too
$deadline = (Get-Date).AddMinutes(12); $root = ''
do { try { $root = Get-Live "$env:SITE/" } catch { $root = '' }
if ($root.Contains("wafer-development-environment/$v/")) { break }
Start-Sleep -Seconds 20 } while ((Get-Date) -lt $deadline)
if (-not $root.Contains('<summary>Wafer Development Environment</summary>')) { throw 'homepage has no Wafer Development Environment nest' }
if (-not $root.Contains("wafer-development-environment/$v/")) { throw "homepage nest does not list $v" }
if (-not $root.Contains('open grid development, engineering, procurement, construction and operations')) { throw 'mission sentence missing' }
if (-not $root.Contains('Disclaimer:')) { throw 'disclaimer missing' }
"OK nest lists $v; mission and disclaimer present" }
'data' {
$app = Get-Live "$folder/app.mjs"
if (-not $app.Contains("const DATA = '../../202609142202/data/';")) { throw "data path wrong in $v/app.mjs" }
$idx = Get-Live "$env:SITE/testcode/202609142202/data/families.json"
if ($idx.Length -lt 1000) { throw 'shared data not served' }
"OK data $v" }
'twin' {
$shared = "$env:SITE/testcode/wafer-development-environment/shared/"
foreach ($f in 'keys.json', 'qubit.json', 'apps.json', 'entangle.json', 'labels.json') {
$r = Invoke-WebRequest -UseBasicParsing -Uri "$shared$f" -TimeoutSec 60
if ($r.StatusCode -ne 200) { throw "shared/$f missing" } }
foreach ($f in 'pilot.mjs', 'pilot-rules.js', 'app.mjs', 'line-index.json') {
$r = Invoke-WebRequest -UseBasicParsing -Uri "$folder$f" -TimeoutSec 60
if ($r.StatusCode -ne 200) { throw "$f missing in $v" } }
$e = (Get-Live "${shared}entangle.json") | ConvertFrom-Json
if ($e.resolved -ne $e.keys -or $e.broken -ne 0) { throw "key-to-code check not 100% ($($e.resolved)/$($e.keys))" }
"OK twin $v (key-to-code $($e.resolved)/$($e.keys))" }
'physics' {
$app = Get-Live "$folder/app.mjs"; $pilot = Get-Live "$folder/pilot.mjs"
foreach ($w in 'gravity', 'PUPIL', 'KEPLER', 'RIM_SHARE', 'release', 'setScope', '__wafer') { if (-not $app.Contains($w)) { throw "renderer without $w in $v/app.mjs (physics left out)" } }
foreach ($w in 'cmds.gravity', 'cmds.release', 'cmds.scope', 'cmds.logo', 'wafer-start') { if (-not $pilot.Contains($w)) { throw "pilot without $w in $v/pilot.mjs" } }
if ($app.Contains([char]0xC2 + [string][char]0xB7)) { throw "stray bytes in $v/app.mjs (encoding)" }
$apps = Get-Live "$env:SITE/testcode/wafer-development-environment/shared/apps.json"
if (-not $apps.Contains('"keys"')) { throw 'shared/apps.json has no key sets; app gravity cannot work' }
"OK physics $v" }
}
summary:
needs: check
if: always()
runs-on: [self-hosted, msi, gpu]
steps:
- shell: 'powershell -NoProfile -ExecutionPolicy Bypass -File {0}'
run: |
"Wafer Development Environment: forty checks finished with result '${{ needs.check.result }}' for ${{ github.sha }}" | Out-File $env:GITHUB_STEP_SUMMARY -Append
if ('${{ needs.check.result }}' -ne 'success') { exit 1 }GlobalGrid2050 Wire Generation Ecg Candidate Workflow
A GitHub Actions workflow. Runs by hand.
automationglobalgrid2050 / .github/workflows/wire_generation_ecg_candidate.yml · lines 1–78 of 78 · Entry point
- What it does
- It runs automated jobs on GitHub Actions. Side effects: starts processes.
- Why it exists in the grid workflow
- Domain stage upstream_foresight (path word 'generation'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
- Inputs & outputs
- Out: commits pushed to the repository.
- Downstream impact
- It is itself an entry point (workflow); no other file was found loading it.
- What it achieves
- Runs GlobalGrid2050 Wire Generation Ecg Candidate (`scripts/wire_generation_ecg_candidate.py`).
- Why it matters
- No other file in the estate was found to import it; it is an entry point.
- Application
- globalgrid2050 · .github/workflows · workflow
- Uses
- GlobalGrid2050 Wire Generation Ecg Candidate (workflow run)
- Used by
- none found
- Produces
- none declared
- Defines here
- Wire Generation ECG Candidate
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 .github/workflows/wire_generation_ecg_candidate.yml:1-78 · blob 64e2e56ea1ec6e4596980c166dd8c030aeb8b912 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: unknown · effects: process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
name: Wire Generation ECG Candidate
on:
workflow_dispatch:
inputs:
mode:
description: Run mode
required: true
default: audit
type: choice
options:
- audit
- apply
commit_outputs:
description: Commit wiring changes and audit reports
required: true
default: 'true'
type: choice
options:
- 'true'
- 'false'
permissions:
contents: write
concurrency:
group: wire-generation-ecg-candidate
cancel-in-progress: false
jobs:
wire-generation-ecg-candidate:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: '3.11'
- name: Audit ECG candidate wiring
if: github.event.inputs.mode == 'audit'
run: python scripts/wire_generation_ecg_candidate.py
- name: Apply ECG candidate wiring
if: github.event.inputs.mode == 'apply'
run: python scripts/wire_generation_ecg_candidate.py --apply
- name: Upload ECG wiring report
if: always()
uses: actions/upload-artifact@v4
with:
name: ecg-candidate-wiring-report
path: |
data_science_protocol/audit_reports/ECG_CANDIDATE_WIRING_LATEST.md
data_science_protocol/audit_reports/json/ECG_CANDIDATE_WIRING_LATEST.json
- name: Commit ECG candidate wiring outputs
if: github.event.inputs.commit_outputs == 'true'
shell: bash
run: |
set -euo pipefail
git config --global user.name "Gridbot"
git config --global user.email "gridbot@globalgrid2050.com"
git add uk_energy_tracking_v6/generation_history/live-config.js || true
git add uk_energy_tracking_v6/generation_history/load_generation_history_data.js || true
git add data_science_protocol/audit_reports/ || true
if git diff --cached --quiet; then
echo "No ECG candidate wiring outputs to commit"
exit 0
fi
git commit -m "gridbot: wire generation ECG candidate ${{ github.event.inputs.mode }}"
git pull --rebase origin "${GITHUB_REF_NAME}"
git push origin HEAD:"${GITHUB_REF_NAME}"Actions
A style sheet in the dc location ui folder of GlobalGrid2050.
renderglobalgrid2050 / automation/dc_location_ui/83e7c36d08ef98f3665f7f35b8637405391dc4be/actions.css · lines 1–13 of 13 · Entry point
- What it does
- Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'dc'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/). Reached from 4 other entry points, including GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents); A4 Legal Model (globalgrid2050).
- What it achieves
- No statement of purpose was found in the file, a README line naming it, or its name. Described from its file name only (a candidate, not yet checked against the code).
- Why it matters
- Loaded by the UK Renewables Pipeline page at https://globalgrid2050.com/uk_renewables_pipeline/202611280922/.
- Application
- globalgrid2050 · automation/dc_location_ui/83e7c36d08ef98f3665f7f35b8637405391dc4be · style sheet
- Uses
- none found
- Used by
- loaded by GlobalGrid2050 — UK Renewables Pipeline Page (stylesheet)
- Produces
- none declared
- Defines here
- none
- Cannot conclude
- Whether this code runs, is used by a live app today, or is correct. This is a static reading.
- Evidence
- globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 automation/dc_location_ui/83e7c36d08ef98f3665f7f35b8637405391dc4be/actions.css:1-13 · blob dbdb84fdead5cd26d9f55b4e69bc026a39e80679 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
.ggdc-location-actions{display:flex;flex-wrap:wrap;align-items:center;gap:4px 10px;margin-top:6px;max-width:100%}
.ggdc-location-actions a{display:inline-flex;align-items:center;min-height:44px;color:#00ffff;text-decoration:underline;text-underline-offset:3px}
.ggdc-location-actions a:focus-visible{outline:2px solid #ffff00;outline-offset:2px}
.ggdc-reported-address{flex-basis:100%;max-width:40ch;font-size:11px;line-height:1.5;overflow-wrap:anywhere}
.ggdc-reported-address summary{min-height:32px;cursor:pointer;color:#00ffff}
.ggdc-reported-address p{margin:4px 0}
.ggdc-screen-location{display:block;flex-basis:100%;max-width:40ch;font-size:10px;line-height:1.4;color:#a6adbb;overflow-wrap:anywhere}
.ggdc-screen-footnote{display:block;margin-top:8px;color:#a6adbb;font-size:10px;line-height:1.5}
.ggdc-screen-footnote[hidden],.ggdc-location-sources[hidden],[data-dc-location-hidden][hidden]{display:none!important}
.ggdc-location-sources{margin-top:8px;font-size:11px;line-height:1.5;color:#a6adbb}
.ggdc-location-sources summary{cursor:pointer;color:#00ffff;min-height:32px;padding:6px 0}
.ggdc-location-sources p{margin:6px 0}.ggdc-location-sources a{color:#00ffff;margin-right:10px}
.ggdc-location-sources small{display:block;overflow-wrap:anywhere}Actions
A JavaScript module in the dc location ui folder of GlobalGrid2050 that draws datacentre locations and postcodes, using SHA-256, and uses data from the data-grid-GB and GridAtlas repositories.
renderglobalgrid2050 / automation/dc_location_ui/83e7c36d08ef98f3665f7f35b8637405391dc4be/actions.mjs · lines 1–219 of 219 · pattern requireValid (shared by 4 files)
- What it does
- It draws datacentre locations and postcodes. Defines 9 functions or classes, including requireValid, checkedPoint, revision, indexLocations, screenUrl. Side effects: changes the web page (DOM).
- Why it exists in the grid workflow
- Domain stage sub33kv_design (path word 'dc'): inside-the-fence electrical and civil design below 33kV, which Ventus Ltd states is within its commercial execution boundary. Domain terms in the code: postcodes.
- Inputs & outputs
- In: GeoJSON file datacentre-locations.geojson.
- Downstream impact
- Used directly by 1 file: Contracts Test (globalgrid2050). Reached from 1 other entry point, including GlobalGrid2050 V930 Preview Acceptance Workflow (globalgrid2050).
- What it achieves
- It indexes locations (`indexLocations`), loads locations (`loadLocations`) and attaches location actions (`attachLocationActions`). Optional, bounded DC location actions. Frame and original source records stay owned by their existing components.
- Why it matters
- Checked by Contracts Test.
- Application
- globalgrid2050 · automation/dc_location_ui/83e7c36d08ef98f3665f7f35b8637405391dc4be · JavaScript module
- Uses
- GridAtlas — Atlas Page (estate URL)
- Used by
- imported by Contracts Test (import)
- Produces
- INPUT, FOOTNOTE, indexLocations, screenUrl, loadLocations, attachLocationActions
- Defines here
- requireValid, checkedPoint, revision, indexLocations, screenUrl, loadLocations, attachLocationActions, mount, refresh
- 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/dc_location_ui/83e7c36d08ef98f3665f7f35b8637405391dc4be/actions.mjs:1-219 · blob 5c9630a830a942b660d8422b5ebd8a50956d5378 · GitHub at these lines
- State
- achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: sub33kv_design · users: EPC_contractor, ICP_grid_engineer · canonical: production_core
/* Optional, bounded DC location actions. Frame and original source records stay owned by their existing components. */
export const INPUT = Object.freeze({
url: 'https://raw.githubusercontent.com/Ventusltd/data-grid-gb/b33190f2a95a2046e108c2ba465c6a9195759892/datacentres/locations/data/20261117T002200Z/datacentre-locations.geojson',
sha256: '6f68e078d9b57057acdda679288730e638553f68df884dfd747c5049e56ea88e',
bytes: 183561
});
const PRECISIONS = new Set(['WIKIDATA_REPORTED_POINT', 'POSTCODE_CENTROID_APPROXIMATE', 'UNKNOWN']);
const ATTACHMENTS = new WeakMap();
export const FOOTNOTE = 'UK screening coverage. Screening only; not a grid-capacity assessment.';
const requireValid = (ok, field) => { if (!ok) throw new Error('DC locations rejected: ' + field); };
function checkedPoint(feature) {
const xy = feature?.geometry?.coordinates;
requireValid(feature?.geometry?.type === 'Point' && Array.isArray(xy) && xy.length === 2 &&
xy.every(Number.isFinite) && Math.abs(xy[0]) <= 180 && Math.abs(xy[1]) <= 90 &&
(xy[0] !== 0 || xy[1] !== 0), 'point');
return xy;
}
function revision(value, qid) {
let u; try { u = new URL(value); } catch { throw new Error('DC locations rejected: source URL'); }
requireValid(u.protocol === 'https:' && u.hostname === 'www.wikidata.org' && !u.username && !u.password &&
!u.port && u.pathname === '/w/index.php' && u.searchParams.get('title') === qid &&
u.searchParams.size === 2 && u.searchParams.getAll('title').length === 1 && u.searchParams.getAll('oldid').length === 1 &&
/^[1-9]\d*$/.test(u.searchParams.get('oldid') || '') && !u.hash, 'source revision');
return u.href;
}
export function indexLocations(document) {
requireValid(document?.schema === 'data-grid-gb.dc-address-locations.v1' && document.type === 'FeatureCollection' &&
Array.isArray(document.features) && document.features.length > 0 && document.features.length <= 1000, 'schema/count');
const index = new Map(); let points = 0, approximate = 0, addresses = 0;
for (const f of document.features) {
const p = f.properties;
requireValid(f.type === 'Feature' && p && /^DC-WD-Q[1-9]\d*$/.test(f.id) && f.id === p.id &&
p.wikidata_id === f.id.slice(6) && !index.has(f.id), 'original source identity');
requireValid(typeof p.name === 'string' && p.name.trim() && p.name.length <= 1000 &&
p.grid_connection_assessed === false && p.facility_identity_review === 'NOT_INDEPENDENTLY_VERIFIED', 'scope');
requireValid(PRECISIONS.has(p.location_precision) && Array.isArray(p.addresses) &&
p.addresses.every(x => typeof x.text === 'string' && x.text.length <= 2000), 'precision/address');
revision(p.source_revision_url, p.wikidata_id);
if (p.addresses.length) addresses++;
if (f.geometry !== null) {
const xy = checkedPoint(f);
requireValid(p.location_precision !== 'UNKNOWN' && typeof p.geometry_licence === 'string' &&
Array.isArray(p.geometry_attribution) && p.geometry_attribution.length > 0 &&
p.geometry_attribution.every(x => typeof x === 'string' && x.trim() && x.length <= 2000), 'point/rights');
points++;
if (p.location_precision === 'POSTCODE_CENTROID_APPROXIMATE') {
requireValid(p.country?.code === 'GB' && xy[0] >= -8.7 && xy[0] <= 2 && xy[1] >= 49.8 && xy[1] <= 61.2 &&
p.geometry_licence.startsWith('OS OpenData') && p.geometry_licence_url === 'https://postcodes.io/docs/licences/', 'postcode geometry terms');
approximate++;
} else requireValid(p.geometry_licence === 'CC0-1.0' &&
p.geometry_licence_url === 'https://www.wikidata.org/wiki/Wikidata:Copyright', 'Wikidata geometry terms');
} else requireValid(p.location_precision === 'UNKNOWN', 'null geometry precision');
index.set(f.id, f);
}
const c = document.counts;
requireValid(c?.records === index.size && c.with_geometry === points && c.unknown_geometry === index.size - points &&
c.postcode_centroids === approximate && c.with_address === addresses, 'observed counts');
return index;
}
export function screenUrl(feature) {
if (!feature?.geometry || feature.properties?.country?.code !== 'GB') return null;
const [longitude, latitude] = checkedPoint(feature);
requireValid(typeof feature.properties?.name === 'string' && feature.properties.name.trim(), 'source label');
// Reconstruct from checked coordinates; never execute a producer-supplied action URL.
return 'https://ventusltd.github.io/gridatlas/atlas/?' + new URLSearchParams({
longitude: String(longitude), latitude: String(latitude), zoom: '12',
project: feature.properties.name, technology: 'datacentre'}).toString();
}
export async function loadLocations(transport = fetch, pin = INPUT) {
requireValid(pin && Number.isSafeInteger(pin.bytes) && pin.bytes > 0 && pin.bytes <= 2 * 1024 * 1024 &&
/^[a-f0-9]{64}$/.test(pin.sha256 || '') && typeof pin.url === 'string' &&
/^https:\/\/raw\.githubusercontent\.com\/Ventusltd\/data-grid-gb\/[a-f0-9]{40}\/datacentres\/locations\/data\/[A-Za-z0-9_-]+\/datacentre-locations\.geojson$/.test(pin.url), 'pinned source contract');
const response = await transport(pin.url, {credentials: 'omit', referrerPolicy: 'no-referrer'});
requireValid(response.ok, 'HTTP response');
const reader = response.body?.getReader();
requireValid(reader, 'bounded response stream');
const chunks = []; let length = 0;
while (true) {
const {done, value} = await reader.read(); if (done) break;
length += value.byteLength;
if (length > pin.bytes) { await reader.cancel(); throw new Error('DC locations rejected: byte limit'); }
chunks.push(value);
}
requireValid(length === pin.bytes, 'source byte count');
const bytes = new Uint8Array(length); let offset = 0;
for (const chunk of chunks) { bytes.set(chunk, offset); offset += chunk.byteLength; }
const digest = await crypto.subtle.digest('SHA-256', bytes);
const actual = Array.from(new Uint8Array(digest), b => b.toString(16).padStart(2, '0')).join('');
requireValid(actual === pin.sha256, 'source digest');
return indexLocations(JSON.parse(new TextDecoder('utf-8', {fatal: true}).decode(bytes)));
}
export function attachLocationActions(host, options = {}) {
const {pin = INPUT, noteId = 'dc-screening-note'} = options;
requireValid(host?.nodeType === 1 && /^[a-z][a-z0-9-]*$/.test(noteId), 'host/note ID');
const key = JSON.stringify([pin.url, pin.sha256, pin.bytes, noteId]);
const previous = ATTACHMENTS.get(host);
if (previous) {
requireValid(previous.key === key, 'host already has another source');
return previous.promise;
}
const state = {key};
state.promise = mount(host, options, state).catch(error => {
if (ATTACHMENTS.get(host) === state) ATTACHMENTS.delete(host);
throw error;
});
ATTACHMENTS.set(host, state);
return state.promise;
}
async function mount(host, {transport = fetch, pin = INPUT, noteId = 'dc-screening-note'}, state) {
const index = await loadLocations(transport, pin);
let closed = false, queued = false;
function refresh() {
if (closed) return;
let count = 0;
for (const row of host.querySelectorAll('tbody tr')) {
const id = row.querySelector('.ggdc-id')?.textContent?.trim(), feature = index.get(id);
const screenable = feature?.geometry && feature.properties.country?.code === 'GB';
const addresses = feature?.properties.addresses || [];
const eligible = screenable || addresses.length > 0;
const stale = [...row.querySelectorAll('.ggdc-location-actions')].filter(n => !eligible || n.dataset.sourceId !== id);
for (const n of stale) n.remove();
if (stale.length) row.querySelectorAll('[data-dc-location-hidden]').forEach(n => {
if (n.dataset.dcLocationHidden === noteId) { n.hidden = false; delete n.dataset.dcLocationHidden; }
});
if (!eligible || row.querySelector('.ggdc-location-actions')) continue;
const cell = row.lastElementChild;
if (!cell) continue;
const p = feature.properties, actions = document.createElement('div');
actions.className = 'ggdc-location-actions' + (screenable ? ' ggdc-screen-actions' : ''); actions.dataset.sourceId = id;
if (screenable) {
const link = document.createElement('a'); link.textContent = 'Screen¹';
link.href = screenUrl(feature); link.target = '_blank'; link.rel = 'noopener noreferrer';
link.setAttribute('aria-describedby', noteId);
link.title = p.location_precision === 'POSTCODE_CENTROID_APPROXIMATE'
? 'Approximate postcode location — open existing grid vicinity screening' : 'Source-reported location — open existing grid vicinity screening';
actions.append(link);
}
const source = document.createElement('a'); source.textContent = 'Location source';
source.href = revision(p.source_revision_url, p.wikidata_id); source.target = '_blank'; source.rel = 'noopener noreferrer';
actions.append(source);
if (addresses.length) {
const reported = document.createElement('details'); reported.className = 'ggdc-reported-address';
const summary = document.createElement('summary'); summary.textContent = 'Reported address'; reported.append(summary);
for (const statement of addresses) {
const line = document.createElement('p'); line.textContent = statement.text; reported.append(line);
}
actions.append(reported);
}
if (screenable) {
const location = document.createElement('small'); location.className = 'ggdc-screen-location';
location.textContent = (p.location_precision === 'POSTCODE_CENTROID_APPROXIMATE' ? 'Approx. postcode: ' : 'Source point: ') +
(p.location_source?.postcode || p.addresses[0]?.text || p.name);
actions.append(location);
for (const n of cell.querySelectorAll('.ggdc-muted')) if (n.textContent.trim() === 'No mapped coordinates') {
n.hidden = true; n.dataset.dcLocationHidden = noteId;
}
}
cell.append(actions); count++;
}
if (!host.querySelector('#' + noteId) && host.querySelector('.ggdc-screen-actions')) {
const note = document.createElement('small'); note.id = noteId; note.className = 'ggdc-screen-footnote';
note.textContent = '¹ ' + FOOTNOTE; host.append(note);
}
if (!host.querySelector('.ggdc-location-sources') && host.querySelector('.ggdc-location-actions')) {
const disclosure = document.createElement('details'); disclosure.className = 'ggdc-location-sources';
const summary = document.createElement('summary'); summary.textContent = 'Location sources and accuracy';
disclosure.append(summary);
const description = document.createElement('p');
description.textContent = 'Addresses and source-reported points use Wikidata structured statements. GB postcode points use Postcodes.io and are approximate postcode locations.';
disclosure.append(description);
const data = document.createElement('a'); data.textContent = 'Source GeoJSON (100 records)';
data.href = pin.url; data.target = '_blank'; data.rel = 'noopener noreferrer'; disclosure.append(data);
const identity = document.createElement('p');
identity.textContent = 'Reported address statements do not independently verify facility identity.'; disclosure.append(identity);
const terms = document.createElement('p');
for (const [label, href] of [['Wikidata CC0 terms', 'https://www.wikidata.org/wiki/Wikidata:Copyright'],
['Postcode-provider terms', 'https://postcodes.io/docs/licences/']]) {
const link = document.createElement('a'); link.textContent = label; link.href = href;
link.target = '_blank'; link.rel = 'noopener noreferrer'; terms.append(link, document.createTextNode(' '));
}
disclosure.append(terms);
const credits = new Set([...index.values()].filter(f => f.geometry &&
f.properties.country?.code === 'GB' && f.properties.location_precision === 'POSTCODE_CENTROID_APPROXIMATE')
.flatMap(f => f.properties.geometry_attribution));
for (const credit of credits) {
const line = document.createElement('small'); line.textContent = credit; disclosure.append(line);
}
host.append(disclosure);
}
const note = host.querySelector('#' + noteId);
if (note) note.hidden = !host.querySelector('.ggdc-screen-actions');
const disclosure = host.querySelector('.ggdc-location-sources');
if (disclosure) disclosure.hidden = !host.querySelector('.ggdc-location-actions');
return count;
}
const observer = new MutationObserver(() => {
if (queued || closed) return;
queued = true;
queueMicrotask(() => { queued = false; refresh(); });
});
refresh(); observer.observe(host, {childList: true, characterData: true, subtree: true});
return {refresh, disconnect() {
closed = true; observer.disconnect();
host.querySelectorAll('.ggdc-location-actions').forEach(n => n.remove());
host.querySelector('#' + noteId)?.remove();
host.querySelector('.ggdc-location-sources')?.remove();
host.querySelectorAll('[data-dc-location-hidden]').forEach(n => {
if (n.dataset.dcLocationHidden === noteId) { n.hidden = false; delete n.dataset.dcLocationHidden; }
});
if (ATTACHMENTS.get(host) === state) ATTACHMENTS.delete(host);
}, sourceIds: index.size};
}Model
A JavaScript module in the document facts ui folder of GlobalGrid2050 that works with accepted documents (`acceptedDocuments`), using SHA-256. It is built from the accepted documents helper (`acceptedDocuments`).
transformglobalgrid2050 / automation/document_facts_ui/20261117-v939/model.mjs · lines 1–12 of 12 · version 2026-11-17
- What it does
- It calculates its inputs. Defines acceptedDocuments.
- Downstream impact
- Used directly by 3 files: Model (globalgrid2050); View (globalgrid2050); Contracts Test (globalgrid2050). Reached from 9 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050).
- What it achieves
- Defines `acceptedDocuments`.
- Why it matters
- Imported by a file of the same name and View. Checked by Contracts Test.
- Application
- globalgrid2050 · automation/document_facts_ui/20261117-v939 · JavaScript module
- Uses
- Model (import)
- Used by
- imported by Model (import), imported by View (import), imported by Contracts Test (import)
- Produces
- bundleHash, acceptedDocuments
- Defines here
- acceptedDocuments
- 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/document_facts_ui/20261117-v939/model.mjs:1-12 · blob 1a702431c1d48dcd764d61b41a93f7e3c2c1f304 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: transform · effects: none found · domain stage: unknown · users: none · canonical: production_core
import {acceptedNotice} from '../../grid_notice_ui/20261117-v938/model.mjs';
export const bundleHash='e2af1d77b9cc49d5d202d4b8f814bcb9469c974193afea21cf9d186a0d722d0a';
export async function acceptedDocuments(bytes,notice){
try{
const digest=Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256',new TextEncoder().encode(bytes)))).map(n=>n.toString(16).padStart(2,'0')).join('');
if(digest!==bundleHash)throw Error('Unreviewed extraction bytes');
const reviewed=await acceptedNotice(notice);if(!reviewed)throw Error('Narrow fact-rights review required');
const payload=JSON.parse(bytes);if(payload.schema!=='globalgrid2050.distilled-document-bundle.v1'||payload.documents.length!==2)throw Error('Unknown bundle');
for(const doc of payload.documents){const source=reviewed.documents.find(d=>d.url===doc.source_url);if(!source||source.source_sha256!==doc.source_version||source.publisher!==doc.publisher||doc.project!=='planning:EN020026'||doc.status!=='machine-provisional')throw Error('Unreviewed source');}
return payload;
}catch{return null;}
}View
A JavaScript module in the document facts ui folder of GlobalGrid2050 that draws facts and notice, using SHA-256.
renderglobalgrid2050 / automation/document_facts_ui/20261117-v939/view.mjs · lines 1–21 of 21 · version 2026-11-17 · Entry point
- What it does
- It draws facts and notice. Defines el. Side effects: changes the web page (DOM); makes network requests.
- Inputs & outputs
- In: JSON file facts.json; JSON file notice.json.
- Downstream impact
- Used directly by 1 file: GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/). Reached from 4 other entry points, including GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); V923 Public Readback Workflow (neural-link-between-agents); A4 Legal Model (globalgrid2050).
- What it achieves
- Its code works with 2 GW.
- Why it matters
- Loaded by the UK Renewables Pipeline page at https://globalgrid2050.com/uk_renewables_pipeline/202611280922/.
- Application
- globalgrid2050 · automation/document_facts_ui/20261117-v939 · JavaScript module
- Uses
- Model (import)
- Used by
- loaded by GlobalGrid2050 — UK Renewables Pipeline Page (script src)
- Produces
- el
- Defines here
- el
- 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/document_facts_ui/20261117-v939/view.mjs:1-21 · blob 46f647ed79af5c3922322e55c3a834c7b9af66ba · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: output · effects: dom, network · domain stage: unknown · users: none · canonical: production_core
import {acceptedDocuments} from './model.mjs';
const doc=document,panel=doc.getElementById('gridPanel'),layer=doc.getElementById('gridLayerHost');
if(panel&&layer){
const el=(tag,text)=>{const n=doc.createElement(tag);if(text!==undefined)n.textContent=text;return n;};
const host=el('details');host.className='pn-document-facts';host.dataset.state='loading';host.append(el('summary','Publication facts and exact source locators'));panel.append(host);
try{
const [facts,notice]=await Promise.all([fetch(new URL('facts.json',import.meta.url),{cache:'no-store'}),fetch(new URL('../../grid_notice_ui/20261117-v938/notice.json',import.meta.url),{cache:'no-store'})]);
if(!facts.ok||!notice.ok)throw Error('Source unavailable');const payload=await acceptedDocuments(await facts.text(),await notice.json());if(!payload)throw Error('Review or integrity pending');
host.dataset.state='source-qualified';host.dataset.documentCount='2';host.dataset.factCount='6';host.append(el('p','Sea Link EN020026: 6 automatically distilled facts from 2 government HTML documents. Machine provisional; exact source versions, no independent verification.'));
const names={application_submitted:'Application submitted',application_accepted:'Accepted for examination',reported_network_operator:'Reported network operator',recommendation:'Recommendation to Secretary of State',consent_decision:'Consent decision',planned_transmission_upper_bound:'Planned transmission upper bound'};
for(const source of payload.documents){
const group=el('section');group.append(el('h4',source.publisher));const link=el('a','Original publication');link.href=source.source_url;link.target='_blank';link.rel='noopener noreferrer';group.append(link,el('p','Published '+source.published_date.value+' (DAY); retrieved '+source.retrieved_at));
for(const fact of source.facts){
const details=el('details'),value=typeof fact.value==='object'?fact.value.value+' (DAY)':fact.value+(fact.unit?' '+fact.unit:'');details.append(el('summary',names[fact.id]+': '+value));
if(fact.meaning)details.append(el('p',fact.meaning));
details.append(el('p','Source paragraph '+fact.locator.paragraph),el('code',fact.locator.selector),el('p','Paragraph SHA-256: '+fact.locator.text_sha256),el('p','Document SHA-256: '+source.source_version));group.append(details);
}host.append(group);
}
host.append(el('p','2 GW is a planned upper bound, not commissioned or currently available capacity. Commissioning, current capacity, coordinates and REPD joins remain unknown.'),el('p','Government-authored facts only under the narrow reviewed Open Government Licence scope; no images or linked third-party material.'),el('p','PDF extraction unavailable: no approved local PDF or installed extracto … [line shortened here: 452 characters; full line on GitHub]
}catch{host.dataset.state='withheld';host.append(el('p','Publication facts unavailable: exact source bytes or independent narrow fact-rights review is pending. Existing Grid layers remain usable.'));}
}Model
A JavaScript module in the grid notice ui folder of GlobalGrid2050 that works with accepted notice (`acceptedNotice`), using SHA-256. It is built from the accepted notice helper (`acceptedNotice`).
transformglobalgrid2050 / automation/grid_notice_ui/20261117-v938/model.mjs · lines 1–17 of 17 · version 2026-11-17 · pattern canonical (shared by 28 files)
- What it does
- It calculates its inputs. Defines canonical, day, acceptedNotice.
- Downstream impact
- Used directly by 3 files: Model (globalgrid2050); View (globalgrid2050); Contracts Test (globalgrid2050). Reached from 11 other entry points, including GlobalGrid2050 — UK Renewables Pipeline Page (globalgrid2050, https://globalgrid2050.com/uk_renewables_pipeline/202611280922/); GlobalGrid2050 Pipeline Legal Evidence Workflow (globalgrid2050); GlobalGrid2050 V934 Preview Acceptance Workflow (globalgrid2050).
- What it achieves
- Defines `canonical`, `day` and `acceptedNotice`.
- Why it matters
- Imported by a file of the same name and View. Checked by Contracts Test.
- Application
- globalgrid2050 · automation/grid_notice_ui/20261117-v938 · JavaScript module
- Uses
- none found
- Used by
- imported by Model (import), imported by View (import), imported by Contracts Test (import)
- Produces
- factsHash, acceptedNotice
- Defines here
- canonical, day, acceptedNotice
- 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/grid_notice_ui/20261117-v938/model.mjs:1-17 · blob 67c450f796d0855e51392bc31b0b83615ada8792 · GitHub at these lines
- State
- achieves: name · context: readme_derived · stage: transform · effects: none found · domain stage: unknown · users: none · canonical: production_core
export const factsHash='f9802c96444c21e84b328d612475353861c8053cde31f55196d1ea5862918afb';
const pins=new Map([
['https://www.gov.uk/government/news/sea-link-development-consent-decision-announced',{publisher:'Planning Inspectorate',sha256:'b9ba26b90820292e0b181da7993d2d3a2180fc2de0ac53cc6239adeb4cccfaeb',bytes:68432}],
['https://www.gov.uk/government/publications/sea-link-development-consent-order-planning-act-2008',{publisher:'Department for Energy Security and Net Zero',sha256:'c26f93aa307740f8b4ec8ad150b152fb6d30e77f201e5bc31a6da52bba16e0d0',bytes:69536}],
]);
function canonical(value){if(Array.isArray(value))return value.map(canonical);if(value&&typeof value==='object')return Object.fromEntries(Object.keys(value).sort().map(key=>[key,canonical(value[key])]));return value;}
function day(value){return value?.precision==='DAY'&&value.value==='2026-10-30'&&Object.keys(value).sort().join(',')==='precision,value';}
export async function acceptedNotice(payload){
try{
if(payload?.schema!=='globalgrid2050.reviewed-grid-notice.v1'||payload.facts_sha256!==factsHash)throw Error('Unpinned notice');
const encoded=new TextEncoder().encode(JSON.stringify(canonical(payload.facts))),digest=Array.from(new Uint8Array(await crypto.subtle.digest('SHA-256',encoded))).map(v=>v.toString(16).padStart(2,'0')).join('');if(digest!==factsHash)throw Error('Changed fact bytes');
const f=payload.facts;if(f.application_ref!=='EN020026'||f.reported_network_operator!=='NGET'||f.reported_stage!=='consented'||!day(f.event_date)||!Array.isArray(f.documents)||f.documents.length!==2)throw Error('Unknown fact scope');
const seen=new Set();for(const d of f.documents){const pin=pins.get(d.url),r=d.source_receipt;if(!pin||seen.has(d.url)||d.publisher!==pin.publisher||d.role!=='government_authority'||d.source_sha256!==pin.sha256||!day(d.published_date)||!day(d.event_date)||d.published_at!==null||r?.source_url!==d.url||r.sha256!==pin.sha256||r.bytes!==pin.bytes||r.http_status!==200||r.retrieved_at!==d.retrieved_at … [line shortened here: 453 characters; full line on GitHub]
const a=payload.approval,reviews=a?.reviews;if(!payload.publishable||payload.review_state!=='NARROW_FACTS_REVIEWED'||payload.notice_count!==1||payload.document_count!==2||a?.state!=='APPROVED_FACTS_ONLY'||a.rights_scope!=='government_html_facts_only_no_images_or_third_party_material'||a.facts_sha256!==factsHash||!Array.isArray(reviews)||reviews.length!==2||new Set(reviews.map(r=>r.role)).size!== … [line shortened here: 732 characters; full line on GitHub]
return f;
}catch{return null;}
}