GLOBALGRID2050 / EXPLORE CODE

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

PipelineNews V9 6 2 Complete Equivalence Gate Workflow and 2 more files

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

545 lines of YAML from pipelinenews, in 3 files. Topic: Automation and CI. Section 1848 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. PipelineNews V9 6 2 Complete Equivalence Gate Workflow automation · pipelinenews / .github/workflows/202608290020-v9-6-2-complete-equivalence-gate.yml lines 1–230
  2. PipelineNews Adaptive Controller Contract Gate Workflow automation · pipelinenews / .github/workflows/202608290202-adaptive-controller-contract-gate.yml lines 1–125
  3. PipelineNews Sync Atlas V9 Deep Links Workflow automation · pipelinenews / .github/workflows/202608300232-sync-atlas-v9-deep-links.yml lines 1–190

PipelineNews V9 6 2 Complete Equivalence Gate Workflow

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

automationpipelinenews / .github/workflows/202608290020-v9-6-2-complete-equivalence-gate.yml · lines 1–230 of 230 · version 2026-08-29 00:20 · 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 field_execution (path word 'gate'): 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 202608290020-v9-6-2-complete-equivalence-gate.json; JSON file 202608282200-v8-fast-site-manifest.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
pipelinenews · .github/workflows · workflow
Uses
none found
Used by
none found
Produces
none declared
Defines here
Audit Complete PipelineNews V9.6.2 Equivalence 202608290020
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 .github/workflows/202608290020-v9-6-2-complete-equivalence-gate.yml:1-230 · blob 533b8a6878634ec940dd4be2ec05377b07f5afda · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem, network, process · domain stage: field_execution · users: EPC_contractor, landowner_planner · canonical: production_core
name: Audit Complete PipelineNews V9.6.2 Equivalence 202608290020

on:
  workflow_dispatch:
  push:
    branches: [main]
    paths:
      - ".github/workflows/202608290020-v9-6-2-complete-equivalence-gate.yml"
      - "atman/202608290020-verify-v9-6-2-complete-equivalence.mjs"
      - "manifests/202608290020-v9-6-2-complete-equivalence-gate.json"

permissions:
  contents: read
  actions: read

concurrency:
  group: pipelinenews-main-candidate-build
  cancel-in-progress: false

env:
  GENERATION: "202608290020"
  SOURCE_PARENT: "00737ad782baf84492fc6e8eb43de796198f7a37"
  CANDIDATE_GENERATION: "202608282200"
  CANDIDATE_RUN: "33211041996"
  CANDIDATE_ARTIFACT: "9701586944"
  CANDIDATE_SOURCE: "1cbe1a9b205af3a2cf62bc7f8130f033423dfe1f"
  PREDECESSOR_AUDIT_RUN: "33218336294"
  PREDECESSOR_AUDIT_ARTIFACT: "9704252432"
  PLAYWRIGHT_VERSION: "1.55.0"

