GLOBALGRID2050 / EXPLORE CODE

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

PipelineNews Sector Intelligence Candidate Workflow and 1 more file

A GitHub Actions workflow that builds and publishes the site. Runs on push and by hand.

700 lines of YAML from pipelinenews, in 2 files. Topic: Automation and CI. Section 1853 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 Build Intelligence Release Workflow automation · pipelinenews / .github/workflows/202608311458-build-intelligence-release.yml lines 1–258
  2. PipelineNews Sector Intelligence Candidate Workflow automation · pipelinenews / .github/workflows/202609010719-sector-intelligence-candidate.yml lines 1–442

PipelineNews Build Intelligence Release Workflow

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

automationpipelinenews / .github/workflows/202608311458-build-intelligence-release.yml · lines 1–258 of 258 · version 2026-08-31 14:58 · 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 upstream_foresight (repository name word 'pipelinenews'): 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 202608291447-registry.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
Build the next timestamped PipelineNews release in CI.
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
Release Builder (workflow run), Render Proof (workflow run), Sector Render Proof (workflow run), Surface Truth Proof (workflow run)
Used by
none found
Produces
none declared
Defines here
Build intelligence release
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/202608311458-build-intelligence-release.yml:1-258 · blob 17cfeec34626d2db6c1a5e9816779f65af9856a6 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: filesystem, process · domain stage: upstream_foresight · users: IPP_developer, ICP_grid_engineer · canonical: production_core
# Build the next timestamped PipelineNews release in CI.
#
#   1. scan this repo with cvaa (Coding Vaccines Against Amnesia) and record it
#   2. stamp a generation from `date -u` at the moment of creation
#   3. build a new immutable release from the chosen parent, adding one
#      discovery cartridge to the UI
#   4. prove it: registered deep-link selfTest, project and sector render
#      proofs, release integrity, and cartridge verifiers
#   5. commit and push the release, and nothing else
#
# Nothing is edited in place. The parent release is asserted byte-for-byte
# unchanged before the run is allowed to commit. If the result is wrong, run
# this again with an earlier `parent` — that is the rollback.
#
# Manual dispatch only. No cron: a schedule pinned to a calendar day is what
# cvaa's no-time-based-gates vaccine exists to catch, and an unattended job that
# pushes to main is not something this repository should grow by accident.

name: Build intelligence release

on:
  workflow_dispatch:
    inputs:
      parent:
        description: Parent release to build from (blank = newest)
        required: false
        default: ''
        type: string
      cartridge:
        description: Cartridge package under tools/intelligence/cartridges
        required: false
        default: 'project-intelligence'
        type: string
      atlas_target:
        description: >-
          Which atlas the MAP links point at. legacy = repd_grid_atlasv8, the
          v8 app whose deep link works today. ported = /gridatlas/atlas/, the
          v9 app, whose deep link is NOT confirmed working.
        required: false
        default: 'legacy'
        type: choice
        options: [legacy, ported]
      cvaa_blocking:
        description: Fail the build if cvaa reports findings
        required: false
        default: false
        type: boolean
      push:
        description: Commit and push the release (off = build and prove only)
        required: false
        default: true
        type: boolean

permissions:
  contents: write

concurrency:
  group: pipelinenews-intelligence-release
  cancel-in-progress: false

