GLOBALGRID2050 / EXPLORE CODE

Part of: Explore Code / Kuiper, cosmos and drawing engines / globalgrid2050 / testcode/ci

CI Star Checks and 7 more files

A Python command-line tool in the testcode folder of GlobalGrid2050 that fetches today, history, UK solar and voices, using SHA-256 from the star-solar-star repository.

697 lines of Python and HTML from globalgrid2050, in 8 files. Topic: Kuiper, cosmos and drawing engines. Section 1460 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. CI Star Checks automation · globalgrid2050 / testcode/ci/star_checks.py lines 1–343
  2. CI Test Star Checks test · globalgrid2050 / testcode/ci/test_star_checks.py lines 1–160
  3. Particles — 01 Run T0120z Page render · globalgrid2050 / testcode/particles/01-run-20260918t0120z/index.html lines 1–31
  4. Particles — 02 Run T0120z Page render · globalgrid2050 / testcode/particles/02-run-20260918t0120z/index.html lines 1–31
  5. Particles — 03 Run T0120z Page render · globalgrid2050 / testcode/particles/03-run-20260918t0120z/index.html lines 1–33
  6. Particles — 04 Line Page render · globalgrid2050 / testcode/particles/04-line-161846/index.html lines 1–33
  7. Particles — 05 Line 30910 Page render · globalgrid2050 / testcode/particles/05-line-30910/index.html lines 1–33
  8. Particles — 06 UK Line Page render · globalgrid2050 / testcode/particles/06-uk-line-242769/index.html lines 1–33

CI Star Checks

A Python command-line tool in the testcode folder of GlobalGrid2050 that fetches today, history, UK solar and voices, using SHA-256 from the star-solar-star repository.

automationglobalgrid2050 / testcode/ci/star_checks.py · lines 1–343 of 343 · Entry point · pattern strict_json (shared by 2 files)

What it does
It fetches today, history, UK solar and voices. Defines 21 functions or classes, including digest, strict_json, unique, finite_only, git. Uses libraries __future__, argparse, concurrent.futures, datetime, hashlib. Side effects: reads or writes files; makes network requests; starts processes.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: data source: star-solar-star data; JSON file today.json; JSON file history.json; JSON file uk-solar.json; JSON file voices.json; JSON file press.json; JSON file provenance.json; command-line arguments.
Downstream impact
Used directly by 2 files: CI Test Star Checks (globalgrid2050); GlobalGrid2050 Star Checks Workflow (globalgrid2050). Reached from 1 other entry point, including GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050).
What it achieves
It validates sun owner (`validate_sun_owner`) and is built from the digest step (`digest`) and the strict JSON helper (`strict_json`). Read-only publication audit. Reports contain hashes/counts, never fetched bodies. It accepts `--repo-root`, `--sun-root` and `--output`.
Why it matters
Run by GlobalGrid2050 Star Checks Workflow. Checked by CI Test Star Checks.
Application
globalgrid2050 · testcode/ci · Python CLI
Uses
__future__, argparse, concurrent.futures, datetime, hashlib, json, re, subprocess
Used by
run by CI Test Star Checks (script call), run by GlobalGrid2050 Star Checks Workflow (workflow run)
Produces
digest, strict_json, git, committed, safe_asset, inventory, plan, origin, remaining_timeout, SameOriginRedirect, fetch, sector_patterns
Defines here
digest, strict_json, unique, finite_only, git, committed, safe_asset, inventory, plan, origin, remaining_timeout, SameOriginRedirect, redirect_request, fetch, sector_patterns, walk, check_item, validate_sun_owner, window_open, window_overdue_days, main
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/ci/star_checks.py:1-343 · blob e990bf2243cea5c6a466690571905e1985b15031 · GitHub at these lines
State
achieves: comment · context: readme_derived · stage: output · effects: filesystem, network, process · domain stage: experimental · users: none · canonical: production_core
#!/usr/bin/env python3
"""Read-only publication audit. Reports contain hashes/counts, never fetched bodies."""
from __future__ import annotations

import argparse
import concurrent.futures
import datetime as dt
import hashlib
import json
import re
import subprocess
import sys
import tempfile
import time
import urllib.error
import urllib.parse
import urllib.request
from pathlib import Path, PurePosixPath

PUBLIC_BASE = "https://globalgrid2050.com/"
SUN_BASE = "https://ventusltd.github.io/star-solar-star/"
SUN_COMMIT = "8b930de59db7b7a6d332025da3eaf80ce8dcf9ab"
SUN_FILES = ("today.json", "history.json", "uk-solar.json", "voices.json", "press.json", "provenance.json")
SUN_CODE = ("scripts/build_sun.py", "scripts/validate_sun.py")
SHA256 = re.compile(r"[0-9a-f]{64}")
MAX_FILE_BYTES = 4 * 1024 * 1024
MAX_TOTAL_BYTES = 160 * 1024 * 1024
SECTOR = "testcode/202609150125/"
PATTERNS = {
    "company_suffix": re.compile(r"\b(?:LIMITED|LTD|PLC|LLP)\b", re.I),
    "registration_number": re.compile(r"(?<!\d)\d{8}(?!\d)"),
    "full_postcode": re.compile(r"\b[A-Z]{1,2}\d[A-Z\d]? ?\d[A-Z]{2}\b"),
    "email_marker": re.compile(r"@"),
}
IDENTIFIER_KEYS = {"company_name", "company_number", "registration_number", "registered_office_address",
                   "address_line_1", "full_postcode", "email", "telephone", "phone_number"}


def digest(raw: bytes) -> str:
    return hashlib.sha256(raw).hexdigest()


def strict_json(raw: bytes):
    def unique(pairs):
        result = {}
        for key, value in pairs:
            if key in result:
                raise ValueError("duplicate JSON key")
            result[key] = value
        return result
    def finite_only(value):
        raise ValueError("non-finite JSON number")
    return json.loads(raw, object_pairs_hook=unique, parse_constant=finite_only)


def git(root: Path, *args: str) -> bytes:
    return subprocess.check_output(["git", "-C", str(root), *args], stderr=subprocess.DEVNULL, timeout=30)


def committed(root: Path, commit: str, path: str) -> bytes:
    return git(root, "show", f"{commit}:{path}")


def safe_asset(manifest: str, name: str) -> str:
    if not isinstance(name, str) or not name or any(c in name for c in "\\%?#:"):
        raise ValueError("invalid asset path")
    parts = name.split("/")
    if any(part in {"", ".", ".."} for part in parts):
        raise ValueError("asset path must not escape its publication")
    parent = str(PurePosixPath(manifest).parent)
    path = name if name.startswith(parent + "/") else parent + "/" + name
    if name.startswith("testcode/") and not name.startswith(parent + "/"):
        raise ValueError("asset path refers to another publication")
    return path


def inventory(manifest: str, obj: dict) -> list[dict] | None:
    files = obj.get("files")
    if files is None:
        return None
    if isinstance(files, dict):
        rows = [{**value, "path": key} for key, value in files.items() if isinstance(value, dict)]
        if len(rows) != len(files):
            raise ValueError("unsupported file inventory")
    elif isinstance(files, list):
        rows = files
    else:
        raise ValueError("unsupported file inventory")
    out, seen = [], set()
    for row in rows:
        if not isinstance(row, dict):
            raise ValueError("invalid file record")
        path = safe_asset(manifest, row.get("path", row.get("file")))
        size, sha = row.get("bytes"), row.get("sha256")
        if type(size) is not int or not 0 <= size <= MAX_FILE_BYTES or not isinstance(sha, str) or not SHA256.fullmatch(sha):
            raise ValueError("invalid file size or SHA256")
        if path in seen:
            raise ValueError("duplicate inventory path")
        seen.add(path)
        out.append({"path": path, "bytes": size, "sha256": sha, "kind": "asset"})
    return out