jobs:
  complete-equivalence:
    name: Exercise every filter and both pagers at desktop and 390px
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - name: Checkout exact audit source
        uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
        with:
          ref: "${{ github.sha }}"
          fetch-depth: 0
          persist-credentials: false

      - name: Prove exact three-file source-only boundary
        shell: bash
        run: |
          set -euo pipefail
          test "$GITHUB_REF" = "refs/heads/main"
          test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
          test "$(git rev-parse HEAD^)" = "$SOURCE_PARENT"
          test "$(git rev-list --count "$SOURCE_PARENT..HEAD")" = 1
          git diff --name-only "$SOURCE_PARENT" HEAD | LC_ALL=C sort > /tmp/actual
          printf '%s\n' \
            ".github/workflows/$GENERATION-v9-6-2-complete-equivalence-gate.yml" \
            "atman/$GENERATION-verify-v9-6-2-complete-equivalence.mjs" \
            "manifests/$GENERATION-v9-6-2-complete-equivalence-gate.json" \
            | LC_ALL=C sort > /tmp/expected
          diff -u /tmp/expected /tmp/actual
          git diff --quiet "$SOURCE_PARENT" HEAD -- releases/ state/ archive/ build/ data/ ui/ index/ .github/workflows/pages.yml
          ! grep -Eq 'deploy[-]pages|upload[-]pages-artifact|pages: [w]rite|id-token: [w]rite|actions: [w]rite|git[ ]push' \
            ".github/workflows/$GENERATION-v9-6-2-complete-equivalence-gate.yml"
          node --check "atman/$GENERATION-verify-v9-6-2-complete-equivalence.mjs"
          jq -e \
            '.source_parent_commit=="00737ad782baf84492fc6e8eb43de796198f7a37"
             and .candidate.generation=="202608282200"
             and .prior_equivalence_evidence.disposition=="GREEN_INCOMPLETE_NOT_PROMOTION_ELIGIBLE"
             and .publication.current_pointer_may_change==false
             and .publication.pages_may_change==false
             and .publication.catalogue_may_change==false' \
            "manifests/$GENERATION-v9-6-2-complete-equivalence-gate.json"

      - name: Pin Node runtime
        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
        with:
          node-version: "22"

      - name: Verify pinned run and artifact identities
        shell: bash
        env:
          GITHUB_TOKEN: "${{ github.token }}"
        run: |
          set -euo pipefail
          api() {
            curl --fail --silent --show-error --location \
              --header "Authorization: Bearer $GITHUB_TOKEN" \
              --header "X-GitHub-Api-Version: 2022-11-28" "$1"
          }
          api "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/runs/$CANDIDATE_RUN" > /tmp/candidate-run.json
          jq -e \
            '.id==33211041996
             and .status=="completed"
             and .conclusion=="success"
             and .head_sha=="1cbe1a9b205af3a2cf62bc7f8130f033423dfe1f"
             and .path==".github/workflows/202608282200-federated-relationship-candidate.yml"' \
            /tmp/candidate-run.json
          api "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/artifacts/$CANDIDATE_ARTIFACT" > /tmp/candidate-artifact.json
          jq -e \
            '.id==9701586944
             and .size_in_bytes==37659
             and .digest=="sha256:8ec24ba18c70b661ddfc6ff9ca4bb728db5929d5700c147c91449f5e93e9b497"
             and .workflow_run.id==33211041996
             and .workflow_run.head_sha=="1cbe1a9b205af3a2cf62bc7f8130f033423dfe1f"
             and .expired==false' \
            /tmp/candidate-artifact.json
          api "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/runs/$PREDECESSOR_AUDIT_RUN" > /tmp/predecessor-run.json
          jq -e \
            '.id==33218336294
             and .status=="completed"
             and .conclusion=="success"
             and .head_sha=="00737ad782baf84492fc6e8eb43de796198f7a37"' \
            /tmp/predecessor-run.json
          api "$GITHUB_API_URL/repos/$GITHUB_REPOSITORY/actions/artifacts/$PREDECESSOR_AUDIT_ARTIFACT" > /tmp/predecessor-artifact.json
          jq -e \
            '.id==9704252432
             and .size_in_bytes==2814
             and .digest=="sha256:18c9ee17c96b9330496306c2a33110c8b820c29e1c913b1287e0d3ce8690d61c"
             and .workflow_run.id==33218336294
             and .workflow_run.head_sha=="00737ad782baf84492fc6e8eb43de796198f7a37"
             and .expired==false' \
            /tmp/predecessor-artifact.json

      - name: Download exact immutable repaired candidate
        uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
        with:
          artifact-ids: 9701586944
          path: candidate
          repository: Ventusltd/pipelinenews
          run-id: 33211041996
          github-token: "${{ github.token }}"

      - name: Independently verify candidate closure and build local overlay
        shell: bash
        run: |
          set -euo pipefail
          python - <<'PY'
          import hashlib
          import json
          from pathlib import Path

          root = Path("candidate")
          manifest_path = root / "build/202608282200-v8-fast-site-manifest.json"
          manifest = json.loads(manifest_path.read_text(encoding="utf-8"))
          assert manifest["generation"] == "202608282200"
          assert manifest["source_commit"] == "1cbe1a9b205af3a2cf62bc7f8130f033423dfe1f"
          assert manifest["github_run_id"] == "33211041996"
          assert manifest["canonical_product"] == {
              "projects": 7680,
              "capacity_mw": 356474.09,
              "headlines": 136,
              "rows_per_page": 100,
              "table_columns": 11,
          }
          expected = sorted([item["path"] for item in manifest["outputs"]] + [str(manifest_path.relative_to(root))])
          actual = sorted(str(path.relative_to(root)) for path in root.rglob("*") if path.is_file())
          assert actual == expected
          assert len(actual) == 8 and len(manifest["outputs"]) == 7
          for item in manifest["outputs"]:
              raw = (root / item["path"]).read_bytes()
              assert len(raw) == item["bytes"]
              assert hashlib.sha256(raw).hexdigest() == item["sha256"]
          assert manifest["relationship_governance_status"]["rows"] == 3
          assert manifest["relationship_governance_status"]["project_bindings"] == 0
          assert manifest["state"] == {
              "candidate": "ARTIFACT_ONLY",
              "current_pointer_changed": False,
              "pages_changed": False,
              "globalgrid_catalogue_changed": False,
              "promotion_eligible": False,
          }
          PY
          mkdir -p "$RUNNER_TEMP/site" "$RUNNER_TEMP/evidence"
          rsync -a --exclude .git ./ "$RUNNER_TEMP/site/"
          rsync -a candidate/ "$RUNNER_TEMP/site/"

      - name: Install pinned browser engine
        run: |
          npm install --no-save --ignore-scripts "playwright@$PLAYWRIGHT_VERSION"
          test "$(node -p "require('playwright/package.json').version")" = "$PLAYWRIGHT_VERSION"
          npx playwright install --with-deps chromium

      - name: Run complete interaction equivalence gate
        id: browser
        continue-on-error: true
        shell: bash
        run: |
          set -euo pipefail
          python3 -m http.server 4173 --bind 127.0.0.1 --directory "$RUNNER_TEMP/site" \
            > "$RUNNER_TEMP/evidence/http.log" 2>&1 &
          server=$!
          trap 'kill "$server" 2>/dev/null || true' EXIT
          for n in $(seq 1 30); do
            curl --fail --silent \
              http://127.0.0.1:4173/releases/202608282200-v8-fast-candidate.html \
              >/dev/null && break
            sleep 1
          done
          node "atman/$GENERATION-verify-v9-6-2-complete-equivalence.mjs" \
            --candidate http://127.0.0.1:4173/releases/202608282200-v8-fast-candidate.html \
            --baseline http://127.0.0.1:4173/releases/202608261927-index.html \
            --report "$RUNNER_TEMP/evidence/$GENERATION-complete-equivalence.json"

      - name: Upload structured complete-equivalence evidence
        if: always()
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
        with:
          name: pipelinenews-v9-6-2-complete-equivalence-${{ github.run_id }}
          path: ${{ runner.temp }}/evidence
          if-no-files-found: error
          retention-days: 30

      - name: Enforce complete promotion gate
        if: always()
        shell: bash
        run: |
          set -euo pipefail
          test -f "$RUNNER_TEMP/evidence/$GENERATION-complete-equivalence.json"
          jq -e \
            '.promotion_eligible==true
             and .summary.failed==0
             and (.complete_matrix.technologies|length)==5
             and (.complete_matrix.statuses|length)==5
             and (.complete_matrix.news_modes|length)==11
             and .complete_matrix.project_pagination==true
             and .complete_matrix.news_pagination==true
             and .state.candidate=="ARTIFACT_ONLY"
             and .state.current_pointer_changed==false
             and .state.pages_changed==false
             and .state.catalogue_changed==false' \
            "$RUNNER_TEMP/evidence/$GENERATION-complete-equivalence.json"

