GLOBALGRID2050 / EXPLORE CODE

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

Watchdog Router Workflow and 2 more files

A GitHub Actions workflow in Data GridAtlas using data from GitHub API. Runs on push, on a schedule and by hand.

488 lines of YAML from data-gridatlas, in 3 files. Topic: Automation and CI. Section 1704 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. Contract Guard Workflow automation · data-gridatlas / .github/workflows/202608291507-contract-guard.yml lines 1–78
  2. Current Integrity Workflow automation · data-gridatlas / .github/workflows/202608291507-current-integrity.yml lines 1–188
  3. Watchdog Router Workflow automation · data-gridatlas / .github/workflows/202608291507-watchdog-router.yml lines 1–222

Contract Guard Workflow

A GitHub Actions workflow in Data GridAtlas. Runs on push, on pull requests and by hand.

automationdata-gridatlas / .github/workflows/202608291507-contract-guard.yml · lines 1–78 of 78 · version 2026-08-29 15:07 · 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 '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: JSON file current.json; JSON file live-set.json.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Guard Data Grid Atlas automation contract”; runs Current Integrity (`atman/202608291507-current-integrity.py`).
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
Current Integrity (workflow run)
Used by
none found
Produces
none declared
Defines here
202608291507 Guard Data Grid Atlas automation contract
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/202608291507-contract-guard.yml:1-78 · blob 287bebcdb45aa1951b3ccfda6ef23d07648a28fb · 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: 202608291507 Guard Data Grid Atlas automation contract
run-name: Automation contract guard ${{ github.event.pull_request.head.sha || github.sha }}

on:
  push:
    branches: [main]
    paths:
      - '.github/workflows/**'
      - 'atman/**'
      - 'compiler/**'
      - 'contracts/**'
      - 'schemas/**'
      - '202608291237-data-gridatlas/**'
      - 'releases/current.json'
      - 'state/live-set.json'
      - 'requirements.lock'
      - 'runbooks/**'
  pull_request:
    branches: [main]
    paths:
      - '.github/workflows/**'
      - 'atman/**'
      - 'compiler/**'
      - 'contracts/**'
      - 'schemas/**'
      - '202608291237-data-gridatlas/**'
      - 'releases/current.json'
      - 'state/live-set.json'
      - 'requirements.lock'
      - 'runbooks/**'
  workflow_dispatch:

permissions: {}

concurrency:
  group: data-gridatlas-contract-guard-${{ github.event.pull_request.head.sha || github.sha }}
  cancel-in-progress: false

env:
  AUTOMATION_CONTRACT: contracts/202608291507-automation.json
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'

jobs:
  guard:
    name: Guard source, pins, permissions and immutable boundary
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    permissions:
      contents: read
    steps:
      - name: Checkout exact push or pull-request head
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ github.event.pull_request.head.sha || github.sha }}
          fetch-depth: 0
          persist-credentials: false

      - name: Verify bounded read-only automation successor
        env:
          EXPECTED_HEAD: ${{ github.event.pull_request.head.sha || github.sha }}
        run: |
          set -eu
          mkdir -p work
          python atman/202608291507-current-integrity.py guard \
            --repository . \
            --contract "$AUTOMATION_CONTRACT" \
            --expected-head "$EXPECTED_HEAD" \
            --output work/automation-contract-guard.json
          cat work/automation-contract-guard.json >> "$GITHUB_STEP_SUMMARY"

      - name: Retain read-only guard attestation
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
        with:
          name: data-gridatlas-202608291507-contract-guard-${{ github.event.pull_request.head.sha || github.sha }}
          path: work/automation-contract-guard.json
          if-no-files-found: error
          retention-days: 90
          compression-level: 0

Current Integrity Workflow

A GitHub Actions workflow in Data GridAtlas. Runs on push, by hand and when called.

automationdata-gridatlas / .github/workflows/202608291507-current-integrity.yml · lines 1–188 of 188 · version 2026-08-29 15:07 · 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 '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: JSON file 202608291507-automation.json; JSON file current.json; JSON file live-set.json; DuckDB queries.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Verify current Data Grid Atlas integrity”; runs Current Integrity (`atman/202608291507-current-integrity.py`).
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
Current Integrity (workflow run)
Used by
none found
Produces
none declared
Defines here
202608291507 Verify current Data Grid Atlas integrity
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/202608291507-current-integrity.yml:1-188 · blob b3165aa3d88c75dfa0d16dd1b9a379552b5088b4 · 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: 202608291507 Verify current Data Grid Atlas integrity
run-name: Current integrity ${{ inputs.expected_head_sha || github.sha }}