def plan(root: Path, commit: str) -> tuple[list[dict], dict]:
    paths = git(root, "ls-tree", "-r", "--name-only", commit).decode().splitlines()
    manifests = sorted(path for path in paths if re.fullmatch(r"testcode/[^/]+/publication\.json", path))
    if not manifests:
        raise ValueError("no committed publication manifests")
    checks, manifest_only, unsupported = [], [], []
    for path in manifests:
        raw = committed(root, commit, path)
        if len(raw) > MAX_FILE_BYTES:
            raise ValueError("manifest exceeds size bound")
        checks.append({"path": path, "bytes": len(raw), "sha256": digest(raw), "kind": "manifest"})
        try:
            rows = inventory(path, strict_json(raw))
        except (ValueError, TypeError, AttributeError):
            unsupported.append(path)
            continue
        if rows is None:
            manifest_only.append(path)
        else:
            checks.extend(rows)
    if sum(check["bytes"] for check in checks) > MAX_TOTAL_BYTES:
        raise ValueError("publication sweep exceeds total size bound")
    return checks, {"manifests": len(manifests), "declared_assets": len(checks)-len(manifests),
                    "manifest_only": manifest_only, "unsupported_inventory": unsupported,
                    "all_manifests_have_asset_inventory": not manifest_only and not unsupported}


def origin(url: str) -> tuple:
    parsed = urllib.parse.urlsplit(url)
    if parsed.username is not None or parsed.password is not None:
        raise ValueError("URL credentials are not supported")
    return parsed.scheme, parsed.hostname, parsed.port or {"https": 443, "http": 80}.get(parsed.scheme)


def remaining_timeout(deadline: float, maximum: float) -> float:
    remaining = deadline - time.monotonic()
    if remaining <= 0:
        raise TimeoutError("sweep deadline reached")
    return min(maximum, remaining)


class SameOriginRedirect(urllib.request.HTTPRedirectHandler):
    def redirect_request(self, req, fp, code, msg, headers, newurl):
        # Validate before urllib opens the redirect target, including scheme and
        # port changes. A post-response check alone is too late to prevent a request.
        if origin(req.full_url) != origin(newurl):
            raise ValueError("cross-origin redirect")
        return super().redirect_request(req, fp, code, msg, headers, newurl)


def fetch(url: str, limit: int, deadline: float) -> bytes:
    timeout = remaining_timeout(deadline, 15)
    request = urllib.request.Request(url, headers={"User-Agent": "GlobalGrid2050-Publication-Integrity/1.0", "Accept-Encoding": "identity"})
    opener = urllib.request.build_opener(SameOriginRedirect())
    with opener.open(request, timeout=timeout) as response:
        if origin(response.url) != origin(url):
            raise ValueError("cross-origin redirect")
        chunks, size = [], 0
        while True:
            if time.monotonic() >= deadline:
                raise TimeoutError("sweep deadline reached")
            chunk = response.read1(min(65536, limit + 1 - size))
            if not chunk:
                break
            chunks.append(chunk)
            size += len(chunk)
            if size > limit:
                raise ValueError("response exceeds declared size")
        raw = b"".join(chunks)
    if len(raw) > limit:
        raise ValueError("response exceeds declared size")
    return raw


def sector_patterns(raw: bytes) -> dict[str, int]:
    """Public JSON strings/keys only. No source-name corpus and no matched values returned."""
    counts = {key: 0 for key in PATTERNS}
    counts["identifier_keys"] = 0
    def walk(value):
        if isinstance(value, str):
            value = re.sub(r"\b[0-9a-f]{64}\b", "", value)
            for name, pattern in PATTERNS.items():
                counts[name] += len(pattern.findall(value))
        elif isinstance(value, dict):
            for key, child in value.items():
                counts["identifier_keys"] += int(key.lower() in IDENTIFIER_KEYS)
                walk(key)
                walk(child)
        elif isinstance(value, list):
            for child in value:
                walk(child)
    walk(strict_json(raw))
    return counts


def check_item(item: dict, base: str, deadline: float, reader=fetch) -> dict:
    result = {**item, "match": False}
    url = base + urllib.parse.quote(item["path"], safe="/")
    try:
        raw = reader(url, item["bytes"], deadline)
        result.update(actual_bytes=len(raw), actual_sha256=digest(raw))
        result["match"] = len(raw) == item["bytes"] and digest(raw) == item["sha256"]
        if item["path"].startswith(SECTOR + "data/") and item["path"].endswith(".json"):
            result["public_pattern_counts"] = sector_patterns(raw)
    except urllib.error.HTTPError as exc:
        result["match"] = False
        result["error"] = f"http_{exc.code}"
    except Exception as exc:
        result["match"] = False
        result["error"] = type(exc).__name__
    return result


def validate_sun_owner(owner: Path, deadline: float, reader=fetch) -> dict:
    if git(owner, "rev-parse", "HEAD").decode().strip() != SUN_COMMIT:
        raise ValueError("Sun owner checkout does not match pinned commit")
    result = {"repository": "Ventusltd/star-solar-star", "commit": SUN_COMMIT,
              "dependencies": [], "files": [], "validated": False}
    with tempfile.TemporaryDirectory(prefix="star-checks-") as temp:
        temp_root = Path(temp)
        # Execute only the reviewed pinned owner dependency closure. No publication
        # manifest controls code imports, and the historical Sector script is never run.
        for path in SUN_CODE:
            raw = committed(owner, SUN_COMMIT, path)
            result["dependencies"].append({"path": path, "sha256": digest(raw), "bytes": len(raw)})
            (temp_root / Path(path).name).write_bytes(raw)
        data = temp_root / "sun"
        data.mkdir()
        for name in SUN_FILES:
            path = "sun/" + name
            expected = committed(owner, SUN_COMMIT, path)
            item = {"path": path, "bytes": len(expected), "sha256": digest(expected), "kind": "sun"}
            raw = reader(SUN_BASE + path, len(expected), deadline)
            result["files"].append({**item, "actual_bytes": len(raw), "actual_sha256": digest(raw), "match": raw == expected})
            (data / name).write_bytes(raw)
        if not all(row["match"] for row in result["files"]):
            return result
        run = subprocess.run([sys.executable, str(temp_root / "validate_sun.py"), str(data)],
                             capture_output=True, timeout=remaining_timeout(deadline, 30), check=False)
        result["validated"] = run.returncode == 0
        result["validator_exit"] = run.returncode
        # Validator output is deliberately not included: report only execution status
        # and hashes/counts. Downloaded bodies are deleted with the temporary directory.
    return result


def window_open(until: str, now: dt.datetime | None = None) -> bool:
    if not re.fullmatch(r"\d{4}-\d{2}-\d{2}T\d{2}:\d{2}:\d{2}Z", until.strip()):
        raise ValueError("invalid night cutoff")
    return (now or dt.datetime.now(dt.timezone.utc)) < dt.datetime.fromisoformat(until.strip().replace("Z", "+00:00"))


EXPIRY_GRACE_DAYS = 7


def window_overdue_days(until: str, now: dt.datetime | None = None) -> float:
    """How long ago did the night window close? Negative while it is still open."""
    cutoff = dt.datetime.fromisoformat(until.strip().replace("Z", "+00:00"))
    return ((now or dt.datetime.now(dt.timezone.utc)) - cutoff).total_seconds() / 86400