PipelineNews Adaptive Controller Contract Gate Workflow

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

automationpipelinenews / .github/workflows/202608290202-adaptive-controller-contract-gate.yml · lines 1–125 of 125 · version 2026-08-29 02:02 · Entry point

What it does
It runs automated jobs on GitHub Actions. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain stage field_execution (path word 'gate'): 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 202608290202-adaptive-build-controller.json.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Named “Verify PipelineNews Merged Adaptive Controller Contract”.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
pipelinenews · .github/workflows · workflow
Uses
Verify Adaptive Build Controller (workflow run)
Used by
none found
Produces
none declared
Defines here
Verify PipelineNews Merged Adaptive Controller Contract 202608290202
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 .github/workflows/202608290202-adaptive-controller-contract-gate.yml:1-125 · blob d03cfa385aa5f12e72db19454aaaaf6821c234ec · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: filesystem, process · domain stage: field_execution · users: EPC_contractor, landowner_planner · canonical: production_core
name: Verify PipelineNews Merged Adaptive Controller Contract 202608290202

on:
  workflow_dispatch:
  push:
    branches: [main]
    paths:
      - ".github/workflows/202608290202-adaptive-controller-contract-gate.yml"
      - "atman/202608290202-verify-adaptive-build-controller.mjs"
      - "manifests/202608290202-adaptive-build-controller-prompt.md"
      - "manifests/202608290202-adaptive-build-controller.json"