jobs:
  build:
    runs-on: ubuntu-24.04
    timeout-minutes: 25
    steps:
      - name: Checkout pipelinenews
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
        with:
          fetch-depth: 0

      - name: Checkout cvaa
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683
        with:
          repository: Ventusltd/cvaa
          path: .cvaa
          fetch-depth: 0
        continue-on-error: true

      # cvaa's antibody runner passes --experimental-permission, which Node 23
      # renamed to --permission and Node 24 rejects outright as a bad option.
      # Every antibody then exits before printing, and cvaa reports "antibody
      # produced no result" for all 24 while exiting 1. Pin 22 until the runner
      # is updated; this is a workaround, not a fix.
      - name: Node 22 for cvaa
        uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
        with:
          node-version: '22'

      - name: Scan this repository with cvaa
        id: cvaa
        continue-on-error: true
        run: |
          set -uo pipefail
          if [ ! -f .cvaa/inoculate.mjs ]; then
            echo "cvaa unavailable; skipping scan" | tee cvaa-report.txt
            echo "status=unavailable" >> "$GITHUB_OUTPUT"
            exit 0
          fi
          node .cvaa/inoculate.mjs . 2>&1 | tee cvaa-report.txt
          code=${PIPESTATUS[0]}
          echo "status=$code" >> "$GITHUB_OUTPUT"
          {
            echo "## cvaa scan"
            echo '```'
            tail -n 60 cvaa-report.txt
            echo '```'
          } >> "$GITHUB_STEP_SUMMARY"
          exit 0

      - name: Enforce cvaa result
        if: ${{ inputs.cvaa_blocking && steps.cvaa.outputs.status != '0' }}
        run: |
          echo "cvaa reported findings and cvaa_blocking is on."
          exit 1

      - name: Node 24 for the release proofs
        uses: actions/setup-node@1d0ff469b7ec7b3cb9d8673fde0c81c44821de2a
        with:
          node-version: '24'

      - uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065
        with:
          python-version: '3.12'
      # No pip install. The builder and every verifier are pure stdlib, so this
      # job cannot fail for a reason unrelated to the release it is building.

      - name: Stamp the generation from the clock
        id: gen
        run: |
          set -euo pipefail
          GEN="$(date -u +%Y%m%d%H%M)"
          PARENT="${{ inputs.parent }}"
          if [ -z "$PARENT" ]; then
            PARENT="$(ls -1 releases | grep -E '^[0-9]{12}-pipelinenews$' | sort | tail -1)"
          fi
          test -d "releases/$PARENT"
          echo "gen=$GEN"          >> "$GITHUB_OUTPUT"
          echo "parent=$PARENT"    >> "$GITHUB_OUTPUT"
          echo "release=$GEN-pipelinenews" >> "$GITHUB_OUTPUT"
          echo "Generation $GEN from parent $PARENT"

      - name: Build the release
        run: |
          set -euo pipefail
          python tools/intelligence/release_builder.py \
            --from "${{ steps.gen.outputs.parent }}" \
            --cartridge "${{ inputs.cartridge }}" \
            --atlas-target "${{ inputs.atlas_target }}" \
            --gen "${{ steps.gen.outputs.gen }}"

      - name: Verify release integrity
        run: python tools/intelligence/release_builder.py --check "${{ steps.gen.outputs.release }}"

      - name: Parent release must be untouched
        run: |
          set -euo pipefail
          if ! git diff --quiet -- "releases/${{ steps.gen.outputs.parent }}"; then
            echo "the parent release changed; that must never happen"
            git --no-pager diff --stat -- "releases/${{ steps.gen.outputs.parent }}"
            exit 1
          fi
          echo "parent ${{ steps.gen.outputs.parent }} unchanged"

      - name: Registered deep-link selfTest
        run: |
          set -euo pipefail
          RELEASE="${{ steps.gen.outputs.release }}" node --input-type=module <<'NODE'
          import { readFile } from 'node:fs/promises';
          import { pathToFileURL } from 'node:url';
          import { resolve } from 'node:path';
          const root = resolve('releases', process.env.RELEASE);
          const registry = JSON.parse(await readFile(resolve(root, 'data/202608291447-registry.json')));
          const entry = registry.supplemental_assets?.atlas_live_handoff;
          if (!entry?.cartridge?.path) throw new Error('registered Atlas handoff is missing');
          const module = await import(pathToFileURL(resolve(root, entry.cartridge.path)));
          const result = module.selfTest();
          for (const check of result.checks) {
            if (!check.ok) console.log('FAIL', check.name, check.detail || '');
          }
          console.log(`${result.checks.length} checks, ${result.checks.filter((check) => !check.ok).length} failed, target ${result.target}`);
          process.exit(result.ok ? 0 : 1);
          NODE

      - name: Project Intelligence render proof — every tab must render
        run: node tools/intelligence/render_proof.mjs "${{ steps.gen.outputs.release }}"

      - name: Sector Intelligence render proof — evidenced topic must open
        run: node tools/intelligence/sector_render_proof.mjs "${{ steps.gen.outputs.release }}"

      - name: Visible-surface truth proof
        run: node tools/intelligence/surface_truth_proof.mjs "${{ steps.gen.outputs.release }}"

      - name: Cartridge verifiers
        run: |
          set -euo pipefail
          export RELEASE="${{ steps.gen.outputs.release }}"
          CARTRIDGE_MJS="$(node --input-type=module <<'NODE'
          import { readFile } from 'node:fs/promises';
          const root = `releases/${process.env.RELEASE}`;
          const registry = JSON.parse(await readFile(`${root}/data/202608291447-registry.json`));
          const path = registry.supplemental_assets?.atlas_live_handoff?.cartridge?.path;
          if (!path) throw new Error('registered Atlas handoff is missing');
          console.log(`${root}/${path}`);
          NODE
          )"
          export CARTRIDGE_MJS
          cd tools/intelligence
          python v6_deep_link_cartridge.py
          python v8_neutral_surface.py "../../releases/${{ steps.gen.outputs.release }}"

      - name: Publish the release
        if: ${{ inputs.push }}
        env:
          GEN: ${{ steps.gen.outputs.gen }}
          PARENT: ${{ steps.gen.outputs.parent }}
          RELEASE: ${{ steps.gen.outputs.release }}
          TARGET: ${{ inputs.atlas_target }}
        run: |
          set -euo pipefail
          git config user.name  "github-actions[bot]"
          git config user.email "41898282+github-actions[bot]@users.noreply.github.com"
          # Exactly one release folder per commit: the Pages workflow stages a
          # release only when precisely one changed, and falls back to the
          # pointer otherwise.
          git add "releases/${RELEASE}"
          git commit -m "${GEN}: intelligence release from ${PARENT}

          Additive panel plus repaired map deep link. Atlas target: ${TARGET}.
          Parent asserted byte-for-byte unchanged.

          Proofs: registered deep-link selfTest, project and sector render
          proofs, release integrity, cartridge verifiers, neutral-surface check."
          git push origin HEAD:main

      - name: Summary
        if: always()
        run: |
          {
            echo "## ${{ steps.gen.outputs.release }}"
            echo ""
            echo "| | |"
            echo "|---|---|"
            echo "| parent | \`${{ steps.gen.outputs.parent }}\` |"
            echo "| cartridge | \`${{ inputs.cartridge }}\` |"
            echo "| atlas target | \`${{ inputs.atlas_target }}\` |"
            echo "| cvaa exit | \`${{ steps.cvaa.outputs.status }}\` |"
            echo "| pushed | \`${{ inputs.push }}\` |"
            echo ""
            echo "Rollback is a rebuild: run this again with an earlier \`parent\`."
          } >> "$GITHUB_STEP_SUMMARY"

      - name: Upload the built release
        if: always()
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
        with:
          name: ${{ steps.gen.outputs.release }}
          path: releases/${{ steps.gen.outputs.release }}
          retention-days: 30