on:
  push:
    branches: [main]
    paths:
      - '.github/workflows/202608291507-current-integrity.yml'
      - 'atman/202608291507-current-integrity.py'
      - 'contracts/202608291507-automation.json'
      - '202608291237-data-gridatlas/**'
      - 'releases/current.json'
      - 'state/live-set.json'
  workflow_dispatch:
    inputs:
      expected_head_sha:
        description: Exact main commit to verify; blank uses the dispatch commit
        required: false
        type: string
      expected_pointer_sha256:
        description: Exact pointer SHA-256; blank uses the automation contract
        required: false
        type: string
  workflow_call:
    inputs:
      expected_head_sha:
        required: false
        type: string
      expected_pointer_sha256:
        required: false
        type: string

permissions: {}

concurrency:
  group: data-gridatlas-current-integrity-${{ inputs.expected_head_sha || github.sha }}
  cancel-in-progress: false

env:
  AUTOMATION_CONTRACT: contracts/202608291507-automation.json
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'

jobs:
  resolve:
    name: Resolve exact live pointer and eight-lane plan
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    permissions:
      contents: read
    outputs:
      head_sha: ${{ steps.plan.outputs.head_sha }}
      pointer_sha256: ${{ steps.plan.outputs.pointer_sha256 }}
      release_id: ${{ steps.plan.outputs.release_id }}
      matrix: ${{ steps.plan.outputs.matrix }}
    steps:
      - name: Checkout exact triggering commit
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ inputs.expected_head_sha || github.sha }}
          fetch-depth: 0
          persist-credentials: false

      - name: Resolve immutable data, pointer and balanced lanes
        id: plan
        env:
          EXPECTED_HEAD: ${{ inputs.expected_head_sha || github.sha }}
          EXPECTED_POINTER: ${{ inputs.expected_pointer_sha256 || '' }}
        run: |
          set -eu
          mkdir -p work
          python atman/202608291507-current-integrity.py resolve \
            --repository . \
            --contract "$AUTOMATION_CONTRACT" \
            --expected-head "$EXPECTED_HEAD" \
            --expected-pointer-sha256 "$EXPECTED_POINTER" \
            --output work/current-integrity-plan.json \
            --github-output "$GITHUB_OUTPUT"

      - name: Retain exact integrity plan
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
        with:
          name: data-gridatlas-202608291507-plan-${{ steps.plan.outputs.head_sha }}
          path: work/current-integrity-plan.json
          if-no-files-found: error
          retention-days: 90
          compression-level: 0

  integrity_shard:
    name: Lane ${{ matrix.lane }} ${{ matrix.role }}
    needs: resolve
    runs-on: ubuntu-24.04
    timeout-minutes: 20
    permissions:
      contents: read
    strategy:
      fail-fast: false
      max-parallel: 8
      matrix: ${{ fromJSON(needs.resolve.outputs.matrix) }}
    steps:
      - name: Checkout exact resolved commit
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ needs.resolve.outputs.head_sha }}
          fetch-depth: 0
          persist-credentials: false

      - name: Configure pinned Python
        uses: actions/setup-python@5fda3b95a4ea91299a34e894583c3862153e4b97
        with:
          python-version: '3.12.13'

      - name: Install locked DuckDB engine
        run: python -m pip install --disable-pip-version-check --require-hashes -r requirements.lock

      - name: Verify local Parquet, DuckDB, privacy, CORS and ranges
        env:
          EXPECTED_HEAD: ${{ needs.resolve.outputs.head_sha }}
          EXPECTED_POINTER: ${{ needs.resolve.outputs.pointer_sha256 }}
          LANE: ${{ matrix.lane }}
          ROLE: ${{ matrix.role }}
        run: |
          set -eu
          mkdir -p work
          python atman/202608291507-current-integrity.py shard \
            --repository . \
            --contract "$AUTOMATION_CONTRACT" \
            --expected-head "$EXPECTED_HEAD" \
            --expected-pointer-sha256 "$EXPECTED_POINTER" \
            --lane "$LANE" \
            --role "$ROLE" \
            --output "work/shard-$LANE.json"

      - name: Retain lane attestation
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
        with:
          name: data-gridatlas-202608291507-shard-${{ matrix.lane }}-${{ needs.resolve.outputs.head_sha }}
          path: |
            work/shard-${{ matrix.lane }}.json
            work/full-release-verification.json
          if-no-files-found: error
          retention-days: 90
          compression-level: 0

  reduce:
    name: Reduce all eight exact attestations
    needs: [resolve, integrity_shard]
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    permissions:
      contents: read
    steps:
      - name: Checkout exact resolved commit
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ needs.resolve.outputs.head_sha }}
          fetch-depth: 0
          persist-credentials: false

      - name: Download all lane attestations
        uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131
        with:
          pattern: data-gridatlas-202608291507-shard-*-${{ needs.resolve.outputs.head_sha }}
          path: work/shards
          merge-multiple: true

      - name: Prove complete non-overlapping release closure
        env:
          EXPECTED_HEAD: ${{ needs.resolve.outputs.head_sha }}
          EXPECTED_POINTER: ${{ needs.resolve.outputs.pointer_sha256 }}
        run: |
          set -eu
          python atman/202608291507-current-integrity.py reduce \
            --repository . \
            --contract "$AUTOMATION_CONTRACT" \
            --expected-head "$EXPECTED_HEAD" \
            --expected-pointer-sha256 "$EXPECTED_POINTER" \
            --attestations work/shards \
            --output work/current-integrity-attestation.json
          cat work/current-integrity-attestation.json >> "$GITHUB_STEP_SUMMARY"

      - name: Retain current-integrity attestation
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
        with:
          name: data-gridatlas-202608291507-current-integrity-${{ needs.resolve.outputs.head_sha }}
          path: work/current-integrity-attestation.json
          if-no-files-found: error
          retention-days: 90
          compression-level: 0