def main(argv=None) -> int:
    parser = argparse.ArgumentParser()
    parser.add_argument("--repo-root", type=Path, default=Path(__file__).resolve().parents[2])
    parser.add_argument("--sun-root", type=Path, required=True)
    parser.add_argument("--output", type=Path, required=True)
    args = parser.parse_args(argv)
    root = args.repo_root.resolve()
    commit = git(root, "rev-parse", "HEAD").decode().strip()
    until = committed(root, commit, "testcode/ci/NIGHT-UNTIL.txt").decode().strip()
    report = {"schema": "globalgrid2050.star-checks.v1", "commit": commit,
              "run_utc": dt.datetime.now(dt.timezone.utc).isoformat(), "until_utc": until,
              "private_name_comparison": "unavailable; public patterns are not proof of absence of private names"}
    exit_code = 0
    try:
        if not window_open(until):
            # EXPIRED IS NOT A PASS.
            #
            # This used to set status "window_closed", and the workflow step that
            # reads this report says, in as many words, `if status ==
            # "window_closed": print(...)` and then does not assert anything. So
            # from 2026-09-15T07:00:00Z the two-hourly sweep has been green
            # without looking at a single published byte - and the run before it,
            # inside the window, found three mismatches. The colour got better
            # when the checking stopped.
            #
            # A closed window now says EXPIRED, carries pass=None rather than a
            # missing key, and exits 3. And a window nobody has renewed or
            # deleted for EXPIRY_GRACE_DAYS is not idle, it is abandoned: that is
            # a FAIL, because a gate asking nothing forever is a defect.
            overdue = window_overdue_days(until)
            report["overdue_days"] = round(overdue, 3)
            if overdue > EXPIRY_GRACE_DAYS:
                report["status"] = "abandoned"
                report["verdict"] = "FAIL"
                report["pass"] = False
                report["detail"] = (
                    f"the night window closed {overdue:.1f} days ago and nothing has renewed or "
                    f"deleted it; put a later time in testcode/ci/NIGHT-UNTIL.txt or remove the "
                    f"schedule from .github/workflows/star-checks.yml")
                exit_code = 1
            else:
                report["status"] = "expired"
                report["verdict"] = "EXPIRED"
                report["pass"] = None
                report["detail"] = f"night window closed {overdue:.1f} days ago; nothing was checked"
                exit_code = 3
        else:
            # Limit the sweep to 8 minutes and to the authorization cutoff, with at
            # most four concurrent requests and no response above its declared size.
            cutoff = dt.datetime.fromisoformat(until.replace("Z", "+00:00"))
            seconds_left = (cutoff-dt.datetime.now(dt.timezone.utc)).total_seconds()
            deadline = time.monotonic() + min(480, max(0, seconds_left))
            checks, coverage = plan(root, commit)
            report["coverage"] = coverage
            with concurrent.futures.ThreadPoolExecutor(max_workers=4) as pool:
                rows = list(pool.map(lambda item: check_item(item, PUBLIC_BASE, deadline), checks))
            report["files"] = rows
            report["mismatches"] = sum(not row["match"] for row in rows)
            report["public_pattern_findings"] = sum(sum(row.get("public_pattern_counts", {}).values()) for row in rows)
            report["sun"] = validate_sun_owner(args.sun_root, deadline)
            report["checked_items_pass"] = not coverage["unsupported_inventory"] and report["mismatches"] == 0 and report["public_pattern_findings"] == 0 and report["sun"]["validated"]
            report["pass"] = report["checked_items_pass"]
            report["full_assurance"] = False  # Missing private-name comparison is an explicit open gate.
            report["status"] = "checked" if report["checked_items_pass"] else "findings"
            report["verdict"] = "PASS" if report["checked_items_pass"] else "FAIL"
            exit_code = 0 if report["checked_items_pass"] else 1
    except Exception as exc:
        report.update(status="error", verdict="FAIL", error=type(exc).__name__,
                      checked_items_pass=False, full_assurance=False)
        report["pass"] = False
        exit_code = 1
    args.output.parent.mkdir(parents=True, exist_ok=True)
    args.output.write_text(json.dumps(report, indent=2, sort_keys=True)+"\n", encoding="utf-8")
    print(json.dumps({key: value for key, value in report.items() if key not in {"files", "sun", "coverage"}}, sort_keys=True))
    return exit_code


if __name__ == "__main__":
    sys.exit(main())

CI Test Star Checks

A test in the testcode folder of GlobalGrid2050 that checks CI Star Checks, using SHA-256.

testglobalgrid2050 / testcode/ci/test_star_checks.py · lines 1–160 of 160 · Entry point · pattern Target (shared by 3 files)

What it does
It tests its inputs. Defines 21 functions or classes, including PublicationChecks, test_inventory_supports_three_committed_formats, test_missing_inventory_is_explicit, test_path_escapes_and_cross_publication_references_rejected, test_invalid_hash_size_duplicate_inventory_rejected. Uses libraries datetime, importlib.util, json, pathlib, time. Side effects: reads or writes files; makes network requests.
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
In: data source: 127.0.0.1:{source.server_port}; JSON file x.json; JSON file publication.json; JSON file test.json.
Downstream impact
Used directly by 2 files: GlobalGrid2050 Project Signals Acid Workflow (globalgrid2050); GlobalGrid2050 Star Checks Workflow (globalgrid2050).
What it achieves
It is built from the publication checks class (`PublicationChecks`), the target class (`Target`) and the do get helper (`do_GET`). Defines `PublicationChecks`, `test_inventory_supports_three_committed_formats`, `test_missing_inventory_is_explicit` and 18 more.
Why it matters
Run by GlobalGrid2050 Project Signals Acid Workflow and GlobalGrid2050 Star Checks Workflow.
Application
globalgrid2050 · testcode/ci · test
Uses
CI Star Checks (script call), datetime, importlib.util, json, pathlib, time, threading, unittest, http.server
Used by
run by GlobalGrid2050 Project Signals Acid Workflow (workflow run), run by GlobalGrid2050 Star Checks Workflow (workflow run)
Produces
PublicationChecks
Defines here
PublicationChecks, test_inventory_supports_three_committed_formats, test_missing_inventory_is_explicit, test_path_escapes_and_cross_publication_references_rejected, test_invalid_hash_size_duplicate_inventory_rejected, test_served_manifest_cannot_authorize_changed_asset, test_plan_uses_committed_manifest_bytes, test_unsupported_inventory_is_a_distinct_coverage_gate, test_public_patterns_report_counts_not_values, test_public_patterns_ignore_numeric_measurements_and_hashes, test_duplicate_json_and_failed_pattern_scan_fail_closed, test_redirect_target_is_never_requested_across_origins, Target, do_GET, log_message, Redirect, do_GET, test_sun_owner_pin_checked_before_execution, test_night_cutoff_is_exclusive_and_utc, test_subprocess_timeout_respects_remaining_deadline, test_production_pin_matches_workflow
Cannot conclude
Whether this code runs, is used by a live app today, or is correct. This is a static reading.
Evidence
globalgrid2050@0aca5121f0795e469b6cf4fc3d3b628edba8d883 testcode/ci/test_star_checks.py:1-160 · blob 82687346a985d3034394018756e1ea86637d1806 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: ingest · effects: filesystem, network · domain stage: experimental · users: none · canonical: production_core
import datetime as dt
import importlib.util
import json
import pathlib
import time
import threading
import unittest
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
from unittest.mock import patch

SPEC = importlib.util.spec_from_file_location("star_checks", pathlib.Path(__file__).with_name("star_checks.py"))
checks = importlib.util.module_from_spec(SPEC)
SPEC.loader.exec_module(checks)