PipelineNews Sector Intelligence Candidate Workflow

A GitHub Actions workflow that builds and publishes the site. Runs on push and by hand.

automationpipelinenews / .github/workflows/202609010719-sector-intelligence-candidate.yml · lines 1–442 of 678 · version 2026-09-01 07:19 · Entry point

What it does
It builds and publishes its content. 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 (repository name word 'pipelinenews'): 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 202609010719-sector-intelligence-contract.json; JSON file 202609010719-sector-intelligence-rss.json; JSON file 202609010719-sector-intelligence-candidate.json; JSON file 202608271524-fd2212a8c76d-v8-fast-news.json; JSON file gated-a.json; JSON file gated-b.json; JSON file ledger-a.json; JSON file ledger-b.json. Out: JSON file source-scope-proof.json; JSON file sector-overlay-proof.json; GitHub Pages deployment; commits pushed to the repository.
Downstream impact
It is itself an entry point (workflow); no other file was found loading it.
What it achieves
Publishes to GitHub Pages.
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
JavaScript Sector Ledger Relevance Gate (workflow run)
Used by
none found
Produces
none declared
Defines here
Build PipelineNews Sector Intelligence Candidate 202609010719
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/202609010719-sector-intelligence-candidate.yml:1-442 · blob 11a2b45229e59a34430d64fed3f38ed019c5a548 · 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: production_core
name: Build PipelineNews Sector Intelligence Candidate 202609010719

on:
  workflow_dispatch:
  push:
    branches: [main]
    paths:
      - ".github/workflows/202609010719-sector-intelligence-candidate.yml"
      - "build/javascript/202609010719-verify-v8-fast-browser.mjs"
      - "build/python/202609010719-build-sector-intelligence-parquet.py"
      - "data/news-discovery/202609010719-sector-intelligence-contract.json"
      - "discovery/fixtures/202609010719-sector-intelligence-rss.json"
      - "discovery/javascript/202609010719-sector-intelligence-runner.mjs"
      - "index/202609010719-compile-v8-sector-intelligence.mjs"
      - "manifests/202609010719-sector-intelligence-candidate.json"
      - "ui/cartridges/202609010719-sector-intelligence.mjs"

permissions:
  contents: read

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

env:
  SECTOR_GENERATION: "202609010719"
  SECTOR_SOURCE_PARENT: "acc1309529177fbf1d7f4df2e8995c228202cb78"
  SECTOR_PARENT_GENERATION: "202609010719"
  SECTOR_WORK_ROOT: "work/202609010719-sector-intelligence"
  DUCKDB_VERSION: "1.3.2"
  PLAYWRIGHT_VERSION: "1.55.0"