Watchdog Router Workflow

A GitHub Actions workflow in Data GridAtlas using data from GitHub API. Runs on push, on a schedule and by hand.

automationdata-gridatlas / .github/workflows/202608291507-watchdog-router.yml · lines 1–222 of 222 · version 2026-08-29 15:07 · Entry point

What it does
It runs automated jobs on GitHub Actions. Side effects: reads or writes files; makes network requests; starts processes.
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: GitHub API; JSON file 202608291507-automation.json. Out: JSON file watchdog-router.json.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Data Grid Atlas watchdog and router”; runs Current Integrity (`atman/202608291507-current-integrity.py`).
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
Current Integrity (workflow run)
Used by
none found
Produces
none declared
Defines here
202608291507 Data Grid Atlas watchdog and router
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/202608291507-watchdog-router.yml:1-222 · blob ece5d243a198265a1b48aeab63994dad83fbd4c6 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, network, process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: supporting_data
name: 202608291507 Data Grid Atlas watchdog and router
run-name: Hourly watchdog ${{ github.sha }}

on:
  push:
    branches: [main]
    paths:
      - '.github/workflows/202608291507-watchdog-router.yml'
      - 'atman/202608291507-current-integrity.py'
      - 'contracts/202608291507-automation.json'
      - 'runbooks/202608291507-data-gridatlas-automation.md'
  schedule:
    - cron: '17 * * * *'
  workflow_dispatch:

permissions: {}

concurrency:
  group: data-gridatlas-watchdog-202608291507
  cancel-in-progress: true

env:
  AUTOMATION_CONTRACT: contracts/202608291507-automation.json
  INTEGRITY_WORKFLOW: 202608291507-current-integrity.yml
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'