class PublicationChecks(unittest.TestCase):
    def test_inventory_supports_three_committed_formats(self):
        item = {"bytes": 3, "sha256": "a"*64}
        variants = [{"files": [{**item, "path": "x.json"}]},
                    {"files": [{**item, "file": "x.json"}]},
                    {"files": {"x.json": item}}]
        rows = [checks.inventory("testcode/123/publication.json", obj) for obj in variants]
        self.assertEqual(rows[0], rows[1])
        self.assertEqual(rows[0], rows[2])
        self.assertEqual(rows[0][0]["path"], "testcode/123/x.json")
        self.assertEqual(checks.safe_asset("testcode/123/publication.json", "testcode/123/x.json"), "testcode/123/x.json")

    def test_missing_inventory_is_explicit(self):
        self.assertIsNone(checks.inventory("testcode/123/publication.json", {}))
        with self.assertRaises(ValueError):
            checks.inventory("testcode/123/publication.json", {"files": "unsupported"})

    def test_path_escapes_and_cross_publication_references_rejected(self):
        for path in ("../x", "/x", "x/../y", "https://example.com/x", "testcode/456/x", "x%2fy", "x\\y", "x?y", "x//y", "."):
            with self.subTest(path=path), self.assertRaises(ValueError):
                checks.safe_asset("testcode/123/publication.json", path)

    def test_invalid_hash_size_duplicate_inventory_rejected(self):
        for item in ({"path": "x", "bytes": True, "sha256": "a"*64},
                     {"path": "x", "bytes": -1, "sha256": "a"*64},
                     {"path": "x", "bytes": checks.MAX_FILE_BYTES+1, "sha256": "a"*64},
                     {"path": "x", "bytes": 2, "sha256": "bad"}):
            with self.assertRaises(ValueError):
                checks.inventory("testcode/123/publication.json", {"files": [item]})
        item = {"path":"x", "bytes":2, "sha256":"a"*64}
        with self.assertRaises(ValueError):
            checks.inventory("testcode/123/publication.json", {"files":[item,item]})

    def test_served_manifest_cannot_authorize_changed_asset(self):
        trusted = b'original'
        item = {"path":"testcode/123/x", "bytes":len(trusted), "sha256":checks.digest(trusted), "kind":"asset"}
        wrong = checks.check_item(item, checks.PUBLIC_BASE, time.monotonic()+1, lambda *args:b"modified")
        right = checks.check_item(item, checks.PUBLIC_BASE, time.monotonic()+1, lambda *args:trusted)
        self.assertFalse(wrong["match"])
        self.assertTrue(right["match"])
        self.assertNotIn("modified", json.dumps(wrong))

    def test_plan_uses_committed_manifest_bytes(self):
        manifest = b'{"files":[{"file":"x","bytes":1,"sha256":"' + b'a'*64 + b'"}]}'
        with patch.object(checks, "git", return_value=b"testcode/123/publication.json\n"), patch.object(checks, "committed", return_value=manifest):
            rows, coverage = checks.plan(pathlib.Path('.'), 'pinned')
        self.assertEqual(rows[0]["sha256"], checks.digest(manifest))
        self.assertEqual(coverage["declared_assets"], 1)
        self.assertEqual(rows[1]["sha256"], "a"*64)

    def test_unsupported_inventory_is_a_distinct_coverage_gate(self):
        manifest = b'{"files":"unsupported"}'
        with patch.object(checks, "git", return_value=b"testcode/123/publication.json\n"), patch.object(checks, "committed", return_value=manifest):
            rows, coverage = checks.plan(pathlib.Path('.'),'pinned')
        self.assertEqual(len(rows),1)
        self.assertEqual(coverage['unsupported_inventory'],['testcode/123/publication.json'])
        self.assertEqual(coverage['manifest_only'],[])
        self.assertFalse(coverage['all_manifests_have_asset_inventory'])

    def test_public_patterns_report_counts_not_values(self):
        raw = json.dumps({"company_name":"Example Private Limited", "contact":"x@example.test", "address":"AB1 2CD", "registration":"12345678"}).encode()
        result = checks.sector_patterns(raw)
        self.assertEqual(result["company_suffix"], 1)
        self.assertEqual(result["identifier_keys"], 1)
        self.assertEqual(result["full_postcode"], 1)
        self.assertEqual(result["registration_number"], 1)
        self.assertNotIn("Example", json.dumps(result))
        self.assertTrue(all(type(value) is int for value in result.values()))

    def test_public_patterns_ignore_numeric_measurements_and_hashes(self):
        result = checks.sector_patterns(json.dumps({"count":12345678, "sha256":"12345678"*8}).encode())
        self.assertFalse(any(result.values()))

    def test_duplicate_json_and_failed_pattern_scan_fail_closed(self):
        raw = b'{"value":"first", "value":"second"}'
        with self.assertRaises(ValueError):
            checks.strict_json(raw)
        item = {"path":checks.SECTOR+'data/test.json', "bytes":len(raw), "sha256":checks.digest(raw), "kind":"asset"}
        result = checks.check_item(item,checks.PUBLIC_BASE,time.monotonic()+1,lambda *args:raw)
        self.assertFalse(result['match'])
        self.assertEqual(result['error'],'ValueError')
        for raw in (b'{"value":NaN}',b'{"value":Infinity}',b'{"value":-Infinity}'):
            with self.assertRaises(ValueError):
                checks.strict_json(raw)

    def test_redirect_target_is_never_requested_across_origins(self):
        requests = []
        class Target(BaseHTTPRequestHandler):
            def do_GET(self):
                requests.append(self.path)
                self.send_response(200)
                self.end_headers()
                self.wfile.write(b'x')
            def log_message(self,*args):
                pass
        target = ThreadingHTTPServer(('127.0.0.1',0),Target)
        class Redirect(Target):
            def do_GET(self):
                self.send_response(302)
                self.send_header('Location',f'http://127.0.0.1:{target.server_port}/blocked')
                self.end_headers()
        source = ThreadingHTTPServer(('127.0.0.1',0),Redirect)
        threads = [threading.Thread(target=server.serve_forever,daemon=True) for server in (source,target)]
        for thread in threads:
            thread.start()
        try:
            with self.assertRaises(ValueError):
                checks.fetch(f'http://127.0.0.1:{source.server_port}/',1,time.monotonic()+2)
            self.assertEqual(requests,[])
            self.assertNotEqual(checks.origin('https://example.test/'),checks.origin('http://example.test/'))
            self.assertEqual(checks.origin('https://example.test/'),checks.origin('https://example.test:443/'))
        finally:
            for server in (source,target):
                server.shutdown()
                server.server_close()
            for thread in threads:
                thread.join()

    def test_sun_owner_pin_checked_before_execution(self):
        with patch.object(checks, "git", return_value=b"0"*40), self.assertRaises(ValueError):
            checks.validate_sun_owner(pathlib.Path('.'), time.monotonic()+1)

    def test_night_cutoff_is_exclusive_and_utc(self):
        at = dt.datetime(2026,9,15,7,tzinfo=dt.timezone.utc)
        self.assertTrue(checks.window_open("2026-09-15T07:00:00Z",at-dt.timedelta(seconds=1)))
        self.assertFalse(checks.window_open("2026-09-15T07:00:00Z",at))
        for text in ("never", "2026-09-15T07:00:00", "2026-09-15T07:00:00+01:00"):
            with self.assertRaises(ValueError):
                checks.window_open(text,at)

    def test_subprocess_timeout_respects_remaining_deadline(self):
        with patch.object(checks.time,'monotonic',return_value=100):
            self.assertEqual(checks.remaining_timeout(105,30),5)
            self.assertEqual(checks.remaining_timeout(150,30),30)
            with self.assertRaises(TimeoutError):
                checks.remaining_timeout(100,30)

    def test_production_pin_matches_workflow(self):
        workflow = pathlib.Path(__file__).resolve().parents[2]/'.github/workflows/star-checks.yml'
        self.assertIn(checks.SUN_COMMIT,workflow.read_text())
        self.assertNotIn('issues: write',workflow.read_text())


if __name__ == '__main__':
    unittest.main()

Particles — 01 Run T0120z Page

A web page in the testcode folder of GlobalGrid2050. Published at https://globalgrid2050.com/testcode/particles/01-run-20260918t0120z/.