permissions:
  contents: read
  actions: read

concurrency:
  group: pipelinenews-adaptive-controller-contract
  cancel-in-progress: false

env:
  GENERATION: "202608290202"
  SOURCE_PARENT: "79fc7576c76e60f5695a26bc5220854b1e023b9f"
  MANIFEST: "manifests/202608290202-adaptive-build-controller.json"
  SCRIPT: "atman/202608290202-verify-adaptive-build-controller.mjs"

jobs:
  verify-contract:
    name: Prove exact mission, timer, milestone and recovery contract
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    timeout-minutes: 5
    steps:
      - name: Checkout exact controller source
        uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
        with:
          ref: "${{ github.sha }}"
          fetch-depth: 0
          persist-credentials: false

      - name: Configure pinned Node runtime
        uses: actions/setup-node@a0853c24544627f65ddf259abe73b1d18a591444
        with:
          node-version: "22"

      - name: Prove exact four-file timestamped source boundary
        shell: bash
        run: |
          set -euo pipefail
          test "$GITHUB_REF" = "refs/heads/main"
          test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
          test "$(git rev-parse HEAD^)" = "$SOURCE_PARENT"
          test "$(git rev-list --count "$SOURCE_PARENT..HEAD")" = "1"
          git diff --name-only "$SOURCE_PARENT" HEAD | LC_ALL=C sort > /tmp/actual-controller-source
          printf '%s\n' \
            ".github/workflows/$GENERATION-adaptive-controller-contract-gate.yml" \
            "$SCRIPT" \
            "manifests/$GENERATION-adaptive-build-controller-prompt.md" \
            "$MANIFEST" \
            | LC_ALL=C sort > /tmp/expected-controller-source
          diff -u /tmp/expected-controller-source /tmp/actual-controller-source
          git diff --quiet "$SOURCE_PARENT" HEAD -- \
            releases/ state/ archive/ build/ data/ index/ ui/ \
            .github/workflows/pages.yml .github/DEPLOYMENT_POLICY.md README.md
          node --check "$SCRIPT"
          node --input-type=module <<'NODE'
          import assert from "node:assert/strict";
          import { readFile } from "node:fs/promises";
          const generation = process.env.GENERATION;
          const sources = await Promise.all([
            readFile(`.github/workflows/${generation}-adaptive-controller-contract-gate.yml`, "utf8"),
            readFile(process.env.SCRIPT, "utf8"),
          ]);
          const combined = sources.join("\n");
          const forbidden = [
            "sch" + "edule:", "cr" + "on:", "workflow" + "_run:",
            "deploy" + "-pages", "upload" + "-pages-artifact",
            "pages:" + " write", "id-token:" + " write",
            "contents:" + " write", "actions:" + " write",
            "git" + " push", "update" + "-ref",
          ];
          for (const token of forbidden) assert.equal(combined.includes(token), false, `forbidden authority: ${token}`);
          NODE

      - name: Verify exact contract, prompts, heads, runs and artifacts
        env:
          GITHUB_TOKEN: "${{ github.token }}"
        run: |
          set -euo pipefail
          mkdir -p "$RUNNER_TEMP/controller-evidence"
          node "$SCRIPT" \
            --manifest "$MANIFEST" \
            --report "$RUNNER_TEMP/controller-evidence/$GENERATION-controller-deployment.json"

      - name: Upload immutable deployment evidence
        if: always()
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
        with:
          name: pipelinenews-adaptive-controller-contract-${{ github.run_id }}
          path: ${{ runner.temp }}/controller-evidence/
          if-no-files-found: error
          retention-days: 30

      - name: Enforce deployed merged-controller source
        if: always()
        shell: bash
        run: |
          set -euo pipefail
          report="$RUNNER_TEMP/controller-evidence/$GENERATION-controller-deployment.json"
          test -f "$report"
          jq -e \
            '.github_contract_source_deployed==true
             and .chatgpt_controller_adoption_attested==false
             and .contract_valid==true
             and .remote.baton.candidate.verdict=="MATCH"
             and .remote.baton.equivalence.verdict=="MATCH"
             and .legacy_pointer.verdict=="UNCHANGED"
             and .publication_state.candidate=="ACTIONS_ARTIFACT_ONLY"
             and .publication_state.state_live_set_present==false
             and .publication_state.pages_changed_by_this_read_only_workflow==false
             and .publication_state.globalgrid_catalogue_changed_by_this_read_only_workflow==false
             and .verified_through=="M00"
             and .earliest_unmet_milestone=="M01"
             and .github_workflow_role=="IMMUTABLE_CONTRACT_GATE_NOT_A_SECOND_TIMER"' \
            "$report"

