GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Automation and CI / companies / .github/workflows

Sync GridAtlas V9 Link Contract Workflow and 6 more files

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

663 lines of YAML and JavaScript from companies, compass, in 7 files. Topic: Automation and CI. Section 1690 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. Sync GridAtlas V9 Link Contract Workflow automation · companies / .github/workflows/202608300312-sync-gridatlas-v9-link-contract.yml lines 1–262
  2. Bound Hourly GridAtlas Link Mission Workflow automation · companies / .github/workflows/202608300327-bound-hourly-gridatlas-link-mission.yml lines 1–111
  3. Dispatch Exact Atlas Link Contract Workflow automation · companies / .github/workflows/202608300418-dispatch-exact-atlas-link-contract.yml lines 1–83
  4. Bootstrap Five Hour Key Only Atlas Mission Workflow automation · companies / .github/workflows/202608300430-bootstrap-five-hour-key-only-atlas-mission.yml lines 1–13
  5. Five Hour Key Only Atlas Watchdog Workflow automation · companies / .github/workflows/202608300435-five-hour-key-only-atlas-watchdog.yml lines 1–164
  6. Verify Workflow automation · compass / .github/workflows/verify.yml lines 1–20
  7. Verify Source Pins ingest · compass / scripts/verify-source-pins.mjs lines 1–10

Sync GridAtlas V9 Link Contract Workflow

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

automationcompanies / .github/workflows/202608300312-sync-gridatlas-v9-link-contract.yml · lines 1–262 of 262 · version 2026-08-30 03:12 · Entry point