renderglobalgrid2050 / testcode/particles/01-run-20260918t0120z/index.html · lines 1–31 of 31 · version 2026-09-18 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
Out: web page.
Downstream impact
It is itself an entry point, published at https://globalgrid2050.com/testcode/particles/01-run-20260918t0120z/.
What it achieves
Its code works with 100 kW.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · testcode/particles/01-run-20260918t0120z · page
Uses
none found
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 testcode/particles/01-run-20260918t0120z/index.html:1-31 · blob 8de70ddfc03286c2565062817020de8783058cb9 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
<!doctype html><html lang="en-GB"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Particles iteration 01</title><style>body{margin:0;background:#000;color:#ccc;font:15px/1.5 ui-monospace,Consolas,monospace}main{max-width:1100px;margin:0 auto;padding:24px 16px}h1{font-size:18px;color:#f2f2f2;margin:0 0 4px}img{width:100%;height:auto;display:block;background:#000;margin:16px 0 6px}small{color:#8a8a8a}a{color:#61d6d6}code{color:#f9f1a5}table{border-collapse:collapse}td,th{p  … [line shortened here: 459 characters; full line on GitHub]
<h1>Iteration 1: 67,108,864 particles under two laws; the Underground, 341 stops; scope tests 4 of 9 tests; 0 failed</h1>
<p>testcode/particles/01-run-20260918t0120z · machine-made on the MSI at 20260918T0120Z by <a href="https://github.com/Ventusltd/particle-physics-drawing-engine">particle-physics-drawing-engine</a> · <a href="../">all iterations</a></p>
<p>Same-sized particles, positions computed from the address by a named law, nothing stored. Left: one spiral. Right: a stack of layers of 262,144 slots, angle by whole-number arithmetic.</p>
<img src="spiral-vs-stack.png" alt="spiral versus stack">
<small>67,108,864 particles; spiral 20.93 s, stack 26.71 s; cells lit 823,777 / 824,320</small>
<p style="margin-top:24px">A network from the typed command <code>draw underground</code>: topology from Transport for London's open data, drawn as the same particles under an eight-direction schematic law. No map artwork.</p>
<img src="underground.png" alt="the Underground as particles">
<small>11 lines, 341 stops, 314 edges, 6,336 particles. Powered by TfL Open Data. Contains OS data © Crown copyright and database rights 2016 and Geomni UK Map data © and database rights 2019.</small>
<h2 style="font-size:16px;margin-top:28px">Generated layers, regenerated and hashed on this machine</h2>
<table><tr><th>layer</th><th>size</th><th>hash of every line</th><th>time</th></tr><tr><td>layer 1</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.63 s</td></tr><tr><td>layer 16</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>layer 64</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>laye  … [line shortened here: 499 characters; full line on GitHub]
<h2 style="font-size:16px;margin-top:28px">Scope status</h2>
<pre style="white-space:pre-wrap;color:#aaa"># Scope status 2026-09-18T01:21:39Z

Ran 4 of 9 tests; 0 failed. Tests marked NOT YET BUILT have no script yet (T1 needs a person with the phone).

| test | what | status | run | last line |
|---|---|---|---|---|
| T1 | a physical iPhone draws one layer | **NOT YET BUILT** |  | `` |
| T2 | exactness of the angle law | **PASS** | exit 0, 0.1 s | `PASS: limit 0.25 px within one layer` |
| T3 | cross-device positions within a pixel | **NOT YET BUILT** |  | `` |
| T4 | generator determinism: a layer regenerates identically | **PASS** | exit 0, 1.2 s | `DNA: regenerated 262144 of 262144 slots on Windows-11-10.0.26200-SP0; MATCH 7e8e65dc0ae61eec... vs 7e8e65dc0ae61eec...` |
| T5 | address to source in one request | **NOT YET BUILT** |  | `` |
| T6 | a law missing a fact refuses by name | **NOT YET BUILT** |  | `` |
| T7 | sixteen layers served from the workstation's second drive | **NOT YET BUILT** |  | `` |
| B1 | spiral and stack side by side | **PASS** | exit 0, 4.3 s | `{"layers": 4, "particles_per_layer": 65536, "particles": 262144, "spiral": {"cells_lit": 262144, "peak_per_cell": 1, "se` |
| B2 | a network from a typed command (the Underground) | **PASS** | exit 0, 1.8 s | `{"command": "draw underground", "source": "https://api.tfl.gov.uk/Line/Mode/tube + /Line/&lt;id>/Route/Sequence/all", "attr` |
</pre>
<small>This page charts measured facts. It is not a design tool; above 100 kW a chartered electrical engineer signs.</small>
</main></body></html>

Particles — 02 Run T0120z Page

A web page in the testcode folder of GlobalGrid2050. Published at https://globalgrid2050.com/testcode/particles/02-run-20260918t0120z/.

renderglobalgrid2050 / testcode/particles/02-run-20260918t0120z/index.html · lines 1–31 of 31 · version 2026-09-18 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
Out: web page.
Downstream impact
It is itself an entry point, published at https://globalgrid2050.com/testcode/particles/02-run-20260918t0120z/.
What it achieves
Its code works with 100 kW.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · testcode/particles/02-run-20260918t0120z · page
Uses
none found
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 testcode/particles/02-run-20260918t0120z/index.html:1-31 · blob 77f15ae8728d3407bc3e80c0cda8078d273daf74 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
<!doctype html><html lang="en-GB"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Particles iteration 02</title><style>body{margin:0;background:#000;color:#ccc;font:15px/1.5 ui-monospace,Consolas,monospace}main{max-width:1100px;margin:0 auto;padding:24px 16px}h1{font-size:18px;color:#f2f2f2;margin:0 0 4px}img{width:100%;height:auto;display:block;background:#000;margin:16px 0 6px}small{color:#8a8a8a}a{color:#61d6d6}code{color:#f9f1a5}table{border-collapse:collapse}td,th{p  … [line shortened here: 459 characters; full line on GitHub]
<h1>Iteration 2: 67,108,864 particles under two laws; the Underground, 341 stops; scope tests 4 of 9 tests; 0 failed</h1>
<p>testcode/particles/02-run-20260918t0120z · machine-made on the MSI at 20260918T0120Z by <a href="https://github.com/Ventusltd/particle-physics-drawing-engine">particle-physics-drawing-engine</a> · <a href="../">all iterations</a></p>
<p>Same-sized particles, positions computed from the address by a named law, nothing stored. Left: one spiral. Right: a stack of layers of 262,144 slots, angle by whole-number arithmetic.</p>
<img src="spiral-vs-stack.png" alt="spiral versus stack">
<small>67,108,864 particles; spiral 20.93 s, stack 26.71 s; cells lit 823,777 / 824,320</small>
<p style="margin-top:24px">A network from the typed command <code>draw underground</code>: topology from Transport for London's open data, drawn as the same particles under an eight-direction schematic law. No map artwork.</p>
<img src="underground.png" alt="the Underground as particles">
<small>11 lines, 341 stops, 314 edges, 6,336 particles. Powered by TfL Open Data. Contains OS data © Crown copyright and database rights 2016 and Geomni UK Map data © and database rights 2019.</small>
<h2 style="font-size:16px;margin-top:28px">Generated layers, regenerated and hashed on this machine</h2>
<table><tr><th>layer</th><th>size</th><th>hash of every line</th><th>time</th></tr><tr><td>layer 1</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.63 s</td></tr><tr><td>layer 16</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>layer 64</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>laye  … [line shortened here: 499 characters; full line on GitHub]
<h2 style="font-size:16px;margin-top:28px">Scope status</h2>
<pre style="white-space:pre-wrap;color:#aaa"># Scope status 2026-09-18T01:21:39Z

Ran 4 of 9 tests; 0 failed. Tests marked NOT YET BUILT have no script yet (T1 needs a person with the phone).

| test | what | status | run | last line |
|---|---|---|---|---|
| T1 | a physical iPhone draws one layer | **NOT YET BUILT** |  | `` |
| T2 | exactness of the angle law | **PASS** | exit 0, 0.1 s | `PASS: limit 0.25 px within one layer` |
| T3 | cross-device positions within a pixel | **NOT YET BUILT** |  | `` |
| T4 | generator determinism: a layer regenerates identically | **PASS** | exit 0, 1.2 s | `DNA: regenerated 262144 of 262144 slots on Windows-11-10.0.26200-SP0; MATCH 7e8e65dc0ae61eec... vs 7e8e65dc0ae61eec...` |
| T5 | address to source in one request | **NOT YET BUILT** |  | `` |
| T6 | a law missing a fact refuses by name | **NOT YET BUILT** |  | `` |
| T7 | sixteen layers served from the workstation's second drive | **NOT YET BUILT** |  | `` |
| B1 | spiral and stack side by side | **PASS** | exit 0, 4.3 s | `{"layers": 4, "particles_per_layer": 65536, "particles": 262144, "spiral": {"cells_lit": 262144, "peak_per_cell": 1, "se` |
| B2 | a network from a typed command (the Underground) | **PASS** | exit 0, 1.8 s | `{"command": "draw underground", "source": "https://api.tfl.gov.uk/Line/Mode/tube + /Line/&lt;id>/Route/Sequence/all", "attr` |
</pre>
<small>This page charts measured facts. It is not a design tool; above 100 kW a chartered electrical engineer signs.</small>
</main></body></html>

Particles — 03 Run T0120z Page

A web page in the testcode folder of GlobalGrid2050. Published at https://globalgrid2050.com/testcode/particles/03-run-20260918t0120z/.

renderglobalgrid2050 / testcode/particles/03-run-20260918t0120z/index.html · lines 1–33 of 33 · version 2026-09-18 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
Out: web page.
Downstream impact
It is itself an entry point, published at https://globalgrid2050.com/testcode/particles/03-run-20260918t0120z/.
What it achieves
Its code works with 100 kW.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · testcode/particles/03-run-20260918t0120z · page
Uses
Wafer Development Environment — Key to Code Page (iframe)
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 testcode/particles/03-run-20260918t0120z/index.html:1-33 · blob 170720f779603bb876cd50e4ea3895c7b6257885 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
<!doctype html><html lang="en-GB"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Particles iteration 03</title><style>body{margin:0;background:#000;color:#ccc;font:15px/1.5 ui-monospace,Consolas,monospace}main{max-width:1400px;margin:0 auto;padding:0 0 24px}h1,p,table,pre,small{margin-left:16px;margin-right:16px}h1{font-size:18px;color:#f2f2f2;margin:0 0 4px}img{width:100%;height:auto;display:block;background:#000;margin:16px 0 6px}small{color:#8a8a8a}a{color:#61d6d6}co  … [line shortened here: 514 characters; full line on GitHub]
<iframe src="../../wafer-development-environment/202609170044-key-to-code/" title="the key-to-code wafer, the home view" style="width:100%;height:92vh;border:0;background:#000"></iframe>
<p><small>Above: the home view, the key-to-code wafer, live. Below: what the swarm measured in this run. The wafer does not yet answer <code>draw underground</code>; that is the next build on this renderer.</small></p>
<h1>Iteration 3: 67,108,864 particles under two laws; the Underground, 341 stops; scope tests 4 of 9 tests; 0 failed</h1>
<p>testcode/particles/03-run-20260918t0120z · machine-made on the MSI at 20260918T0120Z by <a href="https://github.com/Ventusltd/particle-physics-drawing-engine">particle-physics-drawing-engine</a> · <a href="../">all iterations</a></p>
<p>Same-sized particles, positions computed from the address by a named law, nothing stored. Left: one spiral. Right: a stack of layers of 262,144 slots, angle by whole-number arithmetic.</p>
<img src="spiral-vs-stack.png" alt="spiral versus stack">
<small>67,108,864 particles; spiral 20.93 s, stack 26.71 s; cells lit 823,777 / 824,320</small>
<p style="margin-top:24px">A network from the typed command <code>draw underground</code>: topology from Transport for London's open data, drawn as the same particles under an eight-direction schematic law. No map artwork.</p>
<img src="underground.png" alt="the Underground as particles">
<small>11 lines, 341 stops, 314 edges, 6,336 particles. Powered by TfL Open Data. Contains OS data © Crown copyright and database rights 2016 and Geomni UK Map data © and database rights 2019.</small>
<h2 style="font-size:16px;margin-top:28px">Generated layers, regenerated and hashed on this machine</h2>
<table><tr><th>layer</th><th>size</th><th>hash of every line</th><th>time</th></tr><tr><td>layer 1</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.63 s</td></tr><tr><td>layer 16</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>layer 64</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>laye  … [line shortened here: 499 characters; full line on GitHub]
<h2 style="font-size:16px;margin-top:28px">Scope status</h2>
<pre style="white-space:pre-wrap;color:#aaa"># Scope status 2026-09-18T01:21:39Z

Ran 4 of 9 tests; 0 failed. Tests marked NOT YET BUILT have no script yet (T1 needs a person with the phone).

| test | what | status | run | last line |
|---|---|---|---|---|
| T1 | a physical iPhone draws one layer | **NOT YET BUILT** |  | `` |
| T2 | exactness of the angle law | **PASS** | exit 0, 0.1 s | `PASS: limit 0.25 px within one layer` |
| T3 | cross-device positions within a pixel | **NOT YET BUILT** |  | `` |
| T4 | generator determinism: a layer regenerates identically | **PASS** | exit 0, 1.2 s | `DNA: regenerated 262144 of 262144 slots on Windows-11-10.0.26200-SP0; MATCH 7e8e65dc0ae61eec... vs 7e8e65dc0ae61eec...` |
| T5 | address to source in one request | **NOT YET BUILT** |  | `` |
| T6 | a law missing a fact refuses by name | **NOT YET BUILT** |  | `` |
| T7 | sixteen layers served from the workstation's second drive | **NOT YET BUILT** |  | `` |
| B1 | spiral and stack side by side | **PASS** | exit 0, 4.3 s | `{"layers": 4, "particles_per_layer": 65536, "particles": 262144, "spiral": {"cells_lit": 262144, "peak_per_cell": 1, "se` |
| B2 | a network from a typed command (the Underground) | **PASS** | exit 0, 1.8 s | `{"command": "draw underground", "source": "https://api.tfl.gov.uk/Line/Mode/tube + /Line/&lt;id>/Route/Sequence/all", "attr` |
</pre>
<small>This page charts measured facts. It is not a design tool; above 100 kW a chartered electrical engineer signs.</small>
</main></body></html>

Particles — 04 Line Page

A web page in the testcode folder of GlobalGrid2050. Published at https://globalgrid2050.com/testcode/particles/04-line-161846/.

renderglobalgrid2050 / testcode/particles/04-line-161846/index.html · lines 1–33 of 33 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
Out: web page.
Downstream impact
It is itself an entry point, published at https://globalgrid2050.com/testcode/particles/04-line-161846/.
What it achieves
Its code works with 100 kW.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · testcode/particles/04-line-161846 · page
Uses
Wafer Development Environment — State 39885 Page (iframe)
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 testcode/particles/04-line-161846/index.html:1-33 · blob 54b836b4f76852fd48038451c3ea6cb3e0747788 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
<!doctype html><html lang="en-GB"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Particles iteration 04</title><style>body{margin:0;background:#000;color:#ccc;font:15px/1.5 ui-monospace,Consolas,monospace}main{max-width:1400px;margin:0 auto;padding:0 0 24px}h1,p,table,pre,small{margin-left:16px;margin-right:16px}h1{font-size:18px;color:#f2f2f2;margin:0 0 4px}img{width:100%;height:auto;display:block;background:#000;margin:16px 0 6px}small{color:#8a8a8a}a{color:#61d6d6}co  … [line shortened here: 514 characters; full line on GitHub]
<iframe src="../../wafer-development-environment/202609170039-state-39885/?line=161846" title="the state wafer, the home view" style="width:100%;height:92vh;border:0;background:#000"></iframe>
<p><small>Above: the home view, the wafer opened on line 161846 (iteration 4 by the formula 1 + floor(frac(n/φ) × 342,795)) with its state, live. Below: what the swarm measured in this run. The wafer does not yet answer <code>draw underground</code>; that is the next build on this renderer.</small></p>
<h1>Iteration 4: line 161846; 67,108,864 particles under two laws; the Underground, 341 stops; scope tests 4 of 9 tests; 0 failed</h1>
<p>testcode/particles/04-line-161846 · machine-made on the MSI at 20260918T0120Z by <a href="https://github.com/Ventusltd/particle-physics-drawing-engine">particle-physics-drawing-engine</a> · <a href="../">all iterations</a></p>
<p>Same-sized particles, positions computed from the address by a named law, nothing stored. Left: one spiral. Right: a stack of layers of 262,144 slots, angle by whole-number arithmetic.</p>
<img src="spiral-vs-stack.png" alt="spiral versus stack">
<small>67,108,864 particles; spiral 20.93 s, stack 26.71 s; cells lit 823,777 / 824,320</small>
<p style="margin-top:24px">A network from the typed command <code>draw underground</code>: topology from Transport for London's open data, drawn as the same particles under an eight-direction schematic law. No map artwork.</p>
<img src="underground.png" alt="the Underground as particles">
<small>11 lines, 341 stops, 314 edges, 6,336 particles. Powered by TfL Open Data. Contains OS data © Crown copyright and database rights 2016 and Geomni UK Map data © and database rights 2019.</small>
<h2 style="font-size:16px;margin-top:28px">Generated layers, regenerated and hashed on this machine</h2>
<table><tr><th>layer</th><th>size</th><th>hash of every line</th><th>time</th></tr><tr><td>layer 1</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.63 s</td></tr><tr><td>layer 16</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>layer 64</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>laye  … [line shortened here: 499 characters; full line on GitHub]
<h2 style="font-size:16px;margin-top:28px">Scope status</h2>
<pre style="white-space:pre-wrap;color:#aaa"># Scope status 2026-09-18T01:21:39Z

Ran 4 of 9 tests; 0 failed. Tests marked NOT YET BUILT have no script yet (T1 needs a person with the phone).

| test | what | status | run | last line |
|---|---|---|---|---|
| T1 | a physical iPhone draws one layer | **NOT YET BUILT** |  | `` |
| T2 | exactness of the angle law | **PASS** | exit 0, 0.1 s | `PASS: limit 0.25 px within one layer` |
| T3 | cross-device positions within a pixel | **NOT YET BUILT** |  | `` |
| T4 | generator determinism: a layer regenerates identically | **PASS** | exit 0, 1.2 s | `DNA: regenerated 262144 of 262144 slots on Windows-11-10.0.26200-SP0; MATCH 7e8e65dc0ae61eec... vs 7e8e65dc0ae61eec...` |
| T5 | address to source in one request | **NOT YET BUILT** |  | `` |
| T6 | a law missing a fact refuses by name | **NOT YET BUILT** |  | `` |
| T7 | sixteen layers served from the workstation's second drive | **NOT YET BUILT** |  | `` |
| B1 | spiral and stack side by side | **PASS** | exit 0, 4.3 s | `{"layers": 4, "particles_per_layer": 65536, "particles": 262144, "spiral": {"cells_lit": 262144, "peak_per_cell": 1, "se` |
| B2 | a network from a typed command (the Underground) | **PASS** | exit 0, 1.8 s | `{"command": "draw underground", "source": "https://api.tfl.gov.uk/Line/Mode/tube + /Line/&lt;id>/Route/Sequence/all", "attr` |
</pre>
<small>This page charts measured facts. It is not a design tool; above 100 kW a chartered electrical engineer signs.</small>
</main></body></html>

Particles — 05 Line 30910 Page

A web page in the testcode folder of GlobalGrid2050. Published at https://globalgrid2050.com/testcode/particles/05-line-30910/.

renderglobalgrid2050 / testcode/particles/05-line-30910/index.html · lines 1–33 of 33 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
Out: web page.
Downstream impact
It is itself an entry point, published at https://globalgrid2050.com/testcode/particles/05-line-30910/.
What it achieves
Its code works with 100 kW.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · testcode/particles/05-line-30910 · page
Uses
Wafer Development Environment — State 39885 Page (iframe)
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 testcode/particles/05-line-30910/index.html:1-33 · blob 27012df354672f6e7175543630959382a1ce12d6 · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
<!doctype html><html lang="en-GB"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Particles iteration 05</title><style>body{margin:0;background:#000;color:#ccc;font:15px/1.5 ui-monospace,Consolas,monospace}main{max-width:1400px;margin:0 auto;padding:0 0 24px}h1,p,table,pre,small{margin-left:16px;margin-right:16px}h1{font-size:18px;color:#f2f2f2;margin:0 0 4px}img{width:100%;height:auto;display:block;background:#000;margin:16px 0 6px}small{color:#8a8a8a}a{color:#61d6d6}co  … [line shortened here: 514 characters; full line on GitHub]
<iframe src="../../wafer-development-environment/202609170039-state-39885/?line=30910" title="the state wafer, the home view" style="width:100%;height:92vh;border:0;background:#000"></iframe>
<p><small>Above: the home view, the wafer opened on line 30910 (iteration 5 by the formula 1 + floor(frac(n/φ) × 342,795)) with its state, live. Below: what the swarm measured in this run. The wafer does not yet answer <code>draw underground</code>; that is the next build on this renderer.</small></p>
<h1>Iteration 5: line 30910; 67,108,864 particles under two laws; the Underground, 341 stops; scope tests 4 of 9 tests; 0 failed</h1>
<p>testcode/particles/05-line-30910 · machine-made on the MSI at 20260918T0120Z by <a href="https://github.com/Ventusltd/particle-physics-drawing-engine">particle-physics-drawing-engine</a> · <a href="../">all iterations</a></p>
<p>Same-sized particles, positions computed from the address by a named law, nothing stored. Left: one spiral. Right: a stack of layers of 262,144 slots, angle by whole-number arithmetic.</p>
<img src="spiral-vs-stack.png" alt="spiral versus stack">
<small>67,108,864 particles; spiral 20.93 s, stack 26.71 s; cells lit 823,777 / 824,320</small>
<p style="margin-top:24px">A network from the typed command <code>draw underground</code>: topology from Transport for London's open data, drawn as the same particles under an eight-direction schematic law. No map artwork.</p>
<img src="underground.png" alt="the Underground as particles">
<small>11 lines, 341 stops, 314 edges, 6,336 particles. Powered by TfL Open Data. Contains OS data © Crown copyright and database rights 2016 and Geomni UK Map data © and database rights 2019.</small>
<h2 style="font-size:16px;margin-top:28px">Generated layers, regenerated and hashed on this machine</h2>
<table><tr><th>layer</th><th>size</th><th>hash of every line</th><th>time</th></tr><tr><td>layer 1</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.63 s</td></tr><tr><td>layer 16</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>layer 64</td><td>262,144 slots</td><td><code>7e8e65dc0ae61eec…</code></td><td>0.62 s</td></tr><tr><td>laye  … [line shortened here: 499 characters; full line on GitHub]
<h2 style="font-size:16px;margin-top:28px">Scope status</h2>
<pre style="white-space:pre-wrap;color:#aaa"># Scope status 2026-09-18T01:21:39Z

Ran 4 of 9 tests; 0 failed. Tests marked NOT YET BUILT have no script yet (T1 needs a person with the phone).

| test | what | status | run | last line |
|---|---|---|---|---|
| T1 | a physical iPhone draws one layer | **NOT YET BUILT** |  | `` |
| T2 | exactness of the angle law | **PASS** | exit 0, 0.1 s | `PASS: limit 0.25 px within one layer` |
| T3 | cross-device positions within a pixel | **NOT YET BUILT** |  | `` |
| T4 | generator determinism: a layer regenerates identically | **PASS** | exit 0, 1.2 s | `DNA: regenerated 262144 of 262144 slots on Windows-11-10.0.26200-SP0; MATCH 7e8e65dc0ae61eec... vs 7e8e65dc0ae61eec...` |
| T5 | address to source in one request | **NOT YET BUILT** |  | `` |
| T6 | a law missing a fact refuses by name | **NOT YET BUILT** |  | `` |
| T7 | sixteen layers served from the workstation's second drive | **NOT YET BUILT** |  | `` |
| B1 | spiral and stack side by side | **PASS** | exit 0, 4.3 s | `{"layers": 4, "particles_per_layer": 65536, "particles": 262144, "spiral": {"cells_lit": 262144, "peak_per_cell": 1, "se` |
| B2 | a network from a typed command (the Underground) | **PASS** | exit 0, 1.8 s | `{"command": "draw underground", "source": "https://api.tfl.gov.uk/Line/Mode/tube + /Line/&lt;id>/Route/Sequence/all", "attr` |
</pre>
<small>This page charts measured facts. It is not a design tool; above 100 kW a chartered electrical engineer signs.</small>
</main></body></html>

Particles — 06 UK Line Page

A web page in the testcode folder of GlobalGrid2050. Published at https://globalgrid2050.com/testcode/particles/06-uk-line-242769/.

renderglobalgrid2050 / testcode/particles/06-uk-line-242769/index.html · lines 1–33 of 33 · Entry point

What it does
It draws its content. Side effects: changes the web page (DOM).
Why it exists in the grid workflow
Domain stage experimental (path word 'testcode'): work its own path marks as experimental (sandbox, prototype, archive or similar words); by this evidence it is not part of a production workflow.
Inputs & outputs
Out: web page.
Downstream impact
It is itself an entry point, published at https://globalgrid2050.com/testcode/particles/06-uk-line-242769/.
What it achieves
Its code works with 100 kW.
Why it matters
No other file in the estate was found to import it; it is an entry point.
Application
globalgrid2050 · testcode/particles/06-uk-line-242769 · page
Uses
Wafer Development Environment — Real Systems Page (iframe)
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 testcode/particles/06-uk-line-242769/index.html:1-33 · blob 6242bdc285d546e6f8e2731af7063f138d998e5d · GitHub at these lines
State
achieves: name · context: readme_derived · stage: output · effects: dom · domain stage: experimental · users: none · canonical: production_core
<!doctype html><html lang="en-GB"><head><meta charset="utf-8"><meta name="viewport" content="width=device-width,initial-scale=1">
<title>Particles iteration 06</title><style>body{margin:0;background:#000;color:#ccc;font:15px/1.5 ui-monospace,Consolas,monospace}main{max-width:1400px;margin:0 auto;padding:0 0 24px}h1,p,table,pre,small{margin-left:16px;margin-right:16px}h1{font-size:18px;color:#f2f2f2;margin:0 0 4px}img{width:100%;height:auto;display:block;background:#000;margin:16px 0 6px}small{color:#8a8a8a}a{color:#61d6d6}co  … [line shortened here: 514 characters; full line on GitHub]
<iframe src="../../wafer-development-environment/202609180245-real-systems/?draw=uk" title="the wafer drawing a real system" style="width:100%;height:92vh;border:0;background:#000"></iframe>
<p><small>Above: the wafer drawing <code>uk</code> with its own particles, live (iteration 6: system 6 mod 9 of the tour, line 242769 by the formula 1 + floor(frac(n/φ) × 342,795)); type <code>release</code>, then any button. Below: what the swarm measured in this run.</small></p>
<h1>Iteration 6: uk drawn on the wafer; line 242769; 67,108,864 particles under two laws; the Underground, 341 stops; scope tests 4 of 9 tests; 0 failed</h1>
<p>testcode/particles/06-uk-line-242769 · machine-made on the MSI at 20260918T0240Z by <a href="https://github.com/Ventusltd/particle-physics-drawing-engine">particle-physics-drawing-engine</a> · <a href="../">all iterations</a></p>
<p>Same-sized particles, positions computed from the address by a named law, nothing stored. Left: one spiral. Right: a stack of layers of 262,144 slots, angle by whole-number arithmetic.</p>
<img src="spiral-vs-stack.png" alt="spiral versus stack">
<small>67,108,864 particles; spiral 18.23 s, stack 21.66 s; cells lit 823,777 / 824,320</small>
<p style="margin-top:24px">A network from the typed command <code>draw underground</code>: topology from Transport for London's open data, drawn as the same particles under an eight-direction schematic law. No map artwork.</p>
<img src="underground.png" alt="the Underground as particles">
<small>11 lines, 341 stops, 314 edges, 7,368 particles. Powered by TfL Open Data. Contains OS data © Crown copyright and database rights 2016 and Geomni UK Map data © and database rights 2019.</small>
<h2 style="font-size:16px;margin-top:28px">Generated layers, regenerated and hashed on this machine</h2>
<table><tr><th>layer</th><th>size</th><th>hash of every line</th><th>time</th></tr><tr><td>layer 1</td><td>262,144 slots</td><td><code>eb7d6b7a1a0b8b7e…</code></td><td>0.66 s</td></tr><tr><td>layer 16</td><td>262,144 slots</td><td><code>b989530a3b25eb0c…</code></td><td>0.66 s</td></tr><tr><td>layer 64</td><td>262,144 slots</td><td><code>cf3849b416d8fc1c…</code></td><td>0.66 s</td></tr><tr><td>laye  … [line shortened here: 499 characters; full line on GitHub]
<h2 style="font-size:16px;margin-top:28px">Scope status</h2>
<pre style="white-space:pre-wrap;color:#aaa"># Scope status 2026-09-18T02:40:54Z

Ran 4 of 9 tests; 0 failed. Tests marked NOT YET BUILT have no script yet (T1 needs a person with the phone).

| test | what | status | run | last line |
|---|---|---|---|---|
| T1 | a physical iPhone draws one layer | **NOT YET BUILT** |  | `` |
| T2 | exactness of the angle law | **PASS** | exit 0, 0.1 s | `PASS: limit 0.25 px within one layer` |
| T3 | cross-device positions within a pixel | **NOT YET BUILT** |  | `` |
| T4 | generator determinism: a layer regenerates identically | **PASS** | exit 0, 1.5 s | `DNA: regenerated 262144 of 262144 slots on Windows-11-10.0.26200-SP0; MATCH 7e8e65dc0ae61eec... vs 7e8e65dc0ae61eec...` |
| T5 | address to source in one request | **NOT YET BUILT** |  | `` |
| T6 | a law missing a fact refuses by name | **NOT YET BUILT** |  | `` |
| T7 | sixteen layers served from the workstation's second drive | **NOT YET BUILT** |  | `` |
| B1 | spiral and stack side by side | **PASS** | exit 0, 4.9 s | `{"layers": 4, "particles_per_layer": 65536, "particles": 262144, "spiral": {"cells_lit": 262144, "peak_per_cell": 1, "se` |
| B2 | a network from a typed command (the Underground) | **PASS** | exit 0, 1.9 s | `{"command": "draw underground", "source": "https://api.tfl.gov.uk/Line/Mode/tube + /Line/&lt;id>/Route/Sequence/all", "attr` |
</pre>
<small>This page charts measured facts. It is not a design tool; above 100 kW a chartered electrical engineer signs.</small>
</main></body></html>