GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Automation and CI / data-gridatlas / .github/workflows

Layer Fidelity Workflow and 3 more files

A GitHub Actions workflow in Data GridAtlas that builds and publishes the site using data from the GlobalGrid2050 and GridAtlas repositories. Runs on push, on a schedule and by hand.

625 lines of YAML from data-gridatlas, data-interconnectors, data_uk_dno_and_tso and 1 more, in 4 files. Topic: Automation and CI. Section 1706 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. Layer Fidelity Workflow automation · data-gridatlas / .github/workflows/202608301931-layer-fidelity.yml lines 1–401
  2. Gridbot UK Interconnector Build Workflow automation · data-interconnectors / .github/workflows/gridbot_uk_interconnector_build.yml lines 1–134
  3. Audit Workflow automation · data_uk_dno_and_tso / .github/workflows/audit.yml lines 1–32
  4. Overlay Workflow automation · energy-transition-simulator / .github/workflows/overlay.yml lines 1–58

Layer Fidelity Workflow

A GitHub Actions workflow in Data GridAtlas that builds and publishes the site using data from the GlobalGrid2050 and GridAtlas repositories. Runs on push, on a schedule and by hand.

automationdata-gridatlas / .github/workflows/202608301931-layer-fidelity.yml · lines 1–401 of 401 · version 2026-08-30 19:31 · Entry point

