GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Websites and apps / data-grid-gb / derived

Verify Phase0 Acceptance and 13 more files

A Python command-line tool in the derived folder of Data Grid GB that reads GB transmission network, connection points, transformers and 132kV, using SHA-256 and haversine.

612 lines of Python and JavaScript and CSS from data-grid-gb, globalgrid2050, in 14 files. Topic: Websites and apps. Section 1881 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. Verify Phase0 Acceptance electrical · data-grid-gb / derived/verify_phase0_acceptance.py lines 414–661
  2. Reproduce storage · data-grid-gb / reproduce.py lines 1–245
  3. GlobalGrid2050 — Layouts Page render · globalgrid2050 / _layouts/default.html lines 1–23
  4. Progress render · globalgrid2050 / cartridges/202609052136-terminal-progress/progress.css lines 1–20
  5. Progress render · globalgrid2050 / cartridges/202609052136-terminal-progress/progress.js lines 1–28
  6. Ice interaction · globalgrid2050 / cartridges/202609052150-nasa-ice/ice.mjs lines 1–11
  7. Model transform · globalgrid2050 / cartridges/202609052150-nasa-ice/model.mjs lines 1–5
  8. Fast Existing render · globalgrid2050 / cartridges/202609052154-minute-runtime/fast-existing.mjs lines 1–10
  9. Runtime interaction · globalgrid2050 / cartridges/202609052154-minute-runtime/runtime.mjs lines 1–7
  10. Terminal render · globalgrid2050 / cartridges/202609052154-minute-runtime/terminal.css lines 1–5
  11. Circuits interaction · globalgrid2050 / cartridges/202609052156-rc-rl/circuits.mjs lines 1–3
  12. Model transform · globalgrid2050 / cartridges/202609052156-rc-rl/model.mjs lines 1–1
  13. Pipes render · globalgrid2050 / cartridges/202609052158-terminal-pipes/pipes.mjs lines 1–5
  14. Clock render · globalgrid2050 / cartridges/202609052159-nanosecond-clock/clock.mjs lines 1–1

Verify Phase0 Acceptance

A Python command-line tool in the derived folder of Data Grid GB that reads GB transmission network, connection points, transformers and 132kV, using SHA-256 and haversine.

electricaldata-grid-gb / derived/verify_phase0_acceptance.py · lines 414–661 of 661 (continued from section 1880) · Entry point · pattern summarise (shared by 11 files)

What it does
It loads GB transmission network, connection points, transformers and 132kV. Defines 15 functions or classes, including load_json, sha256, legacy_normalise, collision_summary, haversine. Uses libraries argparse, hashlib, io, json, math. Side effects: reads or writes files; starts processes.
Why it exists in the grid workflow
Domain terms in the code: transformers, 132kV, 400kV, 275kV, 66kV, 33kV.
Inputs & outputs
In: JSON file gb-transmission-network.v1.json; JSON file connection-points.v3.json; command-line arguments. Voltage levels named: 400kV, 275kV, 132kV, 66kV, 33kV, 11kV.
Downstream impact
It is itself an entry point (Python CLI); no other file was found loading it.
What it achieves
It loads JSON (`load_json`), replays road results (`replay_road_results`) and builds evidence (`build_evidence`). Independent Phase-0 acceptance oracle for the Electricity Ten Year Statement (ETYS) network products. Its code works with 132 kV. It accepts `--comparison-ref`, `--road-routes` and `--output`.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
data-grid-gb · derived · Python CLI
Uses
Build Connection Points (import), argparse, hashlib, io, json, math, os, re, statistics
Used by
none found
Produces
load_json, sha256, legacy_normalise, collision_summary, haversine, scalar_metrics, cable_evidence, coverage_evidence, transformer_evidence, points_from_git, location_delta, replay_road_results
Defines here
replay_road_results, build_evidence, main
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
data-grid-gb@4a9cef6c7c791f76d416c8b2fbafac8265f7a263 derived/verify_phase0_acceptance.py:414-661 · blob cfc5ca228326be4bae37e04e8027d0ec9aa87585 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: ingest · effects: filesystem, process · domain stage: unknown · users: none · canonical: supporting_data


def replay_road_results(path):
    rows = load_json(path)
    scored = [row for row in rows
              if row.get("status") == "ok" and row.get("routed_total_km") is not None]
    routed_errors = [
        abs(row["routed_total_km"] - row["cable_km"]) / row["cable_km"] * 100.0
        for row in scored
    ]
    wins = sum(
        abs(row["routed_total_km"] - row["cable_km"])
        < abs(row["straight_km"] - row["cable_km"])
        for row in scored
    )
    return {
        "status": "external_result_replay_not_independent_graph_reconstruction",
        "path": os.path.abspath(path),
        "sha256": sha256(path),
        "records": len(rows),
        "scored_records": len(scored),
        "status_counts": dict(Counter(row.get("status") for row in rows)),
        "median_absolute_percentage_error_scored": statistics.median(routed_errors),
        "beats_straight_scored_n": wins,
        "beats_straight_scored_fraction": wins / len(scored),
        "beats_straight_all_records_fraction": wins / len(rows),
        "limitation": (
            "The route geometries cannot be regenerated from data-grid-gb alone; "
            "the graph binary, build inputs and immutable provenance bundle are absent."),
    }