PipelineNews Sync Atlas V9 Deep Links Workflow

A GitHub Actions workflow. Runs on push, on a schedule and by hand.

automationpipelinenews / .github/workflows/202608300232-sync-atlas-v9-deep-links.yml · lines 1–190 of 190 · version 2026-08-30 02:32 · Entry point

What it does
It runs solar. Side effects: changes the web page (DOM); reads or writes files; 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. Domain terms in the code: solar.
Inputs & outputs
In: JSON file live-set.json; JSON file pipelinenews-atlas-v9-result.json; JSON file atlas-v9-deep-link-audit.json; JSON file atlas-v9-current.json. 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 “Five-hour PipelineNews Atlas V9 source sync”; runs PipelineNews Sync Atlas V9 Deep Links (`scripts/202608300232-sync-atlas-v9-deep-links.py`).
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
pipelinenews · .github/workflows · workflow
Uses
PipelineNews Sync Atlas V9 Deep Links (workflow run), UI Atlas V9 Deep Links (workflow run)
Used by
none found
Produces
none declared
Defines here
202608300440 Five-hour PipelineNews Atlas V9 source sync
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
pipelinenews@45c944c8640a9d7ae65edb51d66032ba204f3f46 .github/workflows/202608300232-sync-atlas-v9-deep-links.yml:1-190 · blob 6f0c3ca96b33aaec97085cf3d58250983c36cc4a · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom, filesystem, process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
name: 202608300440 Five-hour PipelineNews Atlas V9 source sync
run-name: Bind PipelineNews sources to verified Atlas V9 ${{ github.run_number }}

on:
  push:
    branches: [main]
    paths:
      - 'scripts/202608300232-sync-atlas-v9-deep-links.py'
      - '.github/workflows/202608300232-sync-atlas-v9-deep-links.yml'
  workflow_dispatch:
  schedule:
    - cron: '20 4-8 30 8 *'

permissions:
  contents: write

concurrency:
  group: pipelinenews-five-hour-atlas-v9-source-sync
  cancel-in-progress: false

env:
  PYTHONDONTWRITEBYTECODE: '1'
  MISSION_INCEPTED_AT: '2026-08-30T03:40:00Z'
  MISSION_EXPIRES_AT: '2026-08-30T08:35:00Z'
  MINIMUM_ATLAS_GENERATION: '202608300453'