What it does
It builds and publishes the REPD register. Side effects: 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 (path 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. Domain terms in the code: the REPD register.
Inputs & outputs
In: data source: gridatlas data; Parquet file company-repd-relationships-v1.parquet; Parquet file solar-company-repd-relationships-v1.parquet. 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
Named “Sync verified Grid Atlas V9 link contract”.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
companies · .github/workflows · workflow
Uses
none found
Used by
none found
Produces
none declared
Defines here
202608300312 Sync verified Grid Atlas V9 link contract
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
companies@1371da4d0166eef13f98fc3847c5bb1e38e8f571 .github/workflows/202608300312-sync-gridatlas-v9-link-contract.yml:1-262 · blob 603ac401dc3e479c8e528f5f6710e1b4b564c084 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, network, process, storage · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
name: 202608300312 Sync verified Grid Atlas V9 link contract

on:
  push:
    branches: [main]
    paths:
      - '.github/workflows/202608300312-sync-gridatlas-v9-link-contract.yml'
  workflow_dispatch:
  schedule:
    - cron: '25 4-8 30 8 *'

permissions:
  contents: write

concurrency:
  group: companies-gridatlas-v9-link-contract
  cancel-in-progress: false

env:
  ATLAS_STATE_URL: https://ventusltd.github.io/gridatlas/state/live-set.json
  MINIMUM_ATLAS_GENERATION: '202608300453'
  GOLDEN_REPD_REF: '13599'
  COMPANIES_CONTRACT: contracts/202608281337-compact-parquet-companies.json
  LINK_CONTRACT: state/atlas-v9-link-contract.json
  LINK_AUDIT: state/atlas-v9-link-audit.json
  MISSION_EXPIRES_AT: '2026-08-30T08:35:00Z'

jobs:
  sync:
    name: Preserve key-only Parquet and publish one verified URL template
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    steps:
      - name: Checkout exact Companies source boundary
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ github.sha }}
          fetch-depth: 20
          persist-credentials: true

      - name: Prove Companies privacy and key-only boundaries
        run: |
          set -euo pipefail
          test -f "$COMPANIES_CONTRACT"
          test "$(jq -r '.schema' "$COMPANIES_CONTRACT")" = companies-house-relationship-report-contract-v1
          test "$(jq -c '[.relationship_schema[].name]' "$COMPANIES_CONTRACT")" = '["company_number","repd_ref","evidence_type"]'
          test "$(jq -c '[.solar_relationship_schema[].name]' "$COMPANIES_CONTRACT")" = '["company_number","repd_ref","evidence_type"]'
          test "$(jq -r '.hard_gates.bridge_columns_per_table' "$COMPANIES_CONTRACT")" = 3
          test "$(jq -r '.hard_gates.descriptive_edge_columns' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.row_level_provenance_columns' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.per_row_digest_columns' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.raw_archives' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.company_master_files' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.company_master_rows' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.duckdb_version' "$COMPANIES_CONTRACT")" = 1.3.2
          git diff --exit-code

      - name: Resolve verified Atlas receiver
        id: atlas
        run: |
          set -euo pipefail
          now="$(date -u +%s)"
          expires="$(date -u -d "$MISSION_EXPIRES_AT" +%s)"
          if (( now > expires )); then
            echo 'ready=false' >> "$GITHUB_OUTPUT"
            echo "Companies Atlas mission retired at $MISSION_EXPIRES_AT; no mutation." >> "$GITHUB_STEP_SUMMARY"
            exit 0
          fi

          curl --fail --location --silent --show-error --retry 3 --retry-delay 2 \
            "$ATLAS_STATE_URL" -o /tmp/atlas-state.json
          python3 -m json.tool /tmp/atlas-state.json >/dev/null

          generation="$(jq -r '.generation // empty' /tmp/atlas-state.json)"
          if [[ ! "$generation" =~ ^[0-9]{12}$ ]] || (( 10#$generation < 10#$MINIMUM_ATLAS_GENERATION )); then
            echo 'ready=false' >> "$GITHUB_OUTPUT"
            echo "Atlas generation $generation is below required $MINIMUM_ATLAS_GENERATION; Companies remains unchanged." >> "$GITHUB_STEP_SUMMARY"
            exit 0
          fi

          release_id="$(jq -r '.current.release_id // empty' /tmp/atlas-state.json)"
          live_url="$(jq -r '.current.live_url // empty' /tmp/atlas-state.json)"
          source_commit="$(jq -r '.current.source_commit // empty' /tmp/atlas-state.json)"
          publication_commit="$(jq -r '.current.publication_commit // empty' /tmp/atlas-state.json)"
          promotion="$(jq -r '.verification.promotion_eligible // false' /tmp/atlas-state.json)"
          failed="$(jq -r '.verification.failed_gates // 999' /tmp/atlas-state.json)"

          test "$promotion" = true
          test "$failed" = 0
          test "$(jq -r '.verification.commit_lineage_attested // false' /tmp/atlas-state.json)" = true
          test "$(jq -r '.verification.exact_repd_deep_link_resolved // false' /tmp/atlas-state.json)" = true
          test "$(jq -r '.verification.exact_repd_fly_to // false' /tmp/atlas-state.json)" = true
          test "$(jq -r '.current.deep_link_receiver.identity_rule // empty' /tmp/atlas-state.json)" = EXACT_REPD_REF_ONLY
          jq -e '.current.deep_link_receiver.synthetic_receiver == false' /tmp/atlas-state.json >/dev/null
          [[ "$release_id" =~ ^[0-9]{12}-atlas-v9$ ]]
          [[ "$live_url" == "https://ventusltd.github.io/gridatlas/$release_id/" ]]
          [[ "$source_commit" =~ ^[a-f0-9]{40}$ ]]
          [[ "$publication_commit" =~ ^[a-f0-9]{40}$ ]]

          curl --fail --location --silent --show-error --retry 3 --retry-delay 2 \
            "${live_url}release-manifest.json" -o /tmp/atlas-release-manifest.json
          test "$(jq -r '.release_id' /tmp/atlas-release-manifest.json)" = "$release_id"
          effective="$(curl --fail --location --silent --show-error --retry 3 --retry-delay 2 \
            --output /tmp/atlas-golden.html --write-out '%{url_effective}' \
            "${live_url}?repd_ref=${GOLDEN_REPD_REF}")"
          test "$effective" = "${live_url}?repd_ref=${GOLDEN_REPD_REF}"
          grep -q 'ventus-corev8engine.js' /tmp/atlas-golden.html

          if test -f "$LINK_CONTRACT" \
             && test -f "$LINK_AUDIT" \
             && test "$(jq -r '.classification' "$LINK_CONTRACT")" = VERIFIED_KEY_ONLY_ATLAS_LINK_TEMPLATE \
             && test "$(jq -r '.atlas.release_id' "$LINK_CONTRACT")" = "$release_id" \
             && test "$(jq -r '.classification' "$LINK_AUDIT")" = PASS \
             && test "$(jq -r '.atlas_release_id' "$LINK_AUDIT")" = "$release_id"; then
            echo 'ready=false' >> "$GITHUB_OUTPUT"
            echo "Companies already carries the verified $release_id key-only link contract." >> "$GITHUB_STEP_SUMMARY"
            exit 0
          fi

          echo 'ready=true' >> "$GITHUB_OUTPUT"
          echo "generation=$generation" >> "$GITHUB_OUTPUT"
          echo "release_id=$release_id" >> "$GITHUB_OUTPUT"
          echo "live_url=$live_url" >> "$GITHUB_OUTPUT"
          echo "source_commit=$source_commit" >> "$GITHUB_OUTPUT"
          echo "publication_commit=$publication_commit" >> "$GITHUB_OUTPUT"

      - name: Build compact link template and audit
        if: steps.atlas.outputs.ready == 'true'
        env:
          ATLAS_GENERATION: ${{ steps.atlas.outputs.generation }}
          ATLAS_RELEASE_ID: ${{ steps.atlas.outputs.release_id }}
          ATLAS_LIVE_URL: ${{ steps.atlas.outputs.live_url }}
          ATLAS_SOURCE_COMMIT: ${{ steps.atlas.outputs.source_commit }}
          ATLAS_PUBLICATION_COMMIT: ${{ steps.atlas.outputs.publication_commit }}
        run: |
          set -euo pipefail
          python3 - <<'PY'
          from __future__ import annotations
          import hashlib
          import json
          import os
          from datetime import datetime, timezone
          from pathlib import Path

          contract_path = Path(os.environ['LINK_CONTRACT'])
          previous = None
          if contract_path.is_file():
              previous = json.loads(contract_path.read_text(encoding='utf-8'))

          atlas_url = os.environ['ATLAS_LIVE_URL']
          release_id = os.environ['ATLAS_RELEASE_ID']
          template = f'{atlas_url}?repd_ref={{repd_ref}}'
          golden = f'{atlas_url}?repd_ref={os.environ["GOLDEN_REPD_REF"]}'
          payload = {
              'schema': 'companies.gridatlas-v9-link-contract.v1',
              'classification': 'VERIFIED_KEY_ONLY_ATLAS_LINK_TEMPLATE',
              'generated_at': datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z'),
              'atlas': {
                  'generation': os.environ['ATLAS_GENERATION'],
                  'release_id': release_id,
                  'base_url': atlas_url,
                  'source_commit': os.environ['ATLAS_SOURCE_COMMIT'],
                  'publication_commit': os.environ['ATLAS_PUBLICATION_COMMIT'],
                  'state_url': os.environ['ATLAS_STATE_URL'],
              },
              'join': {
                  'relationship_key': 'repd_ref',
                  'query_parameter': 'repd_ref',
                  'identity_rule': 'EXACT_REPD_REF_ONLY',
                  'url_template': template,
                  'golden_repd_ref': os.environ['GOLDEN_REPD_REF'],
                  'golden_url': golden,
              },
              'relationship_tables': {
                  'company_repd': 'company-repd-relationships-v1.parquet',
                  'solar_company_repd': 'solar-company-repd-relationships-v1.parquet',
                  'columns': ['company_number', 'repd_ref', 'evidence_type'],
                  'row_url_columns': 0,
                  'descriptive_columns': 0,
              },
              'privacy': {
                  'personal_data': False,
                  'director_names': False,
                  'individual_psc': False,
                  'dates_of_birth': False,
                  'residential_addresses': False,
                  'raw_company_archive': False,
              },
              'storage_rule': 'One dataset-level URL template; never duplicate URLs into relationship rows.',
              'rollback': None,
          }
          if previous and previous.get('atlas', {}).get('release_id') != release_id:
              payload['rollback'] = {
                  'release_id': previous.get('atlas', {}).get('release_id'),
                  'base_url': previous.get('atlas', {}).get('base_url'),
                  'classification': previous.get('classification'),
              }

          contract_path.parent.mkdir(parents=True, exist_ok=True)
          text = json.dumps(payload, indent=2, sort_keys=True) + '\n'
          contract_path.write_text(text, encoding='utf-8', newline='\n')
          audit = {
              'schema': 'companies.gridatlas-v9-link-audit.v1',
              'classification': 'PASS',
              'atlas_release_id': release_id,
              'contract_sha256': hashlib.sha256(text.encode('utf-8')).hexdigest(),
              'companies_contract': os.environ['COMPANIES_CONTRACT'],
              'relationship_columns': ['company_number', 'repd_ref', 'evidence_type'],
              'bridge_columns_per_table': 3,
              'row_url_columns': 0,
              'descriptive_edge_columns': 0,
              'raw_archives': 0,
              'company_master_files': 0,
              'golden_url': golden,
              'http_effective_url_preserved': True,
              'privacy': 'NO_PERSONAL_DATA',
          }
          Path(os.environ['LINK_AUDIT']).write_text(
              json.dumps(audit, indent=2, sort_keys=True) + '\n', encoding='utf-8', newline='\n'
          )
          PY
          python3 -m json.tool "$LINK_CONTRACT" >/dev/null
          python3 -m json.tool "$LINK_AUDIT" >/dev/null
          test "$(jq -r '.classification' "$LINK_CONTRACT")" = VERIFIED_KEY_ONLY_ATLAS_LINK_TEMPLATE
          test "$(jq -r '.atlas.release_id' "$LINK_CONTRACT")" = "$ATLAS_RELEASE_ID"
          test "$(jq -r '.join.identity_rule' "$LINK_CONTRACT")" = EXACT_REPD_REF_ONLY
          test "$(jq -r '.relationship_tables.row_url_columns' "$LINK_CONTRACT")" = 0
          test "$(jq -c '.relationship_tables.columns' "$LINK_CONTRACT")" = '["company_number","repd_ref","evidence_type"]'
          test "$(jq -r '.classification' "$LINK_AUDIT")" = PASS
          git diff --check

      - name: Compare-and-swap verified contract onto main
        if: steps.atlas.outputs.ready == 'true'
        env:
          ATLAS_RELEASE_ID: ${{ steps.atlas.outputs.release_id }}
        run: |
          set -euo pipefail
          if git ls-files --error-unmatch "$LINK_CONTRACT" "$LINK_AUDIT" >/dev/null 2>&1 \
             && git diff --quiet -- "$LINK_CONTRACT" "$LINK_AUDIT"; then
            echo "Companies already points to $ATLAS_RELEASE_ID" >> "$GITHUB_STEP_SUMMARY"
            exit 0
          fi
          git fetch --no-tags origin main:refs/remotes/origin/main
          test "$(git rev-parse origin/main)" = "$GITHUB_SHA"
          git add "$LINK_CONTRACT" "$LINK_AUDIT"
          mapfile -t staged < <(git diff --cached --name-only | sort)
          expected=("$LINK_AUDIT" "$LINK_CONTRACT")
          test "${staged[*]}" = "${expected[*]}"
          git config user.name companies-atlas-link-bot
          git config user.email actions@users.noreply.github.com
          git commit -m "link: verified Grid Atlas $ATLAS_RELEASE_ID template"
          git push origin HEAD:main
          {
            echo '## Companies → Grid Atlas V9 contract updated'
            echo
            echo "- Atlas release: $ATLAS_RELEASE_ID"
            echo "- Join key: repd_ref"
            echo '- Durable URLs per relationship row: 0'
            echo '- Parquet relationship schema changed: no'
            echo '- Personal data added: no'
            echo '- Cadence: hourly through 09:35 BST; hard expiry enforced.'
          } >> "$GITHUB_STEP_SUMMARY"

Bound Hourly GridAtlas Link Mission Workflow

A GitHub Actions workflow in Companies. Runs on push and by hand.

automationcompanies / .github/workflows/202608300327-bound-hourly-gridatlas-link-mission.yml · lines 1–111 of 111 · version 2026-08-30 03:27 · 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 (path 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
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
Named “Bound hourly Companies Atlas V9 mission”.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
companies · .github/workflows · workflow
Uses
none found
Used by
none found
Produces
none declared
Defines here
202608300327 Bound hourly Companies Atlas V9 mission
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
companies@1371da4d0166eef13f98fc3847c5bb1e38e8f571 .github/workflows/202608300327-bound-hourly-gridatlas-link-mission.yml:1-111 · blob 71ba301ae1bbe1275dec493b16c9ab806d0f5763 · 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: unknown
name: 202608300327 Bound hourly Companies Atlas V9 mission

on:
  push:
    branches: [main]
    paths:
      - '.github/workflows/202608300327-bound-hourly-gridatlas-link-mission.yml'
  workflow_dispatch:

permissions:
  contents: write

concurrency:
  group: companies-bound-hourly-gridatlas-bootstrap
  cancel-in-progress: false

env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
  TARGET: .github/workflows/202608300312-sync-gridatlas-v9-link-contract.yml
  MISSION_EXPIRES_AT: '2026-08-30T05:28:00Z'

jobs:
  delegate:
    name: Make the key-only Atlas link sync hourly and bounded
    runs-on: ubuntu-24.04
    timeout-minutes: 5
    steps:
      - name: Checkout exact Companies source boundary
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ github.sha }}
          fetch-depth: 20
          persist-credentials: true

      - name: Patch only the CI conductor
        run: |
          set -euo pipefail
          python3 - <<'PY'
          from pathlib import Path

          path = Path('.github/workflows/202608300312-sync-gridatlas-v9-link-contract.yml')
          text = path.read_text(encoding='utf-8')

          replacements = [
              (
                  "    - cron: '17,47 * * * *'",
                  "    - cron: '25 3-5 30 8 *'",
                  'bounded hourly cron',
              ),
              (
                  "  LINK_AUDIT: state/atlas-v9-link-audit.json\n",
                  "  LINK_AUDIT: state/atlas-v9-link-audit.json\n"
                  "  MISSION_EXPIRES_AT: '2026-08-30T05:28:00Z'\n",
                  'mission expiry',
              ),
              (
                  "      - name: Resolve verified Atlas receiver\n"
                  "        id: atlas\n"
                  "        run: |\n"
                  "          set -euo pipefail\n"
                  "          curl --fail --location --silent --show-error --retry 3 --retry-delay 2 \\\n",
                  "      - name: Resolve verified Atlas receiver\n"
                  "        id: atlas\n"
                  "        run: |\n"
                  "          set -euo pipefail\n"
                  "          now=\"$(date -u +%s)\"\n"
                  "          expires=\"$(date -u -d \"$MISSION_EXPIRES_AT\" +%s)\"\n"
                  "          if (( now > expires )); then\n"
                  "            echo 'ready=false' >> \"$GITHUB_OUTPUT\"\n"
                  "            echo \"Companies three-hour Atlas mission retired at $MISSION_EXPIRES_AT; no mutation.\" >> \"$GITHUB_STEP_SUMMARY\"\n"
                  "            exit 0\n"
                  "          fi\n"
                  "          curl --fail --location --silent --show-error --retry 3 --retry-delay 2 \\\n",
                  'mission window guard',
              ),
          ]

          for before, after, label in replacements:
              count = text.count(before)
              if count != 1:
                  raise SystemExit(f'{label}: expected one anchor, found {count}')
              text = text.replace(before, after, 1)

          path.write_text(text, encoding='utf-8', newline='\n')
          PY
          git diff --check
          grep -q "cron: '25 3-5 30 8 \*'" "$TARGET"
          grep -q "MISSION_EXPIRES_AT: '2026-08-30T05:28:00Z'" "$TARGET"
          test "$(grep -c 'Companies three-hour Atlas mission retired' "$TARGET")" = 1

      - name: Compare-and-swap the bounded conductor onto main
        run: |
          set -euo pipefail
          git fetch --no-tags origin main:refs/remotes/origin/main
          test "$(git rev-parse origin/main)" = "$GITHUB_SHA"
          git add "$TARGET"
          test "$(git diff --cached --name-only)" = "$TARGET"
          git config user.name companies-mission-conductor-bot
          git config user.email actions@users.noreply.github.com
          git commit -m '202608300327: run key-only Atlas link closure hourly for three hours'
          git push origin HEAD:main
          {
            echo '## Companies mission delegated'
            echo
            echo '- Immediate key-only Atlas contract sync: triggered by this conductor update'
            echo '- Hourly follow-ups: 03:25, 04:25 and 05:25 UTC'
            echo '- Hard retirement: 05:28 UTC'
            echo '- Relationship tables changed: no'
            echo '- Raw Companies House data added: no'
            echo '- Personal data added: no'
          } >> "$GITHUB_STEP_SUMMARY"

Dispatch Exact Atlas Link Contract Workflow

A GitHub Actions workflow in Companies using data from GitHub API and the GridAtlas repository. Runs on push and by hand.

automationcompanies / .github/workflows/202608300418-dispatch-exact-atlas-link-contract.yml · lines 1–83 of 83 · version 2026-08-30 04:18 · Entry point

What it does
It runs automated jobs on GitHub Actions. Side effects: makes network requests; starts processes.
Why it exists in the grid workflow
Domain stage upstream_foresight (path word 'atlas'): 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: gridatlas data; data source: GitHub API.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
companies · .github/workflows · workflow
Uses
none found
Used by
none found
Produces
none declared
Defines here
202608300418 Dispatch exact Atlas Companies contract
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
companies@1371da4d0166eef13f98fc3847c5bb1e38e8f571 .github/workflows/202608300418-dispatch-exact-atlas-link-contract.yml:1-83 · blob 9563a76a31028d7baf9bdd2e0612c00bffd69470 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: network, process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
name: 202608300418 Dispatch exact Atlas Companies contract
run-name: Dispatch Companies exact-Atlas contract from ${{ github.sha }}

on:
  push:
    branches: [main]
    paths:
      - '.github/workflows/202608300418-dispatch-exact-atlas-link-contract.yml'
  workflow_dispatch:

permissions:
  actions: write
  contents: read

concurrency:
  group: companies-exact-atlas-contract-dispatch
  cancel-in-progress: false

env:
  ATLAS_STATE_URL: https://ventusltd.github.io/gridatlas/state/live-set.json
  MINIMUM_ATLAS_GENERATION: '202608300453'
  TARGET_WORKFLOW: 202608300312-sync-gridatlas-v9-link-contract.yml

jobs:
  dispatch:
    name: Validate exact Atlas and launch key-only contract sync
    runs-on: ubuntu-24.04
    timeout-minutes: 5
    steps:
      - name: Checkout triggering Companies boundary
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ github.sha }}
          fetch-depth: 20
          persist-credentials: false

      - name: Require triggering commit remains on main lineage
        run: |
          set -euo pipefail
          test "$GITHUB_REF" = refs/heads/main
          git fetch --no-tags origin main:refs/remotes/origin/main
          git merge-base --is-ancestor "$GITHUB_SHA" origin/main
          test -f ".github/workflows/$TARGET_WORKFLOW"

      - name: Require verified exact-REPD Atlas receiver
        run: |
          set -euo pipefail
          curl --fail --location --silent --show-error --retry 3 --retry-delay 2 \
            "$ATLAS_STATE_URL" -o /tmp/atlas-state.json
          python3 -m json.tool /tmp/atlas-state.json >/dev/null
          generation="$(jq -r '.generation // empty' /tmp/atlas-state.json)"
          [[ "$generation" =~ ^[0-9]{12}$ ]]
          (( 10#$generation >= 10#$MINIMUM_ATLAS_GENERATION ))
          test "$(jq -r '.verification.promotion_eligible // false' /tmp/atlas-state.json)" = true
          test "$(jq -r '.verification.failed_gates // 999' /tmp/atlas-state.json)" = 0
          test "$(jq -r '.verification.commit_lineage_attested // false' /tmp/atlas-state.json)" = true
          test "$(jq -r '.verification.exact_repd_deep_link_resolved // false' /tmp/atlas-state.json)" = true
          test "$(jq -r '.verification.exact_repd_fly_to // false' /tmp/atlas-state.json)" = true
          test "$(jq -r '.current.deep_link_receiver.identity_rule // empty' /tmp/atlas-state.json)" = EXACT_REPD_REF_ONLY
          jq -e '.current.deep_link_receiver.synthetic_receiver == false' /tmp/atlas-state.json >/dev/null
          echo "ATLAS_RELEASE_ID=$(jq -r '.current.release_id' /tmp/atlas-state.json)" >> "$GITHUB_ENV"

      - name: Dispatch unchanged key-only Companies contract sync
        env:
          GH_TOKEN: ${{ github.token }}
        run: |
          set -euo pipefail
          payload="$(jq -cn --arg ref main '{ref:$ref}')"
          curl --fail-with-body --location --silent --show-error \
            --request POST \
            --header "Authorization: Bearer $GH_TOKEN" \
            --header 'Accept: application/vnd.github+json' \
            --header 'X-GitHub-Api-Version: 2022-11-28' \
            "https://api.github.com/repos/$GITHUB_REPOSITORY/actions/workflows/$TARGET_WORKFLOW/dispatches" \
            --data "$payload"
          {
            echo '## Companies exact Atlas contract dispatched'
            echo
            echo "- Atlas receiver: $ATLAS_RELEASE_ID"
            echo '- Relationship columns changed: no'
            echo '- Row-level URLs introduced: no'
            echo '- Personal or raw company data introduced: no'
          } >> "$GITHUB_STEP_SUMMARY"

Bootstrap Five Hour Key Only Atlas Mission Workflow

A GitHub Actions workflow in Companies. Runs by hand.

automationcompanies / .github/workflows/202608300430-bootstrap-five-hour-key-only-atlas-mission.yml · lines 1–13 of 13 · version 2026-08-30 04:30 · 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 'atlas'): 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 “Retired Companies bootstrap wrapper”.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
companies · .github/workflows · workflow
Uses
none found
Used by
none found
Produces
none declared
Defines here
202608300430 Retired Companies bootstrap wrapper
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
companies@1371da4d0166eef13f98fc3847c5bb1e38e8f571 .github/workflows/202608300430-bootstrap-five-hour-key-only-atlas-mission.yml:1-13 · blob 7b1af0a908ed5fd7fccc8204b9c3bc4f3f2ae395 · 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: unknown
name: 202608300430 Retired Companies bootstrap wrapper

on:
  workflow_dispatch:

permissions:
  contents: read

jobs:
  retired:
    runs-on: ubuntu-24.04
    steps:
      - run: echo 'Superseded by the direct five-hour key-only Atlas watchdog.'

Five Hour Key Only Atlas Watchdog Workflow

A GitHub Actions workflow in Companies using data from the GridAtlas repository. Runs on push, on a schedule and by hand.

automationcompanies / .github/workflows/202608300435-five-hour-key-only-atlas-watchdog.yml · lines 1–164 of 164 · version 2026-08-30 04:35 · Entry point

What it does
It runs automated jobs on GitHub Actions. 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 (path word 'atlas'): 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: gridatlas data. Out: JSON file key-only-atlas-proof.json.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
companies · .github/workflows · workflow
Uses
none found
Used by
none found
Produces
none declared
Defines here
202608300435 Five-hour Companies key-only Atlas watchdog
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
companies@1371da4d0166eef13f98fc3847c5bb1e38e8f571 .github/workflows/202608300435-five-hour-key-only-atlas-watchdog.yml:1-164 · blob f25a60c83b01303de464d925c418436ff8611ff3 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, filesystem, network, process, storage · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: unknown
name: 202608300435 Five-hour Companies key-only Atlas watchdog
run-name: Companies key-only Atlas check ${{ github.run_number }} from ${{ github.sha }}

on:
  push:
    branches: [main]
    paths:
      - '.github/workflows/202608300435-five-hour-key-only-atlas-watchdog.yml'
  workflow_dispatch:
  schedule:
    - cron: '30 4-8 30 8 *'

permissions:
  contents: read

concurrency:
  group: companies-five-hour-key-only-atlas-watchdog
  cancel-in-progress: false

env:
  FORCE_JAVASCRIPT_ACTIONS_TO_NODE24: 'true'
  MISSION_INCEPTED_AT: '2026-08-30T03:30:00Z'
  MISSION_EXPIRES_AT: '2026-08-30T08:35:00Z'
  ATLAS_STATE_URL: https://ventusltd.github.io/gridatlas/state/live-set.json
  MINIMUM_ATLAS_GENERATION: '202608292311'
  COMPANIES_CONTRACT: contracts/202608281337-compact-parquet-companies.json
  LINK_CONTRACT: state/atlas-v9-link-contract.json
  LINK_AUDIT: state/atlas-v9-link-audit.json

jobs:
  verify:
    name: Prove three-key columns, one URL template and no personal or raw corpus
    runs-on: ubuntu-24.04
    timeout-minutes: 8
    steps:
      - name: Enforce bounded five-hour mission window
        id: window
        run: |
          set -euo pipefail
          now="$(date -u +%s)"
          starts="$(date -u -d "$MISSION_INCEPTED_AT" +%s)"
          expires="$(date -u -d "$MISSION_EXPIRES_AT" +%s)"
          if (( now < starts || now > expires )); then
            echo 'active=false' >> "$GITHUB_OUTPUT"
            echo "Companies five-hour key-only mission inactive outside $MISSION_INCEPTED_AT to $MISSION_EXPIRES_AT." >> "$GITHUB_STEP_SUMMARY"
            exit 0
          fi
          echo 'active=true' >> "$GITHUB_OUTPUT"

      - name: Checkout exact Companies source
        if: steps.window.outputs.active == 'true'
        uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1
        with:
          ref: ${{ github.sha }}
          fetch-depth: 40
          persist-credentials: false

      - name: Require exact main and resolve promoted GridAtlas receiver
        if: steps.window.outputs.active == 'true'
        id: atlas
        run: |
          set -euo pipefail
          test "$GITHUB_REF" = refs/heads/main
          git fetch --no-tags origin main:refs/remotes/origin/main
          test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
          test "$(git rev-parse origin/main)" = "$GITHUB_SHA"

          mkdir -p work
          curl --fail --location --silent --show-error --retry 3 --retry-delay 2 \
            "$ATLAS_STATE_URL" -o work/atlas-live-set.json
          python3 -m json.tool work/atlas-live-set.json >/dev/null
          generation="$(jq -r '.generation' work/atlas-live-set.json)"
          release_id="$(jq -r '.current.release_id' work/atlas-live-set.json)"
          live_url="$(jq -r '.current.live_url' work/atlas-live-set.json)"
          [[ "$generation" =~ ^[0-9]{12}$ ]]
          (( 10#$generation >= 10#$MINIMUM_ATLAS_GENERATION ))
          [[ "$release_id" =~ ^[0-9]{12}-atlas-v9$ ]]
          test "$live_url" = "https://ventusltd.github.io/gridatlas/$release_id/"
          test "$(jq -r '.verification.promotion_eligible' work/atlas-live-set.json)" = true
          test "$(jq -r '.verification.failed_gates' work/atlas-live-set.json)" = 0
          test "$(jq -r '.verification.commit_lineage_attested' work/atlas-live-set.json)" = true
          echo "release_id=$release_id" >> "$GITHUB_OUTPUT"
          echo "live_url=$live_url" >> "$GITHUB_OUTPUT"

      - name: Prove compact relationship and privacy contract
        if: steps.window.outputs.active == 'true'
        env:
          ATLAS_RELEASE_ID: ${{ steps.atlas.outputs.release_id }}
          ATLAS_LIVE_URL: ${{ steps.atlas.outputs.live_url }}
        run: |
          set -euo pipefail
          test -f "$COMPANIES_CONTRACT"
          test -f "$LINK_CONTRACT"
          test -f "$LINK_AUDIT"
          test "$(jq -r '.schema' "$COMPANIES_CONTRACT")" = companies-house-relationship-report-contract-v1
          test "$(jq -r '.duckdb_version' "$COMPANIES_CONTRACT")" = 1.3.2
          test "$(jq -r '.hard_gates.compression' "$COMPANIES_CONTRACT")" = ZSTD
          test "$(jq -r '.hard_gates.bridge_columns_per_table' "$COMPANIES_CONTRACT")" = 3
          test "$(jq -r '.hard_gates.descriptive_edge_columns' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.row_level_provenance_columns' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.per_row_digest_columns' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.raw_archives' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.company_master_files' "$COMPANIES_CONTRACT")" = 0
          test "$(jq -r '.hard_gates.promotion_eligible' "$COMPANIES_CONTRACT")" = false
          test "$(jq -c '[.relationship_schema[].name]' "$COMPANIES_CONTRACT")" = '["company_number","repd_ref","evidence_type"]'
          test "$(jq -c '[.solar_relationship_schema[].name]' "$COMPANIES_CONTRACT")" = '["company_number","repd_ref","evidence_type"]'
          test "$(jq -r '.classification' "$LINK_CONTRACT")" = VERIFIED_KEY_ONLY_ATLAS_LINK_TEMPLATE
          test "$(jq -r '.atlas.release_id' "$LINK_CONTRACT")" = "$ATLAS_RELEASE_ID"
          test "$(jq -r '.atlas.base_url' "$LINK_CONTRACT")" = "$ATLAS_LIVE_URL"
          test "$(jq -r '.join.identity_rule' "$LINK_CONTRACT")" = EXACT_REPD_REF_ONLY
          test "$(jq -r '.relationship_tables.row_url_columns' "$LINK_CONTRACT")" = 0
          test "$(jq -c '.relationship_tables.columns' "$LINK_CONTRACT")" = '["company_number","repd_ref","evidence_type"]'
          test "$(jq -r '.privacy.personal_data' "$LINK_CONTRACT")" = false
          test "$(jq -r '.classification' "$LINK_AUDIT")" = PASS
          test "$(jq -r '.atlas_release_id' "$LINK_AUDIT")" = "$ATLAS_RELEASE_ID"
          test "$(jq -r '.row_url_columns' "$LINK_AUDIT")" = 0
          test "$(jq -r '.privacy' "$LINK_AUDIT")" = NO_PERSONAL_DATA
          test ! -e derived/atlas_v9_company_repd_links.parquet

          python3 - <<'PY'
          import json
          import os
          from datetime import datetime, timezone
          from pathlib import Path

          payload = {
              'schema': 'companies.five-hour-key-only-atlas-proof.v1',
              'classification': 'VERIFIED_KEY_ONLY_ATLAS_LINK_CONTRACT',
              'verified_at': datetime.now(timezone.utc).isoformat().replace('+00:00', 'Z'),
              'atlas_release_id': os.environ['ATLAS_RELEASE_ID'],
              'atlas_live_url': os.environ['ATLAS_LIVE_URL'],
              'relationship_columns': ['company_number', 'repd_ref', 'evidence_type'],
              'row_url_columns': 0,
              'raw_archives': 0,
              'personal_data': False,
              'candidate_promotion_eligible': False,
          }
          Path('work/key-only-atlas-proof.json').write_text(
              json.dumps(payload, indent=2, sort_keys=True) + '\n', encoding='utf-8', newline='\n'
          )
          PY

          {
            echo '## Companies key-only Atlas result'
            echo
            echo "- Atlas release: $ATLAS_RELEASE_ID"
            echo '- Relationship columns: company_number, repd_ref, evidence_type'
            echo '- URL columns per relationship row: 0'
            echo '- Raw archives: 0'
            echo '- Personal data: false'
            echo '- Candidate promotion eligible: false'
          } >> "$GITHUB_STEP_SUMMARY"

      - name: Retain key-only proof
        if: always() && steps.window.outputs.active == 'true'
        uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a
        with:
          name: companies-five-hour-key-only-${{ github.run_number }}-${{ github.sha }}
          path: |
            work/key-only-atlas-proof.json
            work/atlas-live-set.json
          if-no-files-found: warn
          retention-days: 90
          compression-level: 0

Verify Workflow

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

automationcompass / .github/workflows/verify.yml · lines 1–20 of 20 · 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 field_execution (repository name word 'compass'): on-road and off-road field navigation to the farm gate (access gates, terrain slope, ground-bearing limits, electrical hazards), as Ventus Ltd describes its SatNav work.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Compass source isolation and replay”; runs Verify Source Pins (`scripts/verify-source-pins.mjs`).
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
compass · .github/workflows · workflow
Uses
Verify Source Pins (workflow run), Heading Test (workflow run), Compass Test (workflow run)
Used by
none found
Produces
none declared
Defines here
Compass source isolation and replay
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
compass@e200c888acbcc7af59d7cc38b29806e90b0a50db .github/workflows/verify.yml:1-20 · blob 23eae1195d8498081ff955907696a1ee4d8df625 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: unknown · effects: process · domain stage: field_execution · users: EPC_contractor, landowner_planner · canonical: unknown
name: Compass source isolation and replay
on:
  push:
  pull_request:
  workflow_dispatch:
permissions:
  contents: read
jobs:
  verify:
    runs-on: ubuntu-24.04
    timeout-minutes: 10
    steps:
      - uses: actions/checkout@11d5960a326750d5838078e36cf38b85af677262
        with:
          persist-credentials: false
      - uses: actions/setup-node@v4
        with:
          node-version: '22'
      - run: node scripts/verify-source-pins.mjs
      - run: node --test upstream/tools/satnav/orientation/heading.test.mjs tests/compass.test.mjs

Verify Source Pins

A JavaScript module in the scripts folder of Compass.

ingestcompass / scripts/verify-source-pins.mjs · lines 1–10 of 10 · Entry point

What it does
It loads data. Uses libraries node:fs, node:crypto. Side effects: reads or writes files.
Why it exists in the grid workflow
Domain stage field_execution (repository name word 'compass'): on-road and off-road field navigation to the farm gate (access gates, terrain slope, ground-bearing limits, electrical hazards), as Ventus Ltd describes its SatNav work.
Inputs & outputs
In: JSON file source-pins.json.
Downstream impact
Used directly by 1 file: Verify Workflow (compass).
What it achieves
Its name says it verifies source pins. It reads `upstream/source-pins.json`.
Why it matters
Run by Verify Workflow.
Application
compass · scripts · JavaScript module
Uses
node:fs, node:crypto
Used by
run by Verify Workflow (workflow run)
Produces
none declared
Defines here
none
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
compass@e200c888acbcc7af59d7cc38b29806e90b0a50db scripts/verify-source-pins.mjs:1-10 · blob c288b31d39ec7df366b57121481dafd7b6e751cb · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem · domain stage: field_execution · users: EPC_contractor, landowner_planner · canonical: unknown
import fs from 'node:fs';
import { createHash } from 'node:crypto';
const pins=JSON.parse(fs.readFileSync('upstream/source-pins.json','utf8'));
for (const p of pins.files) {
 const b=fs.readFileSync(p.local);
 const sha=createHash('sha1').update('blob '+b.length+'\0').update(b).digest('hex');
 if(sha!==p.blob) throw new Error('SOURCE_BLOB_MISMATCH '+p.local+' '+sha+' expected '+p.blob);
 console.log('VERIFIED',p.repo,p.commit,p.path,sha);
}
console.log(pins.files.length+' exact upstream Git blobs verified');