jobs:
  resolve:
    name: Resolve stable recovery anchor
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    permissions:
      contents: read
    outputs:
      head_sha: ${{ steps.anchor.outputs.head_sha }}
      pointer_sha256: ${{ steps.anchor.outputs.pointer_sha256 }}
    steps:
      - name: Checkout exact watchdog commit
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ github.sha }}
          fetch-depth: 0
          persist-credentials: false

      - name: Resolve immutable pointer without rebuilding
        id: anchor
        run: |
          set -eu
          mkdir -p work
          python atman/202608291507-current-integrity.py resolve \
            --repository . \
            --contract "$AUTOMATION_CONTRACT" \
            --expected-head "$GITHUB_SHA" \
            --output work/watchdog-plan.json \
            --github-output "$GITHUB_OUTPUT"

  probe:
    name: Probe ${{ matrix.mode }}
    needs: resolve
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    permissions:
      contents: read
    strategy:
      fail-fast: false
      max-parallel: 3
      matrix:
        mode: [data-pointer, data-release, consumer]
    steps:
      - name: Checkout exact resolved commit
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ needs.resolve.outputs.head_sha }}
          fetch-depth: 0
          persist-credentials: false

      - name: Run bounded public probe
        env:
          EXPECTED_HEAD: ${{ needs.resolve.outputs.head_sha }}
          EXPECTED_POINTER: ${{ needs.resolve.outputs.pointer_sha256 }}
          PROBE_MODE: ${{ matrix.mode }}
        run: |
          set -eu
          mkdir -p work
          python atman/202608291507-current-integrity.py probe \
            --repository . \
            --contract "$AUTOMATION_CONTRACT" \
            --expected-head "$EXPECTED_HEAD" \
            --expected-pointer-sha256 "$EXPECTED_POINTER" \
            --mode "$PROBE_MODE" \
            --output "work/probe-$PROBE_MODE.json"

      - name: Retain watchdog probe
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
        with:
          name: data-gridatlas-202608291507-probe-${{ matrix.mode }}-${{ needs.resolve.outputs.head_sha }}
          path: work/probe-${{ matrix.mode }}.json
          if-no-files-found: error
          retention-days: 30
          compression-level: 0

  route:
    name: Resume, wait or no-op at exact HEAD
    needs: [resolve, probe]
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    permissions:
      actions: write
      contents: read
    steps:
      - name: Route exact current-integrity run
        env:
          GH_TOKEN: ${{ github.token }}
          EXPECTED_HEAD: ${{ needs.resolve.outputs.head_sha }}
          EXPECTED_POINTER: ${{ needs.resolve.outputs.pointer_sha256 }}
        run: |
          set -eu
          mkdir -p work
          python - <<'PY'
          import json, os
          from datetime import datetime, timezone
          from pathlib import Path
          from urllib.request import Request, urlopen

          repository = os.environ['GITHUB_REPOSITORY']
          workflow = os.environ['INTEGRITY_WORKFLOW']
          expected_head = os.environ['EXPECTED_HEAD']
          expected_pointer = os.environ['EXPECTED_POINTER']
          token = os.environ['GH_TOKEN']
          api = f'https://api.github.com/repos/{repository}'
          headers = {
              'Accept': 'application/vnd.github+json',
              'Authorization': f'Bearer {token}',
              'Content-Type': 'application/json',
              'X-GitHub-Api-Version': '2022-11-28',
          }

          def request(url, method='GET', payload=None):
              body = None if payload is None else json.dumps(payload).encode()
              with urlopen(Request(url, data=body, headers=headers, method=method), timeout=30) as response:
                  raw = response.read()
                  return None if not raw else json.loads(raw)

          runs = request(f'{api}/actions/workflows/{workflow}/runs?branch=main&per_page=100')['workflow_runs']
          matches = [
              run for run in runs
              if run.get('head_sha') == expected_head
              and run.get('path') == f'.github/workflows/{workflow}'
          ]
          matches.sort(key=lambda run: (run.get('created_at', ''), run.get('id', 0)), reverse=True)
          selected = matches[0] if matches else None
          result = {
              'schema': 'data-gridatlas.watchdog-router.v1',
              'generation': '202608291507',
              'recorded_at': datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z'),
              'repository': repository,
              'head_sha': expected_head,
              'pointer_sha256': expected_pointer,
              'selected_run_id': None if selected is None else selected['id'],
              'selected_run_attempt': None if selected is None else selected['run_attempt'],
              'main_mutated': False,
              'rebuild_dispatched': False,
              'failed': 0,
          }

          if selected is None:
              request(
                  f'{api}/actions/workflows/{workflow}/dispatches',
                  method='POST',
                  payload={
                      'ref': 'main',
                      'inputs': {
                          'expected_head_sha': expected_head,
                          'expected_pointer_sha256': expected_pointer,
                      },
                  },
              )
              result['classification'] = 'DISPATCHED_CURRENT_INTEGRITY'
          elif selected['status'] != 'completed':
              result['classification'] = 'WAITING_FOR_CURRENT_INTEGRITY'
          elif selected['conclusion'] == 'success':
              result['classification'] = 'NOOP_ALREADY_VERIFIED'
          elif selected['run_attempt'] < 3 and selected['conclusion'] in ('failure', 'timed_out'):
              request(f"{api}/actions/runs/{selected['id']}/rerun-failed-jobs", method='POST', payload={})
              result['classification'] = 'RERUN_FAILED_INTEGRITY_JOBS'
          elif selected['run_attempt'] < 3 and selected['conclusion'] in ('cancelled', 'stale'):
              request(
                  f'{api}/actions/workflows/{workflow}/dispatches',
                  method='POST',
                  payload={
                      'ref': 'main',
                      'inputs': {
                          'expected_head_sha': expected_head,
                          'expected_pointer_sha256': expected_pointer,
                      },
                  },
              )
              result['classification'] = 'REDISPATCHED_CANCELLED_INTEGRITY'
          else:
              result['classification'] = 'BLOCKED_AFTER_THREE_ATTEMPTS'
              result['failed'] = 1

          Path('work/watchdog-router.json').write_text(
              json.dumps(result, sort_keys=True, indent=2) + '\n', encoding='utf-8'
          )
          with Path(os.environ['GITHUB_STEP_SUMMARY']).open('a', encoding='utf-8') as handle:
              handle.write('## Data Grid Atlas watchdog\n\n```json\n')
              handle.write(json.dumps(result, sort_keys=True, indent=2))
              handle.write('\n```\n')
          print(json.dumps(result, sort_keys=True))
          if result['failed']:
              raise SystemExit('integrity recovery exhausted; fail closed')
          PY

      - name: Retain router decision
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
        with:
          name: data-gridatlas-202608291507-watchdog-${{ needs.resolve.outputs.head_sha }}-${{ github.run_id }}
          path: work/watchdog-router.json
          if-no-files-found: error
          retention-days: 90
          compression-level: 0