jobs:
  sync:
    name: Patch mutable sources from verified GridAtlas and prove canonical identity
    runs-on: ubuntu-24.04
    timeout-minutes: 12
    steps:
      - name: Enforce bounded five-hour mission window
        id: window
        run: |
          set -euo pipefail
          now="$(date -u +%s)"
          expires="$(date -u -d "$MISSION_EXPIRES_AT" +%s)"
          if (( now > expires )); then
            echo 'active=false' >> "$GITHUB_OUTPUT"
            echo "PipelineNews five-hour source-sync mission retired at $MISSION_EXPIRES_AT; no mutation." >> "$GITHUB_STEP_SUMMARY"
            exit 0
          fi
          echo 'active=true' >> "$GITHUB_OUTPUT"

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

      - name: Require exact current main and validate synchroniser
        if: steps.window.outputs.active == 'true'
        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"
          python3 - <<'PY'
          from pathlib import Path
          path = Path('scripts/202608300232-sync-atlas-v9-deep-links.py')
          compile(path.read_text(encoding='utf-8'), str(path), 'exec')
          PY
          test -z "$(find scripts -type d -name __pycache__ -print -quit)"

      - name: Fetch governed GridAtlas source of truth
        if: steps.window.outputs.active == 'true'
        run: |
          set -euo pipefail
          rm -rf "$RUNNER_TEMP/gridatlas"
          git clone --depth 1 https://github.com/Ventusltd/gridatlas.git "$RUNNER_TEMP/gridatlas"
          state="$RUNNER_TEMP/gridatlas/state/live-set.json"
          python3 -m json.tool "$state" >/dev/null
          generation="$(jq -r '.generation // empty' "$state")"
          [[ "$generation" =~ ^[0-9]{12}$ ]]
          (( 10#$generation >= 10#$MINIMUM_ATLAS_GENERATION ))
          test "$(jq -r '.verification.promotion_eligible // false' "$state")" = true
          test "$(jq -r '.verification.failed_gates // 999' "$state")" = 0
          test "$(jq -r '.verification.commit_lineage_attested // false' "$state")" = true
          test "$(jq -r '.verification.exact_repd_deep_link_resolved // false' "$state")" = true
          test "$(jq -r '.verification.exact_repd_fly_to // false' "$state")" = true
          test "$(jq -r '.current.deep_link_receiver.identity_rule // empty' "$state")" = EXACT_REPD_REF_ONLY
          test "$(jq -r '.current.deep_link_receiver.synthetic_receiver' "$state")" = false

      - name: Synchronise canonical Atlas V9 deep links
        if: steps.window.outputs.active == 'true'
        id: sync
        run: |
          set -euo pipefail
          python3 scripts/202608300232-sync-atlas-v9-deep-links.py \
            --gridatlas "$RUNNER_TEMP/gridatlas" \
            --repo-root . \
            | tee "$RUNNER_TEMP/pipelinenews-atlas-v9-result.json"
          if test -f state/atlas-v9-current.json; then
            echo "ready=true" >> "$GITHUB_OUTPUT"
            echo "release_id=$(jq -r .release_id state/atlas-v9-current.json)" >> "$GITHUB_OUTPUT"
            echo "base_url=$(jq -r .base_url state/atlas-v9-current.json)" >> "$GITHUB_OUTPUT"
          else
            echo "ready=false" >> "$GITHUB_OUTPUT"
          fi

      - name: Prove bounded mutation, sentinels and immutable boundary
        if: steps.sync.outputs.ready == 'true'
        run: |
          set -euo pipefail
          node --check ui/atlas-v9-deep-links.js
          test "$(jq -r .classification reports/atlas-v9-deep-link-audit.json)" = CANONICAL_DEEP_LINKS_READY
          test "$(jq -r .immutable_releases_modified reports/atlas-v9-deep-link-audit.json)" = 0
          test "$(jq -r .privacy reports/atlas-v9-deep-link-audit.json)" = NO_PERSONAL_DATA
          test "$(jq -r .globalgrid_mirror_verified reports/atlas-v9-deep-link-audit.json)" = false
          test "$(jq '.sentinels | length' reports/atlas-v9-deep-link-audit.json)" = 2
          jq -e '.sentinels[] | select(.repd_ref == "13599" and .technology == "solar")' reports/atlas-v9-deep-link-audit.json >/dev/null
          jq -e '.sentinels[] | select(.repd_ref == "17494" and .technology == "solar")' reports/atlas-v9-deep-link-audit.json >/dev/null
          python3 - <<'PY'
          import json
          import subprocess
          from pathlib import Path

          audit = json.loads(Path('reports/atlas-v9-deep-link-audit.json').read_text(encoding='utf-8'))
          allowed = {
              'state/atlas-v9-current.json',
              'reports/atlas-v9-deep-link-audit.json',
              'ui/atlas-v9-deep-links.js',
              *audit['files_rewritten'],
          }
          changed = subprocess.check_output(
              ['git', 'status', '--porcelain=v1', '--untracked-files=all'], text=True
          ).splitlines()
          for line in changed:
              path = line[3:]
              if ' -> ' in path:
                  path = path.split(' -> ', 1)[1]
              assert path in allowed, f'unexpected deep-link mutation: {path}'
              first = Path(path).parts[0]
              assert not (len(first) >= 12 and first[:12].isdigit()), f'immutable timestamped release changed: {path}'
          PY
          test -z "$(find . -type d -name __pycache__ -print -quit)"
          git diff --check

      - name: Verify Atlas sentinel URLs by public readback
        if: steps.sync.outputs.ready == 'true'
        run: |
          set -euo pipefail
          while IFS= read -r url; do
            effective="$(curl --fail --location --silent --show-error --output /dev/null --write-out '%{url_effective}' "$url")"
            test "$effective" = "$url"
          done < <(jq -r '.sentinels[].atlas_v9_url' reports/atlas-v9-deep-link-audit.json)

      - name: Compare-and-swap source integration onto main
        if: steps.sync.outputs.ready == 'true'
        id: commit
        run: |
          set -euo pipefail
          if test -z "$(git status --porcelain)"; then
            echo "changed=false" >> "$GITHUB_OUTPUT"
            echo "commit=$GITHUB_SHA" >> "$GITHUB_OUTPUT"
            exit 0
          fi
          git fetch --no-tags origin main:refs/remotes/origin/main
          test "$(git rev-parse origin/main)" = "$GITHUB_SHA"
          git add -A
          git config user.name pipelinenews-atlas-link-bot
          git config user.email actions@users.noreply.github.com
          git commit -m "${{ steps.sync.outputs.release_id }}: bind PipelineNews sources to verified Atlas V9"
          commit="$(git rev-parse HEAD)"
          git push origin HEAD:main
          echo "changed=true" >> "$GITHUB_OUTPUT"
          echo "commit=$commit" >> "$GITHUB_OUTPUT"

      - name: Record milestone summary
        if: always()
        run: |
          {
            echo '## PipelineNews → Atlas V9'
            echo
            echo "- Mission active: ${{ steps.window.outputs.active || 'false' }}"
            echo "- Ready: ${{ steps.sync.outputs.ready || 'false' }}"
            echo "- Minimum Atlas generation: $MINIMUM_ATLAS_GENERATION"
            echo "- Atlas release: ${{ steps.sync.outputs.release_id || 'waiting' }}"
            echo "- Atlas base: ${{ steps.sync.outputs.base_url || 'waiting for verified GridAtlas' }}"
            echo "- Integration commit: ${{ steps.commit.outputs.commit || 'no change' }}"
            if test -f reports/atlas-v9-deep-link-audit.json; then
              echo "- Replacements: $(jq -r .replacement_count reports/atlas-v9-deep-link-audit.json)"
              echo "- Files rewritten: $(jq -r '.files_rewritten | length' reports/atlas-v9-deep-link-audit.json)"
              echo "- Immutable releases modified: $(jq -r .immutable_releases_modified reports/atlas-v9-deep-link-audit.json)"
            fi
          } >> "$GITHUB_STEP_SUMMARY"