jobs:
  build:
    name: Collect, write-audit-publish and compile twice
    if: github.ref == 'refs/heads/main'
    runs-on: ubuntu-latest
    timeout-minutes: 25
    steps:
      - name: Checkout exact source
        uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
        with:
          ref: ${{ github.sha }}
          fetch-depth: 0
          persist-credentials: false

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

      - name: Configure Python
        uses: actions/setup-python@e797f83bcb11b83ae66e0230d6156d7c80228e7c
        with:
          python-version: "3.12"

      - name: Prove exact nine-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^)" = "$SECTOR_SOURCE_PARENT"
          test "$(git rev-list --count "$SECTOR_SOURCE_PARENT..$GITHUB_SHA")" = "1"
          mkdir -p "$SECTOR_WORK_ROOT/evidence"
          git diff --name-only "$SECTOR_SOURCE_PARENT" "$GITHUB_SHA" | LC_ALL=C sort > "$SECTOR_WORK_ROOT/evidence/source-paths.txt"
          node --input-type=module <<'NODE'
          import assert from "node:assert/strict";
          import { readFile, writeFile } from "node:fs/promises";
          const generation = process.env.SECTOR_GENERATION;
          const expected = [
            `.github/workflows/${generation}-sector-intelligence-candidate.yml`,
            `build/javascript/${generation}-verify-v8-fast-browser.mjs`,
            `build/python/${generation}-build-sector-intelligence-parquet.py`,
            `data/news-discovery/${generation}-sector-intelligence-contract.json`,
            `discovery/fixtures/${generation}-sector-intelligence-rss.json`,
            `discovery/javascript/${generation}-sector-intelligence-runner.mjs`,
            `index/${generation}-compile-v8-sector-intelligence.mjs`,
            `manifests/${generation}-sector-intelligence-candidate.json`,
            `ui/cartridges/${generation}-sector-intelligence.mjs`,
          ].sort();
          const actual = (await readFile(`${process.env.SECTOR_WORK_ROOT}/evidence/source-paths.txt`, "utf8"))
            .trim().split("\n").filter(Boolean);
          assert.deepEqual(actual, expected);
          assert.ok(actual.every((relative) => relative.includes(generation)));
          assert.ok(actual.every((relative) => !relative.startsWith("releases/") && !relative.startsWith("atman/")));
          const workflow = await readFile(expected[0], "utf8");
          for (const forbidden of [
            ["actions", "deploy-pages@"].join("/"), ["actions", "upload-pages-artifact@"].join("/"),
            ["pages", "write"].join(": "), ["id-token", "write"].join(": "),
            ["workflows", "pages.yml/dispatches"].join("/"),
          ]) assert.ok(!workflow.includes(forbidden), `deployment capability entered workflow: ${forbidden}`);
          assert.ok(!workflow.includes(["github", "run_attempt"].join(".")), "retry-volatile run_attempt entered artifact identity");
          await writeFile(`${process.env.SECTOR_WORK_ROOT}/evidence/source-scope-proof.json`, `${JSON.stringify({
            schema: "pipelinenews.sector-intelligence-source-scope-proof.v3",
            generation,
            source_commit: process.env.GITHUB_SHA,
            source_parent_commit: process.env.SECTOR_SOURCE_PARENT,
            changed_paths: actual,
            application: "NON_COMMERCIAL_OPEN_SOURCE",
            upstream_rights: "SOURCE_SPECIFIC_NOT_INFERRED",
            prior_releases_changed: false,
            stable_route_changed: false,
            current_pointer_changed: false,
            catalogue_changed: false,
            deployment_authorised: false,
          }, null, 2)}\n`);
          NODE
          git diff --quiet "$SECTOR_SOURCE_PARENT" "$GITHUB_SHA" -- \
            .github/workflows/pages.yml \
            .github/workflows/authorise-v8-fast-pages.yml \
            releases/current.json \
            archive/202608261547-pipelinenews/releases/current.json \
            releases/202608270055-v8-fast-candidate.html

      - name: Verify source manifest and immutable pins
        shell: bash
        run: |
          set -euo pipefail
          node --input-type=module <<'NODE'
          import assert from "node:assert/strict";
          import { createHash } from "node:crypto";
          import { lstat, readFile } from "node:fs/promises";
          const generation = process.env.SECTOR_GENERATION;
          const manifestPath = `manifests/${generation}-sector-intelligence-candidate.json`;
          const manifest = JSON.parse(await readFile(manifestPath));
          const contract = JSON.parse(await readFile(`data/news-discovery/${generation}-sector-intelligence-contract.json`));
          assert.equal(manifest.schema, "pipelinenews.sector-intelligence-source-manifest.v3");
          assert.equal(manifest.generation, generation);
          assert.equal(manifest.source_parent_commit, process.env.SECTOR_SOURCE_PARENT);
          assert.equal(manifest.parent_generation, process.env.SECTOR_PARENT_GENERATION);
          assert.equal(manifest.deployment, "not-authorised");
          assert.equal(manifest.project_posture.application, "NON_COMMERCIAL_OPEN_SOURCE");
          assert.equal(manifest.project_posture.application_usage_establishes_upstream_rights, false);
          assert.equal(manifest.time_provenance.live_collection_anchor_basis,
            "ACTIONS_LIVE_COLLECTION_STARTED_AT");
          assert.equal(manifest.time_provenance.live_collection_anchor_captured_once_immediately_before_fetch, true);
          assert.equal(manifest.source_boundary.length, 9);
          assert.equal(manifest.source_files.length, 8);
          assert.equal(manifest.source_boundaries.maximum_network_requests,
            contract.limits.maximum_network_requests,
            "manifest closure claim disagrees with the contract");
          assert.equal(manifest.data_law.datasets.length, 3);
          assert.equal(manifest.data_law.compression, "ZSTD");
          assert.equal(manifest.data_law.physical_path, contract.physical_layout.path_template);
          assert.deepEqual(manifest.data_law.dataset_directories, contract.physical_layout.dataset_directories);
          assert.equal(manifest.data_law.committed_sanitized_source_ledger_receipt, true);
          assert.equal(manifest.identity_and_news_boundary.generic_headlines, 136);
          assert.equal(manifest.identity_and_news_boundary.data_centre_discovery_rows_sanitised_in_sector_view, 6);
          assert.equal(manifest.identity_and_news_boundary.query_context_may_establish_project_identity, false);
          assert.equal(manifest.federation.data_centres.owner_parquet_copied, false);
          assert.equal(manifest.federation.companies_house.acquisition_in_pipelinenews, false);
          assert.equal(manifest.browser.atman_runtime_dependency, false);
          assert.equal(manifest.browser.browser_overlay,
            "EXACT_CHECKOUT_INHERITED_RELEASES_PLUS_HASH_VERIFIED_CANDIDATE");
          assert.equal(manifest.browser.candidate_artifact_closure_revalidated, true);
          const expectedFiles = manifest.source_boundary.filter((relative) => relative !== manifestPath).sort();
          assert.deepEqual(manifest.source_files.map(({ path }) => path), expectedFiles);
          for (const record of [...manifest.source_files, ...manifest.pinned_parent_references]) {
            assert.deepEqual(Object.keys(record).sort(), ["bytes", "path", "sha256"]);
            assert.equal(typeof record.bytes, "number", `unresolved byte pin: ${record.path}`);
            assert.match(record.sha256, /^[a-f0-9]{64}$/u, `unresolved digest pin: ${record.path}`);
            const metadata = await lstat(record.path);
            assert.ok(metadata.isFile() && !metadata.isSymbolicLink());
            const bytes = await readFile(record.path);
            assert.equal(bytes.length, record.bytes, `byte pin changed: ${record.path}`);
            assert.equal(createHash("sha256").update(bytes).digest("hex"), record.sha256, `digest pin changed: ${record.path}`);
          }
          NODE
          node --input-type=module <<'NODE'
          import assert from "node:assert/strict";
          import { readFile } from "node:fs/promises";
          const unresolved = new RegExp(["__", "[A-Z0-9_]+", "__"].join(""), "u");
          for (const relative of [
            `.github/workflows/${process.env.SECTOR_GENERATION}-sector-intelligence-candidate.yml`,
            `index/${process.env.SECTOR_GENERATION}-compile-v8-sector-intelligence.mjs`,
            `manifests/${process.env.SECTOR_GENERATION}-sector-intelligence-candidate.json`,
          ]) {
            const source = await readFile(relative, "utf8");
            assert.ok(!unresolved.test(source), `unresolved placeholder: ${relative}`);
            assert.ok(!source.includes(["SHA256", "PENDING"].join("_")), `unresolved digest: ${relative}`);
          }
          NODE

      - name: Install pinned analytical engine
        shell: bash
        run: |
          set -euo pipefail
          python -m pip install --disable-pip-version-check "duckdb==$DUCKDB_VERSION"
          python - <<'PY'
          import duckdb
          assert duckdb.__version__ == "1.3.2"
          PY

      - name: Syntax and retention preflight
        shell: bash
        run: |
          set -euo pipefail
          node --check "discovery/javascript/$SECTOR_GENERATION-sector-intelligence-runner.mjs"
          node --check "build/javascript/$SECTOR_GENERATION-verify-v8-fast-browser.mjs"
          node --check "ui/cartridges/$SECTOR_GENERATION-sector-intelligence.mjs"
          node --check "index/$SECTOR_GENERATION-compile-v8-sector-intelligence.mjs"
          python -c 'from pathlib import Path; p=Path("build/python/202609010719-build-sector-intelligence-parquet.py"); compile(p.read_text(), str(p), "exec")'
          test ! -d build/python/__pycache__
          test "$(sha256sum releases/data/202608271524-fd2212a8c76d-v8-fast-news.json | cut -d' ' -f1)" = \
            "00cfbc6243e83cca274707a19b7848f776ce223d5e02808164e213dde887a8be"
          test "$(sha256sum releases/javascript/202608271329-atlas-v8-deep-link-cartridge.js | cut -d' ' -f1)" = \
            "d8e997acea1ed6c628e4d69f27653a5fe9a21bb459ff95d4ee0a7d040b431ff7"

      - name: Run two independent synthetic collectors and hostile source gates
        shell: bash
        run: |
          set -euo pipefail
          mkdir -p "$SECTOR_WORK_ROOT/fixture"
          for pass in a b; do
            node "discovery/javascript/$SECTOR_GENERATION-sector-intelligence-runner.mjs" \
              --contract "data/news-discovery/$SECTOR_GENERATION-sector-intelligence-contract.json" \
              --generic-news "releases/data/202608271524-fd2212a8c76d-v8-fast-news.json" \
              --fixture "discovery/fixtures/$SECTOR_GENERATION-sector-intelligence-rss.json" \
              --ledger "$SECTOR_WORK_ROOT/fixture/ledger-$pass.json"
          done
          # The relevance gate must be as deterministic as the collector it
          # follows: gate both synthetic ledgers and require byte equality of
          # the gated outputs as well as the raw ones.
          for pass in a b; do
            node "discovery/javascript/202609010015-sector-ledger-relevance-gate.mjs" \
              --input "$SECTOR_WORK_ROOT/fixture/ledger-$pass.json" \
              --output "$SECTOR_WORK_ROOT/fixture/gated-$pass.json"
          done
          test "$(sha256sum "$SECTOR_WORK_ROOT/fixture/gated-a.json" | cut -d' ' -f1)" = \
            "$(sha256sum "$SECTOR_WORK_ROOT/fixture/gated-b.json" | cut -d' ' -f1)"
          node "build/javascript/$SECTOR_GENERATION-verify-v8-fast-browser.mjs" \
            --mode source \
            --contract "data/news-discovery/$SECTOR_GENERATION-sector-intelligence-contract.json" \
            --fixture "discovery/fixtures/$SECTOR_GENERATION-sector-intelligence-rss.json" \
            --generic-news "releases/data/202608271524-fd2212a8c76d-v8-fast-news.json" \
            --ledger-a "$SECTOR_WORK_ROOT/fixture/ledger-a.json" \
            --ledger-b "$SECTOR_WORK_ROOT/fixture/ledger-b.json" \
            | tee "$SECTOR_WORK_ROOT/evidence/source-verification.json"

      - name: Collect bounded live sector metadata
        shell: bash
        run: |
          set -euo pipefail
          collection_anchor="$(date -u +%Y-%m-%dT%H:%M:%SZ)"
          printf '%s\n' "$collection_anchor" > "$SECTOR_WORK_ROOT/evidence/collection-anchor.txt"
          node "discovery/javascript/$SECTOR_GENERATION-sector-intelligence-runner.mjs" \
            --contract "data/news-discovery/$SECTOR_GENERATION-sector-intelligence-contract.json" \
            --generic-news "releases/data/202608271524-fd2212a8c76d-v8-fast-news.json" \
            --collection-anchor-at "$collection_anchor" \
            --collection-anchor-basis "ACTIONS_LIVE_COLLECTION_STARTED_AT" \
            --ledger "$SECTOR_WORK_ROOT/live-ledger.json" \
            | tee "$SECTOR_WORK_ROOT/evidence/live-collector-result.json"
          node --input-type=module <<'NODE'
          import assert from "node:assert/strict";
          import { readFile } from "node:fs/promises";
          const ledger = JSON.parse(await readFile(`${process.env.SECTOR_WORK_ROOT}/live-ledger.json`));
          const collectionAnchor = (await readFile(`${process.env.SECTOR_WORK_ROOT}/evidence/collection-anchor.txt`, "utf8")).trim();
          assert.equal(ledger.collection_anchor_at, collectionAnchor);
          assert.equal(ledger.collection_anchor_basis, "ACTIONS_LIVE_COLLECTION_STARTED_AT");
          assert.equal(new Date(ledger.collection_anchor_at).toISOString().replace(".000Z", "Z"), collectionAnchor);
          const boundaryManifest = JSON.parse(await readFile(`manifests/${process.env.SECTOR_GENERATION}-sector-intelligence-candidate.json`));
          assert.equal(ledger.policy_evidence.network_requests,
            boundaryManifest.source_boundaries.maximum_network_requests,
            "executed ledger and published manifest disagree on the network closure");
          assert.equal(ledger.policy_evidence.network_requests, 9);
          assert.equal(ledger.policy_evidence.upstream_data_centre_requests, 0);
          assert.equal(ledger.policy_evidence.pinned_data_centre_owner_export_requests, 1);
          assert.equal(ledger.policy_evidence.generic_data_centre_rows_sanitised, 6);
          assert.equal(ledger.datasets.sector_items.rows.filter(({ owner_repository }) => owner_repository).length, 3);
          assert.equal(ledger.datasets.sector_project_bindings.rows.length, 0);
          assert.ok(ledger.datasets.sector_items.rows.every(({ eligible_for_news_signal }) => eligible_for_news_signal === false));
          NODE
          # The collector's receipt is evidence and stays byte-for-byte as
          # collected. The builder receives only the gated ledger: a dynamic
          # row needs affirmative evidence in its own title or summary, an
          # official source or query string is never sufficient, and zero rows
          # is a valid answer.
          mv "$SECTOR_WORK_ROOT/live-ledger.json" "$SECTOR_WORK_ROOT/raw-live-ledger.json"
          node "discovery/javascript/202609010015-sector-ledger-relevance-gate.mjs" \
            --input "$SECTOR_WORK_ROOT/raw-live-ledger.json" \
            --output "$SECTOR_WORK_ROOT/live-ledger.json" \
            | tee "$SECTOR_WORK_ROOT/evidence/relevance-gate-result.json"
          node --input-type=module <<'NODE'
          import assert from "node:assert/strict";
          import { readFile } from "node:fs/promises";
          const raw = JSON.parse(await readFile(`${process.env.SECTOR_WORK_ROOT}/raw-live-ledger.json`));
          const gated = JSON.parse(await readFile(`${process.env.SECTOR_WORK_ROOT}/live-ledger.json`));
          assert.equal(gated.schema, raw.schema);
          assert.ok(gated.datasets.sector_items.rows.length <= raw.datasets.sector_items.rows.length);
          assert.equal(gated.datasets.sector_project_bindings.rows.length, 0);
          assert.ok(gated.policy_evidence.topic_relevance_gate, "the gate must leave its evidence");
          NODE

      - name: Build and read back three ZSTD Parquet grains twice
        shell: bash
        run: |
          set -euo pipefail
          for pass in a b; do
            python "build/python/$SECTOR_GENERATION-build-sector-intelligence-parquet.py" \
              --contract "data/news-discovery/$SECTOR_GENERATION-sector-intelligence-contract.json" \
              --ledger "$SECTOR_WORK_ROOT/live-ledger.json" \
              --out-root "$SECTOR_WORK_ROOT/pass-$pass" \
              --stage-root "$SECTOR_WORK_ROOT/stage-$pass" \
              --audit "$SECTOR_WORK_ROOT/audit-$pass.json" \
              | tee "$SECTOR_WORK_ROOT/evidence/parquet-pass-$pass.json"
          done
          cmp "$SECTOR_WORK_ROOT/audit-a.json" "$SECTOR_WORK_ROOT/audit-b.json"

      - name: Compile two independent immutable candidates
        shell: bash
        run: |
          set -euo pipefail
          for pass in a b; do
            SOURCE_COMMIT="$GITHUB_SHA" GITHUB_RUN_ID="$GITHUB_RUN_ID" node \
              "index/$SECTOR_GENERATION-compile-v8-sector-intelligence.mjs" \
              --sector-root "$SECTOR_WORK_ROOT/pass-$pass" \
              --audit "$SECTOR_WORK_ROOT/audit-$pass.json" \
              --out-root "$SECTOR_WORK_ROOT/pass-$pass" \
              | tee "$SECTOR_WORK_ROOT/evidence/compiler-pass-$pass.json"
          done

      - name: Independently verify landed files and byte determinism
        shell: bash
        run: |
          set -euo pipefail
          node "build/javascript/$SECTOR_GENERATION-verify-v8-fast-browser.mjs" \
            --mode candidate \
            --contract "data/news-discovery/$SECTOR_GENERATION-sector-intelligence-contract.json" \
            --generic-news "releases/data/202608271524-fd2212a8c76d-v8-fast-news.json" \
            --ledger "$SECTOR_WORK_ROOT/live-ledger.json" \
            --candidate-a "$SECTOR_WORK_ROOT/pass-a" \
            --candidate-b "$SECTOR_WORK_ROOT/pass-b" \
            | tee "$SECTOR_WORK_ROOT/evidence/candidate-verification.json"
          git diff --quiet
          test -z "$(git status --short --untracked-files=no)"

      - name: Upload quarantine candidate and compact evidence
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
        with:
          name: pipelinenews-sector-candidate-${{ github.run_id }}
          path: work/202609010719-sector-intelligence/pass-a/
          if-no-files-found: error
          retention-days: 30
          overwrite: true

      - name: Upload source and data-law evidence
        uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02
        with:
          name: pipelinenews-sector-evidence-${{ github.run_id }}
          path: work/202609010719-sector-intelligence/evidence/
          if-no-files-found: error
          retention-days: 30
          overwrite: true

  browser:
    name: Verify lazy browser behaviour
    needs: build
    runs-on: ubuntu-latest
    timeout-minutes: 15
    steps:
      - name: Checkout exact source
        uses: actions/checkout@fbc6f3992d24b796d5a048ff273f7fcc4a7b6c09
        with:
          ref: ${{ github.sha }}
          persist-credentials: false

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

      - name: Download immutable candidate
        uses: actions/download-artifact@634f93cb2916e3fdff6788551b99b062d0335ce0
        with:
          name: pipelinenews-sector-candidate-${{ github.run_id }}
          path: ${{ runner.temp }}/sector-candidate

      - name: Build exact inherited-asset overlay from verified closure
        shell: bash
        run: |
          set -euo pipefail
          test "$(git rev-parse HEAD)" = "$GITHUB_SHA"
          node --input-type=module <<'NODE'
          import assert from "node:assert/strict";
          import { createHash } from "node:crypto";
          import { constants } from "node:fs";
          import { copyFile, lstat, mkdir, readFile, readdir, writeFile } from "node:fs/promises";
          import path from "node:path";
          const generation = process.env.SECTOR_GENERATION;
          const artifactRoot = path.resolve(process.env.RUNNER_TEMP, "sector-candidate");
          const overlayRoot = path.resolve(process.env.RUNNER_TEMP, "sector-overlay");
          const manifestRelative = `build/${generation}-v8-fast-site-manifest.json`;
          const manifest = JSON.parse(await readFile(path.join(artifactRoot, manifestRelative)));
          assert.equal(manifest.schema, "pipelinenews.v8.fast-site-candidate.v1");
          assert.equal(manifest.generation, generation);
          assert.equal(manifest.source_commit, process.env.GITHUB_SHA);
          assert.equal(manifest.github_run_id, process.env.GITHUB_RUN_ID);
          assert.equal(manifest.deployment, "not-authorised");
          async function walk(directory, base = directory) {
            const files = [];
            for (const entry of await readdir(directory, { withFileTypes: true })) {
              const filename = path.join(directory, entry.name);
              const metadata = await lstat(filename);
              assert.equal(metadata.isSymbolicLink(), false, `overlay source symlink rejected: ${filename}`);
              if (metadata.isDirectory()) files.push(...await walk(filename, base));
              else {
                assert.equal(metadata.isFile(), true, `overlay source is not a regular file: ${filename}`);
                files.push(path.relative(base, filename).split(path.sep).join("/"));
              }
            }
            return files.sort();
          }
          const expected = [manifestRelative, ...manifest.outputs.map(({ path: relative }) => relative)].sort();
          assert.equal(expected.length, 11);
          assert.equal(new Set(expected).size, expected.length);
          assert.deepEqual(await walk(artifactRoot), expected, "candidate artifact closure changed");
          const records = new Map(manifest.outputs.map((record) => [record.path, record]));
          for (const relative of manifest.outputs.map(({ path: value }) => value)) {
            const bytes = await readFile(path.join(artifactRoot, relative));
            const record = records.get(relative);
            assert.equal(bytes.length, record.bytes, `candidate artifact byte mismatch: ${relative}`);
            assert.equal(createHash("sha256").update(bytes).digest("hex"), record.sha256,
              `candidate artifact digest mismatch: ${relative}`);
          }
          await mkdir(overlayRoot);
          const inheritedRoot = path.resolve("releases");
          const inherited = await walk(inheritedRoot);
          for (const relative of inherited) {
            const destination = path.join(overlayRoot, "releases", relative);
            await mkdir(path.dirname(destination), { recursive: true });
            await copyFile(path.join(inheritedRoot, relative), destination, constants.COPYFILE_EXCL);
          }
          for (const relative of expected) {
            assert.equal(path.posix.normalize(relative), relative);
            const destination = path.resolve(overlayRoot, relative);
            assert.ok(destination.startsWith(`${overlayRoot}${path.sep}`));
            await mkdir(path.dirname(destination), { recursive: true });
            await copyFile(path.join(artifactRoot, relative), destination, constants.COPYFILE_EXCL);
          }
          await writeFile(path.join(process.env.RUNNER_TEMP, "sector-overlay-proof.json"), `${JSON.stringify({
            schema: "pipelinenews.sector-intelligence-browser-overlay-proof.v3",