What it does
It builds and publishes its content. Side effects: changes the web page (DOM); reads or writes files; makes network requests; starts processes; uses storage (browser storage, DuckDB or Parquet).
Why it exists in the grid workflow
Domain stage upstream_foresight (repository name word 'gridatlas'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
Inputs & outputs
In: data source: globalgrid2050 data; data source: gridatlas data; JSON file live-set.json; JSON file current.json; JSON file layers.json; JSON file sarif-2.1.0.json; DuckDB queries. Out: JSON file layers.json; JSON file fidelity-summary.json; JSON file live-layer-fidelity.json.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Layer fidelity, V8 origin vs V9 delivery”; runs `live.mjs`.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
data-gridatlas · .github/workflows · workflow
Uses
GridAtlas — Atlas Page (estate URL)
Used by
none found
Produces
none declared
Defines here
202608301931 Layer fidelity, V8 origin vs V9 delivery
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
data-gridatlas@203f9dc3764c05153c2b95f8ace88eb543f26c1e .github/workflows/202608301931-layer-fidelity.yml:1-401 · blob 684fe22cf5ce18e015248cf59800bc20f875408d · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, network, process, storage · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: supporting_data
name: 202608301931 Layer fidelity, V8 origin vs V9 delivery

on:
  push:
    paths:
      - '*/data/**'
      - 'state/live-set.json'
      - 'tools/202608301930-fidelity.py'
      - '.github/workflows/202608301931-layer-fidelity.yml'
  schedule:
    - cron: '23 3 * * *'
  workflow_dispatch:

permissions:
  contents: read
  security-events: write

concurrency:
  group: data-gridatlas-layer-fidelity
  cancel-in-progress: false

jobs:
  offline:
    runs-on: ubuntu-24.04
    timeout-minutes: 35
    steps:
      - name: Checkout complete data-gridatlas history
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          fetch-depth: 0
          persist-credentials: false

      - name: Checkout complete GridAtlas history
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          repository: Ventusltd/gridatlas
          path: gridatlas
          fetch-depth: 0
          persist-credentials: false

      - name: Install the hash-locked DuckDB runtime
        run: python3 -m pip install --require-hashes -r requirements.lock

      - name: Resolve current releases and extract the immutable shell layer table
        id: releases
        shell: bash
        run: |
          set -euo pipefail
          python3 - <<'PY'
          import json
          import os
          from pathlib import Path
          import posixpath
          import re

          data_state = json.loads(Path('state/live-set.json').read_text(encoding='utf-8'))
          data_release = data_state['current']['release_id']
          data_dir = Path(data_release) / 'data'
          if not (data_dir / 'manifest.json').is_file():
              raise SystemExit(f'data manifest missing: {data_dir / "manifest.json"}')

          current = json.loads(Path('gridatlas/atlas/current.json').read_text(encoding='utf-8'))
          shell_rel = str(current['shell']['index']).removeprefix('./')
          shell = Path('gridatlas/atlas') / shell_rel
          if not shell.is_file():
              raise SystemExit(f'immutable shell missing: {shell}')

          text = shell.read_text(encoding='utf-8')
          matches = re.findall(r'id:\s*"([^"]+)"[^}]*?url:\s*"([^"]+)"', text)
          if not matches:
              raise SystemExit('no layer id/url pairs found in immutable shell')

          grouped = {}
          for layer_id, url in matches:
              record = grouped.setdefault(url, {'url': url, 'layer_ids': [], 'stem': Path(url).stem})
              record['layer_ids'].append(layer_id)
              if url.startswith('/'):
                  origin_path = url.lstrip('/')
              else:
                  origin_path = posixpath.normpath(posixpath.join('repd_grid_atlasv8', url))
              record['origin_path'] = origin_path

          payload = {
              'schema': 'data-gridatlas.layer-source-table.v1',
              'gridatlas_generation': current['generation'],
              'gridatlas_release_id': current['release_id'],
              'gridatlas_shell': str(shell),
              'data_release_id': data_release,
              'data_dir': str(data_dir),
              'v8_commit': data_state['rollback']['data_commit'],
              'sources': sorted(grouped.values(), key=lambda row: row['url']),
          }
          Path('layers.json').write_text(json.dumps(payload, indent=2) + '\n', encoding='utf-8')
          with open(os.environ['GITHUB_OUTPUT'], 'a', encoding='utf-8') as output:
              output.write(f"data_release={data_release}\n")
              output.write(f"data_dir={data_dir}\n")
              output.write(f"gridatlas_release={current['release_id']}\n")
              output.write(f"v8_commit={payload['v8_commit']}\n")
          print(json.dumps({k: payload[k] for k in ('gridatlas_generation', 'gridatlas_release_id', 'data_release_id', 'v8_commit')}, indent=2))
          print(len(payload['sources']), 'unique source URLs from', len(matches), 'layers')
          PY

      - name: Fetch pinned V8 origins and compare every Parquet-backed source
        env:
          V8_COMMIT: ${{ steps.releases.outputs.v8_commit }}
          DATA_DIR: ${{ steps.releases.outputs.data_dir }}
        run: |
          set -euo pipefail
          mkdir -p origin reports
          python3 - <<'PY'
          import json
          import os
          from pathlib import Path
          import subprocess
          import urllib.request

          table = json.loads(Path('layers.json').read_text(encoding='utf-8'))
          data_dir = Path(os.environ['DATA_DIR'])
          artifacts = json.loads((data_dir / 'manifest.json').read_text(encoding='utf-8'))['artifacts']
          artifact_paths = {str(item['path']).lower(): item for item in artifacts}
          special = {
              'repd_master': 'repd_master_v8_oracle',
              'uk_metros_trams': 'uk_metros_trams_root',
          }

          for source in table['sources']:
              stem = special.get(source['stem'].lower(), source['stem'].lower())
              expected = f'partitions/{stem}.parquet'
              report_path = Path('reports') / f'{stem}.json'
              artifact = artifact_paths.get(expected)
              if not artifact:
                  report_path.write_text(json.dumps({
                      'schema': 'data-gridatlas.layer-fidelity.v1',
                      'layer': stem,
                      'layer_ids': source['layer_ids'],
                      'source_url': source['url'],
                      'fidelity': 'NO_PARTITION',
                      'expected_partition': expected,
                  }, sort_keys=True), encoding='utf-8')
                  continue

              origin_path = Path('origin') / f'{stem}.geojson'
              origin_url = (
                  'https://raw.githubusercontent.com/Ventusltd/globalgrid2050/'
                  f"{os.environ['V8_COMMIT']}/{source['origin_path']}"
              )
              try:
                  urllib.request.urlretrieve(origin_url, origin_path)
              except Exception as error:
                  report_path.write_text(json.dumps({
                      'schema': 'data-gridatlas.layer-fidelity.v1',
                      'layer': stem,
                      'layer_ids': source['layer_ids'],
                      'source_url': source['url'],
                      'origin_url': origin_url,
                      'fidelity': 'NO_ORIGIN',
                      'error': str(error),
                  }, sort_keys=True), encoding='utf-8')
                  continue

              completed = subprocess.run(
                  [
                      'python3', 'tools/202608301930-fidelity.py',
                      str(data_dir / artifact['path']), str(origin_path),
                  ],
                  capture_output=True,
                  text=True,
                  check=False,
              )
              try:
                  report = json.loads((completed.stdout or '').strip())
              except json.JSONDecodeError:
                  report = {
                      'schema': 'data-gridatlas.layer-fidelity.v1',
                      'layer': stem,
                      'fidelity': 'ERROR',
                      'error': (completed.stderr or completed.stdout)[-1000:],
                  }
              report.update({
                  'layer_ids': source['layer_ids'],
                  'source_url': source['url'],
                  'origin_url': origin_url,
                  'partition_manifest': artifact,
                  'comparator_exit_code': completed.returncode,
              })
              report_path.write_text(json.dumps(report, indent=2, sort_keys=True) + '\n', encoding='utf-8')
          PY

      - name: Judge fidelity and publish delivery-budget warnings
        id: judge
        shell: bash
        run: |
          set -euo pipefail
          python3 - <<'PY'
          import glob
          import json
          import os
          from pathlib import Path

          reports = [json.loads(Path(path).read_text(encoding='utf-8')) for path in sorted(glob.glob('reports/*.json'))]
          fidelity_bad = [row for row in reports if row.get('fidelity') != 'PASS']
          over_budget = [row for row in reports if row.get('fidelity') == 'PASS' and float(row.get('on_demand_budget_s_at_20mbit', 0)) > 15]

          with open(os.environ['GITHUB_STEP_SUMMARY'], 'a', encoding='utf-8') as summary:
              summary.write('## V8 origin vs V9 partition fidelity\n\n')
              summary.write('| source | layers | origin | rows | hash | projected | coords | dropped keys | static s@20Mbit | on-demand s@20Mbit | verdict |\n')
              summary.write('|---|---|---:|---:|---:|---:|---:|---:|---:|---:|---|\n')
              for row in reports:
                  fidelity = row.get('fidelity', 'ERROR')
                  verdict = fidelity
                  if fidelity == 'PASS' and row in over_budget:
                      verdict = 'FIDELITY PASS / DELIVERY OVER BUDGET'
                  elif fidelity == 'PASS':
                      verdict = 'PASS'
                  summary.write(
                      f"| {row.get('source_url', row.get('layer', '-'))} | {', '.join(row.get('layer_ids', []))} | "
                      f"{row.get('original_features', '-')} | {row.get('partition_rows', '-')} | "
                      f"{row.get('hash_mismatch', '-')} | {row.get('projected_mismatch', '-')} | "
                      f"{row.get('coord_mismatch', '-')} | {len(row.get('prop_keys_dropped', []))} | "
                      f"{row.get('delivery_budget_s_at_20mbit', '-')} | {row.get('on_demand_budget_s_at_20mbit', '-')} | {verdict} |\n"
                  )

          results = []
          for row in fidelity_bad:
              results.append({
                  'ruleId': 'layer-fidelity',
                  'level': 'error',
                  'message': {'text': f"{row.get('source_url', row.get('layer'))}: {row.get('fidelity')}"},
                  'locations': [{'physicalLocation': {'artifactLocation': {'uri': 'state/live-set.json'}, 'region': {'startLine': 1}}}],
              })
          for row in over_budget:
              results.append({
                  'ruleId': 'layer-delivery-budget',
                  'level': 'warning',
                  'message': {'text': f"{row.get('source_url')}: DuckDB on-demand estimate {row.get('on_demand_budget_s_at_20mbit')} s exceeds 15 s"},
                  'locations': [{'physicalLocation': {'artifactLocation': {'uri': 'state/live-set.json'}, 'region': {'startLine': 1}}}],
              })
          sarif = {
              '$schema': 'https://json.schemastore.org/sarif-2.1.0.json',
              'version': '2.1.0',
              'runs': [{
                  'tool': {'driver': {'name': 'layer-fidelity', 'rules': [
                      {'id': 'layer-fidelity'}, {'id': 'layer-delivery-budget'}
                  ]}},
                  'results': results,
              }],
          }
          Path('fidelity.sarif').write_text(json.dumps(sarif, indent=2) + '\n', encoding='utf-8')
          Path('fidelity-summary.json').write_text(json.dumps({
              'schema': 'data-gridatlas.layer-fidelity-summary.v1',
              'reports': len(reports),
              'fidelity_failures': len(fidelity_bad),
              'delivery_budget_warnings': len(over_budget),
              'status': 'FAIL' if fidelity_bad else 'PASS',
          }, indent=2) + '\n', encoding='utf-8')
          if fidelity_bad:
              raise SystemExit(f'{len(fidelity_bad)} fidelity/source mapping failure(s)')
          PY

      - name: Upload SARIF
        if: always()
        uses: github/codeql-action/upload-sarif@cdf488f595d80d6e07e03d4674febd5ab45fa938 # v4
        with:
          sarif_file: fidelity.sarif
          category: data-gridatlas-layer-fidelity

      - name: Retain offline evidence
        if: always()
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4.4.3
        with:
          name: layer-fidelity-offline-${{ github.run_id }}
          path: |
            layers.json
            reports/*.json
            fidelity-summary.json
            fidelity.sarif
          if-no-files-found: warn
          retention-days: 90
          compression-level: 6

  browser:
    needs: offline
    if: always()
    runs-on: ubuntu-24.04
    timeout-minutes: 40
    steps:
      - name: Checkout workflow evidence only
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
        with:
          fetch-depth: 0
          persist-credentials: false

      - name: Configure Node
        uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020
        with:
          node-version: '22'

      - name: Install exact Playwright and Chromium
        run: |
          npm install --no-save --ignore-scripts playwright@1.62.1
          npx playwright install --with-deps chromium

      - name: Toggle every live layer and measure MapLibre readiness, heap and features
        env:
          BASE_URL: https://ventusltd.github.io/gridatlas/atlas/
        shell: bash
        run: |
          set -euo pipefail
          cat > live.mjs <<'EOF2'
          import fs from 'node:fs/promises';
          import { chromium } from 'playwright';

          const base = process.env.BASE_URL;
          const browser = await chromium.launch({ headless: true });
          const context = await browser.newContext({ viewport: { width: 1280, height: 900 } });
          const page = await context.newPage();
          const cdp = await context.newCDPSession(page);
          const consoleErrors = [];
          page.on('console', message => { if (message.type() === 'error') consoleErrors.push(message.text()); });
          page.on('pageerror', error => consoleErrors.push(String(error?.message || error)));

          await page.goto(`${base}?layer-fidelity=${Date.now()}`, { waitUntil: 'domcontentloaded', timeout: 120000 });
          await page.waitForFunction(() => window.__GRIDATLAS_V9_MAP__ && document.querySelectorAll('#scada-ui-container input[data-layer-id]').length > 0, null, { timeout: 120000 });
          const ids = await page.$$eval('#scada-ui-container input[data-layer-id]', elements => [...new Set(elements.map(element => element.dataset.layerId))]);
          const rows = [];
          let failures = 0;

          for (const id of ids) {
            const selector = `#scada-ui-container input[data-layer-id="${id}"]`;
            const started = Date.now();
            await page.locator(selector).check({ force: true });
            const state = await page.waitForFunction(layerId => {
              const label = document.querySelector(`#lbl-${CSS.escape(layerId)}`)?.textContent || '';
              const map = window.__GRIDATLAS_V9_MAP__;
              const mapLayer = map?.getLayer(`l-${layerId}`);
              const sourceId = mapLayer?.source;
              let sourceLoaded = false;
              let features = -1;
              try {
                sourceLoaded = Boolean(sourceId && map.isSourceLoaded(sourceId));
                features = sourceId ? map.querySourceFeatures(sourceId).length : -1;
              } catch {}
              const terminal = /\[(OK|EMPTY|FAIL)\]/.test(label);
              return terminal && { label, sourceId, sourceLoaded, features };
            }, id, { timeout: 60000 }).then(handle => handle.jsonValue()).catch(() => ({ label: 'TIMEOUT', sourceId: null, sourceLoaded: false, features: -1 }));

            if (state.sourceId && state.label.includes('[OK]')) {
              await page.waitForFunction(sourceId => {
                const map = window.__GRIDATLAS_V9_MAP__;
                try { return map?.isSourceLoaded(sourceId) === true; } catch { return false; }
              }, state.sourceId, { timeout: 60000 }).catch(() => {});
            }

            const heapMb = (await cdp.send('Runtime.getHeapUsage')).usedSize / 1e6;
            const seconds = (Date.now() - started) / 1000;
            const final = await page.evaluate(layerId => {
              const map = window.__GRIDATLAS_V9_MAP__;
              const mapLayer = map?.getLayer(`l-${layerId}`);
              const sourceId = mapLayer?.source || null;
              let loaded = false;
              let features = -1;
              try {
                loaded = Boolean(sourceId && map.isSourceLoaded(sourceId));
                features = sourceId ? map.querySourceFeatures(sourceId).length : -1;
              } catch {}
              return { sourceId, loaded, features, label: document.querySelector(`#lbl-${CSS.escape(layerId)}`)?.textContent || '' };
            }, id);
            const bad = !final.label.includes('[OK]') || !final.loaded || seconds > 15 || heapMb > 400 || final.features < 1;
            if (bad) failures += 1;
            rows.push({ id, ...final, seconds, heap_mb: heapMb, verdict: bad ? 'FAIL' : 'PASS' });
            await page.locator(selector).uncheck({ force: true }).catch(() => {});
            await page.waitForTimeout(100);
          }

          const report = {
            schema: 'gridatlas.live-layer-fidelity.v1',
            base,
            rows,
            failures,
            console_errors: consoleErrors,
            status: failures ? 'FAIL' : 'PASS',
          };
          await fs.writeFile('live-layer-fidelity.json', JSON.stringify(report, null, 2) + '\n');
          console.log('| layer | label | loaded | seconds | heap MB | features | verdict |');
          console.log('|---|---|---:|---:|---:|---:|---|');
          for (const row of rows) console.log(`| ${row.id} | ${row.label.replaceAll('|', '/')} | ${row.loaded} | ${row.seconds.toFixed(1)} | ${row.heap_mb.toFixed(0)} | ${row.features} | ${row.verdict} |`);
          if (consoleErrors.length) console.log(`\nConsole errors: ${consoleErrors.length}`);
          await browser.close();
          process.exit(failures ? 1 : 0);
          EOF2
          node live.mjs | tee -a "$GITHUB_STEP_SUMMARY"

      - name: Retain browser evidence
        if: always()
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v4.4.3
        with:
          name: layer-fidelity-browser-${{ github.run_id }}
          path: live-layer-fidelity.json
          if-no-files-found: warn
          retention-days: 90
          compression-level: 6

Gridbot UK Interconnector Build Workflow

A GitHub Actions workflow in Data Interconnectors. Runs on a schedule and by hand.

automationdata-interconnectors / .github/workflows/gridbot_uk_interconnector_build.yml · lines 1–134 of 134 · Entry point

What it does
It runs interconnectors. Side effects: starts processes; uses storage (browser storage, DuckDB or Parquet).
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'interconnector'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight. Domain terms in the code: interconnectors.
Inputs & outputs
In: DuckDB queries. 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 Build Interconnectors (`pipelines/build_interconnectors.py`) and Monthly Update Interconnectors (`pipelines/monthly_update_interconnectors.py`).
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
data-interconnectors · .github/workflows · workflow
Uses
Build Interconnectors (workflow run), Monthly Update Interconnectors (workflow run)
Used by
none found
Produces
none declared
Defines here
GridBot UK Interconnector Build
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
data-interconnectors@2bd00d9610f24d02ba00e341216cab162b3e821b .github/workflows/gridbot_uk_interconnector_build.yml:1-134 · blob 0504d75d5c7ac856944bc0bc877b05bddf8d1d37 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: process, storage · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: supporting_data
name: GridBot UK Interconnector Build

on:
  schedule:
    - cron: '17 6 2 * *'
  workflow_dispatch:
    inputs:
      mode:
        description: Run mode
        required: true
        default: 'monthly'
        type: choice
        options:
          - 'monthly'
          - 'full'
      start_month:
        description: First month YYYY-MM, or auto for monthly mode
        required: true
        default: 'auto'
      end_month:
        description: Last month YYYY-MM or latest-complete
        required: true
        default: 'latest-complete'
      refetch_months:
        description: Recent complete months to refresh in monthly mode
        required: true
        default: '3'
      fail_on_reconciliation_mismatch:
        description: Fail if monolith reconciliation is not exact within tolerance
        required: true
        default: 'true'
        type: choice
        options:
          - 'true'
          - 'false'

permissions:
  contents: write

concurrency:
  group: gridbot-uk-interconnector-build
  cancel-in-progress: false

jobs:
  uk-interconnector-build:
    runs-on: ubuntu-latest
    timeout-minutes: 90
    env:
      RUN_MODE: ${{ github.event.inputs.mode || 'monthly' }}
      START_MONTH: ${{ github.event.inputs.start_month || 'auto' }}
      END_MONTH: ${{ github.event.inputs.end_month || 'latest-complete' }}
      REFETCH_MONTHS: ${{ github.event.inputs.refetch_months || '3' }}
      FAIL_RECON: ${{ github.event.inputs.fail_on_reconciliation_mismatch || 'true' }}

    steps:
      - name: Checkout data-interconnectors using GridBot PAT
        uses: actions/checkout@v4
        with:
          fetch-depth: 0
          token: ${{ secrets.GRIDBOT_PAT }}

      - name: Sync latest main before processing
        run: git pull --ff-only origin main

      - name: Clone monolith oracle
        run: |
          rm -rf _monolith
          git clone --depth 1 https://github.com/Ventusltd/globalgrid2050.git _monolith

      - name: Verify monolith interconnector oracle
        run: |
          set -euo pipefail
          ORACLE_DIR="_monolith/uk_energy_tracking_v6/generation_history/interconnectors"
          if [ ! -d "$ORACLE_DIR" ]; then
            echo "Monolith interconnector oracle directory missing: $ORACLE_DIR"
            exit 1
          fi
          COUNT=$(find "$ORACLE_DIR" -maxdepth 1 -type f -name '*.json' | wc -l | tr -d ' ')
          echo "Monolith interconnector oracle JSON files: $COUNT"
          if [ "$COUNT" -lt 1 ]; then
            echo "No monolith interconnector oracle JSON files found. Cannot reconcile."
            exit 1
          fi

      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.11'

      - name: Install build dependencies
        run: |
          set -euo pipefail
          python -m pip install --upgrade pip
          pip install duckdb pyarrow requests

      - name: Run UK interconnector update
        run: |
          set -euo pipefail
          FLAGS=""
          if [ "$FAIL_RECON" = "false" ]; then
            FLAGS="--allow-reconciliation-mismatch"
          fi
          if [ "$RUN_MODE" = "full" ]; then
            FULL_START="$START_MONTH"
            if [ "$FULL_START" = "auto" ]; then
              FULL_START="2020-12"
            fi
            python pipelines/build_interconnectors.py --start "$FULL_START" --end "$END_MONTH" $FLAGS
          else
            python pipelines/monthly_update_interconnectors.py --start "$START_MONTH" --end "$END_MONTH" --refetch-months "$REFETCH_MONTHS" $FLAGS
          fi

      - name: Upload interconnector build report
        uses: actions/upload-artifact@v4
        if: always()
        with:
          name: uk-interconnector-build-report
          path: |
            reports/INTERCONNECTOR_BUILD_LATEST.md
            reports/json/INTERCONNECTOR_BUILD_LATEST.json

      - name: Commit generated outputs
        run: |
          set -euo pipefail
          git config user.name "Gridbot"
          git config user.email "gridbot@users.noreply.github.com"
          git add flows rollups reports CHANGELOG.md
          if git diff --cached --quiet; then
            echo "No generated output changes to commit."
          else
            git commit -m "data(interconnectors): auto monthly fetch"
            git pull --ff-only origin main
            git push origin HEAD:${GITHUB_REF_NAME}
          fi

Audit Workflow

A GitHub Actions workflow in Data UK DNO And TSO. Runs on push, on pull requests and by hand.

automationdata_uk_dno_and_tso / .github/workflows/audit.yml · lines 1–32 of 32 · 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 (repository name word 'dno'): upstream engineering foresight over GB transmission and distribution topology (TSO/DNO, 132kV and above, the REPD pipeline, data centres), which Ventus Ltd states it models for foresight.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Audit declared data”; runs Validate Declared (`scripts/validate_declared.py`), Validate Schema Drift (`scripts/validate_schema_drift.py`) and Build Declared (`scripts/build_declared.py`).
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
data_uk_dno_and_tso · .github/workflows · workflow
Uses
Validate Declared (workflow run), Validate Schema Drift (workflow run), Build Declared (workflow run)
Used by
none found
Produces
none declared
Defines here
Audit declared data
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
data_uk_dno_and_tso@0f012179c2271a7d3bbb06a91af915d23bd9396b .github/workflows/audit.yml:1-32 · blob 251afa9ab0a36d7115f5296fa73bf611b6147934 · 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: supporting_data
name: Audit declared data

on:
  workflow_dispatch:
  pull_request:
  push:
    branches:
      - main

permissions:
  contents: read

jobs:
  audit:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v4
      - name: Set up Python
        uses: actions/setup-python@v5
        with:
          python-version: '3.12'
      - name: Validate declared data
        run: python scripts/validate_declared.py
      - name: Validate operator schema contract
        run: python scripts/validate_schema_drift.py schemas/operators.schema.json data/declared/operators.csv
      - name: Build declared JSON receipts
        run: python scripts/build_declared.py
      - name: Smoke test source registry JSON
        run: python -m json.tool config/sources.json > /tmp/sources.json
      - name: Smoke test schema JSON
        run: for f in schemas/*.schema.json; do python -m json.tool "$f" > /tmp/schema.json; done

Overlay Workflow

A GitHub Actions workflow in Energy Transition Simulator. Runs on push, on pull requests and by hand.

automationenergy-transition-simulator / .github/workflows/overlay.yml · lines 1–58 of 58 · Entry point

What it does
It runs automated jobs on GitHub Actions. Side effects: starts processes.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Runs Privacy Scan (`tests/privacy-scan.cjs`) and UI (`tests/ui.cjs`).
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
energy-transition-simulator · .github/workflows · workflow
Uses
Privacy Scan (workflow run), UI (workflow run)
Used by
none found
Produces
none declared
Defines here
overlay
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
energy-transition-simulator@a165ce6d56cb22271828874d68d570e8fa5e428a .github/workflows/overlay.yml:1-58 · blob 131b88c4ba71515224262b680a5c9af437be75ca · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: process · domain stage: unknown · users: none · canonical: unknown
name: overlay
on:
  push:
    branches: ['main']
  pull_request:
  workflow_dispatch:
jobs:
  # Fast, no browser: the public repo must never carry drive paths, e-mail addresses or private names (hash list).
  privacy:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '22' }
      - run: node tests/privacy-scan.cjs
  # Every tests/*.cjs on software WebGL (process.env.CI switches the launchers to SwiftShader). GPU-only thresholds
  # (frame rate, the GPU look) are gated locally on a real GPU before each push; see docs/RELEASING.md.
  tests:
    runs-on: ubuntu-latest
    timeout-minutes: 60
    steps:
      - uses: actions/checkout@v4
      - uses: actions/setup-node@v4
        with: { node-version: '22' }
      - run: npm install --no-audit --no-fund
      - run: npx playwright install --with-deps chromium
      - name: overlay smoke
        run: npm run test:overlay
        env: { CI: 'true' }
      - name: node-only checks
        run: |
          set -e
          for t in tests/scanner-rows.test.cjs tests/farm-assess.cjs tests/tables.cjs; do echo "== $t"; node "$t"; done
        env: { CI: 'true' }
      - name: browser checks
        run: |
          set -e
          for t in tests/ac-trenches-smoke.cjs tests/lidar-stream.cjs tests/procedural.cjs tests/trench-measure.cjs; do echo "== $t"; timeout 900 node "$t"; done
        env: { CI: 'true' }
        timeout-minutes: 40
      # Tolerated, each bounded to 10 minutes, none can fail the job:
      # - addresses-check and grid-assets fail on main since the menu bar integration (f8d3c16): the find box now lives
      #   under Edit and the module buttons left the toolbar. Both fail identically on a real GPU.
      # - plan-view measures pixels changed per frame during the morph; on software WebGL the frames are so slow that
      #   the timing checks fail (27/27 on a real GPU). It stays here as a smoke run until it has a CI-safe mode.
      - name: tolerated (addresses-check, grid-assets, plan-view; see comments)
        run: |
          for t in tests/addresses-check.cjs tests/grid-assets.cjs tests/plan-view.cjs; do echo "== $t"; timeout 600 node "$t" || echo "KNOWN FAIL $t (exit $?)"; done
        env: { CI: 'true' }
        timeout-minutes: 35
      - name: ui (known "far lines fade" check tolerated until fixed)
        run: timeout 600 node tests/ui.cjs
        continue-on-error: true
        timeout-minutes: 12
        env: { CI: 'true' }
      - uses: actions/upload-artifact@v4
        if: always()
        with: { name: overlay-screenshots, path: test-output/ }