def build_evidence(args):
    network = load_json(NETWORK_PATH)
    points = load_json(POINTS_PATH)
    eligible_sites = [
        site for site in network["sites"]
        if site["voltages_kv"] and max(site["voltages_kv"]) >= points["minimum_kv"]
    ]
    contexts = defaultdict(list)
    for site in eligible_sites:
        contexts[site_join_context(site)].append(site)
    contextual_collisions = [values for values in contexts.values() if len(values) > 1]

    evidence = {
        "schema": "data-grid-gb.phase0-acceptance-evidence.v1",
        "inputs": {
            "network": {"path": os.path.relpath(NETWORK_PATH, REPO),
                        "sha256": sha256(NETWORK_PATH)},
            "connection_points": {"path": os.path.relpath(POINTS_PATH, REPO),
                                  "sha256": sha256(POINTS_PATH)},
        },
        "transformers": transformer_evidence(network, points),
        "name_join": {
            "legacy_normaliser_all_network_sites": collision_summary(
                network["sites"], legacy_normalise),
            "legacy_normaliser_connection_point_population": collision_summary(
                eligible_sites, legacy_normalise),
            "current_normaliser_all_network_sites": collision_summary(
                network["sites"], normalise),
            "current_normaliser_connection_point_population": collision_summary(
                eligible_sites, normalise),
            "contextual_name_highest_voltage_owner_collision_groups": len(
                contextual_collisions),
            "contextual_name_highest_voltage_owner_collision_rows": sum(
                len(values) for values in contextual_collisions),
            "contextual_collision_sites": [
                [site["code"] for site in values] for values in contextual_collisions
            ],
            "rule": (
                "Preserve ONSHORE/OFFSHORE/EXTENSION. Use name + voltage + owner "
                "only to narrow candidates; use site_code or fail closed when that "
                "context is not unique. Never force an OSM operator tag to equal a "
                "transmission owner."),
        },
        "coordinate_coverage": coverage_evidence(points),
        "cable_scalar": cable_evidence(network, points),
        "road_router": {
            "status": "not_reconstructed",
            "reason": (
                "No immutable road-graph bundle and build provenance are present in "
                "this repository; road-router accuracy claims are not acceptance facts."),
        },
    }
    if args.comparison_ref:
        comparison = points_from_git(args.comparison_ref)
        evidence["comparison"] = {
            "git_ref": args.comparison_ref,
            "coordinate_coverage": coverage_evidence(comparison),
            "cable_scalar": cable_evidence(network, comparison),
            "boundary": (
                "Comparison describes the named historical product, including its "
                "known location-join defects; it is not the corrected release oracle."),
            "coordinate_join_delta_to_current": location_delta(points, comparison),
        }
    if args.road_routes:
        evidence["road_router"] = replay_road_results(args.road_routes)

    t = evidence["transformers"]
    c_old_all = evidence["name_join"]["legacy_normaliser_all_network_sites"]
    c_old_rollup = evidence["name_join"]["legacy_normaliser_connection_point_population"]
    c_new_all = evidence["name_join"]["current_normaliser_all_network_sites"]
    c_new_rollup = evidence["name_join"]["current_normaliser_connection_point_population"]
    checks = {
        "1472_global_transformer_records": t["global_transformer_records"] == 1472,
        "1394_same_site_transformer_records": t["same_site_transformer_records"] == 1394,
        "1550_global_transformer_site_incidences":
            t["global_transformer_site_incidences"] == 1550,
        "1526_rollup_transformer_site_incidences":
            t["rollup_transformer_site_incidences"] == 1526,
        "cowley_5_physical_records": t["cowley"]["oracle_physical_record_count"] == 5
            and t["cowley"]["product_physical_record_count"] == 5,
        "cowley_5_windings_at_each_voltage":
            t["cowley"]["node_end_windings_by_voltage_kv"] == {"132": 5, "400": 5},
        "byte_identical_parallel_transformers_remain_distinct":
            t["cowley"]["largest_byte_identical_parallel_group"] > 1,
        "all_product_transformer_counts_match_row_identity_oracle":
            not t["product_count_mismatches"],
        "identity_qualifiers_are_preserved":
            normalise("Moray East Onshore") != normalise("Moray East Offshore")
            and normalise("Arecleoch") != normalise("Arecleoch Extension"),
        "legacy_collision_denominators_reproduced":
            c_old_all["collision_groups"] == 34
            and c_old_all["rows_in_collision_groups"] == 69
            and c_old_rollup["collision_groups"] == 32
            and c_old_rollup["rows_in_collision_groups"] == 65
            and c_old_rollup["destructive_normalisation_groups"] == 30
            and c_old_rollup["distinct_source_names_in_destructive_groups"] == 60
            and c_old_rollup["rows_in_destructive_groups"] == 61,
        "preserved_qualifiers_reduce_collisions":
            c_new_all["collision_groups"] == 6
            and c_new_all["rows_in_collision_groups"] == 12
            and c_new_rollup["collision_groups"] == 5
            and c_new_rollup["rows_in_collision_groups"] == 10,
        "remaining_context_ambiguity_fails_closed":
            evidence["name_join"][
                "contextual_name_highest_voltage_owner_collision_groups"] == 1
            and all(point["join_context_key"] is None
                    for point in points["connection_points"]
                    if point["site_code"] in {"EOWF", "EOWL"}),
        "connection_point_population_is_886":
            evidence["coordinate_coverage"]["connection_points"] == 886,
        "coverage_metadata_matches_rows":
            points["counts"]["with_location"]
            == evidence["coordinate_coverage"]["with_mapped_joined_coordinates"],
        "cable_records_are_not_reported_as_independent_pairs":
            evidence["cable_scalar"]["legacy_study_filter_straight_distance_gt_1km"]
            ["circuit_records"]
            >= evidence["cable_scalar"]["legacy_study_filter_straight_distance_gt_1km"]
            ["distinct_site_pairs"],
        "corrected_cable_cohort_is_95_records_over_60_pairs":
            evidence["cable_scalar"]["legacy_study_filter_straight_distance_gt_1km"]
            ["circuit_records"] == 95
            and evidence["cable_scalar"]
            ["legacy_study_filter_straight_distance_gt_1km"]
            ["distinct_site_pairs"] == 60,
        "corrected_fixed_scalar_metrics_are_reproduced":
            math.isclose(
                evidence["cable_scalar"]
                ["legacy_study_filter_straight_distance_gt_1km"]
                ["fixed_factor_circuit_weighted"]
                ["median_absolute_percentage_error"],
                8.58224,
                rel_tol=0.0,
                abs_tol=1e-4,
            )
            and evidence["cable_scalar"]
            ["legacy_study_filter_straight_distance_gt_1km"]
            ["fixed_factor_circuit_weighted"]["within_15_percent_n"] == 68
            and math.isclose(
                evidence["cable_scalar"]
                ["legacy_study_filter_straight_distance_gt_1km"]
                ["fixed_factor_pair_weighted_mean_published_length"]
                ["median_absolute_percentage_error"],
                9.38712,
                rel_tol=0.0,
                abs_tol=1e-4,
            )
            and evidence["cable_scalar"]
            ["legacy_study_filter_straight_distance_gt_1km"]
            ["fixed_factor_pair_weighted_mean_published_length"]
            ["within_15_percent_n"] == 40,
        "corrected_cable_cohort_membership_is_frozen":
            evidence["cable_scalar"]
            ["legacy_study_filter_straight_distance_gt_1km"]
            ["membership"]["circuit_records_sha256"]
            == "216403a88f9a36a88ed200905a04c84a9c11e7afe7efea6e27b677e5b1bdcf0e"
            and evidence["cable_scalar"]
            ["legacy_study_filter_straight_distance_gt_1km"]
            ["membership"]["site_pairs_sha256"]
            == "ce4f1e56b71c097c4275143633c764b6b5754bf661d1f9d5a3f4012c74d8f736",
    }
    if args.comparison_ref:
        comparison = evidence["comparison"]
        checks["historical_502_of_886_coverage_is_reproduced_not_reused"] = (
            comparison["coordinate_coverage"]["connection_points"] == 886
            and comparison["coordinate_coverage"]["with_mapped_joined_coordinates"] == 502)
        historical = comparison["cable_scalar"][
            "legacy_study_filter_straight_distance_gt_1km"]
        checks["historical_95_records_are_only_59_site_pairs"] = (
            historical["circuit_records"] == 95
            and historical["distinct_site_pairs"] == 59)
        checks["historical_cable_cohort_membership_is_frozen"] = (
            historical["membership"]["circuit_records_sha256"]
            == "75f5130906b25024c2d6b7c797ca06f5b7bcea26539d69ef1edb46dbaa14c53e"
            and historical["membership"]["site_pairs_sha256"]
            == "dfa6ac6086863c489d66238bdf1fec5f807fc9d82994b3d3913b1cf36933512a")
        delta = comparison["coordinate_join_delta_to_current"]["counts"]
        checks["location_delta_is_fully_enumerated"] = (
            delta == {"lost": 16, "gained": 3, "changed": 0,
                      "net_location_change": -13})
    evidence["checks"] = checks
    evidence["summary"] = {
        "passed": sum(checks.values()),
        "total": len(checks),
        "failures": [name for name, passed in checks.items() if not passed],
    }
    return evidence


def main():
    parser = argparse.ArgumentParser()
    parser.add_argument(
        "--comparison-ref",
        default=HISTORICAL_BASELINE_REF,
        help=("Git ref containing the historical connection-points.v3.json "
              f"(default: {HISTORICAL_BASELINE_REF})"))
    parser.add_argument(
        "--road-routes",
        help="Optional external route-result JSON to re-score (not reconstruct)")
    parser.add_argument("--output", help="Optional path for canonical JSON evidence")
    parser.add_argument(
        "--summary-only", action="store_true",
        help="Print only the check summary; --output still receives full evidence")
    args = parser.parse_args()
    evidence = build_evidence(args)
    rendered = json.dumps(evidence, ensure_ascii=False, indent=2, sort_keys=True) + "\n"
    if args.output:
        io.open(args.output, "w", encoding="utf-8", newline="\n").write(rendered)
    if args.summary_only:
        sys.stdout.write(json.dumps(evidence["summary"], indent=2, sort_keys=True) + "\n")
    else:
        sys.stdout.write(rendered)
    return 1 if evidence["summary"]["failures"] else 0


if __name__ == "__main__":
    raise SystemExit(main())

Reproduce

A Python command-line tool in Data Grid GB that reads sources, using SHA-256. It checks domain (`check_domain`) and checks lanes (`check_lanes`).

storagedata-grid-gb / reproduce.py · lines 1–245 of 245 · Entry point · pattern summary_digest (shared by 2 files)

What it does
It loads sources. Defines 8 functions or classes, including sha256_bytes, summary_digest, mw_block, headline, check_domain. Uses libraries __future__, argparse, hashlib, json, os. Side effects: reads or writes files.
Inputs & outputs
In: JSON file sources.json; command-line arguments.
Downstream impact
Used directly by 4 files: Fetch Assets Workflow (data-grid-gb); Test Assets Workflow (data-grid-gb); Test Assets (data-grid-gb); Test Lanes (data-grid-gb).
What it achieves
Recompute the asset pipelines' published files and numbers from the committed raw snapshots. It accepts `--root`, `--json` and `--expect`.
Why it matters
Run by Fetch Assets Workflow. Checked by 3 tests, including Test Assets Workflow.
Application
data-grid-gb · / · Python CLI
Uses
Pipeline (import), Lanes (import), Data Grid GB — Assetpipe (import), Xlsx (import), Run Lanes (script call), __future__, argparse, hashlib, json, os, platform, shutil, sys
Used by
run by Fetch Assets Workflow (workflow run), run by Test Assets Workflow (workflow run), imported by Test Assets (import), imported by Test Lanes (import)
Produces
sha256_bytes, summary_digest, mw_block, headline, check_domain, check_lanes, cmd_check, main
Defines here
sha256_bytes, summary_digest, mw_block, headline, check_domain, check_lanes, cmd_check, main
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
data-grid-gb@4a9cef6c7c791f76d416c8b2fbafac8265f7a263 reproduce.py:1-245 · blob ea671160959c862102abb7ae5f8d78789c86b0b8 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem · domain stage: unknown · users: none · canonical: supporting_data
#!/usr/bin/env python3
"""Recompute the asset pipelines' published files and numbers from the committed raw snapshots.

    python reproduce.py check [--root .] [--json OUT] [--expect SHA256]

Scope: ``datacentres/`` and ``conventional/`` only (the ETYS network products have
their own verifiers under ``derived/``).

``check`` uses no network and no credentials. For each domain it:

1. hashes every committed file under ``<domain>/raw`` and ``<domain>/normalised``
   (sha256) and derives a manifest digest over the sorted ``<sha256>  <path>`` lines;
2. checks every raw file against its pin in ``raw/MANIFEST.json``;
3. re-runs every ready normaliser on the pinned raw bytes and compares the result
   byte for byte with the committed ``normalised/<source>.geojson``: a normaliser
   that depends on the clock, the network or dict order fails here;
4. re-derives the headline numbers from the committed outputs, with the counting
   rules restated below rather than imported, so a writer bug is not repeated:
   records by status (and by fuel), and - kept apart, never added together -
   IT load MW and grid connection MW, each with how many records know it and
   how many do not. Unknown is counted as unknown, never as zero.

5. for the vendored lane scripts (``<domain>/lanes``): checks every file against
   ``lanes/MANIFEST.json``, then rebuilds each fully open lane offline in a scratch
   copy, in lanes.json order, and compares every declared output with its pin.
   A lane whose pinned inputs are not on disk is ``skipped_missing_input`` (an
   error when ``ASSETS_REQUIRE_INPUTS=1``; ``python pipelines/run_lanes.py inputs``
   downloads them by URL and sha256).

It prints a human summary and a canonical JSON summary whose ``summary_sha256`` is
the sha256 of the canonical JSON of everything except that field and the ``run``
block. Two people who run ``check`` on the same commit get the same digest; it is a
content hash, not an identity signature. Exit 0 = everything reproduced, 1 = at
least one mismatch (listed), 2 = unusable input. Normalisers that read .xlsx need
openpyxl; without it those sources are reported as ``skipped_missing_dependency``
and the run exits 1 when ``ASSETS_REQUIRE_DEPS=1``.
"""
from __future__ import annotations

import argparse
import hashlib
import json
import os
import platform
import shutil
import sys
import tempfile
from datetime import datetime, timezone
from pathlib import Path

ROOT = Path(__file__).resolve().parent
sys.path.insert(0, str(ROOT))

from assetpipe.pipeline import load_module  # noqa: E402  (fetchers are loaded by path)
from assetpipe import lanes as lanelib  # noqa: E402
SCHEMA_SUMMARY = "gb-asset-reproduction.v1"
DOMAINS = ("datacentres", "conventional")  # restated, not imported


def sha256_bytes(data: bytes) -> str:
    return hashlib.sha256(data).hexdigest()


def summary_digest(summary: dict) -> str:
    body = {k: v for k, v in summary.items() if k not in ("summary_sha256", "run")}
    return sha256_bytes(json.dumps(body, sort_keys=True, separators=(",", ":"), ensure_ascii=False).encode("utf-8"))


def mw_block(values) -> dict:
    known = [v for v in values if isinstance(v, (int, float)) and not isinstance(v, bool)]
    return {"known": len(known), "unknown": len(values) - len(known), "sum_of_known": round(sum(known), 3)}


def headline(domain: str, features: list) -> dict:
    props = [f.get("properties") or {} for f in features]
    by_status: dict = {}
    for p in props:
        by_status[p.get("status")] = by_status.get(p.get("status"), 0) + 1
    out = {"records": len(props), "by_status": dict(sorted(by_status.items(), key=lambda kv: str(kv[0])))}
    if domain == "datacentres":
        # Two separate quantities. Adding them would be the conflation the schema forbids.
        out["it_load_mw"] = mw_block([p.get("it_load_mw") for p in props])
        out["grid_connection_mw"] = mw_block([p.get("grid_connection_mw") for p in props])
    else:
        by_fuel: dict = {}
        for p in props:
            by_fuel[p.get("fuel")] = by_fuel.get(p.get("fuel"), 0) + 1
        out["by_fuel"] = dict(sorted(by_fuel.items(), key=lambda kv: str(kv[0])))
        out["capacity_mw"] = mw_block([p.get("capacity_mw") for p in props])
    out["location_precision"] = {}
    for p in props:
        key = (p.get("location") or {}).get("precision")
        out["location_precision"][key] = out["location_precision"].get(key, 0) + 1
    out["location_precision"] = dict(sorted(out["location_precision"].items(), key=lambda kv: str(kv[0])))
    return out


def check_domain(root: Path, domain: str, mismatches: list) -> dict:
    ddir = root / domain
    registry = json.loads((ddir / "sources.json").read_text(encoding="utf-8"))
    manifest_path = ddir / "raw" / "MANIFEST.json"
    manifest = json.loads(manifest_path.read_text(encoding="utf-8")) if manifest_path.exists() else {"files": {}}

    lines = []
    for sub in ("raw", "normalised"):
        base = ddir / sub
        if base.exists():
            for path in sorted(p for p in base.rglob("*") if p.is_file() and p.name != ".gitkeep"):
                lines.append(f"{sha256_bytes(path.read_bytes())}  {path.relative_to(root).as_posix()}")
    files_digest = sha256_bytes(("\n".join(lines) + "\n").encode("utf-8")) if lines else None

    for rel, meta in manifest["files"].items():
        path = ddir / "raw" / rel
        if meta.get("committed", True) and (not path.exists() or sha256_bytes(path.read_bytes()) != meta["sha256"]):
            mismatches.append(f"{domain}/raw/{rel}: missing or not the pinned bytes")

    sources = {}
    for entry in registry["sources"]:
        sid, module_name = entry["id"], entry.get("module")
        out_path = ddir / "normalised" / f"{sid}.geojson"
        result = {"open": entry.get("open"), "licence": entry.get("licence")}
        module = load_module(domain, entry, root) if module_name else None
        ready = module is not None and getattr(module, "STATUS", "placeholder") == "ready"
        result["fetcher"] = getattr(module, "STATUS", "placeholder") if module else "none"
        if out_path.exists():
            committed = out_path.read_bytes()
            obj = json.loads(committed.decode("utf-8"))
            result["output_sha256"] = sha256_bytes(committed)
            result["headline"] = headline(domain, obj.get("features") or [])
            if ready and entry.get("open") == "yes":
                from assetpipe.pipeline import PipelineError, build_collection, collection_text, read_raw
                from assetpipe.xlsx import MissingDependency
                try:
                    raw = read_raw(domain, sid, root=root)
                    rebuilt = collection_text(build_collection(domain, entry, module.normalise(raw), manifest)).encode("utf-8")
                    result["rebuilt"] = "identical" if rebuilt == committed else "DIFFERENT"
                    if rebuilt != committed:
                        mismatches.append(f"{domain}/normalised/{sid}.geojson: rebuild from raw is not byte-identical")
                except MissingDependency:
                    result["rebuilt"] = "skipped_missing_dependency"
                    if os.environ.get("ASSETS_REQUIRE_DEPS") == "1":
                        mismatches.append(f"{domain}/{sid}: openpyxl missing but ASSETS_REQUIRE_DEPS=1")
                except PipelineError as error:
                    result["rebuilt"] = "error"
                    mismatches.append(f"{domain}/{sid}: {error}")
            else:
                mismatches.append(f"{domain}/normalised/{sid}.geojson exists but its source is not open+ready")
        sources[sid] = result
    return {"files_sha256": files_digest, "file_count": len(lines), "sources": sources}


def check_lanes(root: Path, domain: str, mismatches: list) -> dict:
    """Rebuild every fully open lane offline in a scratch copy and compare its outputs with the pins."""
    doc = lanelib.load_lanes(domain, root)
    if not doc["lanes"]:
        return {}
    manifest = lanelib.read_manifest(domain, root)
    for problem in lanelib.check_manifest(domain, root, strict_open=False):
        mismatches.append(f"{domain}/lanes: {problem}")
    result = {}
    scratch = Path(tempfile.mkdtemp(prefix="reproduce-lanes-"))
    try:
        work = scratch / "lanes"
        lanelib.copy_tree(lanelib.lanes_dir(domain, root), work)
        for lane in doc["lanes"]:
            lid = lane["id"]
            pins = (manifest["lanes"].get(lid) or {}).get("files", {})
            res = {"open": lane.get("open"), "outputs": {rel: (pins.get(rel) or {}).get("sha256") for rel in lane.get("outputs", [])}}
            ldir = work / lid
            if not lane.get("build"):
                res["rebuilt"] = "no offline build (fetch and build are one step)"
            elif lane.get("open") != "yes":
                res["rebuilt"] = "skipped: licence not confirmed"
            elif not lanelib.inputs_present(ldir, lane):
                res["rebuilt"] = "skipped_missing_input"
                if os.environ.get("ASSETS_REQUIRE_INPUTS") == "1":
                    mismatches.append(f"{domain}/{lid}: pinned inputs missing but ASSETS_REQUIRE_INPUTS=1")
            else:
                for rel in lane.get("outputs", []):
                    if (ldir / rel).exists():
                        (ldir / rel).unlink()
                codes = lanelib.run_commands(ldir, lane, lane["build"], today="reproduce",
                                             retrieved=lanelib.retrieved_for(manifest, lid), log=lambda *_: None)
                rebuilt = {rel: sha256_bytes((ldir / rel).read_bytes()) if (ldir / rel).exists() else None
                           for rel in lane.get("outputs", [])}
                same = not any(codes) and rebuilt == res["outputs"]
                res["rebuilt"] = "identical" if same else "DIFFERENT"
                if not same:
                    diff = [rel for rel in rebuilt if rebuilt[rel] != res["outputs"].get(rel)]
                    mismatches.append(f"{domain}/lanes/{lid}: rebuild differs from the pins ({diff or codes})")
            result[lid] = res
    finally:
        shutil.rmtree(scratch, ignore_errors=True)
    return result


def cmd_check(args) -> int:
    root = args.root.resolve()
    for domain in DOMAINS:
        if not (root / domain / "sources.json").exists():
            print(f"reproduce: {domain}/sources.json missing", file=sys.stderr)
            return 2
    mismatches: list = []
    summary = {"schema": SCHEMA_SUMMARY, "domains": {d: check_domain(root, d, mismatches) for d in DOMAINS}}
    for d in DOMAINS:
        summary["domains"][d]["lanes"] = check_lanes(root, d, mismatches)
    summary["mismatches"] = mismatches
    summary["run"] = {"at": datetime.now(timezone.utc).strftime("%Y-%m-%dT%H:%M:%SZ"),
                      "python": platform.python_version()}
    summary["summary_sha256"] = summary_digest(summary)

    for domain, block in summary["domains"].items():
        print(f"{domain}: {block['file_count']} committed data files")
        for sid, res in block["sources"].items():
            extra = ""
            if "headline" in res:
                h = res["headline"]
                extra = f" records={h['records']} rebuilt={res.get('rebuilt', '-')}"
            print(f"  {sid:<26} open={res['open']:<10} fetcher={res['fetcher']:<11}{extra}")
        for lid, res in block.get("lanes", {}).items():
            print(f"  lane {lid:<21} open={res['open']:<10} rebuilt={res['rebuilt']}")
    for line in mismatches:
        print(f"::error::reproduce {line}")
    print(f"summary_sha256 {summary['summary_sha256']}")
    if args.json:
        Path(args.json).write_text(json.dumps(summary, sort_keys=True, indent=2, ensure_ascii=False) + "\n", encoding="utf-8")
    if args.expect and args.expect != summary["summary_sha256"]:
        print(f"::error::reproduce summary_sha256 {summary['summary_sha256']} != expected {args.expect}")
        return 1
    return 1 if mismatches else 0


def main(argv=None) -> int:
    parser = argparse.ArgumentParser(description=__doc__, formatter_class=argparse.RawDescriptionHelpFormatter)
    sub = parser.add_subparsers(dest="command", required=True)
    check = sub.add_parser("check", help="recompute from the committed files")
    check.add_argument("--root", type=Path, default=ROOT)
    check.add_argument("--json", help="write the canonical summary here")
    check.add_argument("--expect", help="fail unless summary_sha256 equals this")
    args = parser.parse_args(argv)
    return cmd_check(args)


if __name__ == "__main__":
    raise SystemExit(main())

GlobalGrid2050 — Layouts Page

A web page that uses SHA-256. Published at https://globalgrid2050.com/_layouts/default.html.

renderglobalgrid2050 / _layouts/default.html · lines 1–23 of 23 · Entry point

What it does
It draws its content. Uses libraries {{ . Side effects: changes the web page (DOM).
Inputs & outputs
Out: web page.
Downstream impact
It is itself an entry point, published at https://globalgrid2050.com/_layouts/default.html.
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
globalgrid2050 · _layouts · page
Uses
{{ , https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js
Used by
none found
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 _layouts/default.html:1-23 · blob 2ca8906a121e1c2f3aef2388b735fdf00f25a9c2 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
<!DOCTYPE html>
<html lang="{{ site.lang | default: "en-US" }}">
  <head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1">
    {% seo %}
    <link rel="stylesheet" href="{{ "/assets/css/style.css" | relative_url }}">
    {% include head-custom.html %}
  </head>
  <body>
    <div class="container-lg px-3 my-5 markdown-body">
      {% if site.title and site.title != page.title %}
      <h1><a href="{{ "/" | absolute_url }}">{{ site.title }}</a></h1>
      {% endif %}

      {{ content }}

    </div>
    <script src="https://cdnjs.cloudflare.com/ajax/libs/anchor-js/4.1.0/anchor.min.js" integrity="sha256-lZaRhKri35AyJSypXXs4o6OPFTbTmUoltBbDCbdzegg=" crossorigin="anonymous"></script>
    <script>anchors.add();</script>
  </body>
</html>

Progress

A style sheet in the cartridges folder of GlobalGrid2050.

renderglobalgrid2050 / cartridges/202609052136-terminal-progress/progress.css · lines 1–20 of 20 · version 2026-09-05 21:36 · Entry point

What it does
Side effects: changes the web page (DOM).
Downstream impact
Used directly by 36 files: Homepage V058 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v058.html); Homepage V059 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v059.html); Homepage V060 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v060.html); Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); and 32 more.
What it achieves
Terminal presentation adapted from wolph/python-progressbar, BSD-3-Clause.
Why it matters
Loaded by the Homepage V058 page at https://globalgrid2050.com/homepage_versions/homepage_v058.html and 35 other pages.
Application
globalgrid2050 · cartridges/202609052136-terminal-progress · style sheet
Uses
none found
Used by
loaded by Homepage V058 (stylesheet), loaded by Homepage V059 (stylesheet), loaded by Homepage V060 (stylesheet), loaded by Homepage V061 (stylesheet), loaded by Homepage V062 (stylesheet), loaded by Homepage V063 (stylesheet), loaded by Homepage V064 (stylesheet), loaded by Homepage V065 (stylesheet), and 28 more
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052136-terminal-progress/progress.css:1-20 · blob eddb58d7fb447230dde3af44daa9e11fedec1857 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
/* Terminal presentation adapted from wolph/python-progressbar, BSD-3-Clause.
   Copyright (c) 2022, Rick van Hattem (Wolph). See LICENSE.progressbar2.txt. */
body{background:#0b0d0f;color:#d6d8da;font:16px/1.55 Consolas,"Courier New",monospace;max-width:1000px;padding:24px;margin:0 auto}
h1{font:normal 28px/1.2 Consolas,"Courier New",monospace}h2{font-size:17px;letter-spacing:.04em;color:#b9bdc1}
a,.build .prev a{color:#c5cbd1;text-decoration:underline}a:hover{color:#fff}
.build a{font-size:18px}.build .what{font-size:15px}#gridSearch{font:inherit;border-color:#6b7075;background:#15191d}
#precision-progress{border-top:1px solid #7b8794;border-bottom:1px solid #7b8794;padding:18px 0;margin:24px 0;color:#d6e2ef;background:transparent;font:15px/1.5 Consolas,"Courier New",monospace}
#precision-progress h2,#precision-progress h3{font:inherit;font-weight:bold;letter-spacing:1px;color:#dce3ea;margin:0 0 12px}
#precision-progress ul{list-style:none;padding:0;margin:12px 0}
#precision-progress li{display:grid;grid-template-columns:minmax(150px,1fr) minmax(140px,1.4fr) 52px;gap:12px;align-items:center;margin:10px 0}
#precision-progress progress{display:block;appearance:none;-webkit-appearance:none;width:100%;height:17px;border:1px solid #7b8794;border-radius:0;background:#303942;overflow:hidden;color:#c4c9ce}
#precision-progress progress::-webkit-progress-bar{background:#303942}
#precision-progress progress::-webkit-progress-value{background:#c4c9ce}
#precision-progress progress::-moz-progress-bar{background:#c4c9ce}
#precision-progress .precision-count{font-variant-numeric:tabular-nums;text-align:right;white-space:nowrap;color:#dce3ea}
#precision-progress .precision-clock{margin:15px 0}
#precision-progress .precision-clock label{display:flex;justify-content:space-between;gap:12px;flex-wrap:wrap;margin-bottom:5px}
#precision-progress .precision-clock output{font-variant-numeric:tabular-nums;color:#dce3ea}
#precision-progress a{color:#a6d0e8}#precision-progress .precision-note{font-size:12px;color:#b3bdc8}
@media(max-width:520px){#precision-progress{padding:13px;font-size:14px}#precision-progress li{grid-template-columns:1fr 50px;gap:4px 10px}#precision-progress li>span:first-child{grid-column:1/-1}#precision-progress progress{height:18px}}

Progress

A JavaScript file in the cartridges folder of GlobalGrid2050 that updates bar (`updateBar`). It updates bar (`updateBar`) and is built from the parts step (`parts`) and the midnight step (`midnight`).

renderglobalgrid2050 / cartridges/202609052136-terminal-progress/progress.js · lines 1–28 of 28 · version 2026-09-05 21:36 · Entry point · pattern midnight (shared by 3 files)

What it does
It lists and searches its content. Defines parts, midnight, updateBar, calendar, minute. Side effects: changes the web page (DOM).
Downstream impact
Used directly by 36 files: Homepage V058 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v058.html); Homepage V059 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v059.html); Homepage V060 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v060.html); Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); and 32 more.
What it achieves
Terminal presentation adapted from wolph/python-progressbar, BSD-3-Clause.
Why it matters
Loaded by the Homepage V058 page at https://globalgrid2050.com/homepage_versions/homepage_v058.html and 35 other pages.
Application
globalgrid2050 · cartridges/202609052136-terminal-progress · script
Uses
none found
Used by
loaded by Homepage V058 (script src), loaded by Homepage V059 (script src), loaded by Homepage V060 (script src), loaded by Homepage V061 (script src), loaded by Homepage V062 (script src), loaded by Homepage V063 (script src), loaded by Homepage V064 (script src), loaded by Homepage V065 (script src), and 28 more
Produces
parts, midnight, updateBar, calendar, minute
Defines here
parts, midnight, updateBar, calendar, minute
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052136-terminal-progress/progress.js:1-28 · blob 57bd6bbc197f042896f36148d4a98e7f5a5f358a · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
/* Terminal presentation adapted from wolph/python-progressbar, BSD-3-Clause.
 * Copyright (c) 2022, Rick van Hattem (Wolph). See LICENSE.progressbar2.txt.
 * Review progress is a fixed evidence snapshot. Only clock values animate.
 */
const root=document.getElementById('precision-progress');
if(root){
  const target=Date.UTC(2050,0,1),start=Date.UTC(2026,0,1);
  const formatter=new Intl.DateTimeFormat('en-GB',{timeZone:'Europe/London',year:'numeric',month:'2-digit',day:'2-digit',hour:'2-digit',minute:'2-digit',second:'2-digit',hourCycle:'h23'});
  const parts=t=>Object.fromEntries(formatter.formatToParts(t).filter(x=>x.type!=='literal').map(x=>[x.type,Number(x.value)]));
  const midnight=(year,month,day)=>{const nominal=Date.UTC(year,month-1,day);let candidate=nominal;for(let i=0;i<3;i++){const q=parts(candidate);candidate+=nominal-Date.UTC(q.year,q.month-1,q.day,q.hour,q.minute,q.second);}return candidate;};
  function updateBar(id,fraction,label){const bar=root.querySelector('#'+id);bar.value=Math.max(0,Math.min(1,fraction));root.querySelector('#'+id+'-value').textContent=label;}
  function calendar(){
    const now=Date.now(),days=Math.max(0,target-now)/86400000,q=parts(now),end=midnight(q.year,q.month,q.day+1),begin=midnight(q.year,q.month,q.day);
    const fraction=(now-start)/(target-start);
    updateBar('precision-days',fraction,Math.ceil(days).toLocaleString('en-GB')+' days remaining');
    updateBar('precision-weeks',fraction,(days/7).toFixed(1)+' weeks remaining');
    updateBar('precision-months',fraction,(days/(365.2425/12)).toFixed(1)+' months remaining');
    updateBar('precision-today',(now-begin)/(end-begin),Math.max(0,Math.ceil((end-now)/60000))+' minutes remaining');
  }
  calendar();const calendarTimer=setInterval(()=>{if(!root.isConnected)clearInterval(calendarTimer);else calendar();},1000);
  const reduced=matchMedia('(prefers-reduced-motion: reduce)');let last=0;
  function minute(t){
    if(!root.isConnected)return;
    if(t-last>=(reduced.matches?1000:33)){const left=60000-(Date.now()%60000);updateBar('precision-minute',1-left/60000,String(left).padStart(5,'0')+' ms remaining');last=t;}
    requestAnimationFrame(minute);
  }
  requestAnimationFrame(minute);
}

Ice

A JavaScript module in the cartridges folder of GlobalGrid2050.

interactionglobalgrid2050 / cartridges/202609052150-nasa-ice/ice.mjs · lines 1–11 of 11 · version 2026-09-05 21:50 · Entry point

What it does
It fetches data. Defines boot, status, draw. Side effects: changes the web page (DOM); makes network requests.
Inputs & outputs
In: JSON file source.json.
Downstream impact
Used directly by 1 file: Homepage V060 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v060.html).
What it achieves
Defines `boot`, `status` and `draw`.
Why it matters
Loaded by the Homepage V060 page at https://globalgrid2050.com/homepage_versions/homepage_v060.html.
Application
globalgrid2050 · cartridges/202609052150-nasa-ice · JavaScript module
Uses
Model (import)
Used by
loaded by Homepage V060 (script src)
Produces
boot, status, draw
Defines here
boot, status, draw
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052150-nasa-ice/ice.mjs:1-11 · blob 61a692bc550e9bbae5b8b23439d3b898f574daf6 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, network · domain stage: unknown · users: none · canonical: production_core
import {iceRows} from './model.mjs';
const root=document.getElementById('nasa-ice');
if(root)boot().catch(()=>root.querySelector('[data-status]').textContent='Ice baseline unavailable; no estimate shown.');
async function boot(){
 const r=await fetch(new URL('./source.json',import.meta.url));if(!r.ok)throw Error();const s=await r.json();iceRows(s,Date.now());
 const number=new Intl.NumberFormat('en-GB',{maximumFractionDigits:0}),rate=new Intl.NumberFormat('en-GB',{maximumFractionDigits:1});let paused=false,last=0;const reduced=matchMedia('(prefers-reduced-motion: reduce)');
 const b=root.querySelector('button');b.disabled=false;b.onclick=()=>{paused=!paused;b.textContent=paused?'Resume counters':'Pause counters';b.setAttribute('aria-pressed',String(paused));status();};
 function status(){root.querySelector('[data-status]').textContent=(paused?'Paused. ':'')+'Net ice loss illustrated at the 2002-2025 average rate. Not live melting.';}
 function draw(){for(const row of iceRows(s,Date.now())){const el=root.querySelector('[data-ice="'+row.id+'"]');el.querySelector('output').textContent=number.format(row.tonnes)+' tonnes';el.querySelector('progress').value=row.fraction;el.querySelector('small').textContent='~'+rate.format(row.perSecond)+' tonnes / second; '+row.annual+' Gt / year baseline';}}
 status();draw();function frame(t){if(!root.isConnected)return;if(!paused&&!document.hidden&&t-last>=(reduced.matches?1000:50)){draw();last=t;}requestAnimationFrame(frame);}requestAnimationFrame(frame);
}

Model

A JavaScript module in the cartridges folder of GlobalGrid2050 that works with ice rows (`iceRows`). It is built from the ice rows helper (`iceRows`).

transformglobalgrid2050 / cartridges/202609052150-nasa-ice/model.mjs · lines 1–5 of 5 · version 2026-09-05 21:50

What it does
It calculates its inputs. Defines iceRows.
Downstream impact
Used directly by 2 files: Ice (globalgrid2050); Fast Existing (globalgrid2050). Reached from 34 other entry points, including Homepage V060 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v060.html); Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); Homepage V062 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v062.html).
What it achieves
Defines `iceRows`.
Why it matters
Imported by Ice and Fast Existing.
Application
globalgrid2050 · cartridges/202609052150-nasa-ice · JavaScript module
Uses
none found
Used by
imported by Ice (import), imported by Fast Existing (import)
Produces
iceRows
Defines here
iceRows
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052150-nasa-ice/model.mjs:1-5 · blob 49389f88e092fdc7da4d01599fc34e574c9ce940 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: transform · effects: none found · domain stage: unknown · users: none · canonical: production_core
export function iceRows(s,now){
 if(s?.schema!=='ventus.ice-rate.v1'||!Number.isFinite(now)||![s.greenlandGtPerYear,s.antarcticaGtPerYear,s.modelYearDays].every(v=>Number.isFinite(v)&&v>0))throw Error('Invalid ice baseline');
 const fraction=((now%86400000)+86400000)%86400000/86400000;
 return [['greenland',s.greenlandGtPerYear],['antarctica',s.antarcticaGtPerYear]].map(([id,annual])=>({id,tonnes:annual*1e9/s.modelYearDays*fraction,perSecond:annual*1e9/(s.modelYearDays*86400),fraction,annual}));
}

Fast Existing

A JavaScript module in the cartridges folder of GlobalGrid2050.

renderglobalgrid2050 / cartridges/202609052154-minute-runtime/fast-existing.mjs · lines 1–10 of 10 · version 2026-09-05 21:54 · Entry point

What it does
It fetches data. Defines start. Side effects: changes the web page (DOM); makes network requests.
Inputs & outputs
In: JSON file source.json.
Downstream impact
Used directly by 33 files: Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); Homepage V062 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v062.html); Homepage V063 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v063.html); Homepage V064 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v064.html); and 29 more.
What it achieves
Defines `start`.
Why it matters
Loaded by the Homepage V061 page at https://globalgrid2050.com/homepage_versions/homepage_v061.html and 32 other pages.
Application
globalgrid2050 · cartridges/202609052154-minute-runtime · JavaScript module
Uses
Runtime (import), Model (import), Model (import)
Used by
loaded by Homepage V061 (script src), loaded by Homepage V062 (script src), loaded by Homepage V063 (script src), loaded by Homepage V064 (script src), loaded by Homepage V065 (script src), loaded by Homepage V066 (script src), loaded by Homepage V067 (script src), loaded by Homepage V068 (script src), and 25 more
Produces
start
Defines here
start
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052154-minute-runtime/fast-existing.mjs:1-10 · blob e11535d656b15f1cf22c3a6bcef40c616ef7a56d · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom, network · domain stage: unknown · users: none · canonical: production_core
import {animate,minute} from './runtime.mjs';
import {calculate} from '../202609052143-open-energy/model.mjs';
import {iceRows} from '../202609052150-nasa-ice/model.mjs';
const format=new Intl.NumberFormat('en-GB',{maximumFractionDigits:0});
async function start(id,path,model,selector,unit){const root=document.getElementById(id);if(!root)return;try{const response=await fetch(new URL(path,import.meta.url));if(!response.ok)throw Error();const data=await response.json();model(data,Date.now());const b=root.querySelector('button');b.dataset.pause='';
 root.querySelector('[data-status]').textContent=id==='open-energy'?'This minute at EIA 2024 average rates; not live demand.':'This minute at NASA 2002-2025 average net-loss rates; not live melting.';
 animate(root,now=>{const seconds=minute(now)/1000;for(const r of model(data,now)){const el=root.querySelector('['+selector+'="'+r.id+'"]');el.querySelector('output').textContent=format.format(r.perSecond*seconds)+' '+unit;el.querySelector('progress').value=seconds/60;const small=el.querySelector('small');if(small)small.textContent='~'+format.format(r.perSecond)+' '+unit+' / second';}});
 }catch{root.querySelector('[data-status]').textContent='Baseline unavailable; no estimated values shown.';}}
start('open-energy','../202609052143-open-energy/source.json',(d,n)=>calculate(d,n).rows,'data-energy','MWh');
start('nasa-ice','../202609052150-nasa-ice/source.json',iceRows,'data-ice','tonnes');

Runtime

A JavaScript module in the cartridges folder of GlobalGrid2050. It is built from the row step (`row`).

interactionglobalgrid2050 / cartridges/202609052154-minute-runtime/runtime.mjs · lines 1–7 of 7 · version 2026-09-05 21:54 · pattern minute (shared by 3 files)

What it does
Defines minute, animate, frame, row. Side effects: changes the web page (DOM).
Downstream impact
Used directly by 6 files: Solar (globalgrid2050); Scenario (globalgrid2050); Solar (globalgrid2050); Fast Existing (globalgrid2050); and 2 more. Reached from 33 other entry points, including Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); Homepage V062 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v062.html); Homepage V063 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v063.html).
What it achieves
Defines `minute`, `animate`, `frame` and 1 more.
Why it matters
Imported by 6 files, including Solar, Scenario and Fast Existing.
Application
globalgrid2050 · cartridges/202609052154-minute-runtime · JavaScript module
Uses
none found
Used by
imported by Solar (import), imported by Scenario (import), imported by Solar (import), imported by Fast Existing (import), imported by Circuits (import), imported by Clock (import)
Produces
minute, animate, row
Defines here
minute, animate, frame, row
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052154-minute-runtime/runtime.mjs:1-7 · blob 7d48ba12f8cd0ead14be9289a4c77a489f4cfcd2 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
export const minute=now=>((now%60000)+60000)%60000;
export function animate(root,draw){
 let paused=false,last=-Infinity;const reduced=matchMedia('(prefers-reduced-motion: reduce)'),button=root.querySelector('button[data-pause]');
 if(button){button.disabled=false;button.onclick=()=>{paused=!paused;button.textContent=paused?'Resume':'Pause';button.setAttribute('aria-pressed',String(paused));};}
 function frame(t){if(!root.isConnected)return;if(!paused&&!document.hidden&&t-last>=(reduced.matches?1000:50)){draw(Date.now(),t);root.dataset.frames=String(Number(root.dataset.frames||0)+1);last=t;}requestAnimationFrame(frame);}requestAnimationFrame(frame);
}
export function row(root,key,text,fraction){const target=root.querySelector('[data-row="'+key+'"]');target.querySelector('output').textContent=text;target.querySelector('progress').value=Math.max(0,Math.min(1,fraction));}

Terminal

A style sheet in the cartridges folder of GlobalGrid2050.

renderglobalgrid2050 / cartridges/202609052154-minute-runtime/terminal.css · lines 1–5 of 5 · version 2026-09-05 21:54 · Entry point

What it does
Side effects: changes the web page (DOM).
Downstream impact
Used directly by 33 files: Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); Homepage V062 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v062.html); Homepage V063 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v063.html); Homepage V064 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v064.html); and 29 more.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name. Described from its file name only (a candidate, not yet checked against the code).
Why it matters
Loaded by the Homepage V061 page at https://globalgrid2050.com/homepage_versions/homepage_v061.html and 32 other pages.
Application
globalgrid2050 · cartridges/202609052154-minute-runtime · style sheet
Uses
none found
Used by
loaded by Homepage V061 (stylesheet), loaded by Homepage V062 (stylesheet), loaded by Homepage V063 (stylesheet), loaded by Homepage V064 (stylesheet), loaded by Homepage V065 (stylesheet), loaded by Homepage V066 (stylesheet), loaded by Homepage V067 (stylesheet), loaded by Homepage V068 (stylesheet), and 25 more
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052154-minute-runtime/terminal.css:1-5 · blob 70c389f50389412c52dee3c00d20d7a32acab241 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
.science-terminal{border-bottom:1px solid #72777c;padding:18px 0;margin:24px 0;font:15px/1.5 Consolas,"Courier New",monospace;color:#d6d8da}.science-terminal h2{font:inherit;font-weight:bold;letter-spacing:1px;color:inherit}.science-terminal .reading{margin:18px 0}.science-terminal .reading label{display:flex;justify-content:space-between;gap:8px;flex-wrap:wrap}.science-terminal output{font-varian  … [line shortened here: 1,371 characters; full line on GitHub]
/* Evidence and long-period totals stay numeric. Never animate work that has not happened. */
#precision-progress li progress,#precision-days,#precision-weeks,#precision-months,#precision-today{display:none}#precision-progress li{grid-template-columns:1fr 52px}

#precision-progress li>span:first-child{grid-column:auto}

Circuits

A JavaScript module in the cartridges folder of GlobalGrid2050.

interactionglobalgrid2050 / cartridges/202609052156-rc-rl/circuits.mjs · lines 1–3 of 3 · version 2026-09-05 21:56 · Entry point

What it does
Side effects: changes the web page (DOM).
Downstream impact
Used directly by 33 files: Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); Homepage V062 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v062.html); Homepage V063 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v063.html); Homepage V064 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v064.html); and 29 more.
What it achieves
It responds to input events.
Why it matters
Loaded by the Homepage V061 page at https://globalgrid2050.com/homepage_versions/homepage_v061.html and 32 other pages.
Application
globalgrid2050 · cartridges/202609052156-rc-rl · JavaScript module
Uses
Runtime (import)
Used by
loaded by Homepage V061 (script src), loaded by Homepage V062 (script src), loaded by Homepage V063 (script src), loaded by Homepage V064 (script src), loaded by Homepage V065 (script src), loaded by Homepage V066 (script src), loaded by Homepage V067 (script src), loaded by Homepage V068 (script src), and 25 more
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052156-rc-rl/circuits.mjs:1-3 · blob d45e4b12674531873f4959c0fa07177c7b4bb05d · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
import {animate,row} from '../202609052154-minute-runtime/runtime.mjs';import {response} from './model.mjs';const root=document.getElementById('circuit-school');
if(root){let epoch=performance.now();root.querySelectorAll('input').forEach(input=>input.addEventListener('input',()=>epoch=performance.now()));animate(root,(_,clock)=>{const R=10,V=48,C=Number(root.querySelector('[name=c]').value)*1e-6,L=Number(root.querySelector('[name=l]').value)*1e-3;if(!Number.isFinite(C)||!Number.isFinite(L)||C<.0001||C>.005||L<.001||L>.1)return;const duration=5*Math.max(R*C  … [line shortened here: 469 characters; full line on GitHub]
row(root,'cap',r.vc.toFixed(2)+' V',r.vc/V);row(root,'ind',r.i.toFixed(3)+' A',r.i/(V/R));root.querySelector('[data-explain]').textContent='C = '+C.toFixed(4)+' F; L = '+L.toFixed(3)+' H. RC = '+(r.tauC*1000).toFixed(2)+' ms; L/R = '+(r.tauL*1000).toFixed(2)+' ms. Simulated t = '+(t*1000).toFixed(2)+' ms. Stored: '+r.ec.toFixed(3)+' J electric / '+r.el.toFixed(3)+' J magnetic. A 10-second animatio  … [line shortened here: 465 characters; full line on GitHub]

Model

A JavaScript module in the cartridges folder of GlobalGrid2050.

transformglobalgrid2050 / cartridges/202609052156-rc-rl/model.mjs · lines 1–1 of 1 · version 2026-09-05 21:56 · Not reached from any entry point (candidate for review) · pattern response (shared by 6 files)

What it does
It calculates its inputs. Defines response.
What it achieves
Defines `response`.
Why it matters
No other file in the estate was found to import it.
Application
globalgrid2050 · cartridges/202609052156-rc-rl · JavaScript module
Uses
none found
Used by
none found
Produces
response
Defines here
response
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052156-rc-rl/model.mjs:1-1 · blob a9694fc39abb06bc7ef6693afb0ba1fc8fd16e91 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: transform · effects: none found · domain stage: unknown · users: none · canonical: unreached_review
export function response({R,C,L,V},t){if(![R,C,L,V].every(x=>Number.isFinite(x)&&x>0)||!Number.isFinite(t)||t<0)throw Error('Invalid ideal circuit');const tauC=R*C,tauL=L/R,vc=V*(1-Math.exp(-t/tauC)),i=V/R*(1-Math.exp(-t/tauL));return {tauC,tauL,vc,i,ec:.5*C*vc**2,el:.5*L*i**2};}

Pipes

A JavaScript module in the cartridges folder of GlobalGrid2050.

renderglobalgrid2050 / cartridges/202609052158-terminal-pipes/pipes.mjs · lines 1–5 of 5 · version 2026-09-05 21:58 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Downstream impact
Used directly by 33 files: Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); Homepage V062 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v062.html); Homepage V063 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v063.html); Homepage V064 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v064.html); and 29 more.
What it achieves
Direction glyph table adapted from `pipeseroni/pipes.sh` (MIT); see LICENSE.pipes.txt.
Why it matters
Loaded by the Homepage V061 page at https://globalgrid2050.com/homepage_versions/homepage_v061.html and 32 other pages.
Application
globalgrid2050 · cartridges/202609052158-terminal-pipes · JavaScript module
Uses
none found
Used by
loaded by Homepage V061 (script src), loaded by Homepage V062 (script src), loaded by Homepage V063 (script src), loaded by Homepage V064 (script src), loaded by Homepage V065 (script src), loaded by Homepage V066 (script src), loaded by Homepage V067 (script src), loaded by Homepage V068 (script src), and 25 more
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052158-terminal-pipes/pipes.mjs:1-5 · blob c4e9621d2593c311403841ac699ca09aeb2032f0 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
// Direction glyph table adapted from pipeseroni/pipes.sh (MIT); see LICENSE.pipes.txt.
// Original bounded browser rendering. Decorative trace, not actual grid topology.
const root=document.getElementById('terminal-pipes');
if(root){const glyphs=Array.from('│┌ ┐┘─┐  └│┘└ ┌─'),w=40,h=4,grid=Array.from({length:h},()=>Array(w).fill(' '));let x=0,y=1,d=1,n=0,last=0,paused=false;const reduced=matchMedia('(prefers-reduced-motion: reduce)');root.querySelector('button').onclick=()=>{paused=!paused;root.querySelector('button').textContent=paused?'Play sketch':'Pause sketch';};
function frame(t){if(!root.isConnected)return;if(!paused&&!document.hidden&&t-last>=(reduced.matches?1000:80)){const next=n%11===0?(d+1)%4:d;grid[y][x]=glyphs[d*4+next];d=next;x=(x+[0,1,0,-1][d]+w)%w;y=(y+[-1,0,1,0][d]+h)%h;if(++n%240===0)grid.forEach(r=>r.fill(' '));root.querySelector('pre').textContent=grid.map(r=>r.join('')).join('\n');last=t;}requestAnimationFrame(frame);}requestAnimationFrame  … [line shortened here: 409 characters; full line on GitHub]

Clock

A JavaScript module in the cartridges folder of GlobalGrid2050.

renderglobalgrid2050 / cartridges/202609052159-nanosecond-clock/clock.mjs · lines 1–1 of 1 · version 2026-09-05 21:59 · Entry point

What it does
Side effects: changes the web page (DOM).
Downstream impact
Used directly by 33 files: Homepage V061 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v061.html); Homepage V062 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v062.html); Homepage V063 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v063.html); Homepage V064 (globalgrid2050, https://globalgrid2050.com/homepage_versions/homepage_v064.html); and 29 more.
What it achieves
No statement of purpose was found in the file, a README line naming it, or its name. Described from its file name only (a candidate, not yet checked against the code).
Why it matters
Loaded by the Homepage V061 page at https://globalgrid2050.com/homepage_versions/homepage_v061.html and 32 other pages.
Application
globalgrid2050 · cartridges/202609052159-nanosecond-clock · JavaScript module
Uses
Runtime (import)
Used by
loaded by Homepage V061 (script src), loaded by Homepage V062 (script src), loaded by Homepage V063 (script src), loaded by Homepage V064 (script src), loaded by Homepage V065 (script src), loaded by Homepage V066 (script src), loaded by Homepage V067 (script src), loaded by Homepage V068 (script src), and 25 more
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
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 cartridges/202609052159-nanosecond-clock/clock.mjs:1-1 · blob 86517eec20d2156448e942625541dbc059975ccd · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: unknown · users: none · canonical: production_core
import {animate,minute,row} from '../202609052154-minute-runtime/runtime.mjs';const root=document.getElementById('nano-minute');if(root)animate(root,now=>{const ms=minute(now);row(root,'nano',((60000n-BigInt(ms))*1000000n).toLocaleString('en-GB')+' ns',ms